mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 20:51:11 +00:00
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.
This commit is contained in:
parent
7776e6692f
commit
19c4bec0f4
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
2014-05-04 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||
|
||||
* sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c
|
||||
[libc_hidden_builtin_def]: Define to empty value.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S:
|
||||
[libc_hidden_builtin_def]: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S:
|
||||
[libc_hidden_builtin_def]: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S:
|
||||
[libc_hidden_builtin_def]: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy.c (memcpy): Redefined to
|
||||
__redirect_memcpy and define ifunc as default hidden symbol.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memset.c (memset): Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/strlen.c (strlen): Likewise.
|
||||
|
||||
2014-05-04 Adam Conrad <adconrad@0c3.net>
|
||||
|
||||
* locale/iso-4217.def: Reintroduce XDR currency.
|
||||
|
@ -25,8 +25,7 @@
|
||||
|
||||
#ifdef SHARED
|
||||
# undef libc_hidden_builtin_def
|
||||
# define libc_hidden_builtin_def(name) \
|
||||
__hidden_ver1 (__memchr_ppc, __GI_memchr, __memchr_ppc);
|
||||
# define libc_hidden_builtin_def(name)
|
||||
#endif
|
||||
|
||||
extern __typeof (memchr) __memchr_ppc attribute_hidden;
|
||||
|
@ -36,8 +36,7 @@
|
||||
END_2(__memcpy_ppc)
|
||||
|
||||
# undef libc_hidden_builtin_def
|
||||
# define libc_hidden_builtin_def(name) \
|
||||
.globl __GI_memcpy; __GI_memcpy = __memcpy_ppc
|
||||
# define libc_hidden_builtin_def(name)
|
||||
#endif
|
||||
|
||||
#include <sysdeps/powerpc/powerpc64/memcpy.S>
|
||||
|
@ -20,20 +20,23 @@
|
||||
DSO. In static binaries we need memcpy before the initialization
|
||||
happened. */
|
||||
#if defined SHARED && !defined NOT_IN_libc
|
||||
/* Redefine memcpy so that the compiler won't complain about the type
|
||||
mismatch with the IFUNC selector in strong_alias, below. */
|
||||
# undef memcpy
|
||||
# define memcpy __redirect_memcpy
|
||||
# include <string.h>
|
||||
# include <shlib-compat.h>
|
||||
# include "init-arch.h"
|
||||
|
||||
extern __typeof (memcpy) __memcpy_ppc attribute_hidden;
|
||||
extern __typeof (memcpy) __memcpy_power4 attribute_hidden;
|
||||
extern __typeof (memcpy) __memcpy_cell attribute_hidden;
|
||||
extern __typeof (memcpy) __memcpy_power6 attribute_hidden;
|
||||
extern __typeof (memcpy) __memcpy_a2 attribute_hidden;
|
||||
extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __libc_memcpy;
|
||||
|
||||
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
||||
ifunc symbol properly. */
|
||||
libc_ifunc (memcpy,
|
||||
extern __typeof (__redirect_memcpy) __memcpy_ppc attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __memcpy_power4 attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __memcpy_cell attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __memcpy_power6 attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __memcpy_a2 attribute_hidden;
|
||||
extern __typeof (__redirect_memcpy) __memcpy_power7 attribute_hidden;
|
||||
|
||||
libc_ifunc (__libc_memcpy,
|
||||
(hwcap & PPC_FEATURE_HAS_VSX)
|
||||
? __memcpy_power7 :
|
||||
(hwcap & PPC_FEATURE_ARCH_2_06)
|
||||
@ -45,4 +48,8 @@ libc_ifunc (memcpy,
|
||||
(hwcap & PPC_FEATURE_POWER4)
|
||||
? __memcpy_power4
|
||||
: __memcpy_ppc);
|
||||
|
||||
#undef memcpy
|
||||
strong_alias (__libc_memcpy, memcpy);
|
||||
libc_hidden_ver (__libc_memcpy, memcpy);
|
||||
#endif
|
||||
|
@ -47,8 +47,7 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
|
||||
END_2(__memset_ppc)
|
||||
|
||||
# undef libc_hidden_builtin_def
|
||||
# define libc_hidden_builtin_def(name) \
|
||||
.globl __GI_memset; __GI_memset = __memset_ppc
|
||||
# define libc_hidden_builtin_def(name)
|
||||
#endif
|
||||
|
||||
/* Do not implement __bzero at powerpc64/memset.S. */
|
||||
|
@ -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 <string.h>
|
||||
# include <shlib-compat.h>
|
||||
# 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
|
||||
|
@ -35,8 +35,7 @@
|
||||
END_2(__strlen_ppc)
|
||||
|
||||
# undef libc_hidden_builtin_def
|
||||
# define libc_hidden_builtin_def(name) \
|
||||
.globl __GI_strlen; __GI_strlen = __strlen_ppc
|
||||
# define libc_hidden_builtin_def(name)
|
||||
#endif
|
||||
|
||||
#include <sysdeps/powerpc/powerpc64/strlen.S>
|
||||
|
@ -17,15 +17,25 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if defined SHARED && !defined NOT_IN_libc
|
||||
/* Redefine strlen so that the compiler won't complain about the type
|
||||
mismatch with the IFUNC selector in strong_alias, below. */
|
||||
# undef strlen
|
||||
# define strlen __redirect_strlen
|
||||
# include <string.h>
|
||||
# include <shlib-compat.h>
|
||||
# include "init-arch.h"
|
||||
|
||||
extern __typeof (strlen) __strlen_ppc attribute_hidden;
|
||||
extern __typeof (strlen) __strlen_power7 attribute_hidden;
|
||||
extern __typeof (__redirect_strlen) __libc_strlen;
|
||||
|
||||
libc_ifunc (strlen,
|
||||
extern __typeof (__redirect_strlen) __strlen_ppc attribute_hidden;
|
||||
extern __typeof (__redirect_strlen) __strlen_power7 attribute_hidden;
|
||||
|
||||
libc_ifunc (__libc_strlen,
|
||||
(hwcap & PPC_FEATURE_HAS_VSX)
|
||||
? __strlen_power7
|
||||
: __strlen_ppc);
|
||||
|
||||
#undef strlen
|
||||
strong_alias (__libc_strlen, strlen)
|
||||
libc_hidden_ver (__libc_strlen, strlen)
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user