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

[commits] r12010 - in /fsf/trunk/libc: ./ string/ sysdeps/ieee754/ldbl-128ibm/ sysdeps/x86_64/multiarch/



Author: eglibc
Date: Thu Nov 11 00:03:19 2010
New Revision: 12010

Log:
Import glibc-mainline for 2010-11-11

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/string/test-strncasecmp.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Nov 11 00:03:19 2010
@@ -1,3 +1,18 @@
+2010-11-10  Luis Machado  <luisgpm@xxxxxxxxxx>
+
+	* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Force
+	  signed comparison.
+
+2010-11-09  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	[BZ #12205]
+	* string/test-strncasecmp.c (check_result): New function.
+	(do_one_test): Use it.
+	(check1): New function.
+	(test_main): Use it.
+	* sysdeps/i386/i686/multiarch/strcmp.S (nibble_ashr_use_sse4_2_exit):
+	Support strcasecmp and strncasecmp.
+
 2010-11-08  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #12194]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Thu Nov 11 00:03:19 2010
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2010-11-8
+GNU C Library NEWS -- history of user-visible changes.  2010-11-10
 Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -11,7 +11,7 @@
 
   3268, 7066, 10851, 11611, 11640, 11701, 11840, 11856, 11883, 11903, 11904,
   11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108,
-  12113, 12140, 12159, 12167, 12191, 12194
+  12113, 12140, 12159, 12167, 12191, 12194, 12205
 
 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
 

Modified: fsf/trunk/libc/string/test-strncasecmp.c
==============================================================================
--- fsf/trunk/libc/string/test-strncasecmp.c (original)
+++ fsf/trunk/libc/string/test-strncasecmp.c Thu Nov 11 00:03:19 2010
@@ -70,9 +70,9 @@
   return ret;
 }
 
-static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n,
-	     int exp_result)
+static int
+check_result (impl_t *impl, const char *s1, const char *s2, size_t n,
+	      int exp_result)
 {
   int result = CALL (impl, s1, s2, n);
   if ((exp_result == 0 && result != 0)
@@ -82,8 +82,18 @@
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
       ret = 1;
-      return;
-    }
+      return -1;
+    }
+
+  return 0;
+}
+
+static void
+do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n,
+	     int exp_result)
+{
+  if (check_result (impl, s1, s2, n, exp_result) < 0)
+    return;
 
   if (HP_TIMING_AVAIL)
     {
@@ -242,12 +252,33 @@
     }
 }
 
+
+static void
+check1 (void)
+{
+  static char cp [4096+16] __attribute__ ((aligned(4096)));
+  static char gotrel[4096] __attribute__ ((aligned(4096)));
+  char *s1 = cp + 0xffa;
+  char *s2 = gotrel + 0xcbe;
+  int exp_result;
+  size_t n = 6;
+
+  strcpy (s1, "gottpoff");
+  strcpy (s2, "GOTPLT");
+
+  exp_result = simple_strncasecmp (s1, s2, n);
+  FOR_EACH_IMPL (impl, 0)
+    check_result (impl, s1, s2, n, exp_result);
+}
+
 int
 test_main (void)
 {
   size_t i;
 
   test_init ();
+
+  check1 ();
 
   printf ("%23s", "");
   FOR_EACH_IMPL (impl, 0)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c Thu Nov 11 00:03:19 2010
@@ -73,9 +73,9 @@
 	m = ((a.i[2] >> 20) & 0x7ff) - 54;
       }
       m += n;
-      if (m > 0)
+      if ((int) m > 0)
 	a.i[2] = (a.i[2] & 0x800fffff) | (m << 20);
-      else if (m <= -54) {
+      else if ((int) m <= -54) {
 	a.i[2] &= 0x80000000;
 	a.i[3] = 0;
       } else {

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 Thu Nov 11 00:03:19 2010
@@ -1809,7 +1809,13 @@
 	ja	LABEL(loop_ashr_15_use_sse4_2)
 
 LABEL(nibble_ashr_use_sse4_2_exit):
+# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
 	pcmpistri      $0x1a,(%rsi,%rdx), %xmm0
+# else
+	movdqa	(%rsi,%rdx), %xmm1
+	TOLOWER (%xmm0, %xmm1)
+	pcmpistri $0x1a, %xmm1, %xmm0
+# endif
 	.p2align 4
 LABEL(use_sse4_2_exit):
 	jnc	LABEL(strcmp_exitz_sse4_2)