From dc03cb7a80cc282efba7658fb4b211c86eb8023d Mon Sep 17 00:00:00 2001 From: Jonathan Russell Date: Tue, 14 Aug 2018 20:50:32 +0100 Subject: [PATCH] - made CMP_CHECK checking compile time --- src/scripting/vm/jit.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/scripting/vm/jit.cpp b/src/scripting/vm/jit.cpp index 6f70213ff6..8a5018596c 100644 --- a/src/scripting/vm/jit.cpp +++ b/src/scripting/vm/jit.cpp @@ -226,16 +226,15 @@ template void emitComparisonOpcode(asmjit::X86Compiler& cc, const TArray& labels, const VMOP* pc, int i, Func compFunc) { using namespace asmjit; - auto tmp0 = cc.newInt32(); - auto tmp1 = cc.newInt32(); + auto tmp = cc.newInt32(); - compFunc(tmp0); + compFunc(tmp); - cc.mov(tmp1, A); - cc.and_(tmp1, CMP_CHECK); + bool check = static_cast(A & CMP_CHECK); - cc.cmp(tmp0, tmp1); - cc.jne(labels[i + 2]); + cc.test(tmp, tmp); + if (check) cc.je (labels[i + 2]); + else cc.jne(labels[i + 2]); cc.jmp(labels[i + 2 + JMPOFS(pc + 1)]); }