From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7852) id D78CE385737D; Wed, 27 Apr 2022 02:01:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D78CE385737D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sunil Pandey To: glibc-cvs@sourceware.org Subject: [glibc/release/2.34/master] x86: Don't set Prefer_No_AVX512 for processors with AVX512 and AVX-VNNI X-Act-Checkin: glibc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/release/2.34/master X-Git-Oldrev: 4bbd0f866ad0ff197f72346f776ebee9b7e1a706 X-Git-Newrev: f3a99b2216114f89b20329ae7664b764248b4bbd Message-Id: <20220427020127.D78CE385737D@sourceware.org> Date: Wed, 27 Apr 2022 02:01:27 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2022 02:01:28 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f3a99b2216114f89b20329ae7664b764248b4bbd commit f3a99b2216114f89b20329ae7664b764248b4bbd Author: H.J. Lu Date: Mon Dec 6 07:14:12 2021 -0800 x86: Don't set Prefer_No_AVX512 for processors with AVX512 and AVX-VNNI Don't set Prefer_No_AVX512 on processors with AVX512 and AVX-VNNI since they won't lower CPU frequency when ZMM load and store instructions are used. (cherry picked from commit ceeffe968c01b1202e482f4855cb6baf5c6cb713) Diff: --- sysdeps/x86/cpu-features.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index f4d4049e39..09590d8794 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -566,8 +566,11 @@ disable_tsx: |= bit_arch_Prefer_No_VZEROUPPER; else { - cpu_features->preferred[index_arch_Prefer_No_AVX512] - |= bit_arch_Prefer_No_AVX512; + /* Processors with AVX512 and AVX-VNNI won't lower CPU frequency + when ZMM load and store instructions are used. */ + if (!CPU_FEATURES_CPU_P (cpu_features, AVX_VNNI)) + cpu_features->preferred[index_arch_Prefer_No_AVX512] + |= bit_arch_Prefer_No_AVX512; /* Avoid RTM abort triggered by VZEROUPPER inside a transactionally executing RTM region. */