mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Jit64: addx - Emit nothing when possible
When the destination register matches a source register, the other source register contains zero, and overflow isn't needed, the instruction becomes a nop and we don't need to emit anything. We could add specialized handling for the case where overflow is needed, but none of the titles I tried would hit this path. Before: 83 C7 00 add edi,0 After:
This commit is contained in:
@ -1333,8 +1333,11 @@ void Jit64::addx(UGeckoInstruction inst)
|
|||||||
if ((d == a) || (d == b))
|
if ((d == a) || (d == b))
|
||||||
{
|
{
|
||||||
RCOpArg& Rnotd = (d == a) ? Rb : Ra;
|
RCOpArg& Rnotd = (d == a) ? Rb : Ra;
|
||||||
|
if (!Rnotd.IsZero() || inst.OE)
|
||||||
|
{
|
||||||
ADD(32, Rd, Rnotd);
|
ADD(32, Rd, Rnotd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (Ra.IsSimpleReg() && Rb.IsSimpleReg() && !inst.OE)
|
else if (Ra.IsSimpleReg() && Rb.IsSimpleReg() && !inst.OE)
|
||||||
{
|
{
|
||||||
LEA(32, Rd, MRegSum(Ra.GetSimpleReg(), Rb.GetSimpleReg()));
|
LEA(32, Rd, MRegSum(Ra.GetSimpleReg(), Rb.GetSimpleReg()));
|
||||||
|
Reference in New Issue
Block a user