JitArm64_Integer: subfcx - Optimize b == 0

Equivalent to a negation, no need to materialize the zero.

Before:
0x52800015   mov    w21, #0x0                 ; =0
0x6b1802b6   subs   w22, w21, w24

After:
0x6b1803f6   negs   w22, w24
This commit is contained in:
Sintendo 2025-08-06 00:30:31 +02:00
parent e3d889feb1
commit fc9f2d9cea

View File

@ -1443,6 +1443,14 @@ void JitArm64::subfcx(UGeckoInstruction inst)
if (inst.Rc)
ComputeRC0(gpr.R(d));
}
else if (gpr.IsImm(b, 0))
{
gpr.BindToRegister(d, d == a);
CARRY_IF_NEEDED(NEG, NEGS, gpr.R(d), gpr.R(a));
ComputeCarry();
if (inst.Rc)
ComputeRC0(gpr.R(d));
}
else
{
gpr.BindToRegister(d, d == a || d == b);