Skip to content

Commit

Permalink
Jit_Integer: slwx
Browse files Browse the repository at this point in the history
  • Loading branch information
MerryMage committed Oct 28, 2018
1 parent 22600b3 commit 32572dd
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
Expand Up @@ -1786,34 +1786,35 @@ void Jit64::slwx(UGeckoInstruction inst)
int b = inst.RB;
int s = inst.RS;

if (gpr.R(b).IsImm() && gpr.R(s).IsImm())
if (gpr.IsImm(b, s))
{
u32 amount = gpr.R(b).Imm32();
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : gpr.R(s).Imm32() << (amount & 0x1f));
u32 amount = gpr.Imm32(b);
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : gpr.Imm32(s) << (amount & 0x1f));
if (inst.Rc)
ComputeRC(gpr.R(a));
ComputeRC(a);
}
else
{
// no register choice
gpr.FlushLockX(ECX);
gpr.Lock(a, b, s);
MOV(32, R(ECX), gpr.R(b));
gpr.BindToRegister(a, a == s, true);
RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
RCOpArg Rb = gpr.Use(b, RCMode::Read);
RCOpArg Rs = gpr.Use(s, RCMode::Read);
RegCache::Realize(ecx, Ra, Rb, Rs);

MOV(32, ecx, Rb);
if (a != s)
MOV(32, gpr.R(a), gpr.R(s));
SHL(64, gpr.R(a), R(ECX));
MOV(32, Ra, Rs);
SHL(64, Ra, ecx);
if (inst.Rc)
{
AND(32, gpr.R(a), gpr.R(a));
ComputeRC(gpr.R(a), false);
AND(32, Ra, Ra);
RegCache::Unlock(ecx, Ra, Rb, Rs);
ComputeRC(a, false);
}
else
{
MOVZX(64, 32, gpr.RX(a), gpr.R(a));
MOVZX(64, 32, Ra, Ra);
}
gpr.UnlockAll();
gpr.UnlockAllX();
}
}

Expand Down

0 comments on commit 32572dd

Please sign in to comment.