aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2020-06-13 01:12:14 +0200
committerMike Pall <mike>2020-06-13 01:12:14 +0200
commitd333b1a6febf35f891fcd6e121876c9c3efee1e0 (patch)
tree7705bf83072fc5f9bec1f8232f44d8529eff5981
parent8ae5170cdc9c307bd81019b3e014391c9fd00581 (diff)
downloadluajit-d333b1a6febf35f891fcd6e121876c9c3efee1e0.tar.gz
luajit-d333b1a6febf35f891fcd6e121876c9c3efee1e0.tar.bz2
luajit-d333b1a6febf35f891fcd6e121876c9c3efee1e0.zip
ARM: Implement FLOAD from GG_State.
Diffstat (limited to '')
-rw-r--r--src/lj_asm_arm.h21
-rw-r--r--src/lj_ffrecord.c6
-rw-r--r--src/lj_record.c5
3 files changed, 11 insertions, 21 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h
index 56ce4a07..d2fad141 100644
--- a/src/lj_asm_arm.h
+++ b/src/lj_asm_arm.h
@@ -1007,14 +1007,15 @@ static ARMIns asm_fxstoreins(ASMState *as, IRIns *ir)
1007 1007
1008static void asm_fload(ASMState *as, IRIns *ir) 1008static void asm_fload(ASMState *as, IRIns *ir)
1009{ 1009{
1010 Reg dest = ra_dest(as, ir, RSET_GPR);
1011 ARMIns ai = asm_fxloadins(as, ir);
1012 Reg idx;
1013 int32_t ofs;
1010 if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ 1014 if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */
1011 /* We can end up here if DCE is turned off. */ 1015 idx = ra_allock(as, (int32_t)(ir->op2<<2) + (int32_t)J2GG(as->J), RSET_GPR);
1012 lj_assertA(!ra_used(ir), "NYI FLOAD GG_State"); 1016 ofs = 0;
1013 } else { 1017 } else {
1014 Reg dest = ra_dest(as, ir, RSET_GPR); 1018 idx = ra_alloc1(as, ir->op1, RSET_GPR);
1015 Reg idx = ra_alloc1(as, ir->op1, RSET_GPR);
1016 ARMIns ai = asm_fxloadins(as, ir);
1017 int32_t ofs;
1018 if (ir->op2 == IRFL_TAB_ARRAY) { 1019 if (ir->op2 == IRFL_TAB_ARRAY) {
1019 ofs = asm_fuseabase(as, ir->op1); 1020 ofs = asm_fuseabase(as, ir->op1);
1020 if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ 1021 if (ofs) { /* Turn the t->array load into an add for colocated arrays. */
@@ -1023,11 +1024,11 @@ static void asm_fload(ASMState *as, IRIns *ir)
1023 } 1024 }
1024 } 1025 }
1025 ofs = field_ofs[ir->op2]; 1026 ofs = field_ofs[ir->op2];
1026 if ((ai & 0x04000000))
1027 emit_lso(as, ai, dest, idx, ofs);
1028 else
1029 emit_lsox(as, ai, dest, idx, ofs);
1030 } 1027 }
1028 if ((ai & 0x04000000))
1029 emit_lso(as, ai, dest, idx, ofs);
1030 else
1031 emit_lsox(as, ai, dest, idx, ofs);
1031} 1032}
1032 1033
1033static void asm_fstore(ASMState *as, IRIns *ir) 1034static void asm_fstore(ASMState *as, IRIns *ir)
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index 2557cadf..d34340ce 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -1086,13 +1086,7 @@ static TRef recff_io_fp(jit_State *J, TRef *udp, int32_t id)
1086{ 1086{
1087 TRef tr, ud, fp; 1087 TRef tr, ud, fp;
1088 if (id) { /* io.func() */ 1088 if (id) { /* io.func() */
1089#if LJ_GC64
1090 /* TODO: fix ARM32 asm_fload(), so we can use this for all archs. */
1091 ud = lj_ir_ggfload(J, IRT_UDATA, GG_OFS(g.gcroot[id])); 1089 ud = lj_ir_ggfload(J, IRT_UDATA, GG_OFS(g.gcroot[id]));
1092#else
1093 tr = lj_ir_kptr(J, &J2G(J)->gcroot[id]);
1094 ud = emitir(IRT(IR_XLOAD, IRT_UDATA), tr, 0);
1095#endif
1096 } else { /* fp:method() */ 1090 } else { /* fp:method() */
1097 ud = J->base[0]; 1091 ud = J->base[0];
1098 if (!tref_isudata(ud)) 1092 if (!tref_isudata(ud))
diff --git a/src/lj_record.c b/src/lj_record.c
index 2a4a766e..cfa48ecf 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -1009,13 +1009,8 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
1009 } 1009 }
1010 /* The cdata metatable is treated as immutable. */ 1010 /* The cdata metatable is treated as immutable. */
1011 if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt; 1011 if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt;
1012#if LJ_GC64
1013 /* TODO: fix ARM32 asm_fload(), so we can use this for all archs. */
1014 ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB, 1012 ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB,
1015 GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)])); 1013 GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)]));
1016#else
1017 ix->mt = mix.tab = lj_ir_ktab(J, mt);
1018#endif
1019 goto nocheck; 1014 goto nocheck;
1020 } 1015 }
1021 ix->mt = mt ? mix.tab : TREF_NIL; 1016 ix->mt = mt ? mix.tab : TREF_NIL;