b1dca6
commit d90c9b1a121295a5e31810b899ab637f68898857
b1dca6
Author: Joseph Myers <joseph@codesourcery.com>
b1dca6
Date:   Thu Sep 20 12:43:41 2018 +0000
b1dca6
b1dca6
    Invert sense of list of i686-class processors in sysdeps/x86/cpu-features.h.
b1dca6
    
b1dca6
    I noticed that sysdeps/x86/cpu-features.h had conditionals on whether
b1dca6
    to define HAS_CPUID, HAS_I586 and HAS_I686 with a long list of
b1dca6
    preprocessor macros for i686-and-later processors which however was
b1dca6
    out of date.  This patch avoids the problem of the list getting out of
b1dca6
    date by instead having conditionals on all the (few, old) pre-i686
b1dca6
    processors for which GCC has preprocessor macros, rather than the
b1dca6
    (many, expanding list) i686-and-later processors.  It seems HAS_I586
b1dca6
    and HAS_I686 are unused so the only effect of these macros being
b1dca6
    missing is that 32-bit glibc built for one of these processors would
b1dca6
    end up doing runtime detection of CPUID availability.
b1dca6
    
b1dca6
    i386 builds are prevented by a configure test so there is no need to
b1dca6
    allow for them here.  __geode__ (no long nops?) and __k6__ (no CMOV,
b1dca6
    at least according to GCC) are conservatively handled as i586, not
b1dca6
    i686, here (as noted above, this is a theoretical distinction at
b1dca6
    present in that only HAS_CPUID appears to be used).
b1dca6
    
b1dca6
    Tested for x86.
b1dca6
    
b1dca6
            * sysdeps/x86/cpu-features.h [__geode__ || __k6__]: Handle like
b1dca6
            [__i586__ || __pentium__].
b1dca6
            [__i486__]: Handle explicitly.
b1dca6
            (HAS_CPUID): Define to 1 if above macros are undefined.
b1dca6
            (HAS_I586): Likewise.
b1dca6
            (HAS_I686): Likewise.
b1dca6
b1dca6
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
b1dca6
index d342664c64ab7aa1..fb22d7b9d6226a92 100644
b1dca6
--- a/sysdeps/x86/cpu-features.h
b1dca6
+++ b/sysdeps/x86/cpu-features.h
b1dca6
@@ -257,30 +257,19 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 
b1dca6
 #ifdef __x86_64__
b1dca6
 # define HAS_CPUID 1
b1dca6
-#elif defined __i586__ || defined __pentium__
b1dca6
+#elif (defined __i586__ || defined __pentium__	\
b1dca6
+       || defined __geode__ || defined __k6__)
b1dca6
 # define HAS_CPUID 1
b1dca6
 # define HAS_I586 1
b1dca6
 # define HAS_I686 HAS_ARCH_FEATURE (I686)
b1dca6
-#elif (defined __i686__ || defined __pentiumpro__		\
b1dca6
-       || defined __pentium4__ || defined __nocona__		\
b1dca6
-       || defined __atom__ || defined __core2__			\
b1dca6
-       || defined __corei7__ || defined __corei7_avx__		\
b1dca6
-       || defined __core_avx2__	|| defined __nehalem__		\
b1dca6
-       || defined __sandybridge__ || defined __haswell__	\
b1dca6
-       || defined __knl__ || defined __bonnell__		\
b1dca6
-       || defined __silvermont__				\
b1dca6
-       || defined __k6__ || defined __k8__			\
b1dca6
-       || defined __athlon__ || defined __amdfam10__		\
b1dca6
-       || defined __bdver1__ || defined __bdver2__		\
b1dca6
-       || defined __bdver3__ || defined __bdver4__		\
b1dca6
-       || defined __btver1__ || defined __btver2__)
b1dca6
-# define HAS_CPUID 1
b1dca6
-# define HAS_I586 1
b1dca6
-# define HAS_I686 1
b1dca6
-#else
b1dca6
+#elif defined __i486__
b1dca6
 # define HAS_CPUID 0
b1dca6
 # define HAS_I586 HAS_ARCH_FEATURE (I586)
b1dca6
 # define HAS_I686 HAS_ARCH_FEATURE (I686)
b1dca6
+#else
b1dca6
+# define HAS_CPUID 1
b1dca6
+# define HAS_I586 1
b1dca6
+# define HAS_I686 1
b1dca6
 #endif
b1dca6
 
b1dca6
 #endif  /* cpu_features_h */