about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/strstr-c.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-07-20 21:06:50 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-20 21:06:50 -0700
commit2b7a8664fa86a182c053b6743f36a5ea8bf6bf6f (patch)
tree0f7562c05a52ebf1045f02ed2e3dadc94aea5d90 /sysdeps/x86_64/multiarch/strstr-c.c
parent63fbc91bec5623ab002c6e3ae1f3cd08a5f010fd (diff)
downloadglibc-2b7a8664fa86a182c053b6743f36a5ea8bf6bf6f.tar.gz
glibc-2b7a8664fa86a182c053b6743f36a5ea8bf6bf6f.tar.xz
glibc-2b7a8664fa86a182c053b6743f36a5ea8bf6bf6f.zip
SSE4.2 strstr/strcasestr for x86-64.
This patch implements SSE4.2 strstr/strcasestr, using Knuth-Morris-Pratt
string searching algorithm.
Diffstat (limited to 'sysdeps/x86_64/multiarch/strstr-c.c')
-rw-r--r--sysdeps/x86_64/multiarch/strstr-c.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/strstr-c.c b/sysdeps/x86_64/multiarch/strstr-c.c
new file mode 100644
index 0000000000..cff99b71ef
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strstr-c.c
@@ -0,0 +1,12 @@
+#include "init-arch.h"
+
+#define STRSTR __strstr_sse2
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name) \
+  __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
+
+#include "string/strstr.c"
+
+extern char *__strstr_sse42 (const char *, const char *);
+
+libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);