From 855d156018a701b3613eb4b14ab3bd09fd12f0a3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 19 Oct 2011 22:22:29 -0400 Subject: Optimize x86-64 rawmemchr and add test --- sysdeps/x86_64/multiarch/rawmemchr.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64/multiarch') diff --git a/sysdeps/x86_64/multiarch/rawmemchr.S b/sysdeps/x86_64/multiarch/rawmemchr.S index a8933fb55a..1f5bbe6d3f 100644 --- a/sysdeps/x86_64/multiarch/rawmemchr.S +++ b/sysdeps/x86_64/multiarch/rawmemchr.S @@ -43,19 +43,18 @@ strong_alias (rawmemchr, __rawmemchr) .section .text.sse4.2,"ax",@progbits - .align 16 + .align 16 .type __rawmemchr_sse42, @function __rawmemchr_sse42: cfi_startproc CALL_MCOUNT movd %esi, %xmm1 movq %rdi, %rcx - punpcklbw %xmm1, %xmm1 + pxor %xmm2, %xmm2 andq $~15, %rdi - punpcklbw %xmm1, %xmm1 orl $0xffffffff, %esi + pshufb %xmm2, %xmm1 movdqa (%rdi), %xmm0 - pshufd $0, %xmm1, %xmm1 subq %rdi, %rcx pcmpeqb %xmm1, %xmm0 shl %cl, %esi -- cgit 1.4.1