diff options
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r-- | src/lj_asm_x86.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 4e4f351d..6d7dd5a3 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -1815,7 +1815,7 @@ static void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa) | |||
1815 | int32_t k = 0; | 1815 | int32_t k = 0; |
1816 | if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ | 1816 | if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ |
1817 | as->flagmcp = NULL; | 1817 | as->flagmcp = NULL; |
1818 | as->mcp += (LJ_64 && *as->mcp != XI_TEST) ? 3 : 2; | 1818 | as->mcp += (LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2; |
1819 | } | 1819 | } |
1820 | right = IR(rref)->r; | 1820 | right = IR(rref)->r; |
1821 | if (ra_hasreg(right)) { | 1821 | if (ra_hasreg(right)) { |
@@ -2151,7 +2151,7 @@ static void asm_comp(ASMState *as, IRIns *ir, uint32_t cc) | |||
2151 | asm_guardcc(as, cc); | 2151 | asm_guardcc(as, cc); |
2152 | if (usetest && left != RID_MRM) { | 2152 | if (usetest && left != RID_MRM) { |
2153 | /* Use test r,r instead of cmp r,0. */ | 2153 | /* Use test r,r instead of cmp r,0. */ |
2154 | emit_rr(as, XO_TEST, r64 + left, left); | 2154 | emit_rr(as, irt_isu8(ir->t) ? XO_TESTb : XO_TEST, r64 + left, left); |
2155 | if (irl+1 == ir) /* Referencing previous ins? */ | 2155 | if (irl+1 == ir) /* Referencing previous ins? */ |
2156 | as->flagmcp = as->mcp; /* Set flag to drop test r,r if possible. */ | 2156 | as->flagmcp = as->mcp; /* Set flag to drop test r,r if possible. */ |
2157 | } else { | 2157 | } else { |