This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-87-g1814df5


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  1814df5b02b9c359052c2048a1d2d617b406a17a (commit)
      from  441c3b59d1e2fca4ad40cf53d03d6196c978e85f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1814df5b02b9c359052c2048a1d2d617b406a17a

commit 1814df5b02b9c359052c2048a1d2d617b406a17a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Aug 18 07:59:49 2015 -0700

    Define HAS_CPUID/HAS_I586/HAS_I686 from -march=
    
    cpuid, i586 and i686 instructions are available if the processor
    specified by -march= supports them.  We can use this information
    to determine whether those instructions can be used safely.
    
    	* sysdeps/x86/cpu-features.c (init_cpu_features): Check
    	whether cpuid is available only if HAS_CPUID is 0.
    	* sysdeps/x86/cpu-features.h (HAS_CPUID): New.
    	(HAS_I586): Likewise.
    	(HAS_I686): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 298bd22..db5d483 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* sysdeps/x86/cpu-features.c (init_cpu_features): Check
+	whether cpuid is available only if HAS_CPUID is 0.
+	* sysdeps/x86/cpu-features.h (HAS_CPUID): New.
+	(HAS_I586): Likewise.
+	(HAS_I686): Likewise.
+
 2015-08-18  Marko Myllynen  <myllynen@redhat.com>
 
 	[BZ #16973]
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 582a8f5..40575de 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -40,7 +40,7 @@ init_cpu_features (struct cpu_features *cpu_features)
   unsigned int model = 0;
   enum cpu_features_kind kind;
 
-#if !defined __i586__ && !defined __i686__ && !defined __x86_64__
+#if !HAS_CPUID
   if (__get_cpuid_max (0, 0) == 0)
     {
       kind = arch_kind_other;
@@ -204,7 +204,7 @@ init_cpu_features (struct cpu_features *cpu_features)
 	}
     }
 
-#if !defined __i586__ && !defined __i686__ && !defined __x86_64__
+#if !HAS_CPUID
 no_cpuid:
 #endif
 
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 22e5abb..6b8299f 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -237,4 +237,31 @@ extern const struct cpu_features *__get_cpu_features (void)
 
 #endif	/* !__ASSEMBLER__ */
 
+#ifdef __x86_64__
+# define HAS_CPUID 1
+#elif defined __pentium__
+# define HAS_CPUID 1
+# define HAS_I586 1
+# define HAS_I686 0
+#elif (defined __pentiumpro__ || defined __pentium4__		\
+       || defined __nocona__ || defined __atom__		\
+       || defined __core2__ || defined __corei7__		\
+       || defined __corei7_avx__ || defined __core_avx2__	\
+       || defined __nehalem__ || defined __sandybridge__	\
+       || defined __haswell__  || defined __knl__		\
+       || defined __bonnell__ || defined __silvermont__ 	\
+       || defined __k6__ || defined __k8__			\
+       || defined __athlon__ || defined __amdfam10__		\
+       || defined __bdver1__ || defined __bdver2__		\
+       || defined __bdver3__ || defined __bdver4__		\
+       || defined __btver1__ || defined __btver2__)
+# define HAS_CPUID 1
+# define HAS_I586 1
+# define HAS_I686 1
+#else
+# define HAS_CPUID 0
+# define HAS_I586 0
+# define HAS_I686 0
+#endif
+
 #endif  /* cpu_features_h */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |    8 ++++++++
 sysdeps/x86/cpu-features.c |    4 ++--
 sysdeps/x86/cpu-features.h |   27 +++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]