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

[Commits] r18591 - in /fsf/trunk/libc: ./ bits/ crypt/ elf/ manual/ manual/examples/ math/ nptl/ nptl/sysdeps/unix/sysv/linux/i386/i68...



Author: eglibc
Date: Fri May 18 00:01:39 2012
New Revision: 18591

Log:
Import glibc-mainline for 2012-05-18

Added:
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/test-multiarch.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/test-multiarch.c
    fsf/trunk/libc/sysdeps/x86_64/tst-mallocalign1.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/bits/types.h
    fsf/trunk/libc/bits/typesizes.h
    fsf/trunk/libc/crypt/sha512c-test.c
    fsf/trunk/libc/elf/tst-relsort1.c
    fsf/trunk/libc/manual/examples/search.c
    fsf/trunk/libc/manual/string.texi
    fsf/trunk/libc/math/bug-nextafter.c
    fsf/trunk/libc/math/bug-nexttoward.c
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/math/test-fenv.c
    fsf/trunk/libc/math/test-misc.c
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
    fsf/trunk/libc/stdio-common/bug22.c
    fsf/trunk/libc/stdlib/bug-getcontext.c
    fsf/trunk/libc/sysdeps/i386/dl-machine.h
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
    fsf/trunk/libc/sysdeps/mach/hurd/bits/typesizes.h
    fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
    fsf/trunk/libc/sysdeps/x86_64/Makefile
    fsf/trunk/libc/sysdeps/x86_64/multiarch/Makefile
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S
    fsf/trunk/libc/time/time.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri May 18 00:01:39 2012
@@ -1,3 +1,85 @@
+2012-05-17  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* crypt/sha512c-test.c (TIMEOUT): Increase to 32.
+
+2012-05-17  Andreas Jaeger  <aj@xxxxxxx>
+
+	* elf/tst-relsort1.c (do_test): Fix function declaration to avoid
+	warning.
+
+2012-05-17  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/tst-mallocalign1.c (test): Cast to unsigned long.
+
+2012-05-17  Andreas Jaeger  <aj@xxxxxxx>
+
+	* sysdeps/i386/dl-machine.h (elf_machine_rel): Declare refsym only
+	when it is used.
+
+2012-05-17  Chris Metcalf  <cmetcalf@xxxxxxxxxx>
+
+	* stdio-common/bug22.c (TIMEOUT): Bump up from 30 to 60.
+
+2012-05-17  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/Makefile (tests): Add tst-mallocalign1.
+	* sysdeps/x86_64/tst-mallocalign1.c: New file.
+
+2012-05-17  Andreas Jaeger  <aj@xxxxxxx>
+	    Carlos O'Donell  <carlos_odonell@xxxxxxxxxx>
+
+	[BZ #14059]
+	* sysdeps/x86_64/multiarch/init-arch.h
+	(bit_YMM_Usable): Rename to...
+	(bit_AVX_Usable): ... this.
+	(bit_FMA4_Usable): New macro.
+	(bit_XMM_state): New macro.
+	(bit_YMM_state): New macro.
+	[__ASSEMBLER__] (index_YMM_Usable): Rename to...
+	[__ASSEMBLER__] (index_AVX_Usable): ... this.
+	[__ASSEMBLER__] (index_FMA4_Usable): New macro.
+	(CPUID_OSXSAVE): New macro.
+	(CPUID_AVX): New macro.
+	(CPUID_FMA4): New macro.
+	(index_YMM_Usable): Rename to...
+	(index_AVX_Usable): ... this.
+	(HAS_AVX): Use HAS_ARCH_FEATURE.
+	(HAS_FMA4): Likewise.
+	(HAS_YMM_USABLE): Remove.
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
+	Enable AVX or FMA4 IFF YMM and XMM states are usable and the features
+	are present.
+	* sysdeps/x86_64/multiarch/strcmp.S: Use bit_AVX_Usable.
+	* sysdeps/i386/i686/multiarch/Makefile: Add test-multiarch to tests.
+	* sysdeps/x86_64/multiarch/Makefile: Likewise.
+	* sysdeps/i386/i686/multiarch/test-multiarch.c: New file.
+	* sysdeps/x86_64/multiarch/test-multiarch.c: New file.
+
+2012-05-17  Chris Metcalf  <cmetcalf@xxxxxxxxxx>
+
+	* math/libm-test.c: Support platforms without multiple rounding modes.
+	* math/bug-nextafter.c: Support platforms without FP exceptions.
+	* math/bug-nexttoward.c: Likewise.
+	* math/test-fenv.c: Likewise.
+	* math/test-misc.c: Likewise.
+	* stdlib/bug-getcontext.c: Likewise.
+
+2012-05-17  Andreas Jaeger  <aj@xxxxxxx>
+
+	* manual/examples/search.c (critter_cmp): Change signature to
+	avoid warnings.
+	* manual/string.texi (Collation Functions): Likewise.
+
+2012-05-16  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* bits/types.h: Fold copyright years.
+	* bits/typesizes.h: Likewise.
+	* sysdeps/mach/hurd/bits/typesizes.h: Likewise.
+	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: Likewise.
+	* time/time.h: Likewise.
+
 2012-05-16  Paul Pluzhnikov  <ppluzhnikov@xxxxxxxxxx>
 
 	[BZ #208]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri May 18 00:01:39 2012
@@ -27,7 +27,7 @@
   13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938,
   13941, 13942, 13954, 13955, 13956, 13963, 13967, 13970, 13973, 13979,
   13983, 13986, 14012, 14027, 14033, 14034, 14040, 14043, 14044, 14049,
-  14053, 14055, 14064, 14080, 14083, 14103, 14104, 14109
+  14053, 14055, 14059, 14064, 14080, 14083, 14103, 14104, 14109
 
 * ISO C11 support:
 

Modified: fsf/trunk/libc/bits/types.h
==============================================================================
--- fsf/trunk/libc/bits/types.h (original)
+++ fsf/trunk/libc/bits/types.h Fri May 18 00:01:39 2012
@@ -1,6 +1,5 @@
 /* bits/types.h -- definitions of __*_t types underlying *_t types.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/bits/typesizes.h
==============================================================================
--- fsf/trunk/libc/bits/typesizes.h (original)
+++ fsf/trunk/libc/bits/typesizes.h Fri May 18 00:01:39 2012
@@ -1,6 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  Generic version.
-   Copyright (C) 2002, 2003, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/crypt/sha512c-test.c
==============================================================================
--- fsf/trunk/libc/crypt/sha512c-test.c (original)
+++ fsf/trunk/libc/crypt/sha512c-test.c Fri May 18 00:01:39 2012
@@ -58,6 +58,6 @@
   return result;
 }
 
-#define TIMEOUT 6
+#define TIMEOUT 32
 #define TEST_FUNCTION do_test ()
 #include "../test-skeleton.c"

Modified: fsf/trunk/libc/elf/tst-relsort1.c
==============================================================================
--- fsf/trunk/libc/elf/tst-relsort1.c (original)
+++ fsf/trunk/libc/elf/tst-relsort1.c Fri May 18 00:01:39 2012
@@ -3,7 +3,7 @@
 
 
 static int
-do_test ()
+do_test (void)
 {
   const char lib[] = "$ORIGIN/tst-relsort1mod1.so";
   void *h = dlopen (lib, RTLD_NOW);

Modified: fsf/trunk/libc/manual/examples/search.c
==============================================================================
--- fsf/trunk/libc/manual/examples/search.c (original)
+++ fsf/trunk/libc/manual/examples/search.c Fri May 18 00:01:39 2012
@@ -53,8 +53,11 @@
 /* This is the comparison function used for sorting and searching. */
 
 int
-critter_cmp (const struct critter *c1, const struct critter *c2)
+critter_cmp (const void *v1, const void *v2)
 {
+  const struct critter *c1 = v1;
+  const struct critter *c2 = v2;
+
   return strcmp (c1->name, c2->name);
 }
 

Modified: fsf/trunk/libc/manual/string.texi
==============================================================================
--- fsf/trunk/libc/manual/string.texi (original)
+++ fsf/trunk/libc/manual/string.texi Fri May 18 00:01:39 2012
@@ -1370,8 +1370,11 @@
 /* @r{This is the comparison function used with @code{qsort}.} */
 
 int
-compare_elements (char **p1, char **p2)
+compare_elements (const void *v1, const void *v2)
 @{
+  char * const *p1 = v1;
+  char * const *p1 = v2;
+
   return strcoll (*p1, *p2);
 @}
 
@@ -1462,8 +1465,11 @@
    @r{to sort an array of @code{struct sorter}.} */
 
 int
-compare_elements (struct sorter *p1, struct sorter *p2)
+compare_elements (const void *v1, const void *v2)
 @{
+  const struct sorter *p1 = v1;
+  const struct sorter *p2 = v2;
+
   return strcmp (p1->transformed, p2->transformed);
 @}
 

Modified: fsf/trunk/libc/math/bug-nextafter.c
==============================================================================
--- fsf/trunk/libc/math/bug-nextafter.c (original)
+++ fsf/trunk/libc/math/bug-nextafter.c Fri May 18 00:01:39 2012
@@ -4,6 +4,12 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
+/* If there's no support for the exceptions this test is checking,
+   then just return success and allow the test to be compiled.  */
+# define fetestexcept(e) 1
+#endif
+
 float zero = 0.0;
 float inf = INFINITY;
 

Modified: fsf/trunk/libc/math/bug-nexttoward.c
==============================================================================
--- fsf/trunk/libc/math/bug-nexttoward.c (original)
+++ fsf/trunk/libc/math/bug-nexttoward.c Fri May 18 00:01:39 2012
@@ -4,6 +4,12 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
+/* If there's no support for the exceptions this test is checking,
+   then just return success and allow the test to be compiled.  */
+# define fetestexcept(e) 1
+#endif
+
 float zero = 0.0;
 float inf = INFINITY;
 

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Fri May 18 00:01:39 2012
@@ -127,6 +127,22 @@
 #include <stdio.h>
 #include <string.h>
 #include <argp.h>
+
+/* Allow platforms without all rounding modes to test properly,
+   assuming they provide an __FE_UNDEFINED in <bits/fenv.h> which
+   causes fesetround() to return failure.  */
+#ifndef FE_TONEAREST
+# define FE_TONEAREST	__FE_UNDEFINED
+#endif
+#ifndef FE_TOWARDZERO
+# define FE_TOWARDZERO	__FE_UNDEFINED
+#endif
+#ifndef FE_UPWARD
+# define FE_UPWARD	__FE_UNDEFINED
+#endif
+#ifndef FE_DOWNWARD
+# define FE_DOWNWARD	__FE_UNDEFINED
+#endif
 
 /* Possible exceptions */
 #define NO_EXCEPTION			0x0

Modified: fsf/trunk/libc/math/test-fenv.c
==============================================================================
--- fsf/trunk/libc/math/test-fenv.c (original)
+++ fsf/trunk/libc/math/test-fenv.c Fri May 18 00:01:39 2012
@@ -664,9 +664,11 @@
     }
 #endif
   test_exceptions ("feholdexcept_tests 0 test", NO_EXC, 0);
+#ifdef FE_INVALID
   feraiseexcept (FE_INVALID);
   test_exceptions ("feholdexcept_tests FE_INVALID test",
 		   INVALID_EXC, 0);
+#endif
   res = feupdateenv (&saved);
   if (res != 0)
     {
@@ -684,7 +686,9 @@
   test_exceptions ("feholdexcept_tests FE_DIVBYZERO|FE_INVALID test",
 		   DIVBYZERO_EXC | INVALID_EXC, 0);
   feclearexcept (FE_ALL_EXCEPT);
+#ifdef FE_INVALID
   feraiseexcept (FE_INVALID);
+#endif
 #if defined FE_TONEAREST && defined FE_UPWARD
   res = fesetround (FE_UPWARD);
   if (res != 0)
@@ -708,9 +712,11 @@
     }
 #endif
   test_exceptions ("feholdexcept_tests 0 2nd test", NO_EXC, 0);
+#ifdef FE_INEXACT
   feraiseexcept (FE_INEXACT);
   test_exceptions ("feholdexcept_tests FE_INEXACT test",
 		   INEXACT_EXC, 0);
+#endif
   res = feupdateenv (&saved2);
   if (res != 0)
     {

Modified: fsf/trunk/libc/math/test-misc.c
==============================================================================
--- fsf/trunk/libc/math/test-misc.c (original)
+++ fsf/trunk/libc/math/test-misc.c Fri May 18 00:01:39 2012
@@ -1186,12 +1186,14 @@
   (void) &f2;
   feclearexcept (FE_ALL_EXCEPT);
   f2 += f1;
+#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
   int fe = fetestexcept (FE_ALL_EXCEPT);
   if (fe != (FE_OVERFLOW | FE_INEXACT))
     {
       printf ("float overflow test failed: %x\n", fe);
       result = 1;
     }
+#endif
 
   volatile double d1 = DBL_MAX;
   volatile double d2 = DBL_MAX / 2;
@@ -1199,12 +1201,14 @@
   (void) &d2;
   feclearexcept (FE_ALL_EXCEPT);
   d2 += d1;
+#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
   fe = fetestexcept (FE_ALL_EXCEPT);
   if (fe != (FE_OVERFLOW | FE_INEXACT))
     {
       printf ("double overflow test failed: %x\n", fe);
       result = 1;
     }
+#endif
 
 #ifndef NO_LONG_DOUBLE
   volatile long double ld1 = LDBL_MAX;
@@ -1213,12 +1217,14 @@
   (void) &ld2;
   feclearexcept (FE_ALL_EXCEPT);
   ld2 += ld1;
+# if defined(FE_OVERFLOW) && defined(FE_INEXACT)
   fe = fetestexcept (FE_ALL_EXCEPT);
   if (fe != (FE_OVERFLOW | FE_INEXACT))
     {
       printf ("long double overflow test failed: %x\n", fe);
       result = 1;
     }
+# endif
 #endif
 
 #if !defined NO_LONG_DOUBLE && LDBL_MANT_DIG == 113

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri May 18 00:01:39 2012
@@ -1,3 +1,9 @@
+2012-05-17  Andreas Jaeger  <aj@xxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
+	(HAVE_DL_DISCOVER_OSVERSION): Don't declare _dl_discover_osversion
+	only for older kernels.
+
 2012-05-15  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* pthreadP.h [!__NR_set_robust_list] (__NR_set_robust_list): Do

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* System-specific settings for dynamic linker code.  IA-32 version.
-   Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -58,9 +58,7 @@
 #endif
 
 
-/* The _dl_discover_osversion function is so far only needed in sysconf
-   to check for kernels later than 2.6.23.  */
-#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617
+#ifndef __ASSEMBLER__
 /* Get version of the OS.  */
 extern int _dl_discover_osversion (void) attribute_hidden;
 # define HAVE_DL_DISCOVER_OSVERSION	1

Modified: fsf/trunk/libc/stdio-common/bug22.c
==============================================================================
--- fsf/trunk/libc/stdio-common/bug22.c (original)
+++ fsf/trunk/libc/stdio-common/bug22.c Fri May 18 00:01:39 2012
@@ -51,6 +51,6 @@
   return ret != -1 || errno != EOVERFLOW;
 }
 
-#define TIMEOUT 30
+#define TIMEOUT 60
 #define TEST_FUNCTION do_test ()
 #include "../test-skeleton.c"

Modified: fsf/trunk/libc/stdlib/bug-getcontext.c
==============================================================================
--- fsf/trunk/libc/stdlib/bug-getcontext.c (original)
+++ fsf/trunk/libc/stdlib/bug-getcontext.c Fri May 18 00:01:39 2012
@@ -9,6 +9,9 @@
 static int
 do_test (void)
 {
+#if FE_ALL_EXCEPT == 0
+  printf("Skipping test; no support for FP exceptions.\n");
+#else
   int except_mask =  FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW;
   int status = feenableexcept (except_mask);
 
@@ -41,6 +44,7 @@
 
   printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
 	 mask, except_mask);
+#endif
   return 0;
 }
 

Modified: fsf/trunk/libc/sysdeps/i386/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/i386/dl-machine.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  i386 version.
-   Copyright (C) 1995-2005, 2006, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -333,7 +333,9 @@
   else
 # endif	/* !RTLD_BOOTSTRAP and have no -z combreloc */
     {
+# ifndef RTLD_BOOTSTRAP
       const Elf32_Sym *const refsym = sym;
+# endif
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
       Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
 

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile Fri May 18 00:01:39 2012
@@ -1,5 +1,6 @@
 ifeq ($(subdir),csu)
 aux += init-arch
+tests += test-multiarch
 gen-as-const-headers += ifunc-defines.sym
 endif
 

Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/test-multiarch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/test-multiarch.c (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/test-multiarch.c Fri May 18 00:01:39 2012
@@ -1,0 +1,1 @@
+#include <sysdeps/x86_64/multiarch/test-multiarch.c>

Modified: fsf/trunk/libc/sysdeps/mach/hurd/bits/typesizes.h
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/bits/typesizes.h (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/bits/typesizes.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  Hurd version.
-   Copyright (C) 2002,2003,2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h (original)
+++ fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  FreeBSD version.
-   Copyright (C) 2002, 2003, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  Linux/s390 version.
-   Copyright (C) 2003, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  Linux/SPARC version.
-   Copyright (C) 2002, 2003, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

Modified: fsf/trunk/libc/sysdeps/x86_64/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/Makefile (original)
+++ fsf/trunk/libc/sysdeps/x86_64/Makefile Fri May 18 00:01:39 2012
@@ -9,6 +9,10 @@
 
 ifeq ($(subdir),gmon)
 sysdep_routines += _mcount
+endif
+
+ifeq ($(subdir),malloc)
+tests += tst-mallocalign1
 endif
 
 ifeq ($(subdir),string)

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/Makefile Fri May 18 00:01:39 2012
@@ -1,5 +1,6 @@
 ifeq ($(subdir),csu)
 aux += init-arch
+tests += test-multiarch
 gen-as-const-headers += ifunc-defines.sym
 endif
 

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 May 18 00:01:39 2012
@@ -1,6 +1,6 @@
 /* Initialize CPU feature data.
    This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -143,16 +143,23 @@
   else
     kind = arch_kind_other;
 
-  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
+  /* Can we call xgetbv?  */
+  if (CPUID_OSXSAVE)
     {
-      /* Reset the AVX bit in case OSXSAVE is disabled.  */
-      if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) != 0
-	  && ({ unsigned int xcrlow;
-		unsigned int xcrhigh;
-		asm ("xgetbv"
-		     : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
-		(xcrlow & 6) == 6; }))
-	__cpu_features.feature[index_YMM_Usable] |= bit_YMM_Usable;
+      unsigned int xcrlow;
+      unsigned int xcrhigh;
+      asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
+      /* Is YMM and XMM state usable?  */
+      if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
+	  (bit_YMM_state | bit_XMM_state))
+	{
+	  /* Determine if AVX is usable.  */
+	  if (CPUID_AVX)
+	    __cpu_features.feature[index_AVX_Usable] |= bit_AVX_Usable;
+	  /* Determine if FMA4 is usable.  */
+	  if (CPUID_FMA4)
+	    __cpu_features.feature[index_FMA4_Usable] |= bit_FMA4_Usable;
+	}
     }
 
   __cpu_features.family = family;

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -21,8 +21,10 @@
 #define bit_Prefer_SSE_for_memop	(1 << 3)
 #define bit_Fast_Unaligned_Load		(1 << 4)
 #define bit_Prefer_PMINUB_for_stringop	(1 << 5)
-#define bit_YMM_Usable			(1 << 6)
+#define bit_AVX_Usable			(1 << 6)
+#define bit_FMA4_Usable			(1 << 7)
 
+/* CPUID Feature flags.  */
 #define bit_SSE2	(1 << 26)
 #define bit_SSSE3	(1 << 9)
 #define bit_SSE4_1	(1 << 19)
@@ -32,6 +34,10 @@
 #define bit_POPCOUNT	(1 << 23)
 #define bit_FMA		(1 << 12)
 #define bit_FMA4	(1 << 16)
+
+/* XCR0 Feature flags.  */
+#define bit_XMM_state  (1 << 1)
+#define bit_YMM_state  (2 << 1)
 
 #ifdef	__ASSEMBLER__
 
@@ -49,7 +55,8 @@
 # define index_Prefer_SSE_for_memop	FEATURE_INDEX_1*FEATURE_SIZE
 # define index_Fast_Unaligned_Load	FEATURE_INDEX_1*FEATURE_SIZE
 # define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
-# define index_YMM_Usable		FEATURE_INDEX_1*FEATURE_SIZE
+# define index_AVX_Usable		FEATURE_INDEX_1*FEATURE_SIZE
+# define index_FMA4_Usable		FEATURE_INDEX_1*FEATURE_SIZE
 
 #else	/* __ASSEMBLER__ */
 
@@ -113,35 +120,45 @@
 
 /* Following are the feature tests used throughout libc.  */
 
+/* CPUID_* evaluates to true if the feature flag is enabled.
+   We always use &__cpu_features because the HAS_CPUID_* macros
+   are called only within __init_cpu_features, where we can't
+   call __get_cpu_features without infinite recursion.  */
+# define HAS_CPUID_FLAG(idx, reg, bit) \
+  (((&__cpu_features)->cpuid[idx].reg & (bit)) != 0)
+
+# define CPUID_OSXSAVE \
+  HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_OSXSAVE)
+# define CPUID_AVX \
+  HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
+# define CPUID_FMA4 \
+  HAS_CPUID_FLAG (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
+
+/* HAS_* evaluates to true if we may use the feature at runtime.  */
 # define HAS_SSE2	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, edx, bit_SSE2)
 # define HAS_POPCOUNT	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_POPCOUNT)
 # define HAS_SSSE3	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSSE3)
 # define HAS_SSE4_1	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_1)
 # define HAS_SSE4_2	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_2)
 # define HAS_FMA	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_FMA)
-# define HAS_AVX	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
-# define HAS_FMA4	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
 
 # define index_Fast_Rep_String		FEATURE_INDEX_1
 # define index_Fast_Copy_Backward	FEATURE_INDEX_1
 # define index_Slow_BSF			FEATURE_INDEX_1
 # define index_Prefer_SSE_for_memop	FEATURE_INDEX_1
 # define index_Fast_Unaligned_Load	FEATURE_INDEX_1
-# define index_YMM_Usable		FEATURE_INDEX_1
+# define index_AVX_Usable		FEATURE_INDEX_1
+# define index_FMA4_Usable		FEATURE_INDEX_1
 
 # define HAS_ARCH_FEATURE(name) \
   ((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)
 
-# define HAS_FAST_REP_STRING	HAS_ARCH_FEATURE (Fast_Rep_String)
-
-# define HAS_FAST_COPY_BACKWARD	HAS_ARCH_FEATURE (Fast_Copy_Backward)
-
-# define HAS_SLOW_BSF		HAS_ARCH_FEATURE (Slow_BSF)
-
-# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
-
-# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-
-# define HAS_YMM_USABLE		HAS_ARCH_FEATURE (YMM_Usable)
+# define HAS_FAST_REP_STRING		HAS_ARCH_FEATURE (Fast_Rep_String)
+# define HAS_FAST_COPY_BACKWARD		HAS_ARCH_FEATURE (Fast_Copy_Backward)
+# define HAS_SLOW_BSF			HAS_ARCH_FEATURE (Slow_BSF)
+# define HAS_PREFER_SSE_FOR_MEMOP	HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
+# define HAS_FAST_UNALIGNED_LOAD	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
+# define HAS_AVX			HAS_ARCH_FEATURE (AVX_Usable)
+# define HAS_FMA4			HAS_ARCH_FEATURE (FMA4_Usable)
 
 #endif	/* __ASSEMBLER__ */

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S Fri May 18 00:01:39 2012
@@ -1,5 +1,5 @@
 /* strcmp with SSE4.2
-   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -83,6 +83,7 @@
 	.text
 ENTRY(STRCMP)
 	.type	STRCMP, @gnu_indirect_function
+	/* Manually inlined call to __get_cpu_features.  */
 	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
 	jne	1f
 	call	__init_cpu_features
@@ -100,13 +101,14 @@
 # ifdef USE_AS_STRCASECMP_L
 ENTRY(__strcasecmp)
 	.type	__strcasecmp, @gnu_indirect_function
+	/* Manually inlined call to __get_cpu_features.  */
 	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
 	jne	1f
 	call	__init_cpu_features
 1:
 #  ifdef HAVE_AVX_SUPPORT
 	leaq	__strcasecmp_avx(%rip), %rax
-	testl	$bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
 	jnz	2f
 #  endif
 	leaq	__strcasecmp_sse42(%rip), %rax
@@ -123,13 +125,14 @@
 # ifdef USE_AS_STRNCASECMP_L
 ENTRY(__strncasecmp)
 	.type	__strncasecmp, @gnu_indirect_function
+	/* Manually inlined call to __get_cpu_features.  */
 	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
 	jne	1f
 	call	__init_cpu_features
 1:
 #  ifdef HAVE_AVX_SUPPORT
 	leaq	__strncasecmp_avx(%rip), %rax
-	testl	$bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
 	jnz	2f
 #  endif
 	leaq	__strncasecmp_sse42(%rip), %rax

Added: fsf/trunk/libc/sysdeps/x86_64/multiarch/test-multiarch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/test-multiarch.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/test-multiarch.c Fri May 18 00:01:39 2012
@@ -1,0 +1,90 @@
+/* Test CPU feature data.
+   This file is part of the GNU C Library.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <init-arch.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *cpu_flags;
+
+/* Search for flags in /proc/cpuinfo and store line
+   in cpu_flags.  */
+void
+get_cpuinfo (void)
+{
+  FILE *f;
+  char *line = NULL;
+  size_t len = 0;
+  ssize_t read;
+
+  f = fopen ("/proc/cpuinfo", "r");
+  if (f == NULL)
+    {
+      printf ("cannot open /proc/cpuinfo");
+      exit (1);
+    }
+
+  while ((read = getline (&line, &len, f)) != -1)
+    {
+      if (strncmp (line, "flags", 5) == 0)
+       {
+         cpu_flags = strdup (line);
+         break;
+       }
+    }
+  fclose (f);
+  free (line);
+}
+
+int
+check_proc (const char *proc_name, int flag, const char *name)
+{
+  int found = 0;
+
+  printf ("Checking %s:\n", name);
+  printf ("  init-arch %d\n", flag);
+  if (strstr (cpu_flags, proc_name) != NULL)
+    found = 1;
+  printf ("  cpuinfo (%s) %d\n", proc_name, found);
+
+  if (found != flag)
+    printf (" *** failure ***\n");
+
+  return (found != flag);
+}
+
+static int
+do_test (int argc, char **argv)
+{
+  int fails;
+
+  get_cpuinfo ();
+  fails = check_proc ("avx", HAS_AVX, "HAS_AVX");
+  fails += check_proc ("fma4", HAS_FMA4, "HAS_FMA4");
+  fails += check_proc ("sse4_2", HAS_SSE4_2, "HAS_SSE4_2");
+  fails += check_proc ("sse4_1", HAS_SSE4_1, "HAS_SSE4_1");
+  fails += check_proc ("ssse3", HAS_SSSE3, "HAS_SSSE3");
+  fails += check_proc ("popcnt", HAS_POPCOUNT, "HAS_POPCOUNT");
+
+  printf ("%d differences between /proc/cpuinfo and glibc code.\n", fails);
+
+  return (fails != 0);
+}
+
+#include "../../../test-skeleton.c"

Added: fsf/trunk/libc/sysdeps/x86_64/tst-mallocalign1.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-mallocalign1.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-mallocalign1.c Fri May 18 00:01:39 2012
@@ -1,0 +1,72 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Specified by x86-64 psABI.  */
+#define ALIGN_MASK (16 - 1)
+
+void *
+test (size_t s)
+{
+  void *p = malloc (s);
+
+  printf ("malloc: %ld, %p: %ld\n", (unsigned long) s, p,
+	  ((unsigned long) p) & ALIGN_MASK);
+  return p;
+}
+
+static int
+do_test (void)
+{
+  void *p;
+  int ret = 0;
+
+  p = test (2);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (8);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (13);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (16);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (23);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (43);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  p = test (123);
+  ret |= (unsigned long) p & ALIGN_MASK;
+  free (p);
+
+  return ret;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/time/time.h
==============================================================================
--- fsf/trunk/libc/time/time.h (original)
+++ fsf/trunk/libc/time/time.h Fri May 18 00:01:39 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2003,2006,2009,2011,2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits