Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ARM] Fix and optimize mtcrf.
  • Loading branch information
Sonicadvance1 committed Sep 19, 2013
1 parent 1b1b5d2 commit 930f997
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/Core/Core/Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp
Expand Up @@ -110,6 +110,7 @@ void JitArm::mtcrf(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITSystemRegistersOff)

ARMReg rA = gpr.GetReg();

// USES_CR
Expand All @@ -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);
Expand Down

0 comments on commit 930f997

Please sign in to comment.