[PATCH v2 1/1] sysdeps/x86: set Prefer_No_AVX512 for Hygon model 0x7
H.J. Lu
hjl.tools@gmail.com
Wed Oct 15 23:40:35 GMT 2025
On Tue, Oct 14, 2025 at 5:22 PM Jiamei Xie <xiejiamei@hygon.cn> wrote:
>
> Benchmarks on Hygon hardware show that EVEX often outperforms AVX-512.
> To reflect this, enable the Prefer_No_AVX512 flag for model 0x7 so that
> the ifunc selector will favor EVEX paths over AVX-512 for that model.
>
> Signed-off-by: Li jing <lijing@hygon.cn>
> Signed-off-by: Xie jiamei <xiejiamei@hygon.cn>
> ---
> sysdeps/x86/cpu-features.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
> index b67ef541dd..4ec4c43718 100644
> --- a/sysdeps/x86/cpu-features.c
> +++ b/sysdeps/x86/cpu-features.c
> @@ -1123,6 +1123,11 @@ disable_tsx:
> hardware. */
> cpu_features->preferred[index_arch_Avoid_Non_Temporal_Memset]
> &= ~bit_arch_Avoid_Non_Temporal_Memset;
> +
> + /* On Hygon model 0x7, benchmarks show EVEX often beats AVX-512 */
> + if (model == 0x7)
> + cpu_features->preferred[index_arch_Prefer_No_AVX512]
> + |= bit_arch_Prefer_No_AVX512;
> }
> else
> {
> --
> 2.17.1
>
>
LGTM.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Thanks.
--
H.J.
More information about the Libc-alpha
mailing list