aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2023-08-29 22:35:10 +0200
committerMike Pall <mike>2023-08-29 22:35:10 +0200
commit7ff8f26eb852953778736cf244b2884e339d80aa (patch)
tree0c6c36b5a5d11a636f964bf111dcf28f27e98be1
parent356231edafc7e0d6a22488f461c7139341ab1977 (diff)
downloadluajit-7ff8f26eb852953778736cf244b2884e339d80aa.tar.gz
luajit-7ff8f26eb852953778736cf244b2884e339d80aa.tar.bz2
luajit-7ff8f26eb852953778736cf244b2884e339d80aa.zip
ARM64: Fix register allocation for IR_*LOAD.
Thanks to Peter Cawley. #1062
-rw-r--r--src/lj_asm_arm64.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h
index 3889883d..c216fced 100644
--- a/src/lj_asm_arm64.h
+++ b/src/lj_asm_arm64.h
@@ -1107,6 +1107,8 @@ static void asm_ahuvload(ASMState *as, IRIns *ir)
1107 } 1107 }
1108 type = ra_scratch(as, rset_clear(gpr, tmp)); 1108 type = ra_scratch(as, rset_clear(gpr, tmp));
1109 idx = asm_fuseahuref(as, ir->op1, &ofs, rset_clear(gpr, type), A64I_LDRx); 1109 idx = asm_fuseahuref(as, ir->op1, &ofs, rset_clear(gpr, type), A64I_LDRx);
1110 rset_clear(gpr, idx);
1111 if (ofs & FUSE_REG) rset_clear(gpr, ofs & 31);
1110 if (ir->o == IR_VLOAD) ofs += 8 * ir->op2; 1112 if (ir->o == IR_VLOAD) ofs += 8 * ir->op2;
1111 /* Always do the type check, even if the load result is unused. */ 1113 /* Always do the type check, even if the load result is unused. */
1112 asm_guardcc(as, irt_isnum(ir->t) ? CC_LS : CC_NE); 1114 asm_guardcc(as, irt_isnum(ir->t) ? CC_LS : CC_NE);
@@ -1114,7 +1116,7 @@ static void asm_ahuvload(ASMState *as, IRIns *ir)
1114 lj_assertA(irt_isinteger(ir->t) || irt_isnum(ir->t), 1116 lj_assertA(irt_isinteger(ir->t) || irt_isnum(ir->t),
1115 "bad load type %d", irt_type(ir->t)); 1117 "bad load type %d", irt_type(ir->t));
1116 emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32), 1118 emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32),
1117 ra_allock(as, LJ_TISNUM << 15, rset_exclude(gpr, idx)), tmp); 1119 ra_allock(as, LJ_TISNUM << 15, gpr), tmp);
1118 } else if (irt_isaddr(ir->t)) { 1120 } else if (irt_isaddr(ir->t)) {
1119 emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(-irt_toitype(ir->t)), type); 1121 emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(-irt_toitype(ir->t)), type);
1120 emit_dn(as, A64I_ASRx | A64F_IMMR(47), type, tmp); 1122 emit_dn(as, A64I_ASRx | A64F_IMMR(47), type, tmp);