[ARM] Fix and optimize mtcrf.

This commit is contained in:
Ryan Houdek 2013-09-19 02:06:30 +00:00
parent 1b1b5d2100
commit 930f997f04
1 changed files with 6 additions and 4 deletions

View File

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