[02/56] S390: Use hwcap instead of dl_hwcap in ifunc-resolvers.

Message ID 1543593514-10251-3-git-send-email-stli@linux.ibm.com
State Superseded
Headers

Commit Message

Stefan Liebler Nov. 30, 2018, 3:57 p.m. UTC
  The renaming of hwcap arguments in ifunc-resolvers is needed
in order to prepare for further commits which refactors
ifunc handling for memset, memcmp, and memcpy.  Now you are able
to use s390_libc_ifunc_init which stores the stfle bits
within the expression for an ifunc-resolver generated by
s390_libc_ifunc_expr.

ChangeLog:

	* sysdeps/s390/multiarch/ifunc-resolve.h
	(s390_libc_ifunc_init, s390_libc_ifunc,
	s390_vx_libc_ifunc2_redirected): Use hwcap instead of dl_hwcap.
---
 sysdeps/s390/multiarch/ifunc-resolve.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Florian Weimer Nov. 30, 2018, 5:36 p.m. UTC | #1
* Stefan Liebler:

> +  if (__glibc_likely((hwcap & HWCAP_S390_STFLE)				\

Missing space before paren.  Since HWCAP_S390_STFLE 4 is four, this
__glibc_likely is actually equivalent to __glibc_unlikely, so perhaps
you should drop it.

Thanks,
Florian
  

Patch

diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h
index b42ed922fd..6139bd39c5 100644
--- a/sysdeps/s390/multiarch/ifunc-resolve.h
+++ b/sysdeps/s390/multiarch/ifunc-resolve.h
@@ -42,9 +42,9 @@ 
 		       : : "cc");
 #define s390_libc_ifunc_init()						\
   unsigned long long stfle_bits = 0ULL;					\
-  if (__glibc_likely((dl_hwcap & HWCAP_S390_STFLE)			\
-		     && (dl_hwcap & HWCAP_S390_ZARCH)			\
-		     && (dl_hwcap & HWCAP_S390_HIGH_GPRS)))		\
+  if (__glibc_likely((hwcap & HWCAP_S390_STFLE)				\
+		     && (hwcap & HWCAP_S390_ZARCH)			\
+		     && (hwcap & HWCAP_S390_HIGH_GPRS)))		\
     {									\
       S390_STORE_STFLE (stfle_bits);					\
     }
@@ -61,7 +61,7 @@ 
 	   : __glibc_likely (S390_IS_Z10 (stfle_bits))			\
 	     ? RESOLVERFUNC##_z10					\
 	     : RESOLVERFUNC##_default,					\
-	   unsigned long int dl_hwcap, s390_libc_ifunc_init);
+	   unsigned long int hwcap, s390_libc_ifunc_init);
 
 #define s390_vx_libc_ifunc(FUNC)		\
   s390_vx_libc_ifunc2_redirected(FUNC, FUNC, FUNC)
@@ -79,10 +79,10 @@ 
   extern __typeof (TYPE_FUNC) RESOLVERFUNC##_vx attribute_hidden;	\
   extern __typeof (TYPE_FUNC) RESOLVERFUNC##_c attribute_hidden;	\
   __ifunc (TYPE_FUNC, FUNC,						\
-	   (dl_hwcap & HWCAP_S390_VX)					\
+	   (hwcap & HWCAP_S390_VX)					\
 	   ? RESOLVERFUNC##_vx						\
 	   : RESOLVERFUNC##_c,						\
-	   unsigned long int dl_hwcap, s390_vx_libc_ifunc_init);
+	   unsigned long int hwcap, s390_vx_libc_ifunc_init);
 
 #define s390_libc_ifunc_expr_init()
 #define s390_libc_ifunc_expr(TYPE_FUNC, FUNC, EXPR)		\