diff options
-rw-r--r-- | src/lj_asm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index e7f2cb72..89b569cc 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -1148,7 +1148,8 @@ static void asm_fusearef(ASMState *as, IRIns *ir, RegSet allow) | |||
1148 | /* Fuse a constant ADD (e.g. t[i+1]) into the offset. | 1148 | /* Fuse a constant ADD (e.g. t[i+1]) into the offset. |
1149 | ** Doesn't help much without ABCelim, but reduces register pressure. | 1149 | ** Doesn't help much without ABCelim, but reduces register pressure. |
1150 | */ | 1150 | */ |
1151 | if (mayfuse(as, ir->op2) && ra_noreg(irx->r) && | 1151 | if (!LJ_64 && /* Has bad effects with negative index on x64. */ |
1152 | mayfuse(as, ir->op2) && ra_noreg(irx->r) && | ||
1152 | irx->o == IR_ADD && irref_isk(irx->op2)) { | 1153 | irx->o == IR_ADD && irref_isk(irx->op2)) { |
1153 | as->mrm.ofs += 8*IR(irx->op2)->i; | 1154 | as->mrm.ofs += 8*IR(irx->op2)->i; |
1154 | as->mrm.idx = (uint8_t)ra_alloc1(as, irx->op1, allow); | 1155 | as->mrm.idx = (uint8_t)ra_alloc1(as, irx->op1, allow); |
@@ -1236,7 +1237,7 @@ static void asm_fusestrref(ASMState *as, IRIns *ir, RegSet allow) | |||
1236 | } else { | 1237 | } else { |
1237 | Reg r; | 1238 | Reg r; |
1238 | /* Fuse a constant add into the offset, e.g. string.sub(s, i+10). */ | 1239 | /* Fuse a constant add into the offset, e.g. string.sub(s, i+10). */ |
1239 | if (!LJ_64 && /* NYI: has bad effects with negative index on x64. */ | 1240 | if (!LJ_64 && /* Has bad effects with negative index on x64. */ |
1240 | mayfuse(as, ir->op2) && irr->o == IR_ADD && irref_isk(irr->op2)) { | 1241 | mayfuse(as, ir->op2) && irr->o == IR_ADD && irref_isk(irr->op2)) { |
1241 | as->mrm.ofs += IR(irr->op2)->i; | 1242 | as->mrm.ofs += IR(irr->op2)->i; |
1242 | r = ra_alloc1(as, irr->op1, allow); | 1243 | r = ra_alloc1(as, irr->op1, allow); |