about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/init-arch.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-07-31 11:53:35 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-31 11:53:35 -0700
commit6f6f1215f68e5ae15ad18373234815fe7b2acc9e (patch)
treec6ca7c84df2663d2af45a5ebb47e1cb7d181e31d /sysdeps/x86_64/multiarch/init-arch.c
parent1877ea16ca0714abd715d6ce0aa1b840c3850241 (diff)
downloadglibc-6f6f1215f68e5ae15ad18373234815fe7b2acc9e.tar.gz
glibc-6f6f1215f68e5ae15ad18373234815fe7b2acc9e.tar.xz
glibc-6f6f1215f68e5ae15ad18373234815fe7b2acc9e.zip
Support multiarch for i686.
This patch adds multiarch support when configured for i686.  I modified
some x86-64 functions to support 32bit. I will contribute 32bit SSE string
and memory functions later.
Diffstat (limited to 'sysdeps/x86_64/multiarch/init-arch.c')
-rw-r--r--sysdeps/x86_64/multiarch/init-arch.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index 49b421eac8..c152ab29eb 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <cpuid.h>
 #include "init-arch.h"
 
 
@@ -27,12 +28,10 @@ struct cpu_features __cpu_features attribute_hidden;
 static void
 get_common_indeces (void)
 {
-  asm volatile ("cpuid"
-		: "=a" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax),
-		  "=b" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx),
-		  "=c" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx),
-		  "=d" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx)
-		: "0" (1));
+  __cpuid (1, __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax,
+	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx,
+	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx,
+	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx);
 
   unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
   __cpu_features.family = (eax >> 8) & 0x0f;
@@ -47,10 +46,7 @@ __init_cpu_features (void)
   unsigned int ecx;
   unsigned int edx;
 
-  asm volatile ("cpuid"
-		: "=a" (__cpu_features.max_cpuid), "=b" (ebx), "=c" (ecx),
-		  "=d" (edx)
-		: "0" (0));
+  __cpuid (0, __cpu_features.max_cpuid, ebx, ecx, edx);
 
   /* This spells out "GenuineIntel".  */
   if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
@@ -71,9 +67,11 @@ __init_cpu_features (void)
 	{
 	  __cpu_features.model += extended_model;
 
+#ifndef ENABLE_SSSE3_ON_ATOM
 	  if (__cpu_features.model == 0x1c)
 	    /* Avoid SSSE3 on Atom since it is slow.  */
 	    __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~(1 << 9);
+#endif
 	}
     }
   /* This spells out "AuthenticAMD".  */