aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2025-07-24 15:38:45 +0200
committerMike Pall <mike>2025-07-24 15:38:45 +0200
commitc92d0cb19263e7e302b4740ba6617a32c201c613 (patch)
tree0a2665832d62c1fbf076b94fe6a5ce354bac1280
parente3fa3c48d8a4aadcf86429e9f7f6f1171914b15a (diff)
downloadluajit-v2.0.tar.gz
luajit-v2.0.tar.bz2
luajit-v2.0.zip
x86/x64: Don't use undefined MUL/IMUL zero flag.v2.0master
Reported by VrIgHtEr. #1376
-rw-r--r--src/lj_asm_x86.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 239066d4..8b6ce479 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -1841,7 +1841,8 @@ static void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa)
1841 RegSet allow = RSET_GPR; 1841 RegSet allow = RSET_GPR;
1842 Reg dest, right; 1842 Reg dest, right;
1843 int32_t k = 0; 1843 int32_t k = 0;
1844 if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ 1844 if (as->flagmcp == as->mcp && xa != XOg_X_IMUL) {
1845 /* Drop test r,r instruction. */
1845 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2); 1846 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2);
1846 MCode *q = p[0] == 0x0f ? p+1 : p; 1847 MCode *q = p[0] == 0x0f ? p+1 : p;
1847 if ((*q & 15) < 14) { 1848 if ((*q & 15) < 14) {