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

[commits] r10253 - in /fsf/trunk/libc: ./ string/ sysdeps/i386/i686/multiarch/



Author: eglibc
Date: Fri Apr 16 00:03:55 2010
New Revision: 10253

Log:
Import glibc-mainline for 2010-04-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/string/test-strncmp.c
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Apr 16 00:03:55 2010
@@ -1,3 +1,14 @@
+2010-04-15  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* string/test-strncmp.c (check_result): New function.
+	(do_one_test): Use it.
+	(check1): New function.
+	(test_main): Use it.
+	* sysdeps/i386/i686/multiarch/strcmp-sse4.S (crosspage): Properly
+	update source and destination.
+	* sysdeps/i386/i686/multiarch/strcmp-ssse3.S (gobble_ashr_12):
+	Properly check and update counter.
+
 2010-04-14  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* sysdeps/x86_64/elf/configure.in: Move AVX test to ....

Modified: fsf/trunk/libc/string/test-strncmp.c
==============================================================================
--- fsf/trunk/libc/string/test-strncmp.c (original)
+++ fsf/trunk/libc/string/test-strncmp.c Fri Apr 16 00:03:55 2010
@@ -1,5 +1,5 @@
 /* Test and measure strncmp functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@xxxxxxxxxx>, 1999.
 
@@ -51,8 +51,8 @@
   return ret;
 }
 
-static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n,
+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);
@@ -63,8 +63,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)
     {
@@ -283,12 +293,33 @@
     }
 }
 
+static void
+check1 (void)
+{
+  char *s1 = (char *)(buf1 + 0xb2c);
+  char *s2 = (char *)(buf1 + 0xfd8);
+  size_t i;
+  int exp_result;
+
+  strcpy(s1, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs");
+  strcpy(s2, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkLMNOPQRSTUV");
+
+  for (i = 0; i < 80; i++)
+    {
+      exp_result = simple_strncmp (s1, s2, i);
+      FOR_EACH_IMPL (impl, 0)
+	 check_result (impl, s1, s2, i, exp_result);
+    }
+}
+
 int
 test_main (void)
 {
   size_t i;
 
   test_init ();
+
+  check1 ();
 
   printf ("%23s", "");
   FOR_EACH_IMPL (impl, 0)

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S Fri Apr 16 00:03:55 2010
@@ -223,8 +223,8 @@
 	inc	%edx
 	cmp	$15, %edx
 	jle	L(crosspage)
-	add	$16, %edi
-	add	$16, %esi
+	add	%edx, %edi
+	add	%edx, %esi
 	jmp	L(check_offset)
 
 	.p2align 4

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S Fri Apr 16 00:03:55 2010
@@ -1484,17 +1484,18 @@
 	sub	$0xffff, %esi
 	jnz	L(exit)
 
+#ifdef USE_AS_STRNCMP
+	cmp	$16, %ebp
+	lea	-16(%ebp), %ebp
+	jbe	L(more8byteseq)
+#endif
+
 	add	$16, %ecx
 	movdqa	%xmm4, %xmm3
 
 	add	$16, %edi
 	jg	L(nibble_ashr_12)
 
-#ifdef USE_AS_STRNCMP
-	cmp	$16, %ebp
-	lea	-16(%ebp), %ebp
-	jbe	L(more8byteseq)
-#endif
 	movdqa	(%eax, %ecx), %xmm1
 	movdqa	(%edx, %ecx), %xmm2
 	movdqa	%xmm2, %xmm4