]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM64: Fuse negative 32 bit constants into arithmetic ops again.
authorMike Pall <mike>
Thu, 21 Sep 2023 00:38:29 +0000 (02:38 +0200)
committerMike Pall <mike>
Thu, 21 Sep 2023 00:38:29 +0000 (02:38 +0200)
Thanks to Peter Cawley. #1065

src/lj_asm_arm64.h

index c2b1773793572d5d3cc987037b7dbec7148c5872..8673f7df3a237e16d2ba9902f350a5080bef7f9d 100644 (file)
@@ -222,7 +222,8 @@ static uint32_t asm_fuseopm(ASMState *as, A64Ins ai, IRRef ref, RegSet allow)
     return A64F_M(ir->r);
   } else if (irref_isk(ref)) {
     int64_t k = get_k64val(as, ref);
-    uint32_t m = logical ? emit_isk13(k, irt_is64(ir->t)) : emit_isk12(k);
+    uint32_t m = logical ? emit_isk13(k, irt_is64(ir->t)) :
+                          emit_isk12(irt_is64(ir->t) ? k : (int32_t)k);
     if (m)
       return m;
   } else if (mayfuse(as, ref)) {