[PATCH v1 1/1] Set Prefer_No_AVX512 flag for hygon platform

Jiamei Xie xiejiamei@hygon.cn
Tue Oct 14 06:28:15 GMT 2025


Benchmarks indicate evex can be more profitable on Hygon hardware
than AVX512. So add Prefer_No_AVX512 to make it run with evex.

Signed-off-by: Li jing <lijing@hygon.cn>
Signed-off-by: Xie jiamei <xiejiamei@hygon.cn>
---
 sysdeps/x86/cpu-features.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index b67ef541dd..d0d6d9305a 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -1131,6 +1131,10 @@ disable_tsx:
       update_active (cpu_features);
     }
 
+   /* Benchmarks indicate evex can be more profitable on Hygon hardware than AVX512 */
+  if (model == 0x7)
+    cpu_features->preferred[index_arch_Prefer_No_AVX512] |= bit_arch_Prefer_No_AVX512;
+
   /* Support i586 if CX8 is available.  */
   if (CPU_FEATURES_CPU_P (cpu_features, CX8))
     cpu_features->preferred[index_arch_I586] |= bit_arch_I586;
-- 
2.17.1




More information about the Libc-alpha mailing list