[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r15614 - in /fsf/trunk/libc: ./ sysdeps/i386/i686/multiarch/ sysdeps/x86_64/fpu/multiarch/ sysdeps/x86_64/multiarch/



Author: eglibc
Date: Sat Oct 29 00:02:06 2011
New Revision: 15614

Log:
Import glibc-mainline for 2011-10-29

Removed:
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-avx.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strnlen-c.c
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/Makefile
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-avx.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Oct 29 00:02:06 2011
@@ -1,3 +1,42 @@
+2011-10-28  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/strstr.c (__m128i_strloadu_tolower): Take
+	the three constants needed as parameters.  Drop the others.
+	(strcasestr_sse42): Load uclow, uchigh, and lcqword and pass to
+	__m128i_strloadu_tolower.
+	Create and initialize variable zero and use it in all the places
+	where _mm_setzero_si128 was used.
+
+	* sysdeps/x86_64/fpu/multiarch/Makefile: Don't build brandred-avx.c,
+	doasin-avx.c, dosincos-avx.c, e_asin-avx.c, mpatan-avx.c,
+	mpatan2-avx.c, mpsqrt-avx.c, mptan-avx.c, sincos32-avx.c.
+	* sysdeps/x86_64/fpu/multiarch/e_asin.c: There are no _avx variants
+	anymore.
+	* sysdeps/x86_64/fpu/multiarch/e_atan2-avx.c: Don't redirect __mpatan2.
+	* sysdeps/x86_64/fpu/multiarch/s_atan-avx.c: Don't redirect __mpatan.
+	* sysdeps/x86_64/fpu/multiarch/s_sin-avx.c: Don't redirect __branred,
+	__docos, __dubsin, __mpcos, __mpcos1, __mpsin, __mpsin1.
+	* sysdeps/x86_64/fpu/multiarch/s_tan-avx.c: Don't redirect __branred,
+	__mpranred, __mptan.
+	* sysdeps/x86_64/fpu/multiarch/brandred-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/doasin-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/dosincos-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/e_asin-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/mpatan-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/mpatan2-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/mpsqrt-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/mptan-avx.c: Removed.
+	* sysdeps/x86_64/fpu/multiarch/sincos32-avx.c: Removed.
+
+2011-10-28  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/i386/i686/multiarch/strnlen-c.c (libc_hidden_def): Only
+	redefine if SHARED.
+	* sysdeps/i386/i686/multiarch/wcscmp-c.c (libc_hidden_def): Likewise.
+
+	* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Move
+	wide char related routines to wcsmbs subdir.
+
 2011-10-27  Andreas Schwab  <schwab@xxxxxxxxxx>
 
 	[BZ #13344]

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile Sat Oct 29 00:02:06 2011
@@ -15,11 +15,10 @@
 		   strncpy-sse2 stpcpy-sse2 stpncpy-sse2 strcat-ssse3 \
 		   strcat-sse2 strncat-ssse3 strncat-sse2 strncat-c \
 		   strchr-sse2 strrchr-sse2 strchr-sse2-bsf strrchr-sse2-bsf \
-		   wcscmp-sse2 wcscmp-c memchr-sse2 memchr-sse2-bsf \
+		   memchr-sse2 memchr-sse2-bsf \
 		   memrchr-sse2 memrchr-sse2-bsf memrchr-c \
 		   rawmemchr-sse2 rawmemchr-sse2-bsf \
-		   strnlen-sse2 strnlen-c wcslen-sse2 wcslen-c \
-		   wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
+		   strnlen-sse2 strnlen-c
 ifeq (yes,$(config-cflags-sse4))
 sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c
 CFLAGS-varshift.c += -msse4
@@ -32,6 +31,11 @@
 endif
 endif
 
+ifeq ($(subdir),wcsmbs)
+sysdep_routines += wcscmp-sse2 wcscmp-c wcslen-sse2 wcslen-c \
+		   wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
+endif
+
 ifeq (mathyes,$(subdir)$(config-cflags-avx))
 libm-sysdep_routines += s_fma-fma s_fmaf-fma
 CFLAGS-s_fma-fma.c += -mavx -mfpmath=sse

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strnlen-c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strnlen-c.c (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strnlen-c.c Sat Oct 29 00:02:06 2011
@@ -1,6 +1,6 @@
-#ifndef NOT_IN_libc
-# define STRNLEN  __strnlen_ia32
-# undef libc_hidden_builtin_def
+#define STRNLEN  __strnlen_ia32
+#ifdef SHARED
+# undef libc_hidden_def
 # define libc_hidden_def(name)  \
     __hidden_ver1 (__strnlen_ia32, __GI_strnlen, __strnlen_ia32);
 #endif

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c Sat Oct 29 00:02:06 2011
@@ -1,7 +1,5 @@
-#ifndef  NOT_IN_libc
-
-# define WCSCMP __wcscmp_ia32
-
+#define WCSCMP __wcscmp_ia32
+#ifdef SHARED
 # undef libc_hidden_def
 # define libc_hidden_def(name) \
   __hidden_ver1 (__wcscmp_ia32, __GI_wcscmp, __wcscmp_ia32);

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/Makefile Sat Oct 29 00:02:06 2011
@@ -36,29 +36,18 @@
 
 ifeq ($(config-cflags-avx),yes)
 libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
-			e_asin-avx e_atan2-avx s_sin-avx s_tan-avx \
+			e_atan2-avx s_sin-avx s_tan-avx \
 			mplog-avx mpa-avx slowexp-avx \
-			sincos32-avx doasin-avx dosincos-avx \
-			brandred-avx mpexp-avx \
-			mpatan2-avx mpatan-avx mpsqrt-avx mptan-avx
+			mpexp-avx
 
-CFLAGS-brandred-avx.c = -mavx
-CFLAGS-doasin-avx.c = -mavx
-CFLAGS-dosincos-avx.c = -mavx
-CFLAGS-e_asin-avx.c = -mavx
 CFLAGS-e_atan2-avx.c = -mavx
 CFLAGS-e_exp-avx.c = -mavx
 CFLAGS-e_log-avx.c = -mavx
 CFLAGS-mpa-avx.c = -mavx
-CFLAGS-mpatan-avx.c = -mavx
-CFLAGS-mpatan2-avx.c = -mavx
 CFLAGS-mpexp-avx.c = -mavx
 CFLAGS-mplog-avx.c = -mavx
-CFLAGS-mpsqrt-avx.c = -mavx
-CFLAGS-mptan-avx.c = -mavx
 CFLAGS-s_atan-avx.c = -mavx
 CFLAGS-s_sin-avx.c = -mavx
-CFLAGS-sincos32-avx.c = -mavx
 CFLAGS-slowexp-avx.c = -mavx
 CFLAGS-s_tan-avx.c = -mavx
 endif

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-avx.c (removed)
@@ -1,4 +1,0 @@
-#define __branred __branred_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/branred.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-avx.c (removed)
@@ -1,4 +1,0 @@
-#define __doasin __doasin_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/doasin.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-avx.c (removed)
@@ -1,6 +1,0 @@
-#define __docos __docos_avx
-#define __dubcos __dubcos_avx
-#define __dubsin __dubsin_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/dosincos.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-avx.c (removed)
@@ -1,11 +1,0 @@
-#define __ieee754_acos __ieee754_acos_avx
-#define __ieee754_asin __ieee754_asin_avx
-#define __cos32 __cos32_avx
-#define __doasin __doasin_avx
-#define __docos __docos_avx
-#define __dubcos __dubcos_avx
-#define __dubsin __dubsin_avx
-#define __sin32 __sin32_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/e_asin.c>

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c Sat Oct 29 00:02:06 2011
@@ -1,29 +1,18 @@
-#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT
+#ifdef HAVE_FMA4_SUPPORT
 # include <init-arch.h>
 # include <math_private.h>
 
 extern double __ieee754_acos_sse2 (double);
 extern double __ieee754_asin_sse2 (double);
-extern double __ieee754_acos_avx (double);
-extern double __ieee754_asin_avx (double);
-# ifdef HAVE_FMA4_SUPPORT
 extern double __ieee754_acos_fma4 (double);
 extern double __ieee754_asin_fma4 (double);
-# else
-#  undef HAS_FMA4
-#  define HAS_FMA4 0
-#  define __ieee754_acos_fma4 ((void *) 0)
-#  define __ieee754_asin_fma4 ((void *) 0)
-# endif
 
 libm_ifunc (__ieee754_acos,
-	    HAS_FMA4 ? __ieee754_acos_fma4
-	    : (HAS_AVX ? __ieee754_acos_avx : __ieee754_acos_sse2));
+	    HAS_FMA4 ? __ieee754_acos_fma4 : __ieee754_acos_sse2);
 strong_alias (__ieee754_acos, __acos_finite)
 
 libm_ifunc (__ieee754_asin,
-	    HAS_FMA4 ? __ieee754_asin_fma4
-	    : (HAS_AVX ? __ieee754_asin_avx : __ieee754_asin_sse2));
+	    HAS_FMA4 ? __ieee754_asin_fma4 : __ieee754_asin_sse2);
 strong_alias (__ieee754_asin, __asin_finite)
 
 # define __ieee754_acos __ieee754_acos_sse2

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-avx.c Sat Oct 29 00:02:06 2011
@@ -2,7 +2,6 @@
 #define __add __add_avx
 #define __dbl_mp __dbl_mp_avx
 #define __dvd __dvd_avx
-#define __mpatan2 __mpatan2_avx
 #define __mul __mul_avx
 #define __sub __sub_avx
 #define SECTION __attribute__ ((section (".text.avx")))

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-avx.c (removed)
@@ -1,10 +1,0 @@
-#define __mpatan __mpatan_avx
-#define __add __add_avx
-#define __dvd __dvd_avx
-#define __mpsqrt __mpsqrt_avx
-#define __mul __mul_avx
-#define __sub __sub_avx
-#define AVOID_MPATAN_H 1
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mpatan.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-avx.c (removed)
@@ -1,9 +1,0 @@
-#define __mpatan2 __mpatan2_avx
-#define __add __add_avx
-#define __dvd __dvd_avx
-#define __mpatan __mpatan_avx
-#define __mpsqrt __mpsqrt_avx
-#define __mul __mul_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mpatan2.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-avx.c (removed)
@@ -1,8 +1,0 @@
-#define __mpsqrt __mpsqrt_avx
-#define __dbl_mp __dbl_mp_avx
-#define __mul __mul_avx
-#define __sub __sub_avx
-#define AVOID_MPSQRT_H 1
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mpsqrt.c>

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-avx.c (removed)
@@ -1,7 +1,0 @@
-#define __mptan __mptan_avx
-#define __c32 __c32_avx
-#define __dvd __dvd_avx
-#define __mpranred __mpranred_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mptan.c>

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c Sat Oct 29 00:02:06 2011
@@ -1,7 +1,6 @@
 #define atan __atan_avx
 #define __add __add_avx
 #define __dbl_mp __dbl_mp_avx
-#define __mpatan __mpatan_avx
 #define __mul __mul_avx
 #define __sub __sub_avx
 #define SECTION __attribute__ ((section (".text.avx")))

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-avx.c Sat Oct 29 00:02:06 2011
@@ -1,12 +1,5 @@
 #define __cos __cos_avx
 #define __sin __sin_avx
-#define __branred __branred_avx
-#define __docos __docos_avx
-#define __dubsin __dubsin_avx
-#define __mpcos __mpcos_avx
-#define __mpcos1 __mpcos1_avx
-#define __mpsin __mpsin_avx
-#define __mpsin1 __mpsin1_avx
 #define SECTION __attribute__ ((section (".text.avx")))
 
 #include <sysdeps/ieee754/dbl-64/s_sin.c>

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c Sat Oct 29 00:02:06 2011
@@ -1,8 +1,5 @@
 #define tan __tan_avx
-#define __branred __branred_avx
 #define __dbl_mp __dbl_mp_avx
-#define __mpranred __mpranred_avx
-#define __mptan __mptan_avx
 #define __sub __sub_avx
 #define SECTION __attribute__ ((section (".text.avx")))
 

Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-avx.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-avx.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-avx.c (removed)
@@ -1,15 +1,0 @@
-#define __cos32 __cos32_avx
-#define __sin32 __sin32_avx
-#define __c32 __c32_avx
-#define __mpsin __mpsin_avx
-#define __mpsin1 __mpsin1_avx
-#define __mpcos __mpcos_avx
-#define __mpcos1 __mpcos1_avx
-#define __mpranred __mpranred_avx
-#define __add __add_avx
-#define __dbl_mp __dbl_mp_avx
-#define __mul __mul_avx
-#define __sub __sub_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/sincos32.c>

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr.c Sat Oct 29 00:02:06 2011
@@ -1,5 +1,5 @@
 /* strstr with SSE4.2 intrinsics
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -88,14 +88,12 @@
    cross to next page.  */
 
 static inline __m128i
-__m128i_strloadu (const unsigned char * p)
+__m128i_strloadu (const unsigned char * p, __m128i zero)
 {
-  int offset = ((size_t) p & (16 - 1));
-
-  if (offset && (int) ((size_t) p & 0xfff) > 0xff0)
-    {
+  if (__builtin_expect ((int) ((size_t) p & 0xfff) > 0xff0, 0))
+    {
+      size_t offset = ((size_t) p & (16 - 1));
       __m128i a = _mm_load_si128 ((__m128i *) (p - offset));
-      __m128i zero = _mm_setzero_si128 ();
       int bmsk = _mm_movemask_epi8 (_mm_cmpeq_epi8 (a, zero));
       if ((bmsk >> offset) != 0)
 	return __m128i_shift_right (a, offset);
@@ -106,24 +104,22 @@
 #if defined USE_AS_STRCASESTR && !defined STRCASESTR_NONASCII
 
 /* Similar to __m128i_strloadu.  Convert to lower case for POSIX/C
-   locale.  */
+   locale and other which have single-byte letters only in the ASCII
+   range.  */
 static inline __m128i
-__m128i_strloadu_tolower (const unsigned char *p, __m128i rangeuc,
-			  __m128i u2ldelta)
+__m128i_strloadu_tolower (const unsigned char *p, __m128i zero, __m128i uclow,
+			  __m128i uchigh, __m128i lcqword)
 {
-  __m128i frag = __m128i_strloadu (p);
-
-#define UCLOW 0x4040404040404040ULL
-#define UCHIGH 0x5b5b5b5b5b5b5b5bULL
-#define LCQWORD 0x2020202020202020ULL
+  __m128i frag = __m128i_strloadu (p, zero);
+
   /* Compare if 'Z' > bytes. Inverted way to get a mask for byte <= 'Z'.  */
-  __m128i r2 = _mm_cmpgt_epi8 (_mm_set1_epi64x (UCHIGH), frag);
+  __m128i r2 = _mm_cmpgt_epi8 (uchigh, frag);
   /* Compare if bytes are > 'A' - 1.  */
-  __m128i r1 = _mm_cmpgt_epi8 (frag, _mm_set1_epi64x (UCLOW));
+  __m128i r1 = _mm_cmpgt_epi8 (frag, uclow);
   /* Mask byte == ff if byte(r2) <= 'Z' and byte(r1) > 'A' - 1.  */
   __m128i mask = _mm_and_si128 (r2, r1);
   /* Apply lowercase bit 6 mask for above mask bytes == ff.  */
-  return _mm_or_si128 (frag, _mm_and_si128 (mask, _mm_set1_epi64x (LCQWORD)));
+  return _mm_or_si128 (frag, _mm_and_si128 (mask, lcqword));
 }
 
 #endif
@@ -190,14 +186,18 @@
 			!= 0, 0))
     return __strcasestr_sse42_nonascii (s1, s2);
 
-  const __m128i rangeuc = _mm_set_epi64x (0x0, 0x5a41);
-  const __m128i u2ldelta = _mm_set1_epi64x (0xe0e0e0e0e0e0e0e0);
-#  define strloadu(p) __m128i_strloadu_tolower (p, rangeuc, u2ldelta)
+  const __m128i uclow = _mm_set1_epi8 (0x40);
+  const __m128i uchigh = _mm_set1_epi8 (0x5b);
+  const __m128i lcqword = _mm_set1_epi8 (0x20);
+  const __m128i zero = _mm_setzero_si128 ();
+#  define strloadu(p) __m128i_strloadu_tolower (p, zero, uclow, uchigh, lcqword)
 # else
 #  define strloadu __m128i_strloadu_tolower
+#  define zero _mm_setzero_si128 ()
 # endif
 #else
-# define strloadu __m128i_strloadu
+# define strloadu(p) __m128i_strloadu (p, zero)
+  const __m128i zero = _mm_setzero_si128 ();
 #endif
 
   /* p1 > 1 byte long.  Load up to 16 bytes of fragment.  */
@@ -208,7 +208,7 @@
     /* p2 is > 1 byte long.  */
     frag2 = strloadu (p2);
   else
-    frag2 = _mm_insert_epi8 (_mm_setzero_si128 (), LOADBYTE (p2[0]), 0);
+    frag2 = _mm_insert_epi8 (zero, LOADBYTE (p2[0]), 0);
 
   /* Unsigned bytes, equal order, does frag2 has null?  */
   int cmp_c = _mm_cmpistrc (frag2, frag1, 0x0c);
@@ -217,8 +217,7 @@
   int cmp_s = _mm_cmpistrs (frag2, frag1, 0x0c);
   if (cmp_s & cmp_c)
     {
-      int bmsk = _mm_movemask_epi8 (_mm_cmpeq_epi8 (frag2,
-						    _mm_setzero_si128 ()));
+      int bmsk = _mm_movemask_epi8 (_mm_cmpeq_epi8 (frag2, zero));
       int len;
       __asm ("bsfl %[bmsk], %[len]"
 	     : [len] "=r" (len) : [bmsk] "r" (bmsk));
@@ -344,7 +343,6 @@
 
       /* Handle both zero and sign flag set and s1 is shorter in
 	 length.  */
-      __m128i zero = _mm_setzero_si128 ();
       int bmsk = _mm_movemask_epi8 (_mm_cmpeq_epi8 (zero, frag2));
       int bmsk1 = _mm_movemask_epi8 (_mm_cmpeq_epi8 (zero, frag1));
       int len;

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits