JitArm64_Integer: subfcx - Optimize a == 0

This case can be handled as a move. It also generates a constant carry
flag.

Before:
0x52800013   mov    w19, #0x0                 ; =0
0x6b1302b3   subs   w19, w21, w19

After:
0x2a1503f3   mov    w19, w21
This commit is contained in:
Sintendo
2025-08-07 07:51:15 +02:00
parent 3111a785a1
commit e3d889feb1
@@ -1432,6 +1432,17 @@ void JitArm64::subfcx(UGeckoInstruction inst)
if (inst.Rc)
ComputeRC0(gpr.GetImm(d));
}
else if (gpr.IsImm(a, 0))
{
if (d != b)
{
gpr.BindToRegister(d, false);
MOV(gpr.R(d), gpr.R(b));
}
ComputeCarry(true);
if (inst.Rc)
ComputeRC0(gpr.R(d));
}
else
{
gpr.BindToRegister(d, d == a || d == b);