From 57548b456bd4d551109d0591ad513ab949ca6092 Mon Sep 17 00:00:00 2001 From: Sintendo Date: Mon, 4 Jan 2021 23:54:15 +0100 Subject: [PATCH] Jit64: subfx - Special case a == 0 Occurs a bunch of times in Super Mario Sunshine. Before: 41 83 EE 00 sub r14d,0 After: Nothing! --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 607c001bd7..a654b4d776 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -955,7 +955,14 @@ void Jit64::subfx(UGeckoInstruction inst) RCX64Reg Rd = gpr.Bind(d, RCMode::Write); RegCache::Realize(Rb, Rd); - if (d == b) + if (j == 0) + { + if (d != b) + MOV(32, Rd, Rb); + if (inst.OE) + GenerateConstantOverflow(false); + } + else if (d == b) { SUB(32, Rd, Imm32(j)); if (inst.OE)