]> git.ipfire.org Git - thirdparty/glibc.git/commit
riscv: Add Zbkb optimized repeat_bytes helper
authorPincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
Fri, 31 Oct 2025 20:15:26 +0000 (15:15 -0500)
committerPeter Bergner <bergner@tenstorrent.com>
Fri, 31 Oct 2025 21:23:57 +0000 (16:23 -0500)
commit720e89163702ffa1e921d926b6c36b53c3ccbee4
treed45df39627db258cb26a0855546ebe364e7dc613
parent1136c036a321eaf0e3a6bee516cd285805702103
riscv: Add Zbkb optimized repeat_bytes helper

Introduce a RISC-V specific string-misc.h to provide an optimized
repeat_bytes implementation when the Zbkb extension is available.
The new version uses packh/packw/pack instruction count and avoiding
high latency instructions. This helper is used by several mem and string
functions, and falls back to the generic implementation when Zbkb is not
present.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
sysdeps/riscv/string-misc.h [new file with mode: 0644]