aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2020-02-02 18:19:44 +0100
committerMike Pall <mike>2020-02-02 18:19:44 +0100
commit522d2073da4be2af79db4728cbb375db0fbdfc48 (patch)
tree062b15143c8e94ecfde048d6a6e50a1274734789
parentbd907032e3b93651f2b969cbc04477bba40faee8 (diff)
downloadluajit-522d2073da4be2af79db4728cbb375db0fbdfc48.tar.gz
luajit-522d2073da4be2af79db4728cbb375db0fbdfc48.tar.bz2
luajit-522d2073da4be2af79db4728cbb375db0fbdfc48.zip
x86/x64: Fix loop realignment.
-rw-r--r--src/lj_asm_x86.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 2c38d1ec..68b40b31 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -1836,8 +1836,9 @@ static void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa)
1836 int32_t k = 0; 1836 int32_t k = 0;
1837 if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ 1837 if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */
1838 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2); 1838 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2);
1839 if ((p[1] & 15) < 14) { 1839 MCode *q = p[0] == 0x0f ? p+1 : p;
1840 if ((p[1] & 15) >= 12) p[1] -= 4; /* L <->S, NL <-> NS */ 1840 if ((*q & 15) < 14) {
1841 if ((*q & 15) >= 12) *q -= 4; /* L <->S, NL <-> NS */
1841 as->flagmcp = NULL; 1842 as->flagmcp = NULL;
1842 as->mcp = p; 1843 as->mcp = p;
1843 } /* else: cannot transform LE/NLE to cc without use of OF. */ 1844 } /* else: cannot transform LE/NLE to cc without use of OF. */