olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1292018-2.patch

00db10
We keep with the idea behind this patch but adjust all of the changes
00db10
to match the existing impelementations in RHEL 7.3.
00db10
00db10
commit 0b5395f052ee09cd7e3d219af4e805c38058afb5
00db10
Author: H.J. Lu <hjl.tools@gmail.com>
00db10
Date:   Thu Aug 13 03:38:47 2015 -0700
00db10
00db10
    Update x86_64 multiarch functions for <cpu-features.h>
00db10
    
00db10
    This patch updates x86_64 multiarch functions to use the newly defined
00db10
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
00db10
    <cpu-features.h>.
00db10
    
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_asin.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_asin.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_asin.c
00db10
@@ -8,11 +8,15 @@ extern double __ieee754_acos_fma4 (doubl
00db10
 extern double __ieee754_asin_fma4 (double);
00db10
 
00db10
 libm_ifunc (__ieee754_acos,
00db10
-	    HAS_FMA4 ? __ieee754_acos_fma4 : __ieee754_acos_sse2);
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable)
00db10
+	    ? __ieee754_acos_fma4
00db10
+	    : __ieee754_acos_sse2);
00db10
 strong_alias (__ieee754_acos, __acos_finite)
00db10
 
00db10
 libm_ifunc (__ieee754_asin,
00db10
-	    HAS_FMA4 ? __ieee754_asin_fma4 : __ieee754_asin_sse2);
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable)
00db10
+	    ? __ieee754_asin_fma4
00db10
+	    : __ieee754_asin_sse2);
00db10
 strong_alias (__ieee754_asin, __asin_finite)
00db10
 
00db10
 # define __ieee754_acos __ieee754_acos_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_atan2.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_atan2.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_atan2.c
00db10
@@ -7,14 +7,15 @@ extern double __ieee754_atan2_avx (doubl
00db10
 # ifdef HAVE_FMA4_SUPPORT
00db10
 extern double __ieee754_atan2_fma4 (double, double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __ieee754_atan2_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
 libm_ifunc (__ieee754_atan2,
00db10
-	    HAS_FMA4 ? __ieee754_atan2_fma4
00db10
-	    : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_atan2_fma4
00db10
+	    : (HAS_ARCH_FEATURE (AVX_Usable)
00db10
+	       ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
00db10
 strong_alias (__ieee754_atan2, __atan2_finite)
00db10
 
00db10
 # define __ieee754_atan2 __ieee754_atan2_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_exp.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_exp.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_exp.c
00db10
@@ -7,14 +7,15 @@ extern double __ieee754_exp_avx (double)
00db10
 # ifdef HAVE_FMA4_SUPPORT
00db10
 extern double __ieee754_exp_fma4 (double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __ieee754_exp_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
 libm_ifunc (__ieee754_exp,
00db10
-	    HAS_FMA4 ? __ieee754_exp_fma4
00db10
-	    : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2));
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_exp_fma4
00db10
+	    : (HAS_ARCH_FEATURE (AVX_Usable)
00db10
+	       ? __ieee754_exp_avx : __ieee754_exp_sse2));
00db10
 strong_alias (__ieee754_exp, __exp_finite)
00db10
 
00db10
 # define __ieee754_exp __ieee754_exp_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_log.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_log.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_log.c
00db10
@@ -7,14 +7,15 @@ extern double __ieee754_log_avx (double)
00db10
 # ifdef HAVE_FMA4_SUPPORT
00db10
 extern double __ieee754_log_fma4 (double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __ieee754_log_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
 libm_ifunc (__ieee754_log,
00db10
-	    HAS_FMA4 ? __ieee754_log_fma4
00db10
-	    : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2));
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_log_fma4
00db10
+	    : (HAS_ARCH_FEATURE (AVX_Usable)
00db10
+	       ? __ieee754_log_avx : __ieee754_log_sse2));
00db10
 strong_alias (__ieee754_log, __log_finite)
00db10
 
00db10
 # define __ieee754_log __ieee754_log_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_pow.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_pow.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_pow.c
00db10
@@ -5,7 +5,10 @@
00db10
 extern double __ieee754_pow_sse2 (double, double);
00db10
 extern double __ieee754_pow_fma4 (double, double);
00db10
 
00db10
-libm_ifunc (__ieee754_pow, HAS_FMA4 ? __ieee754_pow_fma4 : __ieee754_pow_sse2);
00db10
+libm_ifunc (__ieee754_pow,
00db10
+	    HAS_ARCH_FEATURE (FMA4_Usable)
00db10
+	    ? __ieee754_pow_fma4
00db10
+	    : __ieee754_pow_sse2);
00db10
 strong_alias (__ieee754_pow, __pow_finite)
00db10
 
00db10
 # define __ieee754_pow __ieee754_pow_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_atan.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_atan.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_atan.c
00db10
@@ -7,13 +7,14 @@ extern double __atan_avx (double);
00db10
 # ifdef HAVE_FMA4_SUPPORT
00db10
 extern double __atan_fma4 (double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __atan_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
-libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 :
00db10
-		   HAS_AVX ? __atan_avx : __atan_sse2));
00db10
+libm_ifunc (atan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __atan_fma4 :
00db10
+		   HAS_ARCH_FEATURE (AVX_Usable)
00db10
+		   ? __atan_avx : __atan_sse2));
00db10
 
00db10
 # define atan __atan_sse2
00db10
 #endif
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceil.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_ceil.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceil.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__ceil)
00db10
 	.type	__ceil, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__ceil_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__ceil_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__ceilf)
00db10
 	.type	__ceilf, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__ceilf_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__ceilf_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floor.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_floor.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floor.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__floor)
00db10
 	.type	__floor, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__floor_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__floor_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floorf.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_floorf.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floorf.S
00db10
@@ -22,10 +22,10 @@
00db10
 
00db10
 ENTRY(__floorf)
00db10
 	.type	__floorf, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	movq	%rax, %rdx
00db10
 	leaq	__floorf_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__floorf_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fma.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_fma.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fma.c
00db10
@@ -42,14 +42,15 @@ __fma_fma4 (double x, double y, double z
00db10
   return x;
00db10
 }
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __fma_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
 
00db10
-libm_ifunc (__fma, HAS_FMA
00db10
-	    ? __fma_fma3 : (HAS_FMA4 ? __fma_fma4 : __fma_sse2));
00db10
+libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable)
00db10
+	    ? __fma_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable)
00db10
+			    ? __fma_fma4 : __fma_sse2));
00db10
 weak_alias (__fma, fma)
00db10
 
00db10
 # define __fma __fma_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
00db10
@@ -41,14 +41,15 @@ __fmaf_fma4 (float x, float y, float z)
00db10
   return x;
00db10
 }
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __fmaf_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
 
00db10
-libm_ifunc (__fmaf, HAS_FMA
00db10
-	    ? __fmaf_fma3 : (HAS_FMA4 ? __fmaf_fma4 : __fmaf_sse2));
00db10
+libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable)
00db10
+	    ? __fmaf_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable)
00db10
+			     ? __fmaf_fma4 : __fmaf_sse2));
00db10
 weak_alias (__fmaf, fmaf)
00db10
 
00db10
 # define __fmaf __fmaf_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
00db10
@@ -22,10 +22,10 @@
00db10
 
00db10
 ENTRY(__nearbyint)
00db10
 	.type	__nearbyint, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	movq	%rax, %rdx
00db10
 	leaq	__nearbyint_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__nearbyint_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__nearbyintf)
00db10
 	.type	__nearbyintf, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__nearbyintf_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__nearbyintf_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rint.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_rint.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rint.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__rint)
00db10
 	.type	__rint, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__rint_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__rint_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rintf.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_rintf.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rintf.S
00db10
@@ -22,10 +22,9 @@
00db10
 
00db10
 ENTRY(__rintf)
00db10
 	.type	__rintf, @gnu_indirect_function
00db10
-	call	__get_cpu_features@plt
00db10
-	movq	%rax, %rdx
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	__rintf_sse41(%rip), %rax
00db10
-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
00db10
+	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jnz	2f
00db10
 	leaq	__rintf_c(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_sin.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_sin.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_sin.c
00db10
@@ -11,18 +11,20 @@ extern double __sin_avx (double);
00db10
 extern double __cos_fma4 (double);
00db10
 extern double __sin_fma4 (double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __cos_fma4 ((void *) 0)
00db10
 #  define __sin_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
-libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 :
00db10
-		    HAS_AVX ? __cos_avx : __cos_sse2));
00db10
+libm_ifunc (__cos, (HAS_ARCH_FEATURE (FMA4_Usable) ? __cos_fma4 :
00db10
+		    HAS_ARCH_FEATURE (AVX_Usable)
00db10
+		    ? __cos_avx : __cos_sse2));
00db10
 weak_alias (__cos, cos)
00db10
 
00db10
-libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 :
00db10
-		    HAS_AVX ? __sin_avx : __sin_sse2));
00db10
+libm_ifunc (__sin, (HAS_ARCH_FEATURE (FMA4_Usable) ? __sin_fma4 :
00db10
+		    HAS_ARCH_FEATURE (AVX_Usable)
00db10
+		    ? __sin_avx : __sin_sse2));
00db10
 weak_alias (__sin, sin)
00db10
 
00db10
 # define __cos __cos_sse2
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_tan.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_tan.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_tan.c
00db10
@@ -7,13 +7,14 @@ extern double __tan_avx (double);
00db10
 # ifdef HAVE_FMA4_SUPPORT
00db10
 extern double __tan_fma4 (double);
00db10
 # else
00db10
-#  undef HAS_FMA4
00db10
-#  define HAS_FMA4 0
00db10
+#  undef HAS_ARCH_FEATURE
00db10
+#  define HAS_ARCH_FEATURE(feature) 0
00db10
 #  define __tan_fma4 ((void *) 0)
00db10
 # endif
00db10
 
00db10
-libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 :
00db10
-		  HAS_AVX ? __tan_avx : __tan_sse2));
00db10
+libm_ifunc (tan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __tan_fma4 :
00db10
+		  HAS_ARCH_FEATURE (AVX_Usable)
00db10
+		  ? __tan_avx : __tan_sse2));
00db10
 
00db10
 # define tan __tan_sse2
00db10
 #endif
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/ifunc-impl-list.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c
00db10
@@ -39,25 +39,26 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/memcmp.S.  */
00db10
   IFUNC_IMPL (i, name, memcmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSE4_1,
00db10
+	      IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSE4_1),
00db10
 			      __memcmp_sse4_1)
00db10
-	      IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSSE3, __memcmp_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __memcmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/memmove_chk.S.  */
00db10
   IFUNC_IMPL (i, name, __memmove_chk,
00db10
-	      IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memmove_chk_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memmove_chk_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
00db10
 			      __memmove_chk_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/memmove.S.  */
00db10
   IFUNC_IMPL (i, name, memmove,
00db10
-	      IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memmove_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memmove_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2))
00db10
 
00db10
@@ -74,13 +75,13 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/rawmemchr.S.  */
00db10
   IFUNC_IMPL (i, name, rawmemchr,
00db10
-	      IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __rawmemchr_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/stpncpy.S.  */
00db10
   IFUNC_IMPL (i, name, stpncpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __stpncpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, stpncpy, 1,
00db10
 			      __stpncpy_sse2_unaligned)
00db10
@@ -88,92 +89,105 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/stpcpy.S.  */
00db10
   IFUNC_IMPL (i, name, stpcpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSSE3, __stpcpy_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __stpcpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2_unaligned)
00db10
 	      IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S.  */
00db10
   IFUNC_IMPL (i, name, strcasecmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_AVX,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp,
00db10
+			      HAS_ARCH_FEATURE (AVX_Usable),
00db10
 			      __strcasecmp_avx)
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp,
00db10
+			      HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strcasecmp_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp,
00db10
+			      HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strcasecmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S.  */
00db10
   IFUNC_IMPL (i, name, strcasecmp_l,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_AVX,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp_l,
00db10
+			      HAS_ARCH_FEATURE (AVX_Usable),
00db10
 			      __strcasecmp_l_avx)
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp_l,
00db10
+			      HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strcasecmp_l_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasecmp_l,
00db10
+			      HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strcasecmp_l_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
00db10
 			      __strcasecmp_l_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcasestr.c.  */
00db10
   IFUNC_IMPL (i, name, strcasestr,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcasestr, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcasestr, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strcasestr_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcat.S.  */
00db10
   IFUNC_IMPL (i, name, strcat,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcat, HAS_SSSE3, __strcat_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __strcat_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2_unaligned)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strchr.S.  */
00db10
   IFUNC_IMPL (i, name, strchr,
00db10
-	      IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE4_2, __strchr_sse42)
00db10
+	      IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE4_2),
00db10
+			      __strchr_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2_no_bsf)
00db10
 	      IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcmp.S.  */
00db10
   IFUNC_IMPL (i, name, strcmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2, __strcmp_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSSE3, __strcmp_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSE4_2),
00db10
+			      __strcmp_sse42)
00db10
+	      IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __strcmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcpy.S.  */
00db10
   IFUNC_IMPL (i, name, strcpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSSE3, __strcpy_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __strcpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2_unaligned)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strcspn.S.  */
00db10
   IFUNC_IMPL (i, name, strcspn,
00db10
-	      IFUNC_IMPL_ADD (array, i, strcspn, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strcspn, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strcspn_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strncase_l.S.  */
00db10
   IFUNC_IMPL (i, name, strncasecmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_AVX,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_ARCH_FEATURE (AVX_Usable),
00db10
 			      __strncasecmp_avx)
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strncasecmp_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strncasecmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strncasecmp, 1,
00db10
 			      __strncasecmp_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strncase_l.S.  */
00db10
   IFUNC_IMPL (i, name, strncasecmp_l,
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_AVX,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp_l,
00db10
+			      HAS_ARCH_FEATURE (AVX_Usable),
00db10
 			      __strncasecmp_l_avx)
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strncasecmp_l_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strncasecmp_l_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
00db10
 			      __strncasecmp_l_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strncat.S.  */
00db10
   IFUNC_IMPL (i, name, strncat,
00db10
-	      IFUNC_IMPL_ADD (array, i, strncat, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strncat_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strncat, 1,
00db10
 			      __strncat_sse2_unaligned)
00db10
@@ -181,7 +195,7 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strncpy.S.  */
00db10
   IFUNC_IMPL (i, name, strncpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strncpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strncpy, 1,
00db10
 			      __strncpy_sse2_unaligned)
00db10
@@ -194,79 +208,83 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strpbrk.S.  */
00db10
   IFUNC_IMPL (i, name, strpbrk,
00db10
-	      IFUNC_IMPL_ADD (array, i, strpbrk, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strpbrk, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strpbrk_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strrchr.S.  */
00db10
   IFUNC_IMPL (i, name, strrchr,
00db10
-	      IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strrchr_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2_no_bsf)
00db10
 	      IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strspn.S.  */
00db10
   IFUNC_IMPL (i, name, strspn,
00db10
-	      IFUNC_IMPL_ADD (array, i, strspn, HAS_SSE4_2, __strspn_sse42)
00db10
+	      IFUNC_IMPL_ADD (array, i, strspn, HAS_CPU_FEATURE (SSE4_2),
00db10
+			      __strspn_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strstr-c.c.  */
00db10
   IFUNC_IMPL (i, name, strstr,
00db10
 	      IFUNC_IMPL_ADD (array, i, strstr, use_unaligned_strstr (),
00db10
 			      __strstr_sse2_unaligned)
00db10
-	      IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42)
00db10
+	      IFUNC_IMPL_ADD (array, i, strstr, HAS_CPU_FEATURE (SSE4_2),
00db10
+			      __strstr_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/wcscpy.S.  */
00db10
   IFUNC_IMPL (i, name, wcscpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, wcscpy, HAS_SSSE3, __wcscpy_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, wcscpy, HAS_CPU_FEATURE (SSSE3),
00db10
+			      __wcscpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/wmemcmp.S.  */
00db10
   IFUNC_IMPL (i, name, wmemcmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSE4_1,
00db10
+	      IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSE4_1),
00db10
 			      __wmemcmp_sse4_1)
00db10
-	      IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __wmemcmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_sse2))
00db10
 
00db10
 #ifdef SHARED
00db10
   /* Support sysdeps/x86_64/multiarch/memcpy_chk.S.  */
00db10
   IFUNC_IMPL (i, name, __memcpy_chk,
00db10
-	      IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memcpy_chk_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memcpy_chk_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
00db10
 			      __memcpy_chk_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/memcpy.S.  */
00db10
   IFUNC_IMPL (i, name, memcpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __memcpy_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, __memcpy_ssse3)
00db10
+	      IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), __memcpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S.  */
00db10
   IFUNC_IMPL (i, name, __mempcpy_chk,
00db10
-	      IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __mempcpy_chk_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __mempcpy_chk_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
00db10
 			      __mempcpy_chk_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/mempcpy.S.  */
00db10
   IFUNC_IMPL (i, name, mempcpy,
00db10
-	      IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __mempcpy_ssse3_back)
00db10
-	      IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __mempcpy_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_sse2))
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strlen.S.  */
00db10
   IFUNC_IMPL (i, name, strlen,
00db10
-	      IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE4_2, __strlen_sse42)
00db10
+	      IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE4_2),
00db10
+			      __strlen_sse42)
00db10
 	      IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_pminub)
00db10
 	      IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_no_bsf)
00db10
 	      IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2)
00db10
@@ -274,9 +292,9 @@ __libc_ifunc_impl_list (const char *name
00db10
 
00db10
   /* Support sysdeps/x86_64/multiarch/strncmp.S.  */
00db10
   IFUNC_IMPL (i, name, strncmp,
00db10
-	      IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSE4_2,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSE4_2),
00db10
 			      __strncmp_sse42)
00db10
-	      IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSSE3,
00db10
+	      IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSSE3),
00db10
 			      __strncmp_ssse3)
00db10
 	      IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_sse2))
00db10
 #endif
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcmp.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S
00db10
@@ -26,16 +26,13 @@
00db10
 	.text
00db10
 ENTRY(memcmp)
00db10
 	.type	memcmp, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-
00db10
-1:	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	__memcmp_sse2(%rip), %rax
00db10
 	ret
00db10
 
00db10
-2:	testl	$bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip)
00db10
+2:	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jz	3f
00db10
 	leaq	__memcmp_sse4_1(%rip), %rax
00db10
 	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S
00db10
@@ -29,14 +29,12 @@
00db10
 	.text
00db10
 ENTRY(__new_memcpy)
00db10
 	.type	__new_memcpy, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__memcpy_sse2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__memcpy_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	__memcpy_ssse3(%rip), %rax
00db10
-	testl	$bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
00db10
+	HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	jz	2f
00db10
 	leaq	__memcpy_ssse3_back(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy_chk.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S
00db10
@@ -29,14 +29,12 @@
00db10
 	.text
00db10
 ENTRY(__memcpy_chk)
00db10
 	.type	__memcpy_chk, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__memcpy_chk_sse2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__memcpy_chk_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	__memcpy_chk_ssse3(%rip), %rax
00db10
-	testl	$bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
00db10
+	HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	jz	2f
00db10
 	leaq	__memcpy_chk_ssse3_back(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memmove.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c
00db10
@@ -47,8 +47,8 @@ extern __typeof (__redirect_memmove) __m
00db10
    ifunc symbol properly.  */
00db10
 extern __typeof (__redirect_memmove) __libc_memmove;
00db10
 libc_ifunc (__libc_memmove,
00db10
-	    HAS_SSSE3
00db10
-	    ? (HAS_FAST_COPY_BACKWARD
00db10
+	    HAS_CPU_FEATURE (SSSE3)
00db10
+	    ? (HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	       ? __memmove_ssse3_back : __memmove_ssse3)
00db10
 	    : __memmove_sse2)
00db10
 
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memmove_chk.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c
00db10
@@ -29,7 +29,7 @@ extern __typeof (__memmove_chk) __memmov
00db10
 #include "debug/memmove_chk.c"
00db10
 
00db10
 libc_ifunc (__memmove_chk,
00db10
-	    HAS_SSSE3
00db10
-	    ? (HAS_FAST_COPY_BACKWARD
00db10
+	    HAS_CPU_FEATURE (SSSE3)
00db10
+	    ? (HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	       ? __memmove_chk_ssse3_back : __memmove_chk_ssse3)
00db10
 	    : __memmove_chk_sse2);
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S
00db10
@@ -27,14 +27,12 @@
00db10
 #if defined SHARED && IS_IN (libc)
00db10
 ENTRY(__mempcpy)
00db10
 	.type	__mempcpy, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__mempcpy_sse2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__mempcpy_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	__mempcpy_ssse3(%rip), %rax
00db10
-	testl	$bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
00db10
+	HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	jz	2f
00db10
 	leaq	__mempcpy_ssse3_back(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy_chk.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S
00db10
@@ -29,14 +29,12 @@
00db10
 	.text
00db10
 ENTRY(__mempcpy_chk)
00db10
 	.type	__mempcpy_chk, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__mempcpy_chk_sse2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__mempcpy_chk_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	__mempcpy_chk_ssse3(%rip), %rax
00db10
-	testl	$bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
00db10
+	HAS_ARCH_FEATURE (Fast_Copy_Backward)
00db10
 	jz	2f
00db10
 	leaq	__mempcpy_chk_ssse3_back(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memset.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S
00db10
@@ -24,11 +24,9 @@
00db10
 #if IS_IN (libc)
00db10
 ENTRY(memset)
00db10
 	.type	memset, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__memset_x86_64(%rip), %rax
00db10
-	testl	$bit_Prefer_SSE_for_memop, __cpu_features+FEATURE_OFFSET+index_Prefer_SSE_for_memop(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__memset_x86_64(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
00db10
 	jz	2f
00db10
 	leaq	__memset_sse2(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memset_chk.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S
00db10
@@ -25,11 +25,9 @@
00db10
 # ifdef SHARED
00db10
 ENTRY(__memset_chk)
00db10
 	.type	__memset_chk, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__memset_chk_x86_64(%rip), %rax
00db10
-	testl	$bit_Prefer_SSE_for_memop, __cpu_features+FEATURE_OFFSET+index_Prefer_SSE_for_memop(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__memset_chk_x86_64(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
00db10
 	jz	2f
00db10
 	leaq	__memset_chk_sse2(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/sched_cpucount.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/sched_cpucount.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/sched_cpucount.c
00db10
@@ -33,4 +33,4 @@
00db10
 #undef __sched_cpucount
00db10
 
00db10
 libc_ifunc (__sched_cpucount,
00db10
-	    HAS_POPCOUNT ? popcount_cpucount : generic_cpucount);
00db10
+	    HAS_CPU_FEATURE (POPCOUNT) ? popcount_cpucount : generic_cpucount);
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcat.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S
00db10
@@ -47,14 +47,12 @@
00db10
 	.text
00db10
 ENTRY(STRCAT)
00db10
 	.type	STRCAT, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	STRCAT_SSE2_UNALIGNED(%rip), %rax
00db10
-	testl	$bit_Fast_Unaligned_Load, __cpu_features+FEATURE_OFFSET+index_Fast_Unaligned_Load(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	STRCAT_SSE2_UNALIGNED(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
00db10
 	jnz	2f
00db10
 	leaq	STRCAT_SSE2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	STRCAT_SSSE3(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strchr.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S
00db10
@@ -25,15 +25,13 @@
00db10
 	.text
00db10
 ENTRY(strchr)
00db10
 	.type	strchr, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__strchr_sse2(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__strchr_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	__strchr_sse42(%rip), %rax
00db10
 	ret
00db10
-2:	testl	$bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
00db10
+2:	HAS_ARCH_FEATURE (Slow_BSF)
00db10
 	jz	3f
00db10
 	leaq    __strchr_sse2_no_bsf(%rip), %rax
00db10
 3:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcmp.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S
00db10
@@ -83,16 +83,12 @@
00db10
 	.text
00db10
 ENTRY(STRCMP)
00db10
 	.type	STRCMP, @gnu_indirect_function
00db10
-	/* Manually inlined call to __get_cpu_features.  */
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 	leaq	STRCMP_SSE42(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jnz	2f
00db10
 	leaq	STRCMP_SSSE3(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	STRCMP_SSE2(%rip), %rax
00db10
 2:	ret
00db10
@@ -101,21 +97,17 @@ END(STRCMP)
00db10
 # ifdef USE_AS_STRCASECMP_L
00db10
 ENTRY(__strcasecmp)
00db10
 	.type	__strcasecmp, @gnu_indirect_function
00db10
-	/* Manually inlined call to __get_cpu_features.  */
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 #  ifdef HAVE_AVX_SUPPORT
00db10
 	leaq	__strcasecmp_avx(%rip), %rax
00db10
-	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
00db10
+	HAS_ARCH_FEATURE (AVX_Usable)
00db10
 	jnz	2f
00db10
 #  endif
00db10
 	leaq	__strcasecmp_sse42(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jnz	2f
00db10
 	leaq	__strcasecmp_ssse3(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	__strcasecmp_sse2(%rip), %rax
00db10
 2:	ret
00db10
@@ -125,21 +117,17 @@ weak_alias (__strcasecmp, strcasecmp)
00db10
 # ifdef USE_AS_STRNCASECMP_L
00db10
 ENTRY(__strncasecmp)
00db10
 	.type	__strncasecmp, @gnu_indirect_function
00db10
-	/* Manually inlined call to __get_cpu_features.  */
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
 #  ifdef HAVE_AVX_SUPPORT
00db10
 	leaq	__strncasecmp_avx(%rip), %rax
00db10
-	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
00db10
+	HAS_ARCH_FEATURE (AVX_Usable)
00db10
 	jnz	2f
00db10
 #  endif
00db10
 	leaq	__strncasecmp_sse42(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jnz	2f
00db10
 	leaq	__strncasecmp_ssse3(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	__strncasecmp_sse2(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcpy.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S
00db10
@@ -61,14 +61,12 @@
00db10
 	.text
00db10
 ENTRY(STRCPY)
00db10
 	.type	STRCPY, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	STRCPY_SSE2_UNALIGNED(%rip), %rax
00db10
-	testl	$bit_Fast_Unaligned_Load, __cpu_features+FEATURE_OFFSET+index_Fast_Unaligned_Load(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	STRCPY_SSE2_UNALIGNED(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
00db10
 	jnz	2f
00db10
 	leaq	STRCPY_SSE2(%rip), %rax
00db10
-	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jz	2f
00db10
 	leaq	STRCPY_SSSE3(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcspn.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S
00db10
@@ -45,11 +45,9 @@
00db10
 	.text
00db10
 ENTRY(STRCSPN)
00db10
 	.type	STRCSPN, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	STRCSPN_SSE2(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	STRCSPN_SSE2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	STRCSPN_SSE42(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strspn.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S
00db10
@@ -30,11 +30,9 @@
00db10
 	.text
00db10
 ENTRY(strspn)
00db10
 	.type	strspn, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__strspn_sse2(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__strspn_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	__strspn_sse42(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/test-multiarch.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c
00db10
@@ -75,12 +75,18 @@ do_test (int argc, char **argv)
00db10
   int fails;
00db10
 
00db10
   get_cpuinfo ();
00db10
-  fails = check_proc ("avx", HAS_AVX, "HAS_AVX");
00db10
-  fails += check_proc ("fma4", HAS_FMA4, "HAS_FMA4");
00db10
-  fails += check_proc ("sse4_2", HAS_SSE4_2, "HAS_SSE4_2");
00db10
-  fails += check_proc ("sse4_1", HAS_SSE4_1, "HAS_SSE4_1");
00db10
-  fails += check_proc ("ssse3", HAS_SSSE3, "HAS_SSSE3");
00db10
-  fails += check_proc ("popcnt", HAS_POPCOUNT, "HAS_POPCOUNT");
00db10
+  fails = check_proc ("avx", HAS_ARCH_FEATURE (AVX_Usable),
00db10
+		      "HAS_ARCH_FEATURE (AVX_Usable)");
00db10
+  fails += check_proc ("fma4", HAS_ARCH_FEATURE (FMA4_Usable),
00db10
+		       "HAS_ARCH_FEATURE (FMA4_Usable)");
00db10
+  fails += check_proc ("sse4_2", HAS_CPU_FEATURE (SSE4_2),
00db10
+		       "HAS_CPU_FEATURE (SSE4_2)");
00db10
+  fails += check_proc ("sse4_1", HAS_CPU_FEATURE (SSE4_1)
00db10
+		       , "HAS_CPU_FEATURE (SSE4_1)");
00db10
+  fails += check_proc ("ssse3", HAS_CPU_FEATURE (SSSE3),
00db10
+		       "HAS_CPU_FEATURE (SSSE3)");
00db10
+  fails += check_proc ("popcnt", HAS_CPU_FEATURE (POPCOUNT),
00db10
+		       "HAS_CPU_FEATURE (POPCOUNT)");
00db10
 
00db10
   printf ("%d differences between /proc/cpuinfo and glibc code.\n", fails);
00db10
 
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wcscpy.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S
00db10
@@ -27,11 +27,8 @@
00db10
 	.text
00db10
 ENTRY(wcscpy)
00db10
 	.type	wcscpy, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-
00db10
-1:	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	__wcscpy_sse2(%rip), %rax
00db10
 	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wmemcmp.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S
00db10
@@ -26,16 +26,13 @@
00db10
 	.text
00db10
 ENTRY(wmemcmp)
00db10
 	.type	wmemcmp, @gnu_indirect_function
00db10
-	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-
00db10
-1:	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	HAS_CPU_FEATURE (SSSE3)
00db10
 	jnz	2f
00db10
 	leaq	__wmemcmp_sse2(%rip), %rax
00db10
 	ret
00db10
 
00db10
-2:	testl	$bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip)
00db10
+2:	HAS_CPU_FEATURE (SSE4_1)
00db10
 	jz	3f
00db10
 	leaq	__wmemcmp_sse4_1(%rip), %rax
00db10
 	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/rawmemchr.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S
00db10
@@ -27,12 +27,10 @@
00db10
 	.text
00db10
 ENTRY(rawmemchr)
00db10
 	.type	rawmemchr, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	testl	$bit_Prefer_PMINUB_for_stringop, __cpu_features+FEATURE_OFFSET+index_Prefer_PMINUB_for_stringop(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	HAS_ARCH_FEATURE (Prefer_PMINUB_for_stringop)
00db10
 	jnz	2f
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	__rawmemchr_sse42(%rip), %rax
00db10
 	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S
00db10
@@ -29,18 +29,16 @@
00db10
 	.text
00db10
 ENTRY(strlen)
00db10
 	.type	strlen, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__strlen_sse2_pminub(%rip), %rax
00db10
-	testl	$bit_Prefer_PMINUB_for_stringop, __cpu_features+FEATURE_OFFSET+index_Prefer_PMINUB_for_stringop(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__strlen_sse2_pminub(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Prefer_PMINUB_for_stringop)
00db10
 	jnz	2f
00db10
 	leaq	__strlen_sse2(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	__strlen_sse42(%rip), %rax
00db10
 	ret
00db10
-2:	testl	$bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
00db10
+2:	HAS_ARCH_FEATURE (Slow_BSF)
00db10
 	jz	3f
00db10
 	leaq    __strlen_sse2_no_bsf(%rip), %rax
00db10
 3:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strnlen.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S
00db10
@@ -27,11 +27,9 @@
00db10
 	.text
00db10
 ENTRY(__strnlen)
00db10
 	.type	__strnlen, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__strnlen_sse2(%rip), %rax
00db10
-	testl	$bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__strnlen_sse2(%rip), %rax
00db10
+	HAS_ARCH_FEATURE (Slow_BSF)
00db10
 	jz	2f
00db10
 	leaq	__strnlen_sse2_no_bsf(%rip), %rax
00db10
 2:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strrchr.S
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S
00db10
@@ -28,15 +28,13 @@
00db10
 	.text
00db10
 ENTRY(strrchr)
00db10
 	.type	strrchr, @gnu_indirect_function
00db10
-	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
00db10
-	jne	1f
00db10
-	call	__init_cpu_features
00db10
-1:	leaq	__strrchr_sse2(%rip), %rax
00db10
-	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
00db10
+	LOAD_RTLD_GLOBAL_RO_RDX
00db10
+	leaq	__strrchr_sse2(%rip), %rax
00db10
+	HAS_CPU_FEATURE (SSE4_2)
00db10
 	jz	2f
00db10
 	leaq	__strrchr_sse42(%rip), %rax
00db10
 	ret
00db10
-2:	testl	$bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
00db10
+2:	HAS_ARCH_FEATURE (Slow_BSF)
00db10
 	jz	3f
00db10
 	leaq    __strrchr_sse2_no_bsf(%rip), %rax
00db10
 3:	ret
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcasestr-c.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c
00db10
@@ -12,8 +12,8 @@ extern __typeof (__strcasestr_sse2) __st
00db10
 
00db10
 #if 1
00db10
 libc_ifunc (__strcasestr,
00db10
-	    HAS_SSE4_2 && !use_unaligned_strstr () ? __strcasestr_sse42 :
00db10
-	    __strcasestr_sse2);
00db10
+	    HAS_CPU_FEATURE (SSE4_2) && !use_unaligned_strstr ()
00db10
+	    ? __strcasestr_sse42 : __strcasestr_sse2);
00db10
 #else
00db10
 libc_ifunc (__strcasestr,
00db10
 	    0 ? __strcasestr_sse42 : __strcasestr_sse2);
00db10
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strstr-c.c
00db10
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c
00db10
@@ -42,7 +42,7 @@ extern __typeof (__redirect_strstr) __st
00db10
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
00db10
    ifunc symbol properly.  */
00db10
 extern __typeof (__redirect_strstr) __libc_strstr;
00db10
-libc_ifunc (__libc_strstr, HAS_SSE4_2 ? (use_unaligned_strstr () ?
00db10
+libc_ifunc (__libc_strstr, HAS_CPU_FEATURE (SSE4_2) ? (use_unaligned_strstr () ?
00db10
 					 __strstr_sse2_unaligned :
00db10
 					 __strstr_sse42) : __strstr_sse2)
00db10