JitArm64_Integer: subfex - Improve codegen for zero with InHostCarry

Another instance where we needlessly materialized constant zero in a
register. We can just write the carry flag directly.

Before:
0x5280001a   mov    w26, #0x0                 ; =0
0x1a1f035a   adc    w26, w26, wzr

After:
0x1a9f37fa   cset   w26, hs
This commit is contained in:
Sintendo 2025-07-30 21:29:01 +02:00
commit 854979937c

View file

@ -1339,7 +1339,12 @@ void JitArm64::subfex(UGeckoInstruction inst)
{
gpr.BindToRegister(d, false);
ARM64Reg RD = gpr.R(d);
if (is_all_ones)
if (is_zero)
{
// RD = 0 + carry
CSET(RD, CC_CS);
}
else if (is_all_ones)
{
// RD = -1 + carry = carry ? 0 : -1
// CSETM sets the destination to -1 if the condition is true, 0