mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06: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:
@ -1892,6 +1892,12 @@ void Jit64::slwx(UGeckoInstruction inst)
|
|||||||
if (inst.Rc)
|
if (inst.Rc)
|
||||||
ComputeRC(a);
|
ComputeRC(a);
|
||||||
}
|
}
|
||||||
|
else if (gpr.IsImm(s) && gpr.Imm32(s) == 0)
|
||||||
|
{
|
||||||
|
gpr.SetImmediate32(a, 0);
|
||||||
|
if (inst.Rc)
|
||||||
|
ComputeRC(a);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
|
RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
|
||||||
|
Reference in New Issue
Block a user