about summary refs log tree commit diff
path: root/sysdeps/x86_64/memchr.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/memchr.S')
-rw-r--r--sysdeps/x86_64/memchr.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/x86_64/memchr.S b/sysdeps/x86_64/memchr.S
index 09ba6d4f8d..54b7af534c 100644
--- a/sysdeps/x86_64/memchr.S
+++ b/sysdeps/x86_64/memchr.S
@@ -26,7 +26,9 @@ ENTRY (memchr)
 	movq	%rdi, %rcx
 	punpcklbw %xmm1, %xmm1
 	andq	$~15, %rdi
+	testq	%rdx, %rdx
 	punpcklbw %xmm1, %xmm1
+	jz	3f
 	orl	$0xffffffff, %esi
 	movdqa	(%rdi), %xmm0
 	pshufd	$0, %xmm1, %xmm1