JitArm64: cmp - Refactor

This commit is contained in:
Bram Speeckaert 2022-11-01 11:24:16 +01:00
parent dbb8f588c7
commit f5e7e70cc5
1 changed files with 12 additions and 13 deletions

View File

@ -578,25 +578,24 @@ void JitArm64::cmp(UGeckoInstruction inst)
s64 A = static_cast<s32>(gpr.GetImm(a)); s64 A = static_cast<s32>(gpr.GetImm(a));
s64 B = static_cast<s32>(gpr.GetImm(b)); s64 B = static_cast<s32>(gpr.GetImm(b));
MOVI2R(CR, A - B); MOVI2R(CR, A - B);
return;
} }
else if (gpr.IsImm(b) && !gpr.GetImm(b))
if (gpr.IsImm(b) && !gpr.GetImm(b))
{ {
SXTW(CR, gpr.R(a)); SXTW(CR, gpr.R(a));
return;
} }
else
{
ARM64Reg WA = gpr.GetReg();
ARM64Reg XA = EncodeRegTo64(WA);
ARM64Reg RA = gpr.R(a);
ARM64Reg RB = gpr.R(b);
ARM64Reg WA = gpr.GetReg(); SXTW(XA, RA);
ARM64Reg XA = EncodeRegTo64(WA); SXTW(CR, RB);
ARM64Reg RA = gpr.R(a); SUB(CR, XA, CR);
ARM64Reg RB = gpr.R(b);
SXTW(XA, RA); gpr.Unlock(WA);
SXTW(CR, RB); }
SUB(CR, XA, CR);
gpr.Unlock(WA);
} }
void JitArm64::cmpl(UGeckoInstruction inst) void JitArm64::cmpl(UGeckoInstruction inst)