String buffers, part 3c: Add IRBUFHDR_WRITE mode.
Sponsored by fmad.io.
This commit is contained in:
@@ -392,6 +392,21 @@ static void asm_retf(ASMState *as, IRIns *ir)
|
||||
emit_tai(as, PPCI_LWZ, RID_TMP, base, -8);
|
||||
}
|
||||
|
||||
/* -- Buffer operations --------------------------------------------------- */
|
||||
|
||||
#if LJ_HASBUFFER
|
||||
static void asm_bufhdr_write(ASMState *as, Reg sb)
|
||||
{
|
||||
Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb));
|
||||
IRIns irgc;
|
||||
irgc.ot = IRT(0, IRT_PGC); /* GC type. */
|
||||
emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L));
|
||||
emit_rot(as, PPCI_RLWIMI, RID_TMP, tmp, 0, 31-lj_fls(SBUF_MASK_FLAG), 31);
|
||||
emit_getgl(as, RID_TMP, cur_L);
|
||||
emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -- Type conversions ---------------------------------------------------- */
|
||||
|
||||
#if !LJ_SOFTFP
|
||||
|
||||
Reference in New Issue
Block a user