JitArm64_Integer: addex - Optimize InHostCarry for 0

Similar to what we did for subfex, but for 0.

Before:
0x5280001b   mov    w27, #0x0                 ; =0
0x1a1f037b   adc    w27, w27, wzr

After:
0x1a9f37fb   cset   w27, hs
This commit is contained in:
Sintendo 2024-12-28 21:53:28 +01:00
parent ad7dba5413
commit d2bfa157dc

View File

@ -1495,8 +1495,16 @@ void JitArm64::addex(UGeckoInstruction inst)
{
gpr.BindToRegister(d, false);
ARM64Reg RD = gpr.R(d);
if (is_zero)
{
// RD = 0 + carry = carry ? 1 : 0
CSET(RD, CC_CS);
}
else
{
MOVI2R(RD, imm);
ADC(RD, RD, ARM64Reg::WZR);
}
break;
}
case CarryFlag::ConstantTrue: