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