Skip to content

Commit

Permalink
S390: Ifunc resolver macro for vector instructions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Stefan Liebler authored and Andreas Krebbel committed Aug 26, 2015
1 parent 4f0a1ce commit fd484e0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
19 changes: 19 additions & 0 deletions sysdeps/s390/multiarch/ifunc-resolve.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,22 @@
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");

0 comments on commit fd484e0

Please sign in to comment.