about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--NEWS2
-rw-r--r--sysdeps/x86_64/multiarch/strchr.S4
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a363552ca7..7b9f810b34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-25  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12159]
+	* sysdeps/x86_64/multiarch/strchr.S: Fix propagation of search byte
+	into all bytes of SSE register.
+	Patch by Richard Li <richardpku@gmail.com>.
+
 2010-10-24  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #12140]
diff --git a/NEWS b/NEWS
index 23f1e2df34..30bbd4bbf3 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.13
 
   3268, 7066, 10851, 11611, 11640, 11701, 11840, 11856, 11883, 11903, 11904,
   11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108,
-  12113, 12140
+  12113, 12140, 12159
 
 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
 
diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S
index 27eead9852..71845a35fe 100644
--- a/sysdeps/x86_64/multiarch/strchr.S
+++ b/sysdeps/x86_64/multiarch/strchr.S
@@ -1,5 +1,5 @@
 /* strchr with SSE4.2
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
@@ -87,13 +87,13 @@ __strchr_sse42:
 	pxor	%xmm2, %xmm2
 	movd	%esi, %xmm1
 	movl	%edi, %ecx
+	pshufb  %xmm2, %xmm1
 	andl	$15, %ecx
 	movq	%rdi, %r8
 	je	L(aligned_start)
 
 /* Handle unaligned string.  */
 	andq	$-16, %r8
-	pshufb  %xmm2, %xmm1
 	movdqa	(%r8), %xmm0
 	pcmpeqb	 %xmm0, %xmm2
 	pcmpeqb	 %xmm1, %xmm0