From 19c4bec0f43599eecc2f32de96ae179cd7d64053 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 2 May 2014 12:00:36 -0500 Subject: PowerPC: ifunc improvement for internal calls This patch changes de default symbol redirection for internal call of memcpy, memset, memchr, and strlen to the IFUNC resolved ones. The performance improvement is noticeable in algorithms that uses these symbols extensible, like the regex functions. --- sysdeps/powerpc/powerpc64/multiarch/memset.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'sysdeps/powerpc/powerpc64/multiarch/memset.c') diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c index 829d12759a..aa2ae7056e 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset.c +++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c @@ -18,18 +18,24 @@ /* Define multiple versions only for definition in libc. */ #if defined SHARED && !defined NOT_IN_libc +/* Redefine memset so that the compiler won't complain about the type + mismatch with the IFUNC selector in strong_alias, below. */ +# undef memset +# define memset __redirect_memset # include # include # include "init-arch.h" -extern __typeof (memset) __memset_ppc attribute_hidden; -extern __typeof (memset) __memset_power4 attribute_hidden; -extern __typeof (memset) __memset_power6 attribute_hidden; -extern __typeof (memset) __memset_power7 attribute_hidden; +extern __typeof (__redirect_memset) __libc_memset; + +extern __typeof (__redirect_memset) __memset_ppc attribute_hidden; +extern __typeof (__redirect_memset) __memset_power4 attribute_hidden; +extern __typeof (__redirect_memset) __memset_power6 attribute_hidden; +extern __typeof (__redirect_memset) __memset_power7 attribute_hidden; /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ -libc_ifunc (memset, +libc_ifunc (__libc_memset, (hwcap & PPC_FEATURE_HAS_VSX) ? __memset_power7 : (hwcap & PPC_FEATURE_ARCH_2_05) @@ -37,4 +43,8 @@ libc_ifunc (memset, (hwcap & PPC_FEATURE_POWER4) ? __memset_power4 : __memset_ppc); + +#undef memset +strong_alias (__libc_memset, memset); +libc_hidden_ver (__libc_memset, memset); #endif -- cgit 1.4.1