From 8ade3db78db17e0112648d302f98eda115949cd5 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Wed, 26 Aug 2015 10:26:21 +0200 Subject: 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. --- string/test-stpcpy.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'string') 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 , 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 +# 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" -- cgit 1.4.1