-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(patches): fix incorrect LuaJIT register allocation for IR_*LOAD…
… on ARM64
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message: "Fix incorrect LuaJIT register allocation for IR_*LOAD on ARM64" | ||
type: dependency | ||
scope: Core | ||
prs: | ||
- 11638 | ||
jiras: | ||
- "KAG-2634" |
32 changes: 32 additions & 0 deletions
32
build/openresty/patches/LuaJIT-2.1-20230410_06_arm64_reg_alloc_fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 7ff8f26eb852953778736cf244b2884e339d80aa Mon Sep 17 00:00:00 2001 | ||
From: Mike Pall <mike> | ||
Date: Tue, 29 Aug 2023 22:35:10 +0200 | ||
Subject: [PATCH] ARM64: Fix register allocation for IR_*LOAD. | ||
|
||
Thanks to Peter Cawley. #1062 | ||
--- | ||
src/lj_asm_arm64.h | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/bundle/LuaJIT-2.1-20230410/src/lj_asm_arm64.h b/bundle/LuaJIT-2.1-20230410/src/lj_asm_arm64.h | ||
index 3889883d..c216fced 100644 | ||
--- a/bundle/LuaJIT-2.1-20230410/src/lj_asm_arm64.h | ||
+++ b/bundle/LuaJIT-2.1-20230410/src/lj_asm_arm64.h | ||
@@ -1107,6 +1107,8 @@ static void asm_ahuvload(ASMState *as, IRIns *ir) | ||
} | ||
type = ra_scratch(as, rset_clear(gpr, tmp)); | ||
idx = asm_fuseahuref(as, ir->op1, &ofs, rset_clear(gpr, type), A64I_LDRx); | ||
+ rset_clear(gpr, idx); | ||
+ if (ofs & FUSE_REG) rset_clear(gpr, ofs & 31); | ||
if (ir->o == IR_VLOAD) ofs += 8 * ir->op2; | ||
/* Always do the type check, even if the load result is unused. */ | ||
asm_guardcc(as, irt_isnum(ir->t) ? CC_LS : CC_NE); | ||
@@ -1114,7 +1116,7 @@ static void asm_ahuvload(ASMState *as, IRIns *ir) | ||
lj_assertA(irt_isinteger(ir->t) || irt_isnum(ir->t), | ||
"bad load type %d", irt_type(ir->t)); | ||
emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32), | ||
- ra_allock(as, LJ_TISNUM << 15, rset_exclude(gpr, idx)), tmp); | ||
+ ra_allock(as, LJ_TISNUM << 15, gpr), tmp); | ||
} else if (irt_isaddr(ir->t)) { | ||
emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(-irt_toitype(ir->t)), type); | ||
emit_dn(as, A64I_ASRx | A64F_IMMR(47), type, tmp); |
33ab9a2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel Build
Docker image available
kong/kong:33ab9a202bd78cca522bf1192dc615460fb46e9f
Artifacts available https://github.com/Kong/kong/actions/runs/6302524424