diff options
-rw-r--r-- | src/lj_asm_arm64.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index 8fd92e76..cbb186d3 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h | |||
@@ -869,14 +869,12 @@ static void asm_hrefk(ASMState *as, IRIns *ir) | |||
869 | int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); | 869 | int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); |
870 | int32_t kofs = ofs + (int32_t)offsetof(Node, key); | 870 | int32_t kofs = ofs + (int32_t)offsetof(Node, key); |
871 | int bigofs = !emit_checkofs(A64I_LDRx, ofs); | 871 | int bigofs = !emit_checkofs(A64I_LDRx, ofs); |
872 | RegSet allow = RSET_GPR; | ||
873 | Reg dest = (ra_used(ir) || bigofs) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; | 872 | Reg dest = (ra_used(ir) || bigofs) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; |
874 | Reg node = ra_alloc1(as, ir->op1, allow); | 873 | Reg node = ra_alloc1(as, ir->op1, RSET_GPR); |
875 | Reg key = ra_scratch(as, rset_clear(allow, node)); | 874 | Reg key, idx = node; |
876 | Reg idx = node; | 875 | RegSet allow = rset_exclude(RSET_GPR, node); |
877 | uint64_t k; | 876 | uint64_t k; |
878 | lua_assert(ofs % sizeof(Node) == 0); | 877 | lua_assert(ofs % sizeof(Node) == 0); |
879 | rset_clear(allow, key); | ||
880 | if (bigofs) { | 878 | if (bigofs) { |
881 | idx = dest; | 879 | idx = dest; |
882 | rset_clear(allow, dest); | 880 | rset_clear(allow, dest); |
@@ -892,7 +890,8 @@ static void asm_hrefk(ASMState *as, IRIns *ir) | |||
892 | } else { | 890 | } else { |
893 | k = ((uint64_t)irt_toitype(irkey->t) << 47) | (uint64_t)ir_kgc(irkey); | 891 | k = ((uint64_t)irt_toitype(irkey->t) << 47) | (uint64_t)ir_kgc(irkey); |
894 | } | 892 | } |
895 | emit_nm(as, A64I_CMPx, key, ra_allock(as, k, allow)); | 893 | key = ra_scratch(as, allow); |
894 | emit_nm(as, A64I_CMPx, key, ra_allock(as, k, rset_exclude(allow, key))); | ||
896 | emit_lso(as, A64I_LDRx, key, idx, kofs); | 895 | emit_lso(as, A64I_LDRx, key, idx, kofs); |
897 | if (bigofs) | 896 | if (bigofs) |
898 | emit_opk(as, A64I_ADDx, dest, node, ofs, RSET_GPR); | 897 | emit_opk(as, A64I_ADDx, dest, node, ofs, RSET_GPR); |