Add strcasestr-nonascii to i386 build

This commit is contained in:
Andreas Schwab 2010-07-21 07:26:18 -07:00 committed by Ulrich Drepper
parent 23d101d8ee
commit f6a31e0eb6
4 changed files with 21 additions and 8 deletions

View File

@ -1,3 +1,12 @@
2010-07-21 Andreas Schwab <schwab@redhat.com>
* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
strcasestr-nonascii.
(CFLAGS-strcasestr-nonascii.c): Define.
* sysdeps/i386/i686/multiarch/strcasestr-nonascii.c: New file.
* sysdeps/x86_64/multiarch/strcasestr-nonascii.c (STRSTR_SSE42):
Remove unused attribute.
2010-07-20 Roland McGrath <roland@redhat.com>
* elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to

View File

@ -9,7 +9,7 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
memmove-ssse3-rep bcopy-ssse3 bcopy-ssse3-rep \
memset-sse2-rep bzero-sse2-rep strcmp-ssse3 \
strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \
memcmp-ssse3 memcmp-sse4
memcmp-ssse3 memcmp-sse4 strcasestr-nonascii
ifeq (yes,$(config-cflags-sse4))
sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c
CFLAGS-strcspn-c.c += -msse4
@ -17,6 +17,7 @@ CFLAGS-strpbrk-c.c += -msse4
CFLAGS-strspn-c.c += -msse4
CFLAGS-strstr.c += -msse4
CFLAGS-strcasestr.c += -msse4
CFLAGS-strcasestr-nonascii.c += -msse4
endif
endif

View File

@ -23,7 +23,7 @@
/* Similar to __m128i_strloadu. Convert to lower case for none-POSIX/C
locale. */
static inline __m128i
__m128i_strloadu_tolower (const unsigned char * p)
__m128i_strloadu_tolower (const unsigned char *p)
{
union
{
@ -46,5 +46,5 @@ __m128i_strloadu_tolower (const unsigned char * p)
#define STRCASESTR_NONASCII
#define USE_AS_STRCASESTR
#define STRSTR_SSE42 attribute_hidden __strcasestr_sse42_nonascii
#define STRSTR_SSE42 __strcasestr_sse42_nonascii
#include "strstr.c"

View File

@ -168,13 +168,12 @@ __m128i_strloadu (const unsigned char * p)
/* Similar to __m128i_strloadu. Convert to lower case for POSIX/C
locale. */
static inline __m128i
__m128i_strloadu_tolower (const unsigned char * p)
__m128i_strloadu_tolower (const unsigned char *p, __m128i rangeuc,
__m128i u2ldelta)
{
__m128i frag = __m128i_strloadu (p);
/* Convert frag to lower case for POSIX/C locale. */
__m128i rangeuc = _mm_set_epi64x (0x0, 0x5a41);
__m128i u2ldelta = _mm_set1_epi64x (0xe0e0e0e0e0e0e0e0);
__m128i mask1 = _mm_cmpistrm (rangeuc, frag, 0x44);
__m128i mask2 = _mm_blendv_epi8 (u2ldelta, frag, mask1);
mask2 = _mm_sub_epi8 (mask2, u2ldelta);
@ -244,9 +243,13 @@ STRSTR_SSE42 (const unsigned char *s1, const unsigned char *s2)
if (__builtin_expect (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_NONASCII_CASE)
!= 0, 0))
return __strcasestr_sse42_nonascii (s1, s2);
# endif
# define strloadu __m128i_strloadu_tolower
const __m128i rangeuc = _mm_set_epi64x (0x0, 0x5a41);
const __m128i u2ldelta = _mm_set1_epi64x (0xe0e0e0e0e0e0e0e0);
# define strloadu(p) __m128i_strloadu_tolower (p, rangeuc, u2ldelta)
# else
# define strloadu __m128i_strloadu_tolower
# endif
#else
# define strloadu __m128i_strloadu
#endif