]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM64: Fix LDP code generation.
authorMike Pall <mike>
Sat, 8 Jul 2023 10:10:18 +0000 (12:10 +0200)
committerMike Pall <mike>
Sat, 8 Jul 2023 10:10:18 +0000 (12:10 +0200)
Thanks to Zhongwei Yao. #1028

src/lj_emit_arm64.h

index 0ddba4a3d62ca6567cffb21018601a12fc868872..fcc9c1d81e91454baee2e9b09ce2225683a16ac1 100644 (file)
@@ -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<<sc) && ofsm <= (63<<sc)) {
-      *as->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;
     }