Update list of i686-class processors in sysdeps/x86/cpu-features.h

Joseph Myers joseph@codesourcery.com
Mon Sep 17 23:07:00 GMT 2018


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  <joseph@codesourcery.com>

	* 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

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list