From: Mike Pall Date: Thu, 21 Sep 2023 00:38:29 +0000 (+0200) Subject: ARM64: Fuse negative 32 bit constants into arithmetic ops again. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fca1f51bf8209a41f8d7cd13ff09f113ac0d87b6;p=thirdparty%2FLuaJIT.git ARM64: Fuse negative 32 bit constants into arithmetic ops again. Thanks to Peter Cawley. #1065 --- diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index c2b17737..8673f7df 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h @@ -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)) {