mailing list of musl libc
 help / color / mirror / code / Atom feed
blob 8f939ecdcac56ab061ae905759b121184b850135 736 bytes (raw)
name: src/string/riscv64/memset_vector.S 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
    .text
    .global __memset_vect
    .type __memset_vect,%function
    .option push
    .option arch, +v
/* void *__memset_vect(void *s, int c, size_t n)
 * a0 = s (dest), a1 = c (fill byte), a2 = n (size)
 * Returns a0.
 */
__memset_vect:
    mv      t0, a0                    /* running dst; keep a0 as return */
    beqz    a2, .Ldone_vect           /* n == 0 then return */

    /* Broadcast fill byte once. */
    vsetvli t1, zero, e8, m8, ta, ma
    vmv.v.x v0, a1

.Lbulk_vect:
    vsetvli t1, a2, e8, m8, ta, ma    /* t1 = vl (bytes) */
    vse8.v  v0, (t0)
    add     t0, t0, t1
    sub     a2, a2, t1
    bnez    a2, .Lbulk_vect
    /* fallthrough */

.Ldone_vect:
    ret
.size __memset_vect, .-__memset_vect
.option pop

debug log:

solving 8f939ecd ...
found 8f939ecd in https://inbox.vuxu.org/musl/20251119054059.514848-2-pincheng.plct@isrc.iscas.ac.cn/

applying [1/1] https://inbox.vuxu.org/musl/20251119054059.514848-2-pincheng.plct@isrc.iscas.ac.cn/
diff --git a/src/string/riscv64/memset_vector.S b/src/string/riscv64/memset_vector.S
new file mode 100644
index 00000000..8f939ecd

Checking patch src/string/riscv64/memset_vector.S...
Applied patch src/string/riscv64/memset_vector.S cleanly.

index at:
100644 8f939ecdcac56ab061ae905759b121184b850135	src/string/riscv64/memset_vector.S

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).