Jit64: subfx - Special case a == 0

Occurs a bunch of times in Super Mario Sunshine.

Before:
41 83 EE 00          sub         r14d,0

After:
Nothing!
This commit is contained in:
Sintendo 2021-01-04 23:54:15 +01:00
parent b805223108
commit 57548b456b
1 changed files with 8 additions and 1 deletions

View File

@ -955,7 +955,14 @@ void Jit64::subfx(UGeckoInstruction inst)
RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
RegCache::Realize(Rb, Rd);
if (d == b)
if (j == 0)
{
if (d != b)
MOV(32, Rd, Rb);
if (inst.OE)
GenerateConstantOverflow(false);
}
else if (d == b)
{
SUB(32, Rd, Imm32(j));
if (inst.OE)