Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
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.
- Loading branch information
Ondřej Bílka
committed
Dec 14, 2013
1 parent
8a5c789
commit 584b18e
Showing
10 changed files
with
441 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
extern char *__strcasestr_sse42_nonascii (const unsigned char *s1, | ||
const unsigned char *s2) | ||
attribute_hidden; | ||
/* Multiple versions of strcasestr | ||
All versions must be listed in ifunc-impl-list.c. */ | ||
|
||
#define USE_AS_STRCASESTR | ||
#define STRSTR_SSE42 __strcasestr_sse42 | ||
#include "strstr.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); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.