|
|
190885 |
From f64058914af3c3a429e5947a8a90220240f7d51b Mon Sep 17 00:00:00 2001
|
|
|
190885 |
From: "H.J. Lu" <hjl.tools@gmail.com>
|
|
|
190885 |
Date: Mon, 6 Dec 2021 07:14:12 -0800
|
|
|
190885 |
Subject: [PATCH] x86: Don't set Prefer_No_AVX512 for processors with AVX512
|
|
|
190885 |
and AVX-VNNI
|
|
|
190885 |
|
|
|
190885 |
Don't set Prefer_No_AVX512 on processors with AVX512 and AVX-VNNI since
|
|
|
190885 |
they won't lower CPU frequency when ZMM load and store instructions are
|
|
|
190885 |
used.
|
|
|
190885 |
|
|
|
190885 |
(cherry picked from commit ceeffe968c01b1202e482f4855cb6baf5c6cb713)
|
|
|
190885 |
---
|
|
|
190885 |
sysdeps/x86/cpu-features.c | 7 +++++--
|
|
|
190885 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
190885 |
|
|
|
190885 |
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
|
|
|
190885 |
index 956bfb4f..5ff2baa0 100644
|
|
|
190885 |
--- a/sysdeps/x86/cpu-features.c
|
|
|
190885 |
+++ b/sysdeps/x86/cpu-features.c
|
|
|
190885 |
@@ -525,8 +525,11 @@ init_cpu_features (struct cpu_features *cpu_features)
|
|
|
190885 |
|= bit_arch_Prefer_No_VZEROUPPER;
|
|
|
190885 |
else
|
|
|
190885 |
{
|
|
|
190885 |
- cpu_features->preferred[index_arch_Prefer_No_AVX512]
|
|
|
190885 |
- |= bit_arch_Prefer_No_AVX512;
|
|
|
190885 |
+ /* Processors with AVX512 and AVX-VNNI won't lower CPU frequency
|
|
|
190885 |
+ when ZMM load and store instructions are used. */
|
|
|
190885 |
+ if (!CPU_FEATURES_CPU_P (cpu_features, AVX_VNNI))
|
|
|
190885 |
+ cpu_features->preferred[index_arch_Prefer_No_AVX512]
|
|
|
190885 |
+ |= bit_arch_Prefer_No_AVX512;
|
|
|
190885 |
|
|
|
190885 |
/* Avoid RTM abort triggered by VZEROUPPER inside a
|
|
|
190885 |
transactionally executing RTM region. */
|
|
|
190885 |
--
|
|
|
190885 |
GitLab
|
|
|
190885 |
|