]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM64: Inline only use of emit_loada.
authorMike Pall <mike>
Sat, 9 Sep 2023 12:15:18 +0000 (14:15 +0200)
committerMike Pall <mike>
Sat, 9 Sep 2023 12:15:18 +0000 (14:15 +0200)
Thanks to Peter Cawley. #1065

src/lj_asm_arm64.h
src/lj_emit_arm64.h

index 5e690308c3d2cdc064ba1411783b0c035bcd4efc..a575269b72326deaee7a6e111676d5d1e64c8385 100644 (file)
@@ -831,10 +831,13 @@ static void asm_href(ASMState *as, IRIns *ir, IROp merge)
   /* Key not found in chain: jump to exit (if merged) or load niltv. */
   l_end = emit_label(as);
   as->invmcp = NULL;
-  if (merge == IR_NE)
+  if (merge == IR_NE) {
     asm_guardcc(as, CC_AL);
-  else if (destused)
-    emit_loada(as, dest, niltvg(J2G(as->J)));
+  } else if (destused) {
+    uint32_t k12 = emit_isk12(offsetof(global_State, nilnode.val));
+    lj_assertA(k12 != 0, "Cannot k12 encode niltv(L)");
+    emit_dn(as, A64I_ADDx^k12, dest, RID_GL);
+  }
 
   /* Follow hash chain until the end. */
   l_loop = --as->mcp;
index 7205ce78a1b5317855f1335f5f8e0889f082276d..73df508cd112f53ff8b608deb8197606521d5c66 100644 (file)
@@ -230,8 +230,6 @@ static void emit_loadk(ASMState *as, Reg rd, uint64_t u64, int is64)
 /* Load a 64 bit constant into a GPR. */
 #define emit_loadu64(as, rd, i)        emit_loadk(as, rd, i, A64I_X)
 
-#define emit_loada(as, r, addr)        emit_loadu64(as, (r), (uintptr_t)(addr))
-
 #define glofs(as, k) \
   ((intptr_t)((uintptr_t)(k) - (uintptr_t)&J2GG(as->J)->g))
 #define mcpofs(as, k) \