mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-08 15:20:45 +01:00
JitArm64_Integer: subfzex - Constant folding
When both the input register and the carry flag are constants, the result can be precomputed. Before: 0x52800016 mov w22, #0x0 ; =0 0x2a3603f6 mvn w22, w22 After:
This commit is contained in:
parent
fa13457abb
commit
7410bc2025
@ -1359,6 +1359,15 @@ void JitArm64::subfzex(UGeckoInstruction inst)
|
||||
|
||||
int a = inst.RA, d = inst.RD;
|
||||
|
||||
if (gpr.IsImm(a) && HasConstantCarry())
|
||||
{
|
||||
const u32 imm = ~gpr.GetImm(a);
|
||||
const u32 carry = js.carryFlag == CarryFlag::ConstantTrue;
|
||||
gpr.SetImmediate(d, imm + carry);
|
||||
ComputeCarry(Interpreter::Helper_Carry(imm, carry));
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.BindToRegister(d, d == a);
|
||||
|
||||
switch (js.carryFlag)
|
||||
@ -1393,6 +1402,7 @@ void JitArm64::subfzex(UGeckoInstruction inst)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inst.Rc)
|
||||
ComputeRC0(gpr.R(d));
|
||||
|
Loading…
Reference in New Issue
Block a user