diff options
author | Mike Pall <mike> | 2023-09-09 17:34:28 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-09-09 17:34:28 +0200 |
commit | 4ed83bd990cbe2062a2a7392d7f5d65bc7c2ba04 (patch) | |
tree | 82445a54a760d1e760de0c22ed9d2c0a344eefa9 /src | |
parent | a5ee35867c6dd359a04f58913e9a21f1649d68b3 (diff) | |
download | luajit-4ed83bd990cbe2062a2a7392d7f5d65bc7c2ba04.tar.gz luajit-4ed83bd990cbe2062a2a7392d7f5d65bc7c2ba04.tar.bz2 luajit-4ed83bd990cbe2062a2a7392d7f5d65bc7c2ba04.zip |
ARM64: Simplify code generation for IR_STRTO.
Thanks to Peter Cawley. #1070
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm_arm64.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index 9ea2d405..d2cb7823 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h | |||
@@ -664,25 +664,22 @@ static void asm_strto(ASMState *as, IRIns *ir) | |||
664 | { | 664 | { |
665 | const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; | 665 | const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; |
666 | IRRef args[2]; | 666 | IRRef args[2]; |
667 | Reg dest = 0, tmp; | 667 | Reg tmp; |
668 | int destused = ra_used(ir); | ||
669 | int32_t ofs = 0; | 668 | int32_t ofs = 0; |
670 | ra_evictset(as, RSET_SCRATCH); | 669 | ra_evictset(as, RSET_SCRATCH); |
671 | if (destused) { | 670 | if (ra_used(ir)) { |
672 | if (ra_hasspill(ir->s)) { | 671 | if (ra_hasspill(ir->s)) { |
673 | ofs = sps_scale(ir->s); | 672 | ofs = sps_scale(ir->s); |
674 | destused = 0; | ||
675 | if (ra_hasreg(ir->r)) { | 673 | if (ra_hasreg(ir->r)) { |
676 | ra_free(as, ir->r); | 674 | ra_free(as, ir->r); |
677 | ra_modified(as, ir->r); | 675 | ra_modified(as, ir->r); |
678 | emit_spload(as, ir, ir->r, ofs); | 676 | emit_spload(as, ir, ir->r, ofs); |
679 | } | 677 | } |
680 | } else { | 678 | } else { |
681 | dest = ra_dest(as, ir, RSET_FPR); | 679 | Reg dest = ra_dest(as, ir, RSET_FPR); |
680 | emit_lso(as, A64I_LDRd, (dest & 31), RID_SP, 0); | ||
682 | } | 681 | } |
683 | } | 682 | } |
684 | if (destused) | ||
685 | emit_lso(as, A64I_LDRd, (dest & 31), RID_SP, 0); | ||
686 | asm_guardcnb(as, A64I_CBZ, RID_RET); | 683 | asm_guardcnb(as, A64I_CBZ, RID_RET); |
687 | args[0] = ir->op1; /* GCstr *str */ | 684 | args[0] = ir->op1; /* GCstr *str */ |
688 | args[1] = ASMREF_TMP1; /* TValue *n */ | 685 | args[1] = ASMREF_TMP1; /* TValue *n */ |