diff options
| author | Mike Pall <mike> | 2023-09-09 17:19:02 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2023-09-09 17:19:02 +0200 |
| commit | c2bdce399ebd89a171d2622dd6e0b738aa94a3f5 (patch) | |
| tree | dc7320351cb46e12cc4a27c7b1910adc097ac18f /src | |
| parent | 435d8c630135d4f6a54f2ecf7be2d7e805652f80 (diff) | |
| download | luajit-c2bdce399ebd89a171d2622dd6e0b738aa94a3f5.tar.gz luajit-c2bdce399ebd89a171d2622dd6e0b738aa94a3f5.tar.bz2 luajit-c2bdce399ebd89a171d2622dd6e0b738aa94a3f5.zip | |
ARM64: Improve IR_UREF code generation.
Thanks to Peter Cawley. #1070
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_asm_arm64.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index c5ebd324..68749284 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h | |||
| @@ -924,18 +924,16 @@ static void asm_uref(ASMState *as, IRIns *ir) | |||
| 924 | MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; | 924 | MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; |
| 925 | emit_lsptr(as, A64I_LDRx, dest, v); | 925 | emit_lsptr(as, A64I_LDRx, dest, v); |
| 926 | } else { | 926 | } else { |
| 927 | Reg uv = ra_scratch(as, RSET_GPR); | ||
| 928 | Reg func = ra_alloc1(as, ir->op1, RSET_GPR); | ||
| 929 | if (ir->o == IR_UREFC) { | 927 | if (ir->o == IR_UREFC) { |
| 930 | asm_guardcc(as, CC_NE); | 928 | asm_guardcnb(as, A64I_CBZ, RID_TMP); |
| 931 | emit_n(as, (A64I_CMPx^A64I_K12) | A64F_U12(1), RID_TMP); | 929 | emit_opk(as, A64I_ADDx, dest, dest, |
| 932 | emit_opk(as, A64I_ADDx, dest, uv, | ||
| 933 | (int32_t)offsetof(GCupval, tv), RSET_GPR); | 930 | (int32_t)offsetof(GCupval, tv), RSET_GPR); |
| 934 | emit_lso(as, A64I_LDRB, RID_TMP, uv, (int32_t)offsetof(GCupval, closed)); | 931 | emit_lso(as, A64I_LDRB, RID_TMP, dest, |
| 932 | (int32_t)offsetof(GCupval, closed)); | ||
| 935 | } else { | 933 | } else { |
| 936 | emit_lso(as, A64I_LDRx, dest, uv, (int32_t)offsetof(GCupval, v)); | 934 | emit_lso(as, A64I_LDRx, dest, dest, (int32_t)offsetof(GCupval, v)); |
| 937 | } | 935 | } |
| 938 | emit_lso(as, A64I_LDRx, uv, func, | 936 | emit_lso(as, A64I_LDRx, dest, ra_alloc1(as, ir->op1, RSET_GPR), |
| 939 | (int32_t)offsetof(GCfuncL, uvptr) + 8*(int32_t)(ir->op2 >> 8)); | 937 | (int32_t)offsetof(GCfuncL, uvptr) + 8*(int32_t)(ir->op2 >> 8)); |
| 940 | } | 938 | } |
| 941 | } | 939 | } |
