Jit64: addx - Emit MOV when possible
When the source registers are a simple register and a constant zero and overflow isn't needed, emitting LEA is kinda silly. This will occasionally save a single byte for certain registers due to how x86 encoding works. More importantly, LEA takes up execution resources while MOV does not. Before: 41 8D 7D 00 lea edi,[r13] After: 41 8B FD mov edi,r13d
This commit is contained in:
parent
1c25e6352a
commit
2481660519
|
@ -1346,8 +1346,16 @@ void Jit64::addx(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
RCOpArg& Rimm = Ra.IsImm() ? Ra : Rb;
|
RCOpArg& Rimm = Ra.IsImm() ? Ra : Rb;
|
||||||
RCOpArg& Rreg = Ra.IsImm() ? Rb : Ra;
|
RCOpArg& Rreg = Ra.IsImm() ? Rb : Ra;
|
||||||
|
|
||||||
|
if (Rimm.IsZero())
|
||||||
|
{
|
||||||
|
MOV(32, Rd, Rreg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
LEA(32, Rd, MDisp(Rreg.GetSimpleReg(), Rimm.SImm32()));
|
LEA(32, Rd, MDisp(Rreg.GetSimpleReg(), Rimm.SImm32()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MOV(32, Rd, Ra);
|
MOV(32, Rd, Ra);
|
||||||
|
|
Loading…
Reference in New Issue