Skip to content

riscv: lib: add optimized memchr() and extend KUnit tests

Milan Tripkovic linux-hardening linux-riscv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2riscv: lib: add memchr() implementationarch/riscv/include/asm/string.h arch/riscv/lib/Makefile arch/riscv/lib/memchr.S +1 more+133 -20 replies
2/2lib/string_kunit: extend benchmarks and unit test to memchr()lib/tests/string_kunit.c+53 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] riscv: lib: add optimized memchr() and extend KUnit tests

From: Milan Tripkovic <[email protected]>

Add an optimized assembly implementation of memchr() for RISC-V. The implementation uses word-aligned loads and Zbb optimizations where available, with a fallback for non-Zbb hardware.

The series also includes KUnit tests for functional verification and performance benchmarking.

Milan Tripkovic (2):
riscv: lib: add memchr() implementation lib/string_kunit: extend benchmarks and unit test to memchr()

 arch/riscv/include/asm/string.h |   3 +-
 arch/riscv/lib/Makefile         |   1 +
 arch/riscv/lib/memchr.S         | 126 ++++++++++++++++++++++++++++++++
 arch/riscv/purgatory/Makefile   |   5 +-
 lib/tests/string_kunit.c        |  53 ++++++++++++++
 5 files changed, 186 insertions(+), 2 deletions(-)
 create mode 100644 arch/riscv/lib/memchr.S
Signature · 1 line
2.43.0