wcsmbs: optimize wcscat

System Internals / glibc - Adhemerval Zanella [linaro.org] - 27 February 2019 13:00 EST

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.

81a1443941 wcsmbs: optimize wcscat
ChangeLog | 13 +++++++++++
include/wchar.h | 4 ++++
.../powerpc32/power4/multiarch/wcscpy-ppc32.c | 9 ++++----
.../powerpc/powerpc32/power4/multiarch/wcscpy.c | 24 ++++++++++-----------
sysdeps/powerpc/powerpc64/multiarch/wcscpy.c | 25 +++++++++++-----------
sysdeps/s390/wcscpy.c | 4 +++-
sysdeps/x86_64/multiarch/wcscpy-c.c | 4 ++--
sysdeps/x86_64/multiarch/wcscpy.c | 11 +++++++---
wcsmbs/wcscat.c | 21 +-----------------
wcsmbs/wcscpy.c | 10 ++++++---
10 files changed, 67 insertions(+), 58 deletions(-)

Upstream: sourceware.org


  • Share