// copy pSrc to pDst
L(strcpy_loop):
vsetvli iVL, iLength, e8, ELEM_LMUL_SETTING, ta, ma
vle8ff.v vStr1, (pSrc)
vmseq.vx vMask2, vStr1, zero
csrr iCurrentVL, vl
vfirst.m iActiveElemPos, vMask2
vmsif.m vMask1, vMask2
add pSrc, pSrc, iCurrentVL sub iLength, iLength, iCurrentVL
vse8.v vStr1, (pDst), vMask1.t
add pDst, pDst, iCurrentVL
bgez iActiveElemPos, L(fill_zero)
bnez iLength, L(strcpy_loop)
ret
# fill the tail zero.
L(fill_zero): sub iVL, iCurrentVL, iActiveElemPos
// stpncpy() returns a pointer to byte after the last non-NUL char sub pDst, pDst, iVL
mv pZeros, pDst
add iLength, iLength, iVL
bnez iLength, 1f
ret 1:
vsetvli zero, iLength, e8, ZERO_FILL_ELEM_LMUL_SETTING, ta, ma
vmv.v.x vStr2, zero
L(fill_zero_loop):
vsetvli iVL, iLength, e8, ZERO_FILL_ELEM_LMUL_SETTING, ta, ma
vse8.v vStr2, (pZeros) sub iLength, iLength, iVL
add pZeros, pZeros, iVL
bnez iLength, L(fill_zero_loop)
ret
END(stpncpy)
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.