JitArm64: cmpl - Optimize a == 0 case
By explicitly handling this, we can avoid materializing zero in a register. Before: 0x52800019 mov w25, #0x0 0xb94087b6 ldr w22, [x29, #0x84] 0xcb16033b sub x27, x25, x22 After: 0xb94087b9 ldr w25, [x29, #0x84] 0xcb1903fb neg x27, x25
This commit is contained in:
parent
5488d3b125
commit
dbb8f588c7
|
@ -615,16 +615,19 @@ void JitArm64::cmpl(UGeckoInstruction inst)
|
||||||
u64 A = gpr.GetImm(a);
|
u64 A = gpr.GetImm(a);
|
||||||
u64 B = gpr.GetImm(b);
|
u64 B = gpr.GetImm(b);
|
||||||
MOVI2R(CR, A - B);
|
MOVI2R(CR, A - B);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else if (gpr.IsImm(a) && !gpr.GetImm(a))
|
||||||
if (gpr.IsImm(b) && !gpr.GetImm(b))
|
{
|
||||||
|
NEG(CR, EncodeRegTo64(gpr.R(b)));
|
||||||
|
}
|
||||||
|
else if (gpr.IsImm(b) && !gpr.GetImm(b))
|
||||||
{
|
{
|
||||||
MOV(EncodeRegTo32(CR), gpr.R(a));
|
MOV(EncodeRegTo32(CR), gpr.R(a));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
SUB(gpr.CR(crf), EncodeRegTo64(gpr.R(a)), EncodeRegTo64(gpr.R(b)));
|
{
|
||||||
|
SUB(CR, EncodeRegTo64(gpr.R(a)), EncodeRegTo64(gpr.R(b)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitArm64::cmpi(UGeckoInstruction inst)
|
void JitArm64::cmpi(UGeckoInstruction inst)
|
||||||
|
|
Loading…
Reference in New Issue