JIT64: avoid using LEA for adds when not necessary

This commit is contained in:
Fiora 2014-08-24 11:26:46 -07:00
parent 355850f499
commit cd0c52b537
1 changed files with 9 additions and 7 deletions

View File

@ -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);