summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorSintendo <3380580+Sintendo@users.noreply.github.com>2025-08-06 01:22:01 +0200
committerSintendo <3380580+Sintendo@users.noreply.github.com>2025-08-07 07:51:15 +0200
commit45a3e35b0684d8f42e51f2c074e208658125b49e (patch)
tree4aed5bd88b6ba9122d07884cf35a65a908249bae /Source/Core
parentfc9f2d9cea4fc0e92e16edbe075780d68c591cc7 (diff)
JitArm64_Integer: subfcx - Subtract 12-bit constant
Eliminate an instruction by encoding the constant in the subtraction. Before: 0x5280037a mov w26, #0x1b ; =27 0x6b1a02bb subs w27, w21, w26 0x93407f78 sxtw x24, w27 After: 0x71006ebb subs w27, w21, #0x1b 0x93407f7a sxtw x26, w27
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
index 25a4ada478..7cf2305d5a 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
@@ -1443,6 +1443,14 @@ void JitArm64::subfcx(UGeckoInstruction inst)
if (inst.Rc)
ComputeRC0(gpr.R(d));
}
+ else if (gpr.IsImm(a) && ((gpr.GetImm(a) & 0xFFF) == gpr.GetImm(a)))
+ {
+ gpr.BindToRegister(d, d == b);
+ CARRY_IF_NEEDED(SUB, SUBS, gpr.R(d), gpr.R(b), gpr.GetImm(a));
+ ComputeCarry();
+ if (inst.Rc)
+ ComputeRC0(gpr.R(d));
+ }
else if (gpr.IsImm(b, 0))
{
gpr.BindToRegister(d, d == a);