From 8e50b168cb74b493d6dd4832ea4a8caaaa2d0934 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Thu, 26 Aug 2021 13:40:48 +0200 Subject: [PATCH] Fix OOO access on last instruction. Cycle counting is a bit broken, needs some rework. --- cpu_threaded.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu_threaded.c b/cpu_threaded.c index 87c39b5..de3c0f4 100644 --- a/cpu_threaded.c +++ b/cpu_threaded.c @@ -3132,7 +3132,8 @@ s32 translate_block_arm(u32 pc, translation_region_type /* If the next instruction is a block entry point update the cycle counter and update */ - if(block_data[block_data_position].update_cycles == 1) + if (pc != block_end_pc && + block_data[block_data_position].update_cycles) { generate_cycle_update(); } @@ -3342,7 +3343,8 @@ s32 translate_block_thumb(u32 pc, translation_region_type /* If the next instruction is a block entry point update the cycle counter and update */ - if(block_data[block_data_position].update_cycles == 1) + if (pc != block_end_pc && + block_data[block_data_position].update_cycles) { generate_cycle_update(); }