From 9ff704f202cf4d31e00476c08d27327f12478b8a Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 27 Feb 2013 15:17:23 -0600 Subject: [PATCH] Small improvement to cmpli/cmpi in ARMJit. --- .../Src/PowerPC/JitArm32/JitArm_Integer.cpp | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Integer.cpp b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Integer.cpp index 63c96b21fd..753568c9d3 100644 --- a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Integer.cpp @@ -193,11 +193,18 @@ void JitArm::cmpi(UGeckoInstruction inst) JITDISABLE(Integer) ARMReg RA = gpr.R(inst.RA); - ARMReg rA = gpr.GetReg(); int crf = inst.CRFD; - MOVI2R(rA, inst.SIMM_16); - CMP(RA, rA); - gpr.Unlock(rA); + if (inst.SIMM_16 >= 0 && inst.SIMM_16 < 256) + { + CMP(RA, inst.SIMM_16); + } + else + { + ARMReg rA = gpr.GetReg(); + MOVI2R(rA, inst.SIMM_16); + CMP(RA, rA); + gpr.Unlock(rA); + } ComputeRC(crf); } void JitArm::cmpli(UGeckoInstruction inst) @@ -208,9 +215,16 @@ void JitArm::cmpli(UGeckoInstruction inst) ARMReg RA = gpr.R(inst.RA); ARMReg rA = gpr.GetReg(); int crf = inst.CRFD; - MOVI2R(rA, (u32)inst.UIMM); - CMP(RA, rA); - + u32 uimm = (u32)inst.UIMM; + if (uimm < 256) + { + CMP(RA, uimm); + } + else + { + MOVI2R(rA, (u32)inst.UIMM); + CMP(RA, rA); + } // Unsigned GenerateRC() MOV(rA, 0x2); // Result == 0