]> git.ipfire.org Git - thirdparty/glibc.git/commit
riscv: Add RVV memmove for both multiarch and non-multiarch builds master
authorYao Zihong <zihong.plct@isrc.iscas.ac.cn>
Sun, 21 Jun 2026 03:54:22 +0000 (22:54 -0500)
committerPeter Bergner <bergner@tenstorrent.com>
Sun, 21 Jun 2026 03:56:09 +0000 (22:56 -0500)
commit60f7247847ba7244541fc783079c298416756399
tree9c44266b2281c1aa07c9dafbeec4cc6185fc6233
parent53d909a283085c82bdcc71e1cf06c0899506b664
riscv: Add RVV memmove for both multiarch and non-multiarch builds

This patch adds an RVV-optimized implementation of memmove for RISC-V and
enables it for both multiarch (IFUNC) and non-multiarch builds.

The implementation integrates Hau Hsu's 2023 RVV work under a unified
ifunc-based framework. A vectorized version (__memmove_vector) is added
alongside the generic fallback (__memmove_generic). The runtime resolver
selects the RVV variant when RISCV_HWPROBE_KEY_IMA_EXT_0 reports vector
support (RVV).

Currently, the resolver still selects the RVV variant even when the RVV
extension is disabled via prctl(). As a consequence, any process that
has RVV disabled via prctl() will receive SIGILL when calling memmove().

Co-authored-by: Hau Hsu <hau.hsu@sifive.com>
Co-authored-by: Jerry Shih <jerry.shih@sifive.com>
Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
sysdeps/riscv/multiarch/dl-symbol-redir-ifunc.h
sysdeps/riscv/multiarch/memmove-generic.c [new file with mode: 0644]
sysdeps/riscv/multiarch/memmove-vector.S [new file with mode: 0644]
sysdeps/riscv/rvv/memmove.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/riscv/multiarch/Makefile
sysdeps/unix/sysv/linux/riscv/multiarch/ifunc-impl-list.c
sysdeps/unix/sysv/linux/riscv/multiarch/memmove.c [new file with mode: 0644]