void-packages/srcpkgs/LuaJIT/patches/aarch64-register-allocation-bug-fix.patch
q66 f642382ad7 LuaJIT: update to 2.1.0-beta3, add patches
The patches enable support on ppc64 targets and some other things,
taken from Ubuntu, plus a bcsave.lua patch made by myself.
2019-01-22 13:07:19 -02:00

29 lines
1 KiB
Diff

From: Jason Teplitz <jason@tensyr.com>
Date: Mon, 9 Oct 2017 23:03:09 +0000
Subject: Fix register allocation bug in arm64
---
src/lj_asm_arm64.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git src/lj_asm_arm64.h src/lj_asm_arm64.h
index 8fd92e7..549f8a6 100644
--- src/lj_asm_arm64.h
+++ src/lj_asm_arm64.h
@@ -871,7 +871,7 @@ static void asm_hrefk(ASMState *as, IRIns *ir)
int bigofs = !emit_checkofs(A64I_LDRx, ofs);
RegSet allow = RSET_GPR;
Reg dest = (ra_used(ir) || bigofs) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;
- Reg node = ra_alloc1(as, ir->op1, allow);
+ Reg node = ra_alloc1(as, ir->op1, ra_hasreg(dest) ? rset_clear(allow, dest) : allow);
Reg key = ra_scratch(as, rset_clear(allow, node));
Reg idx = node;
uint64_t k;
@@ -879,7 +879,6 @@ static void asm_hrefk(ASMState *as, IRIns *ir)
rset_clear(allow, key);
if (bigofs) {
idx = dest;
- rset_clear(allow, dest);
kofs = (int32_t)offsetof(Node, key);
} else if (ra_hasreg(dest)) {
emit_opk(as, A64I_ADDx, dest, node, ofs, allow);