diff options
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r-- | src/lj_asm_x86.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 40f95636..04b79649 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -325,6 +325,14 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow) | |||
325 | as->mrm.base = as->mrm.idx = RID_NONE; | 325 | as->mrm.base = as->mrm.idx = RID_NONE; |
326 | return RID_MRM; | 326 | return RID_MRM; |
327 | } | 327 | } |
328 | } else if (ir->o == IR_KINT64) { | ||
329 | RegSet avail = as->freeset & ~as->modset & RSET_GPR; | ||
330 | lua_assert(allow != RSET_EMPTY); | ||
331 | if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ | ||
332 | as->mrm.ofs = ptr2addr(ir_kint64(ir)); | ||
333 | as->mrm.base = as->mrm.idx = RID_NONE; | ||
334 | return RID_MRM; | ||
335 | } | ||
328 | } else if (mayfuse(as, ref)) { | 336 | } else if (mayfuse(as, ref)) { |
329 | RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR; | 337 | RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR; |
330 | if (ir->o == IR_SLOAD) { | 338 | if (ir->o == IR_SLOAD) { |
@@ -361,7 +369,7 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow) | |||
361 | return RID_MRM; | 369 | return RID_MRM; |
362 | } | 370 | } |
363 | } | 371 | } |
364 | if (!(as->freeset & allow) && | 372 | if (!(as->freeset & allow) && !irref_isk(ref) && |
365 | (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref))) | 373 | (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref))) |
366 | goto fusespill; | 374 | goto fusespill; |
367 | return ra_allocref(as, ref, allow); | 375 | return ra_allocref(as, ref, allow); |