From 930f997f041da73a81e6b4769b33311aa8ab2e37 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 19 Sep 2013 02:06:30 +0000 Subject: [PATCH] [ARM] Fix and optimize mtcrf. --- .../Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp index 40a3fd9fbf..7056441856 100644 --- a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp +++ b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_SystemRegisters.cpp @@ -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);