]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update i686 multiarch functions for <cpu-features.h>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 13 Aug 2015 10:39:22 +0000 (03:39 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 13 Aug 2015 10:41:37 +0000 (03:41 -0700)
This patch updates i686 multiarch functions to use the newly defined
HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
LOAD_FUNC_GOT_EAX from <cpu-features.h>.

* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
* sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
* sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
* sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
* sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
* sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
* sysdeps/i386/i686/multiarch/memset.S: Likewise.
* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
* sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
* sysdeps/i386/i686/multiarch/strchr.S: Likewise.
* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
* sysdeps/i386/i686/multiarch/strncase.S: Likewise.
* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

39 files changed:
ChangeLog
sysdeps/i386/i686/fpu/multiarch/e_expf.c
sysdeps/i386/i686/fpu/multiarch/s_cosf.c
sysdeps/i386/i686/fpu/multiarch/s_sincosf.c
sysdeps/i386/i686/fpu/multiarch/s_sinf.c
sysdeps/i386/i686/multiarch/bcopy.S
sysdeps/i386/i686/multiarch/bzero.S
sysdeps/i386/i686/multiarch/ifunc-impl-list.c
sysdeps/i386/i686/multiarch/memchr.S
sysdeps/i386/i686/multiarch/memcmp.S
sysdeps/i386/i686/multiarch/memcpy.S
sysdeps/i386/i686/multiarch/memcpy_chk.S
sysdeps/i386/i686/multiarch/memmove.S
sysdeps/i386/i686/multiarch/memmove_chk.S
sysdeps/i386/i686/multiarch/mempcpy.S
sysdeps/i386/i686/multiarch/mempcpy_chk.S
sysdeps/i386/i686/multiarch/memrchr.S
sysdeps/i386/i686/multiarch/memset.S
sysdeps/i386/i686/multiarch/memset_chk.S
sysdeps/i386/i686/multiarch/rawmemchr.S
sysdeps/i386/i686/multiarch/s_fma.c
sysdeps/i386/i686/multiarch/s_fmaf.c
sysdeps/i386/i686/multiarch/strcasecmp.S
sysdeps/i386/i686/multiarch/strcat.S
sysdeps/i386/i686/multiarch/strchr.S
sysdeps/i386/i686/multiarch/strcmp.S
sysdeps/i386/i686/multiarch/strcpy.S
sysdeps/i386/i686/multiarch/strcspn.S
sysdeps/i386/i686/multiarch/strlen.S
sysdeps/i386/i686/multiarch/strncase.S
sysdeps/i386/i686/multiarch/strnlen.S
sysdeps/i386/i686/multiarch/strrchr.S
sysdeps/i386/i686/multiarch/strspn.S
sysdeps/i386/i686/multiarch/wcschr.S
sysdeps/i386/i686/multiarch/wcscmp.S
sysdeps/i386/i686/multiarch/wcscpy.S
sysdeps/i386/i686/multiarch/wcslen.S
sysdeps/i386/i686/multiarch/wcsrchr.S
sysdeps/i386/i686/multiarch/wmemcmp.S

index 5ea2847453b0f97dc2ca9e5340171a6ee46d1e78..60e3e8f43094017893163671ffe7ad74c11c6294 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2015-08-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
+       with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
+       * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
+       * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
+       * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
+       * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
+       * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
+       * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
+       * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
+       * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
+       call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
+       Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
+       with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
+       * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
+       * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
+       * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memset.S: Likewise.
+       * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
+       * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
+       * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.
+
 2015-08-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
index 5102dae3bbca5ef48a0192f72bfe58ac7883082f..697888343bc09a452bf3797c76fe46d5eff86c33 100644 (file)
@@ -23,11 +23,15 @@ extern double __ieee754_expf_ia32 (double);
 
 double __ieee754_expf (double);
 libm_ifunc (__ieee754_expf,
-           HAS_SSE2 ? __ieee754_expf_sse2 : __ieee754_expf_ia32);
+           HAS_CPU_FEATURE (SSE2)
+           ? __ieee754_expf_sse2
+           : __ieee754_expf_ia32);
 
 extern double __expf_finite_sse2 (double);
 extern double __expf_finite_ia32 (double);
 
 double __expf_finite (double);
 libm_ifunc (__expf_finite,
-           HAS_SSE2 ? __expf_finite_sse2 : __expf_finite_ia32);
+           HAS_CPU_FEATURE (SSE2)
+           ? __expf_finite_sse2
+           : __expf_finite_ia32);
index 0799dca3efaff4b14aac2dc3b14c2f2cf639988a..e32b2f45297af51d66df1ad6e9c518e1a3ffcbb0 100644 (file)
@@ -22,7 +22,7 @@ extern float __cosf_sse2 (float);
 extern float __cosf_ia32 (float);
 float __cosf (float);
 
-libm_ifunc (__cosf, HAS_SSE2 ? __cosf_sse2 : __cosf_ia32);
+libm_ifunc (__cosf, HAS_CPU_FEATURE (SSE2) ? __cosf_sse2 : __cosf_ia32);
 weak_alias (__cosf, cosf);
 
 #define COSF __cosf_ia32
index 384d84470f18ec6f693c572cab966ca5e4aba97b..0d827e0daa981dd57c87ea0548872ad3521e3d9d 100644 (file)
@@ -22,7 +22,8 @@ extern void __sincosf_sse2 (float, float *, float *);
 extern void __sincosf_ia32 (float, float *, float *);
 void __sincosf (float, float *, float *);
 
-libm_ifunc (__sincosf, HAS_SSE2 ? __sincosf_sse2 : __sincosf_ia32);
+libm_ifunc (__sincosf,
+           HAS_CPU_FEATURE (SSE2) ? __sincosf_sse2 : __sincosf_ia32);
 weak_alias (__sincosf, sincosf);
 
 #define SINCOSF __sincosf_ia32
index 6b627720cf0ff745919b6e33addfe765ba52c499..18afaa2714c860b31d245074a90c38c37874b951 100644 (file)
@@ -22,7 +22,7 @@ extern float __sinf_sse2 (float);
 extern float __sinf_ia32 (float);
 float __sinf (float);
 
-libm_ifunc (__sinf, HAS_SSE2 ? __sinf_sse2 : __sinf_ia32);
+libm_ifunc (__sinf, HAS_CPU_FEATURE (SSE2) ? __sinf_sse2 : __sinf_ia32);
 weak_alias (__sinf, sinf);
 #define SINF __sinf_ia32
 #include <sysdeps/ieee754/flt-32/s_sinf.c>
index e767d970193a36f59fc2a0a24bc9e782e5154f4f..3fc95dcba96239a0d19f71933783ab81d634609b 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(bcopy)
        .type   bcopy, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __bcopy_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__bcopy_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __bcopy_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__bcopy_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __bcopy_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__bcopy_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __bcopy_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(bcopy)
-# else
-       .text
-ENTRY(bcopy)
-       .type   bcopy, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __bcopy_ia32, %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __bcopy_ssse3, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
-       jz      2f
-       leal    __bcopy_ssse3_rep, %eax
+       LOAD_FUNC_GOT_EAX (__bcopy_ssse3_rep)
 2:     ret
 END(bcopy)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index e8dc85fc9f3a487dd5748bb5f1962e4ae6859b5b..95c96a81eacd7af16050a051f44c6693cedb6f7a 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
-       .text
-ENTRY(__bzero)
-       .type   __bzero, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __bzero_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __bzero_sse2@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __bzero_sse2_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(__bzero)
-# else
        .text
 ENTRY(__bzero)
        .type   __bzero, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __bzero_ia32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__bzero_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __bzero_sse2, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
+       LOAD_FUNC_GOT_EAX ( __bzero_sse2)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __bzero_sse2_rep, %eax
+       LOAD_FUNC_GOT_EAX (__bzero_sse2_rep)
 2:     ret
 END(__bzero)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index 92366a7b46feb309b4784ffbea6ddd86d57cc28f..a6735a804bf377be1e05deddc2b84876d3290be5 100644 (file)
@@ -38,152 +38,179 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   /* Support sysdeps/i386/i686/multiarch/bcopy.S.  */
   IFUNC_IMPL (i, name, bcopy,
-             IFUNC_IMPL_ADD (array, i, bcopy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, bcopy, HAS_CPU_FEATURE (SSSE3),
                              __bcopy_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, bcopy, HAS_SSSE3, __bcopy_ssse3)
-             IFUNC_IMPL_ADD (array, i, bcopy, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, bcopy, HAS_CPU_FEATURE (SSSE3),
+                             __bcopy_ssse3)
+             IFUNC_IMPL_ADD (array, i, bcopy, HAS_CPU_FEATURE (SSE2),
                              __bcopy_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/bzero.S.  */
   IFUNC_IMPL (i, name, bzero,
-             IFUNC_IMPL_ADD (array, i, bzero, HAS_SSE2, __bzero_sse2_rep)
-             IFUNC_IMPL_ADD (array, i, bzero, HAS_SSE2, __bzero_sse2)
+             IFUNC_IMPL_ADD (array, i, bzero, HAS_CPU_FEATURE (SSE2),
+                             __bzero_sse2_rep)
+             IFUNC_IMPL_ADD (array, i, bzero, HAS_CPU_FEATURE (SSE2),
+                             __bzero_sse2)
              IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memchr.S.  */
   IFUNC_IMPL (i, name, memchr,
-             IFUNC_IMPL_ADD (array, i, memchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, memchr, HAS_CPU_FEATURE (SSE2),
                              __memchr_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, memchr, HAS_SSE2, __memchr_sse2)
+             IFUNC_IMPL_ADD (array, i, memchr, HAS_CPU_FEATURE (SSE2),
+                             __memchr_sse2)
              IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memcmp.S.  */
   IFUNC_IMPL (i, name, memcmp,
-             IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSE4_2),
                              __memcmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSSE3, __memcmp_ssse3)
+             IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSSE3),
+                             __memcmp_ssse3)
              IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memmove_chk.S.  */
   IFUNC_IMPL (i, name, __memmove_chk,
-             IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __memmove_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __memmove_chk_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __memmove_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __memmove_chk_ssse3)
-             IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, __memmove_chk,
+                             HAS_CPU_FEATURE (SSE2),
                              __memmove_chk_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
                              __memmove_chk_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memmove.S.  */
   IFUNC_IMPL (i, name, memmove,
-             IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
                              __memmove_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
                              __memmove_ssse3)
-             IFUNC_IMPL_ADD (array, i, memmove, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSE2),
                              __memmove_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memrchr.S.  */
   IFUNC_IMPL (i, name, memrchr,
-             IFUNC_IMPL_ADD (array, i, memrchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, memrchr, HAS_CPU_FEATURE (SSE2),
                              __memrchr_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, memrchr, HAS_SSE2, __memrchr_sse2)
+             IFUNC_IMPL_ADD (array, i, memrchr, HAS_CPU_FEATURE (SSE2),
+                             __memrchr_sse2)
              IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memset_chk.S.  */
   IFUNC_IMPL (i, name, __memset_chk,
-             IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, __memset_chk,
+                             HAS_CPU_FEATURE (SSE2),
                              __memset_chk_sse2_rep)
-             IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, __memset_chk,
+                             HAS_CPU_FEATURE (SSE2),
                              __memset_chk_sse2)
              IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
                              __memset_chk_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memset.S.  */
   IFUNC_IMPL (i, name, memset,
-             IFUNC_IMPL_ADD (array, i, memset, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, memset, HAS_CPU_FEATURE (SSE2),
                              __memset_sse2_rep)
-             IFUNC_IMPL_ADD (array, i, memset, HAS_SSE2, __memset_sse2)
+             IFUNC_IMPL_ADD (array, i, memset, HAS_CPU_FEATURE (SSE2),
+                             __memset_sse2)
              IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/rawmemchr.S.  */
   IFUNC_IMPL (i, name, rawmemchr,
-             IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE2),
                              __rawmemchr_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE2),
                              __rawmemchr_sse2)
              IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/stpncpy.S.  */
   IFUNC_IMPL (i, name, stpncpy,
-             IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSSE3),
                              __stpncpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSE2, __stpncpy_sse2)
+             IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSE2),
+                             __stpncpy_sse2)
              IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/stpcpy.S.  */
   IFUNC_IMPL (i, name, stpcpy,
-             IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSSE3, __stpcpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSE2, __stpcpy_sse2)
+             IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSSE3),
+                             __stpcpy_ssse3)
+             IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSE2),
+                             __stpcpy_sse2)
              IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcasecmp.S.  */
   IFUNC_IMPL (i, name, strcasecmp,
-             IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strcasecmp,
+                             HAS_CPU_FEATURE (SSE4_2),
                              __strcasecmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strcasecmp,
+                             HAS_CPU_FEATURE (SSSE3),
                              __strcasecmp_ssse3)
              IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcasecmp_l.S.  */
   IFUNC_IMPL (i, name, strcasecmp_l,
-             IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strcasecmp_l,
+                             HAS_CPU_FEATURE (SSE4_2),
                              __strcasecmp_l_sse4_2)
-             IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strcasecmp_l,
+                             HAS_CPU_FEATURE (SSSE3),
                              __strcasecmp_l_ssse3)
              IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
                              __strcasecmp_l_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcat.S.  */
   IFUNC_IMPL (i, name, strcat,
-             IFUNC_IMPL_ADD (array, i, strcat, HAS_SSSE3, __strcat_ssse3)
-             IFUNC_IMPL_ADD (array, i, strcat, HAS_SSE2, __strcat_sse2)
+             IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSSE3),
+                             __strcat_ssse3)
+             IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSE2),
+                             __strcat_sse2)
              IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strchr.S.  */
   IFUNC_IMPL (i, name, strchr,
-             IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE2),
                              __strchr_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE2, __strchr_sse2)
+             IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE2),
+                             __strchr_sse2)
              IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcmp.S.  */
   IFUNC_IMPL (i, name, strcmp,
-             IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSE4_2),
                              __strcmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSSE3, __strcmp_ssse3)
+             IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSSE3),
+                             __strcmp_ssse3)
              IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcpy.S.  */
   IFUNC_IMPL (i, name, strcpy,
-             IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSSE3, __strcpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSE2, __strcpy_sse2)
+             IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSSE3),
+                             __strcpy_ssse3)
+             IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSE2),
+                             __strcpy_sse2)
              IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strcspn.S.  */
   IFUNC_IMPL (i, name, strcspn,
-             IFUNC_IMPL_ADD (array, i, strcspn, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strcspn, HAS_CPU_FEATURE (SSE4_2),
                              __strcspn_sse42)
              IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strncase.S.  */
   IFUNC_IMPL (i, name, strncasecmp,
-             IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strncasecmp,
+                             HAS_CPU_FEATURE (SSE4_2),
                              __strncasecmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strncasecmp,
+                             HAS_CPU_FEATURE (SSSE3),
                              __strncasecmp_ssse3)
              IFUNC_IMPL_ADD (array, i, strncasecmp, 1,
                              __strncasecmp_ia32))
@@ -191,136 +218,156 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/i386/i686/multiarch/strncase_l.S.  */
   IFUNC_IMPL (i, name, strncasecmp_l,
              IFUNC_IMPL_ADD (array, i, strncasecmp_l,
-                             HAS_SSE4_2, __strncasecmp_l_sse4_2)
+                             HAS_CPU_FEATURE (SSE4_2),
+                             __strncasecmp_l_sse4_2)
              IFUNC_IMPL_ADD (array, i, strncasecmp_l,
-                             HAS_SSSE3, __strncasecmp_l_ssse3)
+                             HAS_CPU_FEATURE (SSSE3),
+                             __strncasecmp_l_ssse3)
              IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
                              __strncasecmp_l_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strncat.S.  */
   IFUNC_IMPL (i, name, strncat,
-             IFUNC_IMPL_ADD (array, i, strncat, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSSE3),
                              __strncat_ssse3)
-             IFUNC_IMPL_ADD (array, i, strncat, HAS_SSE2, __strncat_sse2)
+             IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSE2),
+                             __strncat_sse2)
              IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strncpy.S.  */
   IFUNC_IMPL (i, name, strncpy,
-             IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSSE3),
                              __strncpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSE2, __strncpy_sse2)
+             IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSE2),
+                             __strncpy_sse2)
              IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strnlen.S.  */
   IFUNC_IMPL (i, name, strnlen,
-             IFUNC_IMPL_ADD (array, i, strnlen, HAS_SSE2, __strnlen_sse2)
+             IFUNC_IMPL_ADD (array, i, strnlen, HAS_CPU_FEATURE (SSE2),
+                             __strnlen_sse2)
              IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strpbrk.S.  */
   IFUNC_IMPL (i, name, strpbrk,
-             IFUNC_IMPL_ADD (array, i, strpbrk, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strpbrk, HAS_CPU_FEATURE (SSE4_2),
                              __strpbrk_sse42)
              IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strrchr.S.  */
   IFUNC_IMPL (i, name, strrchr,
-             IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE2),
                              __strrchr_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE2, __strrchr_sse2)
+             IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE2),
+                             __strrchr_sse2)
              IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strspn.S.  */
   IFUNC_IMPL (i, name, strspn,
-             IFUNC_IMPL_ADD (array, i, strspn, HAS_SSE4_2, __strspn_sse42)
+             IFUNC_IMPL_ADD (array, i, strspn, HAS_CPU_FEATURE (SSE4_2),
+                             __strspn_sse42)
              IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wcschr.S.  */
   IFUNC_IMPL (i, name, wcschr,
-             IFUNC_IMPL_ADD (array, i, wcschr, HAS_SSE2, __wcschr_sse2)
+             IFUNC_IMPL_ADD (array, i, wcschr, HAS_CPU_FEATURE (SSE2),
+                             __wcschr_sse2)
              IFUNC_IMPL_ADD (array, i, wcschr, 1, __wcschr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wcscmp.S.  */
   IFUNC_IMPL (i, name, wcscmp,
-             IFUNC_IMPL_ADD (array, i, wcscmp, HAS_SSE2, __wcscmp_sse2)
+             IFUNC_IMPL_ADD (array, i, wcscmp, HAS_CPU_FEATURE (SSE2),
+                             __wcscmp_sse2)
              IFUNC_IMPL_ADD (array, i, wcscmp, 1, __wcscmp_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wcscpy.S.  */
   IFUNC_IMPL (i, name, wcscpy,
-             IFUNC_IMPL_ADD (array, i, wcscpy, HAS_SSSE3, __wcscpy_ssse3)
+             IFUNC_IMPL_ADD (array, i, wcscpy, HAS_CPU_FEATURE (SSSE3),
+                             __wcscpy_ssse3)
              IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wcslen.S.  */
   IFUNC_IMPL (i, name, wcslen,
-             IFUNC_IMPL_ADD (array, i, wcslen, HAS_SSE2, __wcslen_sse2)
+             IFUNC_IMPL_ADD (array, i, wcslen, HAS_CPU_FEATURE (SSE2),
+                             __wcslen_sse2)
              IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wcsrchr.S.  */
   IFUNC_IMPL (i, name, wcsrchr,
-             IFUNC_IMPL_ADD (array, i, wcsrchr, HAS_SSE2, __wcsrchr_sse2)
+             IFUNC_IMPL_ADD (array, i, wcsrchr, HAS_CPU_FEATURE (SSE2),
+                             __wcsrchr_sse2)
              IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/wmemcmp.S.  */
   IFUNC_IMPL (i, name, wmemcmp,
-             IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSE4_2),
                              __wmemcmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSSE3),
                              __wmemcmp_ssse3)
              IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_ia32))
 
 #ifdef SHARED
   /* Support sysdeps/i386/i686/multiarch/memcpy_chk.S.  */
   IFUNC_IMPL (i, name, __memcpy_chk,
-             IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __memcpy_chk_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __memcpy_chk_ssse3)
-             IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+                             HAS_CPU_FEATURE (SSE2),
                              __memcpy_chk_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
                              __memcpy_chk_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/memcpy.S.  */
   IFUNC_IMPL (i, name, memcpy,
-             IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3),
                              __memcpy_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, __memcpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3),
+                             __memcpy_ssse3)
+             IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSE2),
                              __memcpy_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/mempcpy_chk.S.  */
   IFUNC_IMPL (i, name, __mempcpy_chk,
-             IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __mempcpy_chk_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+                             HAS_CPU_FEATURE (SSSE3),
                              __mempcpy_chk_ssse3)
-             IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+                             HAS_CPU_FEATURE (SSE2),
                              __mempcpy_chk_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
                              __mempcpy_chk_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/mempcpy.S.  */
   IFUNC_IMPL (i, name, mempcpy,
-             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
                              __mempcpy_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
                              __mempcpy_ssse3)
-             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSE2),
                              __mempcpy_sse2_unaligned)
              IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strlen.S.  */
   IFUNC_IMPL (i, name, strlen,
-             IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE2,
+             IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE2),
                              __strlen_sse2_bsf)
-             IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE2, __strlen_sse2)
+             IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE2),
+                             __strlen_sse2)
              IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_ia32))
 
   /* Support sysdeps/i386/i686/multiarch/strncmp.S.  */
   IFUNC_IMPL (i, name, strncmp,
-             IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSE4_2,
+             IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSE4_2),
                              __strncmp_sse4_2)
-             IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSSE3,
+             IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSSE3),
                              __strncmp_ssse3)
              IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_ia32))
 #endif
index 02994d055ea9075928b44650c504160a444fb86f..65e6b96f3b92bf184ad0c754c6ad170ccfc71412 100644 (file)
 #include <init-arch.h>
 
 #if IS_IN (libc)
-# define CFI_POP(REG) \
-       cfi_adjust_cfa_offset (-4); \
-       cfi_restore (REG)
-
-# define CFI_PUSH(REG) \
-       cfi_adjust_cfa_offset (4); \
-       cfi_rel_offset (REG, 0)
-
        .text
 ENTRY(__memchr)
        .type   __memchr, @gnu_indirect_function
-       pushl   %ebx
-       CFI_PUSH (%ebx)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-
-1:     testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      3f
 
-       leal    __memchr_sse2@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+       LOAD_FUNC_GOT_EAX ( __memchr_sse2)
        ret
 
-       CFI_PUSH (%ebx)
-
-2:     leal    __memchr_ia32@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+2:     LOAD_FUNC_GOT_EAX (__memchr_ia32)
        ret
 
-       CFI_PUSH (%ebx)
-
-3:     leal    __memchr_sse2_bsf@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+3:     LOAD_FUNC_GOT_EAX (__memchr_sse2_bsf)
        ret
 END(__memchr)
 
index 6b607ebd3b292d6d16d0e4293cf96fe7a025a22b..d4d7d2e91dbf7a3c329b4ed253ea0e30b378fc7d 100644 (file)
 
 /* Define multiple versions only for the definition in libc. */
 #if IS_IN (libc)
-# ifdef SHARED
-       .text
-ENTRY(memcmp)
-       .type   memcmp, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memcmp_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __memcmp_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __memcmp_sse4_2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(memcmp)
-# else
        .text
 ENTRY(memcmp)
        .type   memcmp, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memcmp_ia32, %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memcmp_ia32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __memcmp_ssse3, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
+       LOAD_FUNC_GOT_EAX (__memcmp_ssse3)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       leal    __memcmp_sse4_2, %eax
+       LOAD_FUNC_GOT_EAX (__memcmp_sse4_2)
 2:     ret
 END(memcmp)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index c6d20bd8e03b66b409dc94791f681ce4528b6c38..9a4d183e01151bd05bd341b540d1e0774b2447e3 100644 (file)
        .text
 ENTRY(memcpy)
        .type   memcpy, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memcpy_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memcpy_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memcpy_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memcpy_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __memcpy_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memcpy_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memcpy_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__memcpy_ssse3_rep)
+2:     ret
 END(memcpy)
 
 # undef ENTRY
index 93995879f85fe2a93ec783d2b454c5dd16c4da9e..3bbd921555a889e087f7b4a5c93e9f26bfa78e27 100644 (file)
        .text
 ENTRY(__memcpy_chk)
        .type   __memcpy_chk, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memcpy_chk_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memcpy_chk_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memcpy_chk_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memcpy_chk_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __memcpy_chk_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memcpy_chk_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3_rep)
+2:     ret
 END(__memcpy_chk)
 # else
 #  include "../memcpy_chk.S"
index 70334639bae6dbf1f9ede9595f81f3101b9b26bb..2bf427fe93774bcd8589619ee6b743cf5bcbb367 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(memmove)
        .type   memmove, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memmove_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memmove_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memmove_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memmove_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __memmove_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memmove_ssse3)
+       HAS_ARCH_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memmove_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__memmove_ssse3_rep)
+2:     ret
 END(memmove)
 
-# undef ENTRY
-# define ENTRY(name) \
+# ifdef SHARED
+#  undef ENTRY
+#  define ENTRY(name) \
        .type __memmove_ia32, @function; \
        .p2align 4; \
        .globl __memmove_ia32; \
@@ -61,29 +52,8 @@ END(memmove)
        __memmove_ia32: cfi_startproc; \
        CALL_MCOUNT
 # else
-       .text
-ENTRY(memmove)
-       .type   memmove, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memmove_ia32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
-       jz      2f
-       leal    __memmove_sse2_unaligned, %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features
-       jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __memmove_ssse3, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
-       jz      2f
-       leal    __memmove_ssse3_rep, %eax
-2:     ret
-END(memmove)
-
-# undef ENTRY
-# define ENTRY(name) \
+#  undef ENTRY
+#  define ENTRY(name) \
        .type __memmove_ia32, @function; \
        .globl __memmove_ia32; \
        .p2align 4; \
index 2b576d496088e7d812744a23b19eabbbf41dd55e..b17f6edbdcee364335617e2ebc6820c868fb8b1e 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(__memmove_chk)
        .type   __memmove_chk, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memmove_chk_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memmove_chk_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memmove_chk_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memmove_chk_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __memmove_chk_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memmove_chk_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(__memmove_chk)
-# else
-       .text
-ENTRY(__memmove_chk)
-       .type   __memmove_chk, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memmove_chk_ia32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
-       jz      2f
-       leal    __memmove_chk_sse2_unaligned, %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features
-       jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __memmove_chk_ssse3, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
-       jz      2f
-       leal    __memmove_chk_ssse3_rep, %eax
+       LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3_rep)
 2:     ret
 END(__memmove_chk)
 
+# ifndef SHARED
        .type __memmove_chk_sse2_unaligned, @function
        .p2align 4;
 __memmove_chk_sse2_unaligned:
index 39c934eb49ce81f0319a069157259acf90d74815..021558a5b04cde927da4f9b7f89ee6e951ebdebe 100644 (file)
        .text
 ENTRY(__mempcpy)
        .type   __mempcpy, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __mempcpy_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__mempcpy_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __mempcpy_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__mempcpy_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __mempcpy_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__mempcpy_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __mempcpy_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__mempcpy_ssse3_rep)
+2:     ret
 END(__mempcpy)
 
 # undef ENTRY
index b6fa202833cfbb85941b508e3a46f0ef231b5277..1bea6eab381b4796390f1fffa29f8f0608dac173 100644 (file)
        .text
 ENTRY(__mempcpy_chk)
        .type   __mempcpy_chk, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __mempcpy_chk_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__mempcpy_chk_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __mempcpy_chk_sse2_unaligned@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__mempcpy_chk_sse2_unaligned)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __mempcpy_chk_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __mempcpy_chk_ssse3_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3_rep)
+2:     ret
 END(__mempcpy_chk)
 # else
 #  include "../mempcpy_chk.S"
index 321e0b7e4e17f510198e515b389c583a08eca2df..32fb1a67923083792a5f2bfb307e49aa143448a7 100644 (file)
 #include <init-arch.h>
 
 #if IS_IN (libc)
-# define CFI_POP(REG) \
-       cfi_adjust_cfa_offset (-4); \
-       cfi_restore (REG)
-
-# define CFI_PUSH(REG) \
-       cfi_adjust_cfa_offset (4); \
-       cfi_rel_offset (REG, 0)
-
        .text
 ENTRY(__memrchr)
        .type   __memrchr, @gnu_indirect_function
-       pushl   %ebx
-       CFI_PUSH (%ebx)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-
-1:     testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      3f
 
-       leal    __memrchr_sse2@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+       LOAD_FUNC_GOT_EAX (__memrchr_sse2)
        ret
 
-       CFI_PUSH (%ebx)
-
-2:     leal    __memrchr_ia32@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+2:     LOAD_FUNC_GOT_EAX (__memrchr_ia32)
        ret
 
-       CFI_PUSH (%ebx)
-
-3:     leal    __memrchr_sse2_bsf@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+3:     LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
        ret
 END(__memrchr)
 
index 6d7d9194095fb2c2ecc9c2011fb459e13cae60fa..8015d57894e5053155a4cf0a9fdc678f99c279f7 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
-       .text
-ENTRY(memset)
-       .type   memset, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memset_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __memset_sse2@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    __memset_sse2_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(memset)
-# else
        .text
 ENTRY(memset)
        .type   memset, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memset_ia32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memset_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memset_sse2, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
+       LOAD_FUNC_GOT_EAX (__memset_sse2)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memset_sse2_rep, %eax
+       LOAD_FUNC_GOT_EAX (__memset_sse2_rep)
 2:     ret
 END(memset)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index a770c0d9e268f3368e9becbfb44a93cbeb875b89..7be45e710ef986fce189f775e6fcbbf8bb9256e0 100644 (file)
 
 /* Define multiple versions only for the definition in lib.  */
 #if IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(__memset_chk)
        .type   __memset_chk, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memset_chk_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__memset_chk_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __memset_chk_sse2@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__memset_chk_sse2)
+       HAS_CPU_FEATURE (Fast_Rep_String)
        jz      2f
-       leal    __memset_chk_sse2_rep@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__memset_chk_sse2_rep)
+2:     ret
 END(__memset_chk)
 
+# ifdef SHARED
 strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
        .section .gnu.warning.__memset_zero_constant_len_parameter
        .string "memset used with constant zero length parameter; this could be due to transposed parameters"
 # else
        .text
-ENTRY(__memset_chk)
-       .type   __memset_chk, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __memset_chk_ia32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
-       jz      2f
-       leal    __memset_chk_sse2, %eax
-       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features
-       jz      2f
-       leal    __memset_chk_sse2_rep, %eax
-2:     ret
-END(__memset_chk)
-
        .type __memset_chk_sse2, @function
        .p2align 4;
 __memset_chk_sse2:
index c2b7ee647e68c0a943ac0cf5892bcd92ef8bdc55..2cfbe1b3fc42aaef658e10c5bc41fa23924946a7 100644 (file)
 #include <init-arch.h>
 
 #if IS_IN (libc)
-# define CFI_POP(REG) \
-       cfi_adjust_cfa_offset (-4); \
-       cfi_restore (REG)
-
-# define CFI_PUSH(REG) \
-       cfi_adjust_cfa_offset (4); \
-       cfi_rel_offset (REG, 0)
-
        .text
 ENTRY(__rawmemchr)
        .type   __rawmemchr, @gnu_indirect_function
-       pushl   %ebx
-       CFI_PUSH (%ebx)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-
-1:     testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      3f
 
-       leal    __rawmemchr_sse2@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+       LOAD_FUNC_GOT_EAX (__rawmemchr_sse2)
        ret
 
-       CFI_PUSH (%ebx)
-
-2:     leal    __rawmemchr_ia32@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+2:     LOAD_FUNC_GOT_EAX (__rawmemchr_ia32)
        ret
 
-       CFI_PUSH (%ebx)
-
-3:     leal    __rawmemchr_sse2_bsf@GOTOFF(%ebx), %eax
-       popl    %ebx
-       CFI_POP (%ebx)
+3:     LOAD_FUNC_GOT_EAX (__rawmemchr_sse2_bsf)
        ret
 END(__rawmemchr)
 
index dd70f78fd7934b85d5aa95cc680f5e95c5558851..cf2ede5309b1f0823844ba719c26e0d437d72c1a 100644 (file)
@@ -26,7 +26,8 @@
 extern double __fma_ia32 (double x, double y, double z) attribute_hidden;
 extern double __fma_fma (double x, double y, double z) attribute_hidden;
 
-libm_ifunc (__fma, HAS_FMA ? __fma_fma : __fma_ia32);
+libm_ifunc (__fma,
+           HAS_ARCH_FEATURE (FMA_Usable) ? __fma_fma : __fma_ia32);
 weak_alias (__fma, fma)
 
 # define __fma __fma_ia32
index 9ffa4f15d9599a3636635583966854b0e79bd49a..526cdf16e409537a45ea3db5f3815941b99d2d94 100644 (file)
@@ -26,7 +26,8 @@
 extern float __fmaf_ia32 (float x, float y, float z) attribute_hidden;
 extern float __fmaf_fma (float x, float y, float z) attribute_hidden;
 
-libm_ifunc (__fmaf, HAS_FMA ? __fmaf_fma : __fmaf_ia32);
+libm_ifunc (__fmaf,
+           HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma : __fmaf_ia32);
 weak_alias (__fmaf, fmaf)
 
 # define __fmaf __fmaf_ia32
index c30ac3a8bdec2595e6773129cfbe03f473a03fb9..e4b3cf5b46e77556732e13bd621bea8c5c1ae3b5 100644 (file)
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifdef SHARED
        .text
 ENTRY(__strcasecmp)
        .type   __strcasecmp, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strcasecmp_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strcasecmp_ia32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __strcasecmp_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__strcasecmp_ssse3)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_SSE4_2)
        jnz     2f
-       leal    __strcasecmp_sse4_2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(__strcasecmp)
-#else
-       .text
-ENTRY(__strcasecmp)
-       .type   __strcasecmp, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strcasecmp_ia32, %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __strcasecmp_ssse3, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
-       jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features
-       jnz     2f
-       leal    __strcasecmp_sse4_2, %eax
+       LOAD_FUNC_GOT_EAX (__strcasecmp_sse4_2)
 2:     ret
 END(__strcasecmp)
-#endif
 
 weak_alias (__strcasecmp, strcasecmp)
index 474f753f3fcf9c2714a5a912e3a97a6155e6f23f..45d84cdf4eab450d5071c7e9937371916d087552 100644 (file)
    need strncat before the initialization happened.  */
 #if IS_IN (libc)
 
-# ifdef SHARED
        .text
 ENTRY(STRCAT)
        .type   STRCAT, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCAT_IA32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    STRCAT_SSE2@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
-       jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
-       jz      2f
-       leal    STRCAT_SSSE3@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(STRCAT)
-# else
-
-ENTRY(STRCAT)
-       .type   STRCAT, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCAT_IA32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (STRCAT_IA32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    STRCAT_SSE2, %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features
+       LOAD_FUNC_GOT_EAX (STRCAT_SSE2)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    STRCAT_SSSE3, %eax
+       LOAD_FUNC_GOT_EAX (STRCAT_SSSE3)
 2:     ret
 END(STRCAT)
 
-# endif
-
 # undef ENTRY
 # define ENTRY(name) \
        .type STRCAT_IA32, @function; \
index 45624fdee01b08f3ac5b182435083a8db6b90b0c..6b4656582aa91ee706b759d9a0b5c1e922130067 100644 (file)
        .text
 ENTRY(strchr)
        .type   strchr, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strchr_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strchr_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __strchr_sse2_bsf@GOTOFF(%ebx), %eax
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__strchr_sse2_bsf)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      2f
-       leal    __strchr_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__strchr_sse2)
+2:     ret
 END(strchr)
 
 # undef ENTRY
index 9df40089a7a7f471ce39a5e4155d41517bed8339..cad179d8f2ea75850d9f15330bce460b5e979827 100644 (file)
    define multiple versions for strncmp in static library since we
    need strncmp before the initialization happened.  */
 #if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(STRCMP)
        .type   STRCMP, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __STRCMP_IA32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__STRCMP_IA32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __STRCMP_SSSE3@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__STRCMP_SSSE3)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_SSE4_2)
        jnz     2f
-       leal    __STRCMP_SSE4_2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(STRCMP)
-# else
-       .text
-ENTRY(STRCMP)
-       .type   STRCMP, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __STRCMP_IA32, %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __STRCMP_SSSE3, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
-       jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features
-       jnz     2f
-       leal    __STRCMP_SSE4_2, %eax
+       LOAD_FUNC_GOT_EAX (__STRCMP_SSE4_2)
 2:     ret
 END(STRCMP)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index c279d468cb94c2508e8c75591348a1a6cbbdc656..e9db76634726173a039603d7fd37a9de81f4ee6f 100644 (file)
    need strncpy before the initialization happened.  */
 #if IS_IN (libc)
 
-# ifdef SHARED
        .text
 ENTRY(STRCPY)
        .type   STRCPY, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCPY_IA32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (STRCPY_IA32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    STRCPY_SSE2@GOTOFF(%ebx), %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (STRCPY_SSE2)
+       HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    STRCPY_SSSE3@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(STRCPY)
-# else
-
-ENTRY(STRCPY)
-       .type   STRCPY, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCPY_IA32, %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
-       jz      2f
-       leal    STRCPY_SSE2, %eax
-       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features
-       jnz     2f
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    STRCPY_SSSE3, %eax
+       LOAD_FUNC_GOT_EAX (STRCPY_SSSE3)
 2:     ret
 END(STRCPY)
 
-# endif
-
 # undef ENTRY
 # define ENTRY(name) \
        .type STRCPY_IA32, @function; \
index e6ea454150ddad29598b82fa056e19c6359e71d2..b669b9797a020c5b4c0981ed27bfe7c4f15a821a 100644 (file)
    define multiple versions for strpbrk in static library since we
    need strpbrk before the initialization happened.  */
 #if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(STRCSPN)
        .type   STRCSPN, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCSPN_IA32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (STRCSPN_IA32)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       leal    STRCSPN_SSE42@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
-END(STRCSPN)
-# else
-       .text
-ENTRY(STRCSPN)
-       .type   STRCSPN, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    STRCSPN_IA32, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
-       jz      2f
-       leal    STRCSPN_SSE42, %eax
+       LOAD_FUNC_GOT_EAX (STRCSPN_SSE42)
 2:     ret
 END(STRCSPN)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index 2e6993b738e07f6ac276d5738c2d5b6ed4c5cea9..613559ca01dd5f93e6805bbafe209f1b1db59e57 100644 (file)
        .text
 ENTRY(strlen)
        .type   strlen, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strlen_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strlen_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __strlen_sse2_bsf@GOTOFF(%ebx), %eax
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__strlen_sse2_bsf)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      2f
-       leal    __strlen_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__strlen_sse2)
+2:     ret
 END(strlen)
 
 # undef ENTRY
index c2cb03c2bbd59e7d73a81ba1224403223642d231..0cdbeff42ad197538b8c56992bde3ea89a653a49 100644 (file)
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifdef SHARED
        .text
 ENTRY(__strncasecmp)
        .type   __strncasecmp, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strncasecmp_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strncasecmp_ia32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __strncasecmp_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__strncasecmp_ssse3)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       HAS_ARCH_FEATURE (Slow_SSE4_2)
        jnz     2f
-       leal    __strncasecmp_sse4_2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
-END(__strncasecmp)
-#else
-       .text
-ENTRY(__strncasecmp)
-       .type   __strncasecmp, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strncasecmp_ia32, %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
-       jz      2f
-       leal    __strncasecmp_ssse3, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
-       jz      2f
-       testl   $bit_Slow_SSE4_2, FEATURE_OFFSET+index_Slow_SSE4_2+__cpu_features
-       jnz     2f
-       leal    __strncasecmp_sse4_2, %eax
+       LOAD_FUNC_GOT_EAX (__strncasecmp_sse4_2)
 2:     ret
 END(__strncasecmp)
-#endif
 
 weak_alias (__strncasecmp, strncasecmp)
index 56a51366061c41e346611d9b1d7dbde1b5028235..baf21fc205a9e98f0a77086ce09db3040b5f6167 100644 (file)
        .text
 ENTRY(__strnlen)
        .type   __strnlen, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strnlen_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strnlen_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __strnlen_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__strnlen_sse2)
+2:     ret
 END(__strnlen)
 
 weak_alias(__strnlen, strnlen)
index 91074b4315dfdc13c87adde5c9d237428a837b55..6aa332190755d2d3ed7ad1a65a935a9f71fa9a10 100644 (file)
        .text
 ENTRY(strrchr)
        .type   strrchr, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strrchr_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strrchr_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __strrchr_sse2_bsf@GOTOFF(%ebx), %eax
-       testl   $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__strrchr_sse2_bsf)
+       HAS_ARCH_FEATURE (Slow_BSF)
        jz      2f
-       leal    __strrchr_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__strrchr_sse2)
+2:     ret
 END(strrchr)
 
 # undef ENTRY
index 9d353a27351c092acc1bc56422dff7c0ae018cac..4ba87be45bb54fd84663f9e61763c37037b1a339 100644 (file)
 
 /* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-# ifdef SHARED
        .text
 ENTRY(strspn)
        .type   strspn, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strspn_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__strspn_ia32)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       leal    __strspn_sse42@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
-END(strspn)
-# else
-       .text
-ENTRY(strspn)
-       .type   strspn, @gnu_indirect_function
-       cmpl    $0, KIND_OFFSET+__cpu_features
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __strspn_ia32, %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
-       jz      2f
-       leal    __strspn_sse42, %eax
+       LOAD_FUNC_GOT_EAX (__strspn_sse42)
 2:     ret
 END(strspn)
-# endif
 
 # undef ENTRY
 # define ENTRY(name) \
index 603d7d79c1407690829fda1c94cdbe7b70186a28..5918b127a62d77741e9059c58ff8fccd05a74753 100644 (file)
        .text
 ENTRY(__wcschr)
        .type   wcschr, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wcschr_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wcschr_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __wcschr_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wcschr_sse2)
+2:     ret
 END(__wcschr)
 weak_alias (__wcschr, wcschr)
 #endif
index 92c2c84ad45ac4513333e4eb8f7b9988c471ea08..db9c05af0d1dcdd95532d8d9158c1a35009da2dd 100644 (file)
        .text
 ENTRY(__wcscmp)
        .type   __wcscmp, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wcscmp_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wcscmp_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __wcscmp_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wcscmp_sse2)
+2:     ret
 END(__wcscmp)
 weak_alias (__wcscmp, wcscmp)
 #endif
index f7253c7f453c881cf0a9ead8fe0a15e031dc54fe..5f149701d3dce6595d052d470f636cf2b0798c2f 100644 (file)
        .text
 ENTRY(wcscpy)
        .type   wcscpy, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wcscpy_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wcscpy_ia32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __wcscpy_ssse3@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wcscpy_ssse3)
+2:     ret
 END(wcscpy)
 #endif
index 3926a50a87ba80d1f7f2ace06883bb63721fa408..7740404a82dbef0bce2d30d2624540e402e21180 100644 (file)
        .text
 ENTRY(__wcslen)
        .type   __wcslen, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wcslen_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wcslen_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __wcslen_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wcslen_sse2)
+2:     ret
 END(__wcslen)
 
 weak_alias(__wcslen, wcslen)
index 5c96129fbed13744fa0811b78a8d14cb64ad6448..9ed68101e1154716a3ae428dbf51e8ca1962b46f 100644 (file)
        .text
 ENTRY(wcsrchr)
        .type   wcsrchr, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wcsrchr_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
+       HAS_CPU_FEATURE (SSE2)
        jz      2f
-       leal    __wcsrchr_sse2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4);
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
+2:     ret
 END(wcsrchr)
 #endif
index 6ca60531db730829065bbbf5366d0532eb11572b..6025942fb60d6fa60ae66a4ef5355d4e9e0ae7d2 100644 (file)
        .text
 ENTRY(wmemcmp)
        .type   wmemcmp, @gnu_indirect_function
-       pushl   %ebx
-       cfi_adjust_cfa_offset (4)
-       cfi_rel_offset (ebx, 0)
-       LOAD_PIC_REG(bx)
-       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
-       jne     1f
-       call    __init_cpu_features
-1:     leal    __wmemcmp_ia32@GOTOFF(%ebx), %eax
-       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       LOAD_GOT_AND_RTLD_GLOBAL_RO
+       LOAD_FUNC_GOT_EAX (__wmemcmp_ia32)
+       HAS_CPU_FEATURE (SSSE3)
        jz      2f
-       leal    __wmemcmp_ssse3@GOTOFF(%ebx), %eax
-       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+       LOAD_FUNC_GOT_EAX (__wmemcmp_ssse3)
+       HAS_CPU_FEATURE (SSE4_2)
        jz      2f
-       leal    __wmemcmp_sse4_2@GOTOFF(%ebx), %eax
-2:     popl    %ebx
-       cfi_adjust_cfa_offset (-4)
-       cfi_restore (ebx)
-       ret
+       LOAD_FUNC_GOT_EAX (__wmemcmp_sse4_2)
+2:     ret
 END(wmemcmp)
 #endif