Optimized addx()

Removed some code duplication

Fixed whitespace

Moved else condition
This commit is contained in:
Anthony Serna 2015-07-27 11:40:15 -07:00
parent 558abae760
commit 7e8cfff3c0

View File

@ -282,6 +282,25 @@ void JitArm64::addx(UGeckoInstruction inst)
if (inst.Rc)
ComputeRC(gpr.GetImm(d), 0);
}
else if (gpr.IsImm(a) || gpr.IsImm(b))
{
int imm_reg = gpr.IsImm(a) ? a : b;
int in_reg = gpr.IsImm(a) ? b : a;
gpr.BindToRegister(d, d == in_reg);
if (gpr.GetImm(imm_reg) < 4096)
{
ADD(gpr.R(d), gpr.R(in_reg), gpr.GetImm(imm_reg));
}
else
{
ARM64Reg WA = gpr.GetReg();
MOVI2R(WA, gpr.GetImm(imm_reg));
ADD(gpr.R(d), gpr.R(in_reg), WA);
gpr.Unlock(WA);
}
if (inst.Rc)
ComputeRC(gpr.R(d), 0);
}
else
{
gpr.BindToRegister(d, d == a || d == b);