HomeFreeBSD

libc: scalar strchrnul() in RISC-V assembly

Description

libc: scalar strchrnul() in RISC-V assembly

Scalar implementation of strchrnul() in RISC-V assembly and changes to the
corresponding manpage.

Performance was benchmarked on a HiFive Unmatched (SiFive HF105-001) board
using: https://github.com/clausecker/strperf

os: FreeBSD
arch: riscv

│ strchrnul_baseline │          strchrnul_scalar           │
│       sec/op       │   sec/op     vs base                │

Short 680.2µ ± 5% 435.3µ ± 0% -36.01% (p=0.000 n=20)
Mid 314.7µ ± 3% 221.4µ ± 0% -29.63% (p=0.000 n=20)
Long 152.3µ ± 0% 138.5µ ± 0% -9.08% (p=0.000 n=20)
geomean 319.5µ 237.2µ -25.75%

│ strchrnul_baseline │          strchrnul_scalar          │
│       MiB/s        │   MiB/s     vs base                │

Short 183.8 ± 5% 287.2 ± 0% +56.27% (p=0.000 n=20)
Mid 397.3 ± 3% 564.6 ± 0% +42.12% (p=0.000 n=20)
Long 820.5 ± 0% 902.5 ± 0% +9.99% (p=0.000 n=20)
geomean 391.3 527.0 +34.68%

MFC after: 1 month
MFC to: stable/15
Approved by: markj (mentor)
Reviewed by: fuz
Sponsored by: Google LLC (GSoC 2024)
Differential Revision: https://reviews.freebsd.org/D46047

Details

Provenance
strajabotAuthored on Jul 19 2024, 5:58 PM
fuzCommitted on Fri, Oct 31, 12:48 PM
Reviewer
fuz
Differential Revision
D46047: libc: scalar strchrnul() in RISC-V assembly
Parents
rG474a80d3ff85: simd.7: add scalar strnlen() for RISC-V to manpage
Branches
Unknown
Tags
Unknown