about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-02-05 17:35:12 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-02-27 10:00:37 -0300
commit81a14439417552324ec6ca71f65ddf8e7cdd51c7 (patch)
tree3300f5fec6acc1ef4c95c333bf165ebb51248f68 /sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
parent39ef07441910c2d2f8c02579e808862194b9a23b (diff)
downloadglibc-81a14439417552324ec6ca71f65ddf8e7cdd51c7.tar.gz
glibc-81a14439417552324ec6ca71f65ddf8e7cdd51c7.tar.xz
glibc-81a14439417552324ec6ca71f65ddf8e7cdd51c7.zip
wcsmbs: optimize wcscat
This patch rewrites wcscat using wcslen and wcscpy.  This is similar to
the optimization done on strcat by 6e46de42fe.

The strcpy changes are mainly to add the internal alias to avoid PLT
calls.

Checked on x86_64-linux-gnu and a build against the affected
architectures.

	* include/wchar.h (__wcscpy): New prototype.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
	(__wcscpy): Route internal symbol to generic implementation.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c (wcscpy):
	Add internal __wcscpy alias.
	* sysdeps/powerpc/powerpc64/multiarch/wcscpy.c (wcscpy): Likewise.
	* sysdeps/s390/wcscpy.c (wcscpy): Likewise.
	* sysdeps/x86_64/multiarch/wcscpy.c (wcscpy): Likewise.
	* wcsmbs/wcscpy.c (wcscpy): Add
	* sysdeps/x86_64/multiarch/wcscpy-c.c (WCSCPY): Adjust macro to
	use generic implementation.
	* wcsmbs/wcscat.c (wcscat): Rewrite using wcslen and wcscpy.
Diffstat (limited to 'sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c')
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
index ecca37d5d6..e87984669e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
@@ -17,20 +17,20 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
+# define wcscpy __redirect_wcscpy
 # include <wchar.h>
-# include <shlib-compat.h>
+# undef wcscpy
 # include "init-arch.h"
 
-extern __typeof (wcscpy) __wcscpy_ppc attribute_hidden;
-extern __typeof (wcscpy) __wcscpy_power6 attribute_hidden;
-extern __typeof (wcscpy) __wcscpy_power7 attribute_hidden;
+extern __typeof (__redirect_wcscpy) __wcscpy_ppc attribute_hidden;
+extern __typeof (__redirect_wcscpy) __wcscpy_power6 attribute_hidden;
+extern __typeof (__redirect_wcscpy) __wcscpy_power7 attribute_hidden;
 
-libc_ifunc (wcscpy,
-	     (hwcap & PPC_FEATURE_HAS_VSX)
-             ? __wcscpy_power7 :
-	       (hwcap & PPC_FEATURE_ARCH_2_05)
-	       ? __wcscpy_power6
-             : __wcscpy_ppc);
-#else
-#include <wcsmbs/wcscpy.c>
+libc_ifunc_redirected (__redirect_wcscpy, wcscpy,
+		       (hwcap & PPC_FEATURE_HAS_VSX)
+		       ? __wcscpy_power7 :
+			 (hwcap & PPC_FEATURE_ARCH_2_05)
+			 ? __wcscpy_power6
+		       : __wcscpy_ppc);
+weak_alias (wcscpy, __wcscpy)
 #endif