]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
S390: Ifunc resolver macro for vector instructions.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Wed, 26 Aug 2015 08:26:19 +0000 (10:26 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 26 Aug 2015 08:26:19 +0000 (10:26 +0200)
This patch introduces a s390 specific ifunc resolver macro for 32/64bit,
which chooses <func>_vx with vector instructions if HWCAP_S390_VX flag
in hwcaps is set or <func>_c if not.

ChangeLog:

* sysdeps/s390/multiarch/ifunc-resolve.h (s390_vx_libc_ifunc,
s390_vx_libc_ifunc2): New macro function.

ChangeLog
sysdeps/s390/multiarch/ifunc-resolve.h

index 19d089acc8db1e370cf86c98cd2dbb189ed2db99..930437857395369a3b654bc95f7a37fcd6dadbe0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-26  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * sysdeps/s390/multiarch/ifunc-resolve.h (s390_vx_libc_ifunc,
+       s390_vx_libc_ifunc2): New macro function.
+
 2015-08-26  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * config.h.in (HAVE_S390_VX_ASM_SUPPORT): New macro undefine.
index 491df68a61c346cb648bb1eaf0a9ff0f212f6acf..e9fd90e26bbae6e9175eada5bc2599b2c49e49fb 100644 (file)
     else                                                               \
       return &__##FUNC##_default;                                      \
   }
+
+#define s390_vx_libc_ifunc(FUNC)               \
+  s390_vx_libc_ifunc2(FUNC, FUNC)
+
+#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC)                                \
+  /* Make the declarations of the optimized functions hidden in order
+     to prevent GOT slots being generated for them.  */                        \
+  extern __typeof (FUNC) RESOLVERFUNC##_vx attribute_hidden;           \
+  extern __typeof (FUNC) RESOLVERFUNC##_c attribute_hidden;            \
+  extern void *__resolve_##RESOLVERFUNC (unsigned long int) __asm__ (#FUNC); \
+                                                                       \
+  void *__resolve_##RESOLVERFUNC (unsigned long int dl_hwcap)          \
+  {                                                                    \
+    if (dl_hwcap & HWCAP_S390_VX)                                      \
+      return &RESOLVERFUNC##_vx;                                       \
+    else                                                               \
+      return &RESOLVERFUNC##_c;                                                \
+  }                                                                    \
+ __asm__ (".type " #FUNC ", %gnu_indirect_function");