glibc/sysdeps/x86_64/multiarch/strcasestr.c
Ondřej Bílka 584b18eb4d Add strstr with unaligned loads. Fixes bug 12100.
A sse42 version of strstr used pcmpistr instruction which is quite
ineffective. A faster way is look for pairs of characters which is uses
sse2, is faster than pcmpistr and for real strings a pairs we look for
are relatively rare.

For linear time complexity we use buy or rent technique which switches
to two-way algorithm when superlinear behaviour is detected.
2013-12-14 20:08:13 +01:00

14 lines
311 B
C

/* Multiple versions of strcasestr
All versions must be listed in ifunc-impl-list.c. */
#include "init-arch.h"
#define STRCASESTR __strcasestr_sse2
#include "string/strcasestr.c"
extern __typeof (__strcasestr_sse2) __strcasestr_sse2 attribute_hidden;
libc_ifunc (__strcasestr,
__strcasestr_sse2);