From: kub Date: Sat, 28 Sep 2019 15:12:56 +0000 (+0200) Subject: sh2 drc: drc exit, block linking and branch handling revised (overlooked commit) X-Git-Tag: v2.00~830 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32818177bd7d5266dc08a4034373f20b444a3be6;p=picodrive.git sh2 drc: drc exit, block linking and branch handling revised (overlooked commit) --- diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 932f21cf..2c9e5b7a 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -3270,7 +3270,7 @@ static void REGPARM(2) *sh2_translate(SH2 *sh2, int tcache_id) emith_cmp_r_imm(sr, 0); #if LOOP_OPTIMIZER - u8 *jp = NULL; + void *jp = NULL; if (op_flags[i] & OF_BASIC_LOOP) { // if exiting a pinned loop pinned regs must be written back to ctx // since they are reloaded in the loop entry code @@ -3292,8 +3292,10 @@ static void REGPARM(2) *sh2_translate(SH2 *sh2, int tcache_id) } emith_jump_cond_patchable(DCOND_LE, tcache_ptr); #if LOOP_OPTIMIZER - if (op_flags[i] & OF_BASIC_LOOP) + if (op_flags[i] & OF_BASIC_LOOP) { + emith_flush(); emith_jump_patch(jp, tcache_ptr, NULL); + } #endif #if (DRC_DEBUG & 32)