diff options
author | Stefan Liebler <stli@linux.vnet.ibm.com> | 2015-08-26 10:26:21 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-08-26 10:26:21 +0200 |
commit | 8ade3db78db17e0112648d302f98eda115949cd5 (patch) | |
tree | 787e1a2e0d2dd3bc7ad4d7bf067ebb39ec760c05 /string | |
parent | S390: Optimize strcpy and wcscpy. (diff) | |
download | glibc-8ade3db78db17e0112648d302f98eda115949cd5.tar.gz glibc-8ade3db78db17e0112648d302f98eda115949cd5.tar.bz2 glibc-8ade3db78db17e0112648d302f98eda115949cd5.zip |
S390: Optimize stpcpy and wcpcpy.
This patch provides optimized versions of stpcpy and wcpcpy with the z13
vector instructions.
ChangeLog:
* sysdeps/s390/multiarch/stpcpy-c.c: New File.
* sysdeps/s390/multiarch/stpcpy-vx.S: Likewise.
* sysdeps/s390/multiarch/stpcpy.c: Likewise.
* sysdeps/s390/multiarch/wcpcpy-c.c: Likewise.
* sysdeps/s390/multiarch/wcpcpy-vx.S: Likewise.
* sysdeps/s390/multiarch/wcpcpy.c: Likewise.
* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add stpcpy and
wcpcpy functions.
* string/stpcpy.c: Use STPCPY if defined.
* wcsmbs/wcpcpy.c: Use WCPCPY if defined.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add ifunc test for stpcpy, wcpcpy.
* string/test-stpcpy.c: Add wcpcpy support.
* wcsmbs/test-wcpcpy.c: New File.
* wcsmbs/Makefile (strop-tests): Add wcpcpy.
* benchtests/bench-stpcpy.c: Add wcpcpy support.
* benchtests/bench-wcpcpy.c: New File.
* benchtests/Makefile (wcsmbs-bench): Add wcpcpy.
Diffstat (limited to 'string')
-rw-r--r-- | string/test-stpcpy.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/string/test-stpcpy.c b/string/test-stpcpy.c index 3d138d9cae..7336834493 100644 --- a/string/test-stpcpy.c +++ b/string/test-stpcpy.c @@ -1,4 +1,4 @@ -/* Test and measure stpcpy functions. +/* Test stpcpy functions. Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -19,19 +19,34 @@ #define STRCPY_RESULT(dst, len) ((dst) + (len)) #define TEST_MAIN -#define TEST_NAME "stpcpy" +#ifndef WIDE +# define TEST_NAME "stpcpy" +#else +# define TEST_NAME "wcpcpy" +#endif /* !WIDE */ #include "test-string.h" - -char *simple_stpcpy (char *, const char *); - -IMPL (simple_stpcpy, 0) -IMPL (stpcpy, 1) - -char * -simple_stpcpy (char *dst, const char *src) +#ifndef WIDE +# define CHAR char +# define SIMPLE_STPCPY simple_stpcpy +# define STPCPY stpcpy +#else +# include <wchar.h> +# define CHAR wchar_t +# define SIMPLE_STPCPY simple_wcpcpy +# define STPCPY wcpcpy +#endif /* !WIDE */ + +CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *); + +IMPL (SIMPLE_STPCPY, 0) +IMPL (STPCPY, 1) + +CHAR * +SIMPLE_STPCPY (CHAR *dst, const CHAR *src) { while ((*dst++ = *src++) != '\0'); return dst - 1; } +#undef CHAR #include "test-strcpy.c" |