From cfd4348b7afd8482048e6690cdd68840ef09dc92 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 18 Jan 2015 16:45:00 -0600 Subject: [PATCH] [AArch64] Fully implement cmpl and cmpli. --- .../PowerPC/JitArm64/JitArm64_Integer.cpp | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index f32a563a86..472162332c 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -405,7 +405,11 @@ void JitArm64::cmpl(UGeckoInstruction inst) return; } - FALLBACK_IF(true); + ARM64Reg WA = gpr.GetReg(); + ARM64Reg XA = EncodeRegTo64(WA); + SUB(XA, EncodeRegTo64(gpr.R(a)), EncodeRegTo64(gpr.R(b))); + STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[0]) + (sizeof(PowerPC::ppcState.cr_val[0]) * crf)); + gpr.Unlock(WA); } void JitArm64::cmpi(UGeckoInstruction inst) @@ -457,7 +461,21 @@ void JitArm64::cmpli(UGeckoInstruction inst) return; } - FALLBACK_IF(true); + ARM64Reg WA = gpr.GetReg(); + ARM64Reg XA = EncodeRegTo64(WA); + + if (inst.UIMM < 4096) + { + SUB(XA, EncodeRegTo64(gpr.R(a)), inst.UIMM); + } + else + { + MOVI2R(WA, inst.UIMM); + SUB(XA, EncodeRegTo64(gpr.R(a)), XA); + } + + STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[0]) + (sizeof(PowerPC::ppcState.cr_val[0]) * crf)); + gpr.Unlock(WA); } void JitArm64::rlwinmx(UGeckoInstruction inst)