summaryrefslogtreecommitdiff
path: root/src/lj_asm_x86.h
diff options
context:
space:
mode:
authorMike Pall <mike>2012-11-06 17:05:37 +0100
committerMike Pall <mike>2012-11-06 17:05:37 +0100
commit4e5ef81b869dd15238ccfd5aeef09ce577f9b805 (patch)
tree4f87b74e0ad1c0ee9390cc34a513379fb4f6cd48 /src/lj_asm_x86.h
parent8a1a6097bef28df3875f5f9c2624952bd173cf81 (diff)
downloadluajit-4e5ef81b869dd15238ccfd5aeef09ce577f9b805.tar.gz
luajit-4e5ef81b869dd15238ccfd5aeef09ce577f9b805.tar.bz2
luajit-4e5ef81b869dd15238ccfd5aeef09ce577f9b805.zip
FFI: Fix recording of bool call result check on x86/x64.
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r--src/lj_asm_x86.h4
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 {