mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Jit64: slwx - Handle constant zero input
Shifting zero by any amount always gives zero. Before: 41 BF 00 00 00 00 mov r15d,0 8B CF mov ecx,edi 49 D3 E7 shl r15,cl 45 8B FF mov r15d,r15d After: Nothing, register is set to constant zero. All games I've tried hit this optimization on launch. In Soul Calibur II it occurs very frequently during gameplay.
This commit is contained in:
parent
1a52fdf7e3
commit
10d65519f9
@ -1892,6 +1892,12 @@ void Jit64::slwx(UGeckoInstruction inst)
|
||||
if (inst.Rc)
|
||||
ComputeRC(a);
|
||||
}
|
||||
else if (gpr.IsImm(s) && gpr.Imm32(s) == 0)
|
||||
{
|
||||
gpr.SetImmediate32(a, 0);
|
||||
if (inst.Rc)
|
||||
ComputeRC(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
|
||||
|
Loading…
Reference in New Issue
Block a user