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