mirror of
https://github.com/libretro/mame2003-plus-libretro.git
synced 2026-11-07 04:16:07 -10:00
SH-2 recompiler: compare for CMP/EQ on AArch64 (ST-V black screens) (#2187)
jit_cmp() asked the flags of the compare with SLJIT_SET(cond & ~1). For SLJIT_EQUAL that is SLJIT_SET(0), no flag at all: the x86 back ends compare anyway, the AArch64 one does not, so CMP/EQ Rm,Rn and CMP/EQ #imm,R0 set T from stale flags. The ST-V BIOS then took wrong branches and games stayed on a black screen or ran with broken graphics with the SH-2 Dynarec option on. The zero flag is now asked with SLJIT_SET_Z, as the SH-3 recompiler already does. Claude-Session: https://claude.ai/code/session_013Vje3pEtpLHubqCGwCgoQX Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4125e63480
commit
b168882c39
1 file changed
+4
-2
@@ -593,10 +593,12 @@ static void jit_alu(struct sljit_compiler *C, sljit_s32 op, int n, sljit_s32 src
|
||||
sljit_emit_op1(C, SLJIT_MOV32, JREG(n), SLJIT_R0, 0);
|
||||
}
|
||||
|
||||
/* T = (src1 cmp src2) */
|
||||
/* T = (src1 cmp src2). The zero flag is asked with SLJIT_SET_Z: SLJIT_SET(SLJIT_EQUAL)
|
||||
is 0, no flag at all, and the AArch64 back end then does not compare */
|
||||
static void jit_cmp(struct sljit_compiler *C, sljit_s32 cond, sljit_s32 src1, sljit_sw src1w, sljit_s32 src2, sljit_sw src2w)
|
||||
{
|
||||
sljit_emit_op2u(C, SLJIT_SUB32 | SLJIT_SET(cond & ~1), src1, src1w, src2, src2w);
|
||||
sljit_s32 setf = (cond == SLJIT_EQUAL) ? SLJIT_SET_Z : SLJIT_SET(cond & ~1);
|
||||
sljit_emit_op2u(C, SLJIT_SUB32 | setf, src1, src1w, src2, src2w);
|
||||
jit_set_t(C, cond);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user