[PATCH v2 1/1] riscv: Add RVV memset via multiarch/IFUNC

Vineet Gupta vineetg@rivosinc.com
Thu Nov 13 05:36:59 GMT 2025


On 11/4/25 04:37, Yao Zihong wrote:
> diff --git a/sysdeps/unix/sysv/linux/riscv/multiarch/ifunc-impl-list.c b/sysdeps/unix/sysv/linux/riscv/multiarch/ifunc-impl-list.c
> index 1c1deca8f6..b4defac9c4 100644
> --- a/sysdeps/unix/sysv/linux/riscv/multiarch/ifunc-impl-list.c
> +++ b/sysdeps/unix/sysv/linux/riscv/multiarch/ifunc-impl-list.c
> @@ -27,6 +27,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
>    size_t i = max;
>  
>    bool fast_unaligned = false;
> +  bool rvv_ext = false;
>  
>    struct riscv_hwprobe pair = { .key = RISCV_HWPROBE_KEY_CPUPERF_0 };
>    if (__riscv_hwprobe (&pair, 1, 0, NULL, 0) == 0
> @@ -34,10 +35,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
>            == RISCV_HWPROBE_MISALIGNED_FAST)
>      fast_unaligned = true;
>  
> +  struct riscv_hwprobe ext_pair = { .key = RISCV_HWPROBE_KEY_IMA_EXT_0 };
> +  if (__riscv_hwprobe (&ext_pair, 1, 0, NULL, 0) == 0
> +      && (ext_pair.value & RISCV_HWPROBE_IMA_V))
> +    rvv_ext = true;

Can we not club this key with the prev one and get 2 pairs in a single syscall.
Granted it is vdso, still ?

-Vineet


More information about the Libc-alpha mailing list