aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Li <richardpku@gmail.com>2010-10-25 14:13:17 -0400
committerAndreas Schwab <schwab@redhat.com>2010-10-26 15:18:07 +0200
commitbe75fb29ec9f1d7dfc2e91b74b5ffefeaaa9aeb6 (patch)
tree60fe82e0ff7d80af8c733f8f86621904b5e772e2
parent173ab210e3f2a776c6de3a31533c6af50a275f57 (diff)
downloadglibc-be75fb29ec9f1d7dfc2e91b74b5ffefeaaa9aeb6.tar.xz
glibc-be75fb29ec9f1d7dfc2e91b74b5ffefeaaa9aeb6.zip
Fix x86-64 strchr propagation of search byte into all bytes of SSE register
(cherry picked from commit dbf3a06904168417a05882a871342e7a9ee3b383)
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/x86_64/multiarch/strchr.S4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a8e764c37b..cbab7a5a48 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-22 Andreas Schwab <schwab@redhat.com>
* include/dlfcn.h (__RTLD_SECURE): Define.
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