[PATCH] AArch64: Add support for sve2 ifuncs
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Thu May 7 13:42:45 GMT 2026
On 06/05/26 12:34, Wilco Dijkstra wrote:
>
> Add support for sve2 in cpu-features. Minor cleanup of init-arch.h.
>
> OK for commit?
>
I would prefer to add required machinery when we actually need them.
> ---
>
> diff --git a/sysdeps/aarch64/cpu-features.h b/sysdeps/aarch64/cpu-features.h
> index d6367a4596bdfb348d9de3a021c680f8d1348547..d1377c0dcaf5bdb2d6b9010947af521d88e88734 100644
> --- a/sysdeps/aarch64/cpu-features.h
> +++ b/sysdeps/aarch64/cpu-features.h
> @@ -69,6 +69,7 @@ struct cpu_features
> bool sve;
> bool unused;
> bool mops;
> + bool sve2;
> };
>
> #endif /* _CPU_FEATURES_AARCH64_H */
> diff --git a/sysdeps/aarch64/multiarch/init-arch.h b/sysdeps/aarch64/multiarch/init-arch.h
> index 8afd91164fadb683367229a424612224c5f5ee20..e00d1746d864ecb72a6f0e4730cb162ee3ec33bb 100644
> --- a/sysdeps/aarch64/multiarch/init-arch.h
> +++ b/sysdeps/aarch64/multiarch/init-arch.h
> @@ -19,22 +19,13 @@
> #include <ldsodefs.h>
> #include <sys/auxv.h>
>
> -/* Make glibc MTE-safe on a system that supports MTE in case user code
> - enables tag checks independently of the mte_status of glibc. There
> - is currently no ABI contract for enabling tag checks in user code,
> - but this can be useful for debugging with MTE. */
> -#define MTE_ENABLED() (GLRO(dl_hwcap2) & HWCAP2_MTE)
> -
> #define INIT_ARCH() \
> uint64_t __attribute__((unused)) midr = \
> GLRO(dl_aarch64_cpu_features).midr_el1; \
> unsigned __attribute__((unused)) zva_size = \
> GLRO(dl_aarch64_cpu_features).zva_size; \
> - bool __attribute__((unused)) bti = \
> - GLRO(dl_aarch64_cpu_features).bti; \
> - bool __attribute__((unused)) mte = \
> - MTE_ENABLED (); \
> - bool __attribute__((unused)) sve = \
> - GLRO(dl_aarch64_cpu_features).sve; \
> - bool __attribute__((unused)) mops = \
> - GLRO(dl_aarch64_cpu_features).mops;
> + bool __attribute__((unused)) bti = GLRO(dl_aarch64_cpu_features).bti; \
> + bool __attribute__((unused)) mte = GLRO(dl_hwcap2) & HWCAP2_MTE; \
> + bool __attribute__((unused)) sve = GLRO(dl_aarch64_cpu_features).sve; \
> + bool __attribute__((unused)) sve2 = GLRO(dl_aarch64_cpu_features).sve2; \
> + bool __attribute__((unused)) mops = GLRO(dl_aarch64_cpu_features).mops;
> diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> index 36bd72bb12d989bccafa5a9dd5ce1ac7c702a86f..2e8887ce23fb0d3283dd3bc19e2b642ccefbac48 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> @@ -125,6 +125,7 @@ init_cpu_features (struct cpu_features *cpu_features)
>
> /* Check if SVE is supported. */
> cpu_features->sve = GLRO (dl_hwcap) & HWCAP_SVE;
> + cpu_features->sve2 = GLRO (dl_hwcap2) & HWCAP2_SVE2;
>
> /* Check if MOPS is supported. */
> cpu_features->mops = GLRO (dl_hwcap2) & HWCAP2_MOPS;
>
More information about the Libc-alpha
mailing list