From 7d06606b67f469cdf6caa93b677ae91cc3c9142d Mon Sep 17 00:00:00 2001 From: Zhongwei Yao Date: Thu, 6 Jul 2023 13:29:43 -0700 Subject: [PATCH] Arm64: Fix LDP instruction fuse when offset is negative. --- src/lj_emit_arm64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lj_emit_arm64.h b/src/lj_emit_arm64.h index 0ddba4a3..e19a8e4a 100644 --- a/src/lj_emit_arm64.h +++ b/src/lj_emit_arm64.h @@ -143,7 +143,7 @@ static void emit_lso(ASMState *as, A64Ins ai, Reg rd, Reg rn, int64_t ofs) goto nopair; } if (ofsm >= (int)((unsigned int)-64<mcp = aip | A64F_N(rn) | ((ofsm >> sc) << 15) | + *as->mcp = aip | A64F_N(rn) | (((ofsm >> sc)&0x7f) << 15) | (ai ^ ((ai == A64I_LDRx || ai == A64I_STRx) ? 0x50000000 : 0x90000000)); return; }