Jit64: addx - Emit LEA for register + immediate

Prefer LEA over MOV + ADD when dealing with immediates.

Before:
44 8B EE             mov         r13d,esi
41 83 C5 20          add         r13d,20h

After:
44 8D 6E 20          lea         r13d,[rsi+20h]
This commit is contained in:
Sintendo 2020-01-05 23:28:04 +01:00
parent 8e7b6f4178
commit 12fcbac2a3
1 changed files with 8 additions and 0 deletions

View File

@ -1342,6 +1342,14 @@ void Jit64::addx(UGeckoInstruction inst)
{ {
LEA(32, Rd, MRegSum(Ra.GetSimpleReg(), Rb.GetSimpleReg())); LEA(32, Rd, MRegSum(Ra.GetSimpleReg(), Rb.GetSimpleReg()));
} }
else if (Ra.IsSimpleReg() && Rb.IsImm() && !inst.OE)
{
LEA(32, Rd, MDisp(Ra.GetSimpleReg(), Rb.SImm32()));
}
else if (Rb.IsSimpleReg() && Ra.IsImm() && !inst.OE)
{
LEA(32, Rd, MDisp(Rb.GetSimpleReg(), Ra.SImm32()));
}
else else
{ {
MOV(32, Rd, Ra); MOV(32, Rd, Ra);