1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Stefan Liebler
2015-08-26 10:26:21 +02:00
committed by Andreas Krebbel
parent 680df122ab
commit 8ade3db78d
16 changed files with 455 additions and 18 deletions

View File

@ -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"
#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 *);
CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *);
IMPL (simple_stpcpy, 0)
IMPL (stpcpy, 1)
IMPL (SIMPLE_STPCPY, 0)
IMPL (STPCPY, 1)
char *
simple_stpcpy (char *dst, const char *src)
CHAR *
SIMPLE_STPCPY (CHAR *dst, const CHAR *src)
{
while ((*dst++ = *src++) != '\0');
return dst - 1;
}
#undef CHAR
#include "test-strcpy.c"