From df70077e6b27608bfdc9812fa0d2bec6c1a4247b Mon Sep 17 00:00:00 2001 From: Sintendo Date: Tue, 5 Jan 2021 18:52:24 +0100 Subject: [PATCH] JitArm64: subfx - Special case a == b --- Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index 645ffc4af5..33e8f47450 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -856,7 +856,13 @@ void JitArm64::subfx(UGeckoInstruction inst) int a = inst.RA, b = inst.RB, d = inst.RD; - if (gpr.IsImm(a) && gpr.IsImm(b)) + if (a == b) + { + gpr.SetImmediate(d, 0); + if (inst.Rc) + ComputeRC0(gpr.GetImm(d)); + } + else if (gpr.IsImm(a) && gpr.IsImm(b)) { u32 i = gpr.GetImm(a), j = gpr.GetImm(b); gpr.SetImmediate(d, j - i);