diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-03-29 21:53:54 -0500 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-03-29 21:53:54 -0500 |
commit | fd9206a6aaa3acd5f48922396878e24a6de90cef (patch) | |
tree | efaf692b608ef46bb3ffbb3e31f23eb13553c1e1 | |
parent | c65e47d572d510078cc5faae675bc9ed7f059577 (diff) | |
download | glibc-fd9206a6aaa3acd5f48922396878e24a6de90cef.tar.gz glibc-fd9206a6aaa3acd5f48922396878e24a6de90cef.tar.xz glibc-fd9206a6aaa3acd5f48922396878e24a6de90cef.zip |
PowerPC: memrchr multilib for PPC32
-rw-r--r-- | sysdeps/powerpc/powerpc32/multiarch/Makefile | 3 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c | 7 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/multiarch/memrchr-c.c | 7 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S (renamed from sysdeps/powerpc/powerpc32/power7/memrchr.S) | 6 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/multiarch/memrchr.c | 37 |
5 files changed, 55 insertions, 5 deletions
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile index 63ef4a6e37..7e091aef0d 100644 --- a/sysdeps/powerpc/powerpc32/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile @@ -6,5 +6,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \ strcasecmp-power7 strcasecmp_l-power7 \ strnlen-power7 strnlen-c \ mempcpy-power7 mempcpy-c \ - memchr-power7 memchr-c + memchr-power7 memchr-c \ + memrchr-power7 memrchr-c endif diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c index 49bdb50f2b..345855fd5c 100644 --- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c @@ -96,6 +96,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_ppc32)) + IFUNC_IMPL (i, name, memrchr, + IFUNC_IMPL_ADD (array, i, memrchr, + hwcap & PPC_FEATURE_HAS_VSX, + __memrchr_power7) + IFUNC_IMPL_ADD (array, i, memrchr, 1, + __memrchr_ppc32)) + IFUNC_IMPL (i, name, strlen, IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX, __strlen_power7) diff --git a/sysdeps/powerpc/powerpc32/multiarch/memrchr-c.c b/sysdeps/powerpc/powerpc32/multiarch/memrchr-c.c new file mode 100644 index 0000000000..3de758554a --- /dev/null +++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr-c.c @@ -0,0 +1,7 @@ +#ifndef NOT_IN_libc +# define MEMRCHR __memrchr_ppc32 +# include <string.h> +extern void *__memrchr_ppc32 (const void *, int, size_t); +#endif + +#include "string/memrchr.c" diff --git a/sysdeps/powerpc/powerpc32/power7/memrchr.S b/sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S index d1e3fda125..0aaf01788b 100644 --- a/sysdeps/powerpc/powerpc32/power7/memrchr.S +++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S @@ -21,7 +21,7 @@ /* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */ .machine power7 -ENTRY (__memrchr) +ENTRY (__memrchr_power7) CALL_MCOUNT dcbt 0,r3 mr r7,r3 @@ -170,6 +170,4 @@ L(loop_small): ble L(null) b L(loop_small) -END (__memrchr) -weak_alias (__memrchr, memrchr) -libc_hidden_builtin_def (memrchr) +END (__memrchr_power7) diff --git a/sysdeps/powerpc/powerpc32/multiarch/memrchr.c b/sysdeps/powerpc/powerpc32/multiarch/memrchr.c new file mode 100644 index 0000000000..b94267b995 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr.c @@ -0,0 +1,37 @@ +/* Multiple versions of memrchr. + Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef NOT_IN_libc +# include <string.h> +# include <shlib-compat.h> +# include "init-arch.h" + +extern __typeof (__memrchr) __memrchr_ppc32 attribute_hidden; +extern __typeof (__memrchr) __memrchr_power7 attribute_hidden; + +/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle + ifunc symbol properly. */ +libc_ifunc (__memrchr, + (hwcap & PPC_FEATURE_HAS_VSX) + ? __memrchr_power7 + : __memrchr_ppc32); + +weak_alias (__memrchr, memrchr) +#else +#include "string/memrchr.c" +#endif |