[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8699 - in /fsf/trunk/libc: ./ elf/ include/ nptl/ nptl/sysdeps/unix/sysv/linux/x86_64/ nptl/sysdeps/x86_64/ posix/ sysdeps/...



Author: eglibc
Date: Fri Jul 24 00:06:42 2009
New Revision: 8699

Log:
Import glibc-mainline for 2009-07-24

Added:
    fsf/trunk/libc/nptl/sysdeps/x86_64/configure
    fsf/trunk/libc/nptl/sysdeps/x86_64/configure.in
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/elf/dl-lookup.c
    fsf/trunk/libc/elf/tst-unique1.c
    fsf/trunk/libc/include/unistd.h
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
    fsf/trunk/libc/posix/tst-rfc3484-2.c
    fsf/trunk/libc/posix/tst-rfc3484-3.c
    fsf/trunk/libc/posix/tst-rfc3484.c
    fsf/trunk/libc/sysdeps/generic/ldsodefs.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/makecontext.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
    fsf/trunk/libc/sysdeps/x86_64/cacheinfo.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strcpy.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Jul 24 00:06:42 2009
@@ -1,3 +1,42 @@
+2009-07-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/cacheinfo.c [USE_MULTIARCH]: Rearrange code to
+	avoid additional cpuid instructions.  Most of the information is
+	stored somewhere.
+
+	* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_02_known): Add more
+	cache descriptors.
+	* sysdeps/x86_64/cacheinfo.c (intel_02_known): Likewise.
+
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Reset
+	SSSE3 bit for Atoms.
+	* sysdeps/x86_64/multiarch/strcpy.S: New need to perform Atom test
+	here anymore.
+
+	* posix/tst-rfc3484.c (do_test): Initialize entire sockaddr_in
+	structure before copying it to avoid warning.
+	* posix/tst-rfc3484-2.c (do_test): Likewise.
+	* posix/tst-rfc3484-3.c (do_test): Likewise.
+
+	[BZ #10416]
+	* include/unistd.h: Make header file suitable for C++ test cases.
+	Patch by Duncan Simpson <dps@xxxxxxxxxxxxxxxxxxx>.
+
+	* sysdeps/unix/sysv/linux/i386/makecontext.S: Ensure we preserve the
+	stack alignment in the exit code.
+
+	* elf/dl-lookup.c (dl_lookup_x): The hashval for unique symbol can
+	potentially be zero.
+
+	* elf/tst-unique1.c: Extend test to check for unloading DSO with
+	unique symbol definition.
+	Patch by Jakub Jelinek.
+	* elf/dl-lookup.c (do_lookup_x): When entering a new unique symbol,
+	make sure the object with the definition cannot be unloaded.  Adjust
+	a few types.
+	* sysdeps/generic/ldsodefs.h (struct rtld_global): The map element in
+	the unique symbol hash table should not be const.
+
 2009-07-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/x86_64/multiarch/strstr.c: Minor cleanups.  Remove

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri Jul 24 00:06:42 2009
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2009-6-1
+GNU C Library NEWS -- history of user-visible changes.  2009-7-21
 Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -15,6 +15,27 @@
 
 * STT_GNU_IFUNC is now supported in static executables.
   Implemented by H.J. Lu.
+
+* New optimized string functions for x86-64: strstr, strcasestr, memcmp,
+  strcspn, strpbrk, strspn, strcpy, stpcpy, strncpy, strcmp, strncmp.
+  Contributed by H.J. Lu.
+
+  strlen, rawmemchr.
+  Implemented by Ulrich Drepper.
+
+* AVX support in x86-64 auditing support in ld.so.
+  Implemented by H.J. Lu.
+
+* STB_GNU_UNIQUE support added.
+  Implemented by Ulrich Drepper.
+
+* Implement second fallback mode for optimized DNS lookup for even more
+  broken environments.  If two requests from the same port are not
+  handled correctly close the socket and open a new one before sending
+  the second request.  The 'single-request-reopen' option in /etc/resolv.conf
+  can be used to select this mode right away, instead of rediscovering the
+  necessity is every process again.
+  Implemented by Ulrich Drepper.
 
 
 Version 2.10

Modified: fsf/trunk/libc/elf/dl-lookup.c
==============================================================================
--- fsf/trunk/libc/elf/dl-lookup.c (original)
+++ fsf/trunk/libc/elf/dl-lookup.c Fri Jul 24 00:06:42 2009
@@ -312,13 +312,13 @@
 		 definition we have to use it.  */
 	      void enter (struct unique_sym *table, size_t size,
 			  unsigned int hash, const char *name,
-			  const ElfW(Sym) *sym, const struct link_map *map)
+			  const ElfW(Sym) *sym, struct link_map *map)
 	      {
 		size_t idx = hash % size;
 		size_t hash2 = 1 + hash % (size - 2);
 		while (1)
 		  {
-		    if (table[idx].hashval == 0)
+		    if (table[idx].name == NULL)
 		      {
 			table[idx].hashval = hash;
 			table[idx].name = strtab + sym->st_name;
@@ -331,7 +331,13 @@
 			  {
 			    table[idx].sym = sym;
 			    table[idx].map = map;
+
+			    if (map->l_type == lt_loaded)
+			      /* Make sure we don't unload this object by
+				 setting the appropriate flag.  */
+			      map->l_flags_1 |= DF_1_NODELETE;
 			  }
+
 			return;
 		      }
 
@@ -363,8 +369,7 @@
 			  return 1;
 			}
 
-		      if (entries[idx].hashval == 0
-			  && entries[idx].name == NULL)
+		      if (entries[idx].name == NULL)
 			break;
 
 		      idx += hash2;
@@ -386,7 +391,7 @@
 			}
 
 		      for (idx = 0; idx < size; ++idx)
-			if (entries[idx].hashval != 0)
+			if (entries[idx].name != NULL)
 			  enter (newentries, newsize, entries[idx].hashval,
 				 entries[idx].name, entries[idx].sym,
 				 entries[idx].map);
@@ -410,7 +415,8 @@
 		  tab->free = free;
 		}
 
-	      enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
+	      enter (entries, size, new_hash, strtab + sym->st_name, sym,
+		     (struct link_map *) map);
 	      ++tab->n_elements;
 
 	      __rtld_lock_unlock_recursive (tab->lock);

Modified: fsf/trunk/libc/elf/tst-unique1.c
==============================================================================
--- fsf/trunk/libc/elf/tst-unique1.c (original)
+++ fsf/trunk/libc/elf/tst-unique1.c Fri Jul 24 00:06:42 2009
@@ -1,6 +1,7 @@
 #include <config.h>
 #include <dlfcn.h>
 #include <stdio.h>
+#include <sys/mman.h>
 
 static int
 do_test (void)
@@ -30,10 +31,45 @@
       puts ("cannot locate f in tst-unique1mod2");
       return 1;
     }
-  return f2 (f1 ());
-#else
+  if (f2 (f1 ()))
+    {
+      puts ("f from tst-unique1mod2 failed");
+      return 1;
+    }
+  dlclose (h2);
+  dlclose (h1);
+  mmap (NULL, 1024 * 1024 * 16, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  h2 = dlopen ("tst-unique1mod2.so", RTLD_LAZY);
+  if (h2 == NULL)
+    {
+      puts ("cannot load tst-unique1mod2");
+      return 1;
+    }
+  f2 = dlsym (h2, "f");
+  if (f2 == NULL)
+    {
+      puts ("cannot locate f in tst-unique1mod2");
+      return 1;
+    }
+  h1 = dlopen ("tst-unique1mod1.so", RTLD_LAZY);
+  if (h1 == NULL)
+    {
+      puts ("cannot load tst-unique1mod1");
+      return 1;
+    }
+  f1 = dlsym (h1, "f");
+  if (f1 == NULL)
+    {
+      puts ("cannot locate f in tst-unique1mod1");
+      return 1;
+    }
+  if (f2 (f1 ()))
+    {
+      puts ("f from tst-unique1mod2 failed");
+      return 1;
+    }
+#endif
   return 0;
-#endif
 }
 
 #define TEST_FUNCTION do_test ()

Modified: fsf/trunk/libc/include/unistd.h
==============================================================================
--- fsf/trunk/libc/include/unistd.h (original)
+++ fsf/trunk/libc/include/unistd.h Fri Jul 24 00:06:42 2009
@@ -1,5 +1,7 @@
 #ifndef _UNISTD_H
 # include <posix/unistd.h>
+
+__BEGIN_DECLS
 
 libc_hidden_proto (_exit, __noreturn__)
 libc_hidden_proto (alarm)
@@ -174,4 +176,6 @@
    unless it is really necessary.  */
 #define __have_pipe2 __have_sock_cloexec
 
+__END_DECLS
+
 #endif

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri Jul 24 00:06:42 2009
@@ -1,3 +1,10 @@
+2009-07-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/configure.in: New file.
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
+	path when not using absolute timeout futex.
+
 2009-07-20  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S Fri Jul 24 00:06:42 2009
@@ -551,12 +551,12 @@
 	jne	53b
 
 	cmpq	24(%rsp), %r9
-	jbe	45b
+	jbe	15f
 
 	cmpq	%rax, %r9
 	ja	39b
 
-	cmpq	$-ETIMEDOUT, %r14
+15:	cmpq	$-ETIMEDOUT, %r14
 	jne	8b
 
 	jmp	99b

Added: fsf/trunk/libc/nptl/sysdeps/x86_64/configure
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/configure (added)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/configure Fri Jul 24 00:06:42 2009
@@ -1,0 +1,36 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/i386.
+
+{ echo "$as_me:$LINENO: checking for .cfi_personality and .cfi_lsda pseudo-ops" >&5
+echo $ECHO_N "checking for .cfi_personality and .cfi_lsda pseudo-ops... $ECHO_C" >&6; }
+if test "${libc_cv_asm_cfi_personality+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    cat > conftest.s <<EOF
+${libc_cv_dot_text}
+foo:
+	.cfi_startproc
+	.cfi_personality 0, foo
+	.cfi_lsda 0, foo
+	.cfi_endproc
+EOF
+  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    libc_cv_asm_cfi_personality=yes
+  else
+    libc_cv_asm_cfi_personality=no
+  fi
+  rm -f conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $libc_cv_asm_cfi_personality" >&5
+echo "${ECHO_T}$libc_cv_asm_cfi_personality" >&6; }
+if test x"$libc_cv_asm_cfi_personality" != xyes; then
+  { { echo "$as_me:$LINENO: error: assembler too old, .cfi_personality support missing" >&5
+echo "$as_me: error: assembler too old, .cfi_personality support missing" >&2;}
+   { (exit 1); exit 1; }; }
+fi

Added: fsf/trunk/libc/nptl/sysdeps/x86_64/configure.in
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/configure.in (added)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/configure.in Fri Jul 24 00:06:42 2009
@@ -1,0 +1,23 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/i386.
+
+AC_CACHE_CHECK([for .cfi_personality and .cfi_lsda pseudo-ops],
+	       libc_cv_asm_cfi_personality, [dnl
+  cat > conftest.s <<EOF
+${libc_cv_dot_text}
+foo:
+	.cfi_startproc
+	.cfi_personality 0, foo
+	.cfi_lsda 0, foo
+	.cfi_endproc
+EOF
+  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
+    libc_cv_asm_cfi_personality=yes
+  else
+    libc_cv_asm_cfi_personality=no
+  fi
+  rm -f conftest*
+])
+if test x"$libc_cv_asm_cfi_personality" != xyes; then
+  AC_MSG_ERROR([assembler too old, .cfi_personality support missing])
+fi

Modified: fsf/trunk/libc/posix/tst-rfc3484-2.c
==============================================================================
--- fsf/trunk/libc/posix/tst-rfc3484-2.c (original)
+++ fsf/trunk/libc/posix/tst-rfc3484-2.c Fri Jul 24 00:06:42 2009
@@ -82,6 +82,8 @@
   struct sockaddr_in so1;
   so1.sin_family = AF_INET;
   so1.sin_addr.s_addr = h (0xc0a85f19);
+  /* Clear the rest of the structure to avoid warnings.  */
+  memset (so1.sin_zero, '\0', sizeof (so1.sin_zero));
 
   struct sockaddr_in sa1;
   sa1.sin_family = AF_INET;

Modified: fsf/trunk/libc/posix/tst-rfc3484-3.c
==============================================================================
--- fsf/trunk/libc/posix/tst-rfc3484-3.c (original)
+++ fsf/trunk/libc/posix/tst-rfc3484-3.c Fri Jul 24 00:06:42 2009
@@ -113,6 +113,8 @@
   struct sockaddr_in so;
   so.sin_family = AF_INET;
   so.sin_addr.s_addr = h (0x0aa85f19);
+  /* Clear the rest of the structure to avoid warnings.  */
+  memset (so.sin_zero, '\0', sizeof (so.sin_zero));
 
   for (int i = 0; i < naddrs; ++i)
     {

Modified: fsf/trunk/libc/posix/tst-rfc3484.c
==============================================================================
--- fsf/trunk/libc/posix/tst-rfc3484.c (original)
+++ fsf/trunk/libc/posix/tst-rfc3484.c Fri Jul 24 00:06:42 2009
@@ -102,6 +102,8 @@
   struct sockaddr_in so;
   so.sin_family = AF_INET;
   so.sin_addr.s_addr = h (0xc0a85f19);
+  /* Clear the rest of the structure to avoid warnings.  */
+  memset (so.sin_zero, '\0', sizeof (so.sin_zero));
 
   for (int i = 0; i < naddrs; ++i)
     {

Modified: fsf/trunk/libc/sysdeps/generic/ldsodefs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/ldsodefs.h (original)
+++ fsf/trunk/libc/sysdeps/generic/ldsodefs.h Fri Jul 24 00:06:42 2009
@@ -396,7 +396,7 @@
 	uint32_t hashval;
 	const char *name;
 	const ElfW(Sym) *sym;
-	const struct link_map *map;
+	struct link_map *map;
       } *entries;
       size_t size;
       size_t n_elements;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/makecontext.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/makecontext.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/makecontext.S Fri Jul 24 00:06:42 2009
@@ -1,5 +1,5 @@
 /* Create new context.
-   Copyright (C) 2001, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2005,2007,2008,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2001.
 
@@ -105,17 +105,15 @@
 1:	popl	%ebx
 	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
 #endif
-	popl	%eax			/* This is the next context.  */
-	testl	%eax, %eax
+	cmpl	$0, (%esp)		/* Check the next context.  */
 	je	2f			/* If it is zero exit.  */
 
-	pushl	%eax
 	call	JUMPTARGET(__setcontext)
 	/* If this returns (which can happen if the syscall fails) we'll
 	   exit the program with the return error value (-1).  */
 
-2:	pushl	%eax
-	call	HIDDEN_JUMPTARGET(exit)
+	movl	%eax, (%esp)
+2:	call	HIDDEN_JUMPTARGET(exit)
 	/* The 'exit' call should never return.  In case it does cause
 	   the process to terminate.  */
 	hlt

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c Fri Jul 24 00:06:42 2009
@@ -138,6 +138,9 @@
     { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
     { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
     { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+    { 0xeb, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 18874368 },
+    { 0xec, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 25165824 },
   };
 #define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known[0]))
 

Modified: fsf/trunk/libc/sysdeps/x86_64/cacheinfo.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/cacheinfo.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/cacheinfo.c Fri Jul 24 00:06:42 2009
@@ -25,6 +25,17 @@
 
 #ifdef USE_MULTIARCH
 # include "multiarch/init-arch.h"
+
+# define is_intel __cpu_features.kind == arch_kind_intel
+# define is_amd __cpu_features.kind == arch_kind_amd
+# define max_cpuid __cpu_features.max_cpuid
+#else
+  /* This spells out "GenuineIntel".  */
+# define is_intel \
+  ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69
+  /* This spells out "AuthenticAMD".  */
+# define is_amd \
+  ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65
 #endif
 
 static const struct intel_02_cache_info
@@ -100,6 +111,9 @@
     { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
     { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
     { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+    { 0xeb, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 18874368 },
+    { 0xec, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 25165824 },
   };
 
 #define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0]))
@@ -152,6 +166,12 @@
 	      /* Intel reused this value.  For family 15, model 6 it
 		 specifies the 3rd level cache.  Otherwise the 2nd
 		 level cache.  */
+	      unsigned int family;
+	      unsigned int model;
+#ifdef USE_MULTIARCH
+	      family = __cpu_features.family;
+	      model = __cpu_features.model;
+#else
 	      unsigned int eax;
 	      unsigned int ebx;
 	      unsigned int ecx;
@@ -160,9 +180,10 @@
 			    : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
 			    : "0" (1));
 
-	      unsigned int family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
-	      unsigned int model = ((((eax >>16) & 0xf) << 4)
-				    + ((eax >> 4) & 0xf));
+	      family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
+	      model = (((eax >>16) & 0xf) << 4) + ((eax >> 4) & 0xf);
+#endif
+
 	      if (family == 15 && model == 6)
 		{
 		  /* The level 3 cache is encoded for this model like
@@ -394,21 +415,24 @@
 attribute_hidden
 __cache_sysconf (int name)
 {
+#ifdef USE_MULTIARCH
+  if (__cpu_features.kind == arch_kind_unknown)
+    __init_cpu_features ();
+#else
   /* Find out what brand of processor.  */
-  unsigned int eax;
+  unsigned int max_cpuid;
   unsigned int ebx;
   unsigned int ecx;
   unsigned int edx;
   asm volatile ("cpuid"
-		: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+		: "=a" (max_cpuid), "=b" (ebx), "=c" (ecx), "=d" (edx)
 		: "0" (0));
-
-  /* This spells out "GenuineIntel".  */
-  if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
-    return handle_intel (name, eax);
-
-  /* This spells out "AuthenticAMD".  */
-  if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
+#endif
+
+  if (is_intel)
+    return handle_intel (name, max_cpuid);
+
+  if (is_amd)
     return handle_amd (name);
 
   // XXX Fill in more vendors.
@@ -457,20 +481,11 @@
 #ifdef USE_MULTIARCH
   if (__cpu_features.kind == arch_kind_unknown)
     __init_cpu_features ();
-# define is_intel __cpu_features.kind == arch_kind_intel
-# define is_amd __cpu_features.kind == arch_kind_amd
-# define max_cpuid __cpu_features.max_cpuid
 #else
   int max_cpuid;
   asm volatile ("cpuid"
 		: "=a" (max_cpuid), "=b" (ebx), "=c" (ecx), "=d" (edx)
 		: "0" (0));
-  /* This spells out "GenuineIntel".  */
-# define is_intel \
-  ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69
-  /* This spells out "AuthenticAMD".  */
-# define is_amd \
-  ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65
 #endif
 
   if (is_intel)

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c Fri Jul 24 00:06:42 2009
@@ -68,7 +68,13 @@
 	  __cpu_features.model += extended_model;
 	}
       else if (__cpu_features.family == 0x06)
-	__cpu_features.model += extended_model;
+	{
+	  __cpu_features.model += extended_model;
+
+	  if (__cpu_features.model == 0x1c)
+	    /* Avoid SSSE3 on Atom since it is slow.  */
+	    __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~(1 << 9);
+	}
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strcpy.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strcpy.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strcpy.S Fri Jul 24 00:06:42 2009
@@ -64,16 +64,9 @@
 	call	__init_cpu_features
 1:	leaq	STRCPY_SSE2(%rip), %rax
 	testl	$(1<<9), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip)
-	jz	3f
-/* Avoid SSSE3 strcpy on Atom since it is slow.  */
-	cmpl	$1, __cpu_features+KIND_OFFSET(%rip)
-	jne	2f
-	cmpl	$6, __cpu_features+FAMILY_OFFSET(%rip)
-	jne	2f
-	cmpl	$28, __cpu_features+MODEL_OFFSET(%rip)
-	jz	3f
-2:	leaq	STRCPY_SSSE3(%rip), %rax
-3:	ret
+	jz	2f
+	leaq	STRCPY_SSSE3(%rip), %rax
+2:	ret
 END(STRCPY)
 
 	.section .text.ssse3,"ax",@progbits