JitArm64_Integer: addex - Optimize InHostCarry for -1

Same thing we did for subfex.

Before:
0x1280001a   mov    w26, #-0x1                ; =-1
0x1a1f035a   adc    w26, w26, wzr

After:
0x5a9f23fa   csetm  w26, lo
This commit is contained in:
Sintendo 2024-12-28 22:12:46 +01:00
parent d2bfa157dc
commit a4ba13b4c9

View File

@ -1500,6 +1500,13 @@ void JitArm64::addex(UGeckoInstruction inst)
// RD = 0 + carry = carry ? 1 : 0
CSET(RD, CC_CS);
}
else if (is_all_ones)
{
// RD = -1 + carry = carry ? 0 : -1
// Note that CSETM sets the destination to -1 if the condition is true,
// and 0 otherwise. Hence, the condition must be carry clear.
CSETM(RD, CC_CC);
}
else
{
MOVI2R(RD, imm);