rolwinmix and rlwnmx optimizations, another Rc/RC typo fixed

This commit is contained in:
calc84maniac 2012-01-02 17:30:54 -05:00
parent 9530bd0292
commit ff6d0d056a
1 changed files with 16 additions and 12 deletions

View File

@ -1556,31 +1556,35 @@ void Jit64::rlwnmx(UGeckoInstruction inst)
INSTRUCTION_START INSTRUCTION_START
JITDISABLE(Integer) JITDISABLE(Integer)
int a = inst.RA, b = inst.RB, s = inst.RS; int a = inst.RA, b = inst.RB, s = inst.RS;
u32 mask = Helper_Mask(inst.MB, inst.ME); u32 mask = Helper_Mask(inst.MB, inst.ME);
if (gpr.R(b).IsImm() && gpr.R(s).IsImm()) if (gpr.R(b).IsImm() && gpr.R(s).IsImm())
{ {
gpr.SetImmediate32(a, _rotl((u32)gpr.R(s).offset, (u32)gpr.R(b).offset & 0x1F) & mask); gpr.SetImmediate32(a, _rotl((u32)gpr.R(s).offset, (u32)gpr.R(b).offset & 0x1F) & mask);
if (inst.Rc)
{
ComputeRC(gpr.R(a));
}
} }
else else
{ {
gpr.FlushLockX(ECX); gpr.FlushLockX(ECX);
gpr.Lock(a, b, s); gpr.Lock(a, b, s);
gpr.KillImmediate(a, (a == s || a == b), true); gpr.BindToRegister(a, true, true);
MOV(32, R(EAX), gpr.R(s));
MOV(32, R(ECX), gpr.R(b)); MOV(32, R(ECX), gpr.R(b));
AND(32, R(ECX), Imm32(0x1f)); if (a != s)
ROL(32, R(EAX), R(ECX)); {
AND(32, R(EAX), Imm32(mask)); MOV(32, gpr.R(a), gpr.R(s));
MOV(32, gpr.R(a), R(EAX)); }
ROL(32, gpr.R(a), R(ECX));
AND(32, gpr.R(a), Imm32(mask));
if (inst.Rc)
{
GenerateRC();
}
gpr.UnlockAll(); gpr.UnlockAll();
gpr.UnlockAllX(); gpr.UnlockAllX();
} }
if (inst.Rc)
{
ComputeRC(gpr.R(a));
}
} }
void Jit64::negx(UGeckoInstruction inst) void Jit64::negx(UGeckoInstruction inst)