From cd0c52b537628cdfcce483cbbbdf310c62666dc0 Mon Sep 17 00:00:00 2001 From: Fiora Date: Sun, 24 Aug 2014 11:26:46 -0700 Subject: [PATCH] JIT64: avoid using LEA for adds when not necessary --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 45a164de98..bb3bd15969 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1428,13 +1428,6 @@ void Jit64::addx(UGeckoInstruction inst) GenerateConstantOverflow((s64)i + (s64)j); } } - else if (gpr.R(a).IsSimpleReg() && gpr.R(b).IsSimpleReg() && !inst.Rc && !inst.OE) - { - gpr.Lock(a, b, d); - gpr.BindToRegister(d, false); - LEA(32, gpr.RX(d), MComplex(gpr.RX(a), gpr.RX(b), 1, 0)); - gpr.UnlockAll(); - } else if ((d == a) || (d == b)) { int operand = ((d == a) ? b : a); @@ -1447,6 +1440,15 @@ void Jit64::addx(UGeckoInstruction inst) ComputeRC(gpr.R(d)); gpr.UnlockAll(); } + else if (gpr.R(a).IsSimpleReg() && gpr.R(b).IsSimpleReg() && !inst.OE) + { + gpr.Lock(a, b, d); + gpr.BindToRegister(d, false); + LEA(32, gpr.RX(d), MComplex(gpr.RX(a), gpr.RX(b), 1, 0)); + if (inst.Rc) + ComputeRC(gpr.R(d)); + gpr.UnlockAll(); + } else { gpr.Lock(a, b, d);