Jit_Integer: slwx

This commit is contained in:
MerryMage 2018-10-15 21:01:13 +01:00
parent 22600b33ee
commit 32572dd639

View File

@ -1786,34 +1786,35 @@ void Jit64::slwx(UGeckoInstruction inst)
int b = inst.RB; int b = inst.RB;
int s = inst.RS; int s = inst.RS;
if (gpr.R(b).IsImm() && gpr.R(s).IsImm()) if (gpr.IsImm(b, s))
{ {
u32 amount = gpr.R(b).Imm32(); u32 amount = gpr.Imm32(b);
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : gpr.R(s).Imm32() << (amount & 0x1f)); gpr.SetImmediate32(a, (amount & 0x20) ? 0 : gpr.Imm32(s) << (amount & 0x1f));
if (inst.Rc) if (inst.Rc)
ComputeRC(gpr.R(a)); ComputeRC(a);
} }
else else
{ {
// no register choice RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
gpr.FlushLockX(ECX); RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
gpr.Lock(a, b, s); RCOpArg Rb = gpr.Use(b, RCMode::Read);
MOV(32, R(ECX), gpr.R(b)); RCOpArg Rs = gpr.Use(s, RCMode::Read);
gpr.BindToRegister(a, a == s, true); RegCache::Realize(ecx, Ra, Rb, Rs);
MOV(32, ecx, Rb);
if (a != s) if (a != s)
MOV(32, gpr.R(a), gpr.R(s)); MOV(32, Ra, Rs);
SHL(64, gpr.R(a), R(ECX)); SHL(64, Ra, ecx);
if (inst.Rc) if (inst.Rc)
{ {
AND(32, gpr.R(a), gpr.R(a)); AND(32, Ra, Ra);
ComputeRC(gpr.R(a), false); RegCache::Unlock(ecx, Ra, Rb, Rs);
ComputeRC(a, false);
} }
else else
{ {
MOVZX(64, 32, gpr.RX(a), gpr.R(a)); MOVZX(64, 32, Ra, Ra);
} }
gpr.UnlockAll();
gpr.UnlockAllX();
} }
} }