diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_asm_arm64.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index c9ba7b7b..5bd4e0d5 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h | |||
@@ -198,6 +198,9 @@ static Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow, | |||
198 | return RID_GL; | 198 | return RID_GL; |
199 | } | 199 | } |
200 | } | 200 | } |
201 | } else if (ir->o == IR_TMPREF) { | ||
202 | *ofsp = (int32_t)glofs(as, &J2G(as->J)->tmptv); | ||
203 | return RID_GL; | ||
201 | } | 204 | } |
202 | } | 205 | } |
203 | *ofsp = 0; | 206 | *ofsp = 0; |
@@ -675,22 +678,23 @@ static void asm_tvstore64(ASMState *as, Reg base, int32_t ofs, IRRef ref) | |||
675 | } | 678 | } |
676 | 679 | ||
677 | /* Get pointer to TValue. */ | 680 | /* Get pointer to TValue. */ |
678 | static void asm_tvptr(ASMState *as, Reg dest, IRRef ref) | 681 | static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) |
679 | { | 682 | { |
680 | IRIns *ir = IR(ref); | 683 | if ((mode & IRTMPREF_IN1)) { |
681 | if (irt_isnum(ir->t)) { | 684 | IRIns *ir = IR(ref); |
682 | if (irref_isk(ref)) { | 685 | if (irt_isnum(ir->t)) { |
683 | /* Use the number constant itself as a TValue. */ | 686 | if (irref_isk(ref) && !(mode & IRTMPREF_OUT1)) { |
684 | ra_allockreg(as, i64ptr(ir_knum(ir)), dest); | 687 | /* Use the number constant itself as a TValue. */ |
688 | ra_allockreg(as, i64ptr(ir_knum(ir)), dest); | ||
689 | return; | ||
690 | } | ||
691 | emit_lso(as, A64I_STRd, (ra_alloc1(as, ref, RSET_FPR) & 31), dest, 0); | ||
685 | } else { | 692 | } else { |
686 | /* Otherwise force a spill and use the spill slot. */ | 693 | asm_tvstore64(as, dest, 0, ref); |
687 | emit_opk(as, A64I_ADDx, dest, RID_SP, ra_spill(as, ir), RSET_GPR); | ||
688 | } | 694 | } |
689 | } else { | ||
690 | /* Otherwise use g->tmptv to hold the TValue. */ | ||
691 | asm_tvstore64(as, dest, 0, ref); | ||
692 | emit_dn(as, A64I_ADDx^emit_isk12(glofs(as, &J2G(as->J)->tmptv)), dest, RID_GL); | ||
693 | } | 695 | } |
696 | /* g->tmptv holds the TValue(s). */ | ||
697 | emit_dn(as, A64I_ADDx^emit_isk12(glofs(as, &J2G(as->J)->tmptv)), dest, RID_GL); | ||
694 | } | 698 | } |
695 | 699 | ||
696 | static void asm_aref(ASMState *as, IRIns *ir) | 700 | static void asm_aref(ASMState *as, IRIns *ir) |