From 6743d6ef1f7125a89944ffa982ee059fa0edbed3 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 23 Oct 2014 15:19:51 +0000 Subject: [PATCH] Adds support back for non-immediate cmp/cmpi to ARMv7 JIT. --- .../Core/PowerPC/JitArm32/JitArm_Integer.cpp | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp index 6b7479e4ca..de78e8f6d6 100644 --- a/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp @@ -772,7 +772,14 @@ void JitArm::cmp (UGeckoInstruction inst) return; } - FALLBACK_IF(true); + ARMReg rA = gpr.GetReg(); + ARMReg RA = gpr.R(a); + ARMReg RB = gpr.R(b); + + SUB(rA, RA, RB); + ComputeRC(rA, crf); + + gpr.Unlock(rA); } void JitArm::cmpi(UGeckoInstruction inst) { @@ -785,8 +792,21 @@ void JitArm::cmpi(UGeckoInstruction inst) ComputeRC((s32)gpr.GetImm(a) - inst.SIMM_16, crf); return; } + ARMReg rA = gpr.GetReg(); + ARMReg RA = gpr.R(a); - FALLBACK_IF(true); + if (inst.SIMM_16 >= 0 && inst.SIMM_16 < 256) + { + SUB(rA, RA, inst.SIMM_16); + } + else + { + MOVI2R(rA, inst.SIMM_16); + SUB(rA, RA, rA); + } + ComputeRC(rA, crf); + + gpr.Unlock(rA); } void JitArm::negx(UGeckoInstruction inst)