]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix x86-64 strchr propagation of search byte into all bytes of SSE register
authorRichard Li <richardpku@gmail.com>
Mon, 25 Oct 2010 18:13:17 +0000 (14:13 -0400)
committerPetr Baudis <pasky@suse.cz>
Mon, 1 Nov 2010 21:29:35 +0000 (22:29 +0100)
(cherry picked from commit dbf3a06904168417a05882a871342e7a9ee3b383)

ChangeLog
sysdeps/x86_64/multiarch/strchr.S

index 69117a6d3c67106852fb26372d134edac3a37897..88a0dc5a8499015e85a1cec3c1f4813be6f272eb 100644 (file)
--- 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.
index b35566d1a5412c777bc8a7135e52908f38fda1a9..44538aaa81acd90ab6a68bf0b28109adede3de8b 100644 (file)
@@ -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