aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm_arm64.h
diff options
context:
space:
mode:
authorMike Pall <mike>2021-07-19 16:41:29 +0200
committerMike Pall <mike>2021-07-19 16:46:27 +0200
commit02bcbea8b0f1b30b75460f31fb8749fec55d1e2e (patch)
tree741a23b5d54e6bda4f254d2c4f5cec70e8a2d8d8 /src/lj_asm_arm64.h
parent1d5ef35fed472140fcb4c5f9a1fee6d05a8a6591 (diff)
downloadluajit-02bcbea8b0f1b30b75460f31fb8749fec55d1e2e.tar.gz
luajit-02bcbea8b0f1b30b75460f31fb8749fec55d1e2e.tar.bz2
luajit-02bcbea8b0f1b30b75460f31fb8749fec55d1e2e.zip
String buffers, part 3c: Add IRBUFHDR_WRITE mode.
Sponsored by fmad.io.
Diffstat (limited to 'src/lj_asm_arm64.h')
-rw-r--r--src/lj_asm_arm64.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h
index 5bd4e0d5..dde52347 100644
--- a/src/lj_asm_arm64.h
+++ b/src/lj_asm_arm64.h
@@ -522,6 +522,21 @@ static void asm_retf(ASMState *as, IRIns *ir)
522 emit_lso(as, A64I_LDRx, RID_TMP, base, -8); 522 emit_lso(as, A64I_LDRx, RID_TMP, base, -8);
523} 523}
524 524
525/* -- Buffer operations --------------------------------------------------- */
526
527#if LJ_HASBUFFER
528static void asm_bufhdr_write(ASMState *as, Reg sb)
529{
530 Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb));
531 IRIns irgc;
532 irgc.ot = IRT(0, IRT_PGC); /* GC type. */
533 emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L));
534 emit_dn(as, A64I_BFMx | A64F_IMMS(lj_fls(SBUF_MASK_FLAG)) | A64F_IMMR(0), RID_TMP, tmp);
535 emit_getgl(as, RID_TMP, cur_L);
536 emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L));
537}
538#endif
539
525/* -- Type conversions ---------------------------------------------------- */ 540/* -- Type conversions ---------------------------------------------------- */
526 541
527static void asm_tointg(ASMState *as, IRIns *ir, Reg left) 542static void asm_tointg(ASMState *as, IRIns *ir, Reg left)