]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI/x86: Fix register allocation for 64 bit comparisons.
authorMike Pall <mike>
Thu, 4 Apr 2013 15:05:00 +0000 (17:05 +0200)
committerMike Pall <mike>
Thu, 4 Apr 2013 15:05:00 +0000 (17:05 +0200)
src/lj_asm_x86.h

index e9c53a0926812d7ab83032ad5fbb9f1080924bf5..28aa2791a1b184cd89b6c3ad7a8517849a581287 100644 (file)
@@ -2211,6 +2211,7 @@ static void asm_comp_int64(ASMState *as, IRIns *ir)
     lefthi = asm_fuseload(as, ir->op1, allow);
   } else {
     lefthi = ra_alloc1(as, ir->op1, allow);
+    rset_clear(allow, lefthi);
     righthi = asm_fuseload(as, ir->op2, allow);
     if (righthi == RID_MRM) {
       if (as->mrm.base != RID_NONE) rset_clear(allow, as->mrm.base);
@@ -2226,13 +2227,8 @@ static void asm_comp_int64(ASMState *as, IRIns *ir)
     leftlo = asm_fuseload(as, (ir-1)->op1, allow);
   } else {
     leftlo = ra_alloc1(as, (ir-1)->op1, allow);
+    rset_clear(allow, leftlo);
     rightlo = asm_fuseload(as, (ir-1)->op2, allow);
-    if (rightlo == RID_MRM) {
-      if (as->mrm.base != RID_NONE) rset_clear(allow, as->mrm.base);
-      if (as->mrm.idx != RID_NONE) rset_clear(allow, as->mrm.idx);
-    } else {
-      rset_clear(allow, rightlo);
-    }
   }
 
   /* All register allocations must be performed _before_ this point. */