From 89646c898fc0507135cb56acda7a4776ccca17d1 Mon Sep 17 00:00:00 2001 From: Sintendo Date: Sun, 19 Apr 2020 23:47:47 +0200 Subject: [PATCH] Jit64: addx - Skip ADD after MOV when possible We can get away with skipping the addition when we know we're dealing with a constant zero. Just a MOV will suffice in this case. Once again, we don't bother to add separate handling for when overflow is needed, because no titles would ever hit that path during my testing. Before: 8B 7D F8 mov edi,dword ptr [rbp-8] 83 C7 00 add edi,0 After: 8B 7D F8 mov edi,dword ptr [rbp-8] --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 5eab8e7de5..8b5c7d95ad 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1365,7 +1365,10 @@ void Jit64::addx(UGeckoInstruction inst) if (imm >= -128 && imm <= 127) { MOV(32, Rd, Rother); - ADD(32, Rd, Rimm); + if (imm != 0 || inst.OE) + { + ADD(32, Rd, Rimm); + } } else {