]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix broken intarith + testop optimization.
authorMike Pall <mike>
Tue, 19 Jan 2010 00:45:39 +0000 (01:45 +0100)
committerMike Pall <mike>
Tue, 19 Jan 2010 00:45:39 +0000 (01:45 +0100)
src/lj_asm.c

index 20d262782cafbb1a7a125c216b395696797abfa5..6d42cf35479955c024d525505fc3bf193294f973 100644 (file)
@@ -2423,9 +2423,9 @@ static void asm_comp_(ASMState *as, IRIns *ir, int cc)
        asm_guardcc(as, cc);
        if (usetest && left != RID_MRM) {
          /* Use test r,r instead of cmp r,0. */
+         emit_rr(as, XO_TEST, left, left);
          if (irl+1 == ir)  /* Referencing previous ins? */
            as->testmcp = as->mcp;  /* Set flag to drop test r,r if possible. */
-         emit_rr(as, XO_TEST, left, left);
        } else {
          x86Op xo;
          if (checki8(imm)) {