diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_asm.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 9b394beb..0b3e770a 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -334,7 +334,7 @@ static Reg ra_rematk(ASMState *as, IRRef ref) | |||
334 | RA_DBGX((as, "remat $i $r", ir, r)); | 334 | RA_DBGX((as, "remat $i $r", ir, r)); |
335 | #if !LJ_SOFTFP | 335 | #if !LJ_SOFTFP |
336 | if (ir->o == IR_KNUM) { | 336 | if (ir->o == IR_KNUM) { |
337 | emit_loadn(as, r, ir_knum(ir)); | 337 | emit_loadk64(as, r, ir); |
338 | } else | 338 | } else |
339 | #endif | 339 | #endif |
340 | if (emit_canremat(REF_BASE) && ir->o == IR_BASE) { | 340 | if (emit_canremat(REF_BASE) && ir->o == IR_BASE) { |
@@ -695,15 +695,14 @@ static void ra_left(ASMState *as, Reg dest, IRRef lref) | |||
695 | if (ra_noreg(left)) { | 695 | if (ra_noreg(left)) { |
696 | if (irref_isk(lref)) { | 696 | if (irref_isk(lref)) { |
697 | if (ir->o == IR_KNUM) { | 697 | if (ir->o == IR_KNUM) { |
698 | cTValue *tv = ir_knum(ir); | ||
699 | /* FP remat needs a load except for +0. Still better than eviction. */ | 698 | /* FP remat needs a load except for +0. Still better than eviction. */ |
700 | if (tvispzero(tv) || !(as->freeset & RSET_FPR)) { | 699 | if (tvispzero(ir_knum(ir)) || !(as->freeset & RSET_FPR)) { |
701 | emit_loadn(as, dest, tv); | 700 | emit_loadk64(as, dest, ir); |
702 | return; | 701 | return; |
703 | } | 702 | } |
704 | #if LJ_64 | 703 | #if LJ_64 |
705 | } else if (ir->o == IR_KINT64) { | 704 | } else if (ir->o == IR_KINT64) { |
706 | emit_loadu64(as, dest, ir_kint64(ir)->u64); | 705 | emit_loadk64(as, dest, ir); |
707 | return; | 706 | return; |
708 | #endif | 707 | #endif |
709 | } else if (ir->o != IR_KPRI) { | 708 | } else if (ir->o != IR_KPRI) { |
@@ -1963,8 +1962,14 @@ static void asm_setup_regsp(ASMState *as) | |||
1963 | ra_setup(as); | 1962 | ra_setup(as); |
1964 | 1963 | ||
1965 | /* Clear reg/sp for constants. */ | 1964 | /* Clear reg/sp for constants. */ |
1966 | for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) | 1965 | for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) { |
1967 | ir->prev = REGSP_INIT; | 1966 | ir->prev = REGSP_INIT; |
1967 | if (irt_is64(ir->t) && ir->o != IR_KNULL) { | ||
1968 | /* Make life easier for backends by putting address of constant in i. */ | ||
1969 | ir->i = (int32_t)(intptr_t)(ir+1); | ||
1970 | ir++; | ||
1971 | } | ||
1972 | } | ||
1968 | 1973 | ||
1969 | /* REF_BASE is used for implicit references to the BASE register. */ | 1974 | /* REF_BASE is used for implicit references to the BASE register. */ |
1970 | lastir->prev = REGSP_HINT(RID_BASE); | 1975 | lastir->prev = REGSP_HINT(RID_BASE); |