about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch
diff options
context:
space:
mode:
authorLiubov Dmitrieva <liubov.dmitrieva@gmail.com>2011-10-07 11:49:10 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-07 11:49:10 -0400
commit093ecf92998de275820296058ad5648e354b9e0d (patch)
tree5f1fabcf8d97f0ff7da005cdeed3532761b895d1 /sysdeps/x86_64/multiarch
parentfde56e5cc5011d8c0de39290af0e76d884d07624 (diff)
downloadglibc-093ecf92998de275820296058ad5648e354b9e0d.tar.gz
glibc-093ecf92998de275820296058ad5648e354b9e0d.tar.xz
glibc-093ecf92998de275820296058ad5648e354b9e0d.zip
Improve 64 bit memchr, memrchr, rawmemchr with SSE2
Diffstat (limited to 'sysdeps/x86_64/multiarch')
-rw-r--r--sysdeps/x86_64/multiarch/rawmemchr.S10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/x86_64/multiarch/rawmemchr.S b/sysdeps/x86_64/multiarch/rawmemchr.S
index 2a8a6909ef..a8933fb55a 100644
--- a/sysdeps/x86_64/multiarch/rawmemchr.S
+++ b/sysdeps/x86_64/multiarch/rawmemchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009, 2011 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@redhat.com>.
    This file is part of the GNU C Library.
 
@@ -29,11 +29,15 @@ ENTRY(rawmemchr)
 	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
 	jne	1f
 	call	__init_cpu_features
-1:	leaq	__rawmemchr_sse2(%rip), %rax
+1:	testl	$bit_Prefer_PMINUB_for_stringop, __cpu_features+FEATURE_OFFSET+index_Prefer_PMINUB_for_stringop(%rip)
+	jnz	2f
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
 	jz	2f
 	leaq	__rawmemchr_sse42(%rip), %rax
-2:	ret
+	ret
+2:	leaq	__rawmemchr_sse2(%rip), %rax
+	ret
+
 END(rawmemchr)
 strong_alias (rawmemchr, __rawmemchr)