From 63975d636bbeb097f9d9f15b8b10a18d4224f66d Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 13 Jul 2020 22:18:21 +0200 Subject: [PATCH] New recompiler fixes: fixed cycle accumulation and a division by zero. --- src/codegen_new/codegen_accumulate.h | 3 +-- src/codegen_new/codegen_ops_helpers.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/codegen_new/codegen_accumulate.h b/src/codegen_new/codegen_accumulate.h index 9e6ee3a59..a9ce2e871 100644 --- a/src/codegen_new/codegen_accumulate.h +++ b/src/codegen_new/codegen_accumulate.h @@ -1,7 +1,6 @@ enum { - ACCREG_ins = 0, - ACCREG_cycles = 1, + ACCREG_cycles = 0, ACCREG_COUNT }; diff --git a/src/codegen_new/codegen_ops_helpers.c b/src/codegen_new/codegen_ops_helpers.c index 41450151d..a7a67ce7a 100644 --- a/src/codegen_new/codegen_ops_helpers.c +++ b/src/codegen_new/codegen_ops_helpers.c @@ -62,7 +62,7 @@ int codegen_can_unroll_full(codeblock_t *block, ir_data_t *ir, uint32_t next_pc, return 0; max_unroll = UNROLL_MAX_UOPS / ((ir->wr_pos-start)+6); - if (max_unroll > (UNROLL_MAX_REG_REFERENCES / max_version_refcount)) + if ((max_version_refcount != 0) && (max_unroll > (UNROLL_MAX_REG_REFERENCES / max_version_refcount))) max_unroll = (UNROLL_MAX_REG_REFERENCES / max_version_refcount); if (max_unroll > UNROLL_MAX_COUNT) max_unroll = UNROLL_MAX_COUNT;