From patchwork Mon Sep 17 23:07:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 29433 Received: (qmail 36888 invoked by alias); 17 Sep 2018 23:07:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 36522 invoked by uid 89); 17 Sep 2018 23:07:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=former, availability X-HELO: relay1.mentorg.com Date: Mon, 17 Sep 2018 23:07:26 +0000 From: Joseph Myers To: Subject: Update list of i686-class processors in sysdeps/x86/cpu-features.h Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 I noticed that sysdeps/x86/cpu-features.h had conditionals on whether to define HAS_CPUID, HAS_I586 and HAS_I686 with a long list of preprocessor macros for i686-and-later processors which however was out of date. This patch adds more such macros based on the list in current GCC. It seems HAS_I586 and HAS_I686 are unused so the only effect of these macros being missing is that 32-bit glibc built for one of these processors would end up doing runtime detection of CPUID availability. Tested for x86. Question: would it be better to implement this conditional in a negative sense (!defined __i486__ && !defined __i586__ && !defined __geode__, based on what macros are in the fixed conditional, but maybe using __k6__ instead of __geode__ based on GCC's understanding of the options in question) to reduce the chances of it needing updating in future? (__i586__ is actually handled above.) Question: is the inclusion of __k6__ in the present conditional logically incorrect, and the omission of __geode__ logically incorrect, as regards whether to define HAVE_I686? The way GCC defines -march=k6 and -march=geode, it seems to think that the former excludes CMOV and the latter includes it. (-march=geode is specifically "AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.".) 2018-09-17 Joseph Myers * sysdeps/x86/cpu-features.h [__goldmont__ || __goldmont_plus__ || __tremont__ || __knm__ || __skylake__ || __skylake_avx512__ || __cannonlake__ || __icelake_client__ || __icelake_server__ || __znver1__]: Also count as i686 processors. diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h index d342664c64..e086b5f09e 100644 --- a/sysdeps/x86/cpu-features.h +++ b/sysdeps/x86/cpu-features.h @@ -268,12 +268,18 @@ extern const struct cpu_features *__get_cpu_features (void) || defined __core_avx2__ || defined __nehalem__ \ || defined __sandybridge__ || defined __haswell__ \ || defined __knl__ || defined __bonnell__ \ - || defined __silvermont__ \ + || defined __silvermont__ || defined __goldmont__ \ + || defined __goldmont_plus__ || defined __tremont__ \ + || defined __knm__ || defined __skylake__ \ + || defined __skylake_avx512__ || defined __cannonlake__ \ + || defined __icelake_client__ \ + || defined __icelake_server__ \ || defined __k6__ || defined __k8__ \ || defined __athlon__ || defined __amdfam10__ \ || defined __bdver1__ || defined __bdver2__ \ || defined __bdver3__ || defined __bdver4__ \ - || defined __btver1__ || defined __btver2__) + || defined __btver1__ || defined __btver2__ \ + || defined __znver1__) # define HAS_CPUID 1 # define HAS_I586 1 # define HAS_I686 1