summaryrefslogtreecommitdiff
path: root/src/lj_asm_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm_arm.h')
-rw-r--r--src/lj_asm_arm.h49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h
index e6ab3573..19250254 100644
--- a/src/lj_asm_arm.h
+++ b/src/lj_asm_arm.h
@@ -693,6 +693,8 @@ static void asm_newref(ASMState *as, IRIns *ir)
693{ 693{
694 const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey]; 694 const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
695 IRRef args[3]; 695 IRRef args[3];
696 if (ir->r == RID_SINK) /* Sink newref. */
697 return;
696 args[0] = ASMREF_L; /* lua_State *L */ 698 args[0] = ASMREF_L; /* lua_State *L */
697 args[1] = ir->op1; /* GCtab *t */ 699 args[1] = ir->op1; /* GCtab *t */
698 args[2] = ASMREF_TMP1; /* cTValue *key */ 700 args[2] = ASMREF_TMP1; /* cTValue *key */
@@ -836,9 +838,13 @@ static void asm_xload(ASMState *as, IRIns *ir)
836 838
837static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs) 839static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs)
838{ 840{
839 Reg src = ra_alloc1(as, ir->op2, RSET_GPR); 841 if (ir->r == RID_SINK) { /* Sink store. */
840 asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1, 842 asm_snap_prep(as);
841 rset_exclude(RSET_GPR, src), ofs); 843 } else {
844 Reg src = ra_alloc1(as, ir->op2, RSET_GPR);
845 asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,
846 rset_exclude(RSET_GPR, src), ofs);
847 }
842} 848}
843 849
844static void asm_ahuvload(ASMState *as, IRIns *ir) 850static void asm_ahuvload(ASMState *as, IRIns *ir)
@@ -876,21 +882,25 @@ static void asm_ahuvload(ASMState *as, IRIns *ir)
876 882
877static void asm_ahustore(ASMState *as, IRIns *ir) 883static void asm_ahustore(ASMState *as, IRIns *ir)
878{ 884{
879 RegSet allow = RSET_GPR; 885 if (ir->r == RID_SINK) { /* Sink store. */
880 Reg idx, src = RID_NONE, type = RID_NONE; 886 asm_snap_prep(as);
881 int32_t ofs = 0; 887 } else {
882 int hiop = ((ir+1)->o == IR_HIOP); 888 RegSet allow = RSET_GPR;
883 if (!irt_ispri(ir->t)) { 889 Reg idx, src = RID_NONE, type = RID_NONE;
884 src = ra_alloc1(as, ir->op2, allow); 890 int32_t ofs = 0;
885 rset_clear(allow, src); 891 int hiop = ((ir+1)->o == IR_HIOP);
892 if (!irt_ispri(ir->t)) {
893 src = ra_alloc1(as, ir->op2, allow);
894 rset_clear(allow, src);
895 }
896 if (hiop)
897 type = ra_alloc1(as, (ir+1)->op2, allow);
898 else
899 type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
900 idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type));
901 if (ra_hasreg(src)) emit_lso(as, ARMI_STR, src, idx, ofs);
902 emit_lso(as, ARMI_STR, type, idx, ofs+4);
886 } 903 }
887 if (hiop)
888 type = ra_alloc1(as, (ir+1)->op2, allow);
889 else
890 type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
891 idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type));
892 if (ra_hasreg(src)) emit_lso(as, ARMI_STR, src, idx, ofs);
893 emit_lso(as, ARMI_STR, type, idx, ofs+4);
894} 904}
895 905
896static void asm_sload(ASMState *as, IRIns *ir) 906static void asm_sload(ASMState *as, IRIns *ir)
@@ -1382,7 +1392,10 @@ static void asm_hiop(ASMState *as, IRIns *ir)
1382 asm_fpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_HI : CC_LO); 1392 asm_fpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_HI : CC_LO);
1383 return; 1393 return;
1384 } else if ((ir-1)->o == IR_XSTORE) { 1394 } else if ((ir-1)->o == IR_XSTORE) {
1385 asm_xstore(as, ir, 4); 1395 if ((ir-1)->r == RID_SINK)
1396 asm_snap_prep(as);
1397 else
1398 asm_xstore(as, ir, 4);
1386 return; 1399 return;
1387 } 1400 }
1388 if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ 1401 if (!usehi) return; /* Skip unused hiword op for all remaining ops. */