diff options
author | Andreas Schwab <schwab@redhat.com> | 2010-07-21 07:26:18 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2010-07-21 07:26:18 -0700 |
commit | f6a31e0eb6150b8b2307b6003ab18a048b91b11a (patch) | |
tree | 50bfad1b713f24a57a0b2c7a679f9cf00286a5a1 | |
parent | 23d101d8eea76469b41c12b10a8e8ed13cf66bc6 (diff) | |
download | glibc-f6a31e0eb6150b8b2307b6003ab18a048b91b11a.zip glibc-f6a31e0eb6150b8b2307b6003ab18a048b91b11a.tar.gz glibc-f6a31e0eb6150b8b2307b6003ab18a048b91b11a.tar.bz2 |
Add strcasestr-nonascii to i386 build
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | sysdeps/i386/i686/multiarch/Makefile | 3 | ||||
-rw-r--r-- | sysdeps/x86_64/multiarch/strcasestr-nonascii.c | 4 | ||||
-rw-r--r-- | sysdeps/x86_64/multiarch/strstr.c | 13 |
4 files changed, 21 insertions, 8 deletions
@@ -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 diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile index 1245950..12bcfc2 100644 --- a/sysdeps/i386/i686/multiarch/Makefile +++ b/sysdeps/i386/i686/multiarch/Makefile @@ -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 diff --git a/sysdeps/x86_64/multiarch/strcasestr-nonascii.c b/sysdeps/x86_64/multiarch/strcasestr-nonascii.c index 0804e96..8e1e6cf 100644 --- a/sysdeps/x86_64/multiarch/strcasestr-nonascii.c +++ b/sysdeps/x86_64/multiarch/strcasestr-nonascii.c @@ -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" diff --git a/sysdeps/x86_64/multiarch/strstr.c b/sysdeps/x86_64/multiarch/strstr.c index a0f2bb4..32ab939 100644 --- a/sysdeps/x86_64/multiarch/strstr.c +++ b/sysdeps/x86_64/multiarch/strstr.c @@ -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 |