[ARM] Fix and optimize mtcrf.

This commit is contained in:
Ryan Houdek 2013-09-19 02:06:30 +00:00
parent 1b1b5d2100
commit 930f997f04

View File

@ -110,6 +110,7 @@ void JitArm::mtcrf(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITSystemRegistersOff)
ARMReg rA = gpr.GetReg();
// USES_CR
@ -130,16 +131,17 @@ void JitArm::mtcrf(UGeckoInstruction inst)
}
else
{
ARMReg rB = gpr.GetReg();
MOV(rA, gpr.R(inst.RS));
for (int i = 0; i < 8; i++)
{
if ((crm & (0x80 >> i)) != 0)
{
MOV(rA, gpr.R(inst.RS));
LSR(rA, rA, 28 - (i * 4));
AND(rA, rA, 0xF);
STRB(rA, R9, PPCSTATE_OFF(cr_fast[i]));
UBFX(rB, rA, 28 - (i * 4), 4);
STRB(rB, R9, PPCSTATE_OFF(cr_fast[i]));
}
}
gpr.Unlock(rB);
}
}
gpr.Unlock(rA);