glibc/sysdeps
Stefan Liebler 4c01126896 S390: Implement mempcpy with help of memcpy. [BZ #19765]
There exist optimized memcpy functions on s390, but no optimized mempcpy.
This patch adds mempcpy entry points in memcpy.S files, which
use the memcpy implementation. Now mempcpy itself is also an IFUNC function
as memcpy is and the variants are listed in ifunc-impl-list.c.

The s390 string.h does not define _HAVE_STRING_ARCH_mempcpy.
Instead mempcpy string/string.h inlines memcpy() + n.
If n is constant and small enough, GCC emits instructions like mvi or mvc
and avoids the function call to memcpy.
If n is not constant, then memcpy is called and n is added afterwards.
If _HAVE_STRING_ARCH_mempcpy would be defined, mempcpy would be called in
every case.

According to PR70140 "Inefficient expansion of __builtin_mempcpy"
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70140) GCC should handle a
call to mempcpy in the same way as memcpy. Then either the mempcpy macro
in string/string.h has to be removed or _HAVE_STRING_ARCH_mempcpy has to
be defined for S390.

ChangeLog:

	[BZ #19765]
	* sysdeps/s390/mempcpy.S: New File.
	* sysdeps/s390/multiarch/mempcpy.c: Likewise.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add mempcpy.
	* sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Add mempcpy variants.
	* sysdeps/s390/s390-32/memcpy.S: Add mempcpy entry point.
	(memcpy): Adjust to be usable from mempcpy entry point.
	(__memcpy_mvcle): Likewise.
	* sysdeps/s390/s390-64/memcpy.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Add entry points
	____mempcpy_z196, ____mempcpy_z10 and add __GI_ symbols for mempcpy.
	(__memcpy_z196): Adjust to be usable from mempcpy entry point.
	(__memcpy_z10): Likewise.
	* sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Likewise.
2016-05-24 10:39:13 +02:00
..
aarch64 This is an optimized memset for AArch64. Memset is split into 4 main cases: 2016-05-12 16:44:53 +01:00
alpha Update Alpha libm-test-ulps 2016-01-25 10:43:41 -08:00
arm Fix building glibc master with NDEBUG and --with-cpu. 2016-03-15 23:23:24 -04:00
generic Fix crash on getauxval call without HAVE_AUX_VECTOR 2016-04-10 23:58:43 +02:00
gnu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hppa hppa: fix dladdr [BZ #19415] 2016-01-08 02:19:26 -05:00
i386 Call init_cpu_features only if SHARED is defined 2016-05-13 08:29:33 -07:00
ia64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ieee754 Implement proper fmal for ldbl-128ibm (bug 13304). 2016-05-19 20:10:56 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k m68k: use large PIC model for gcrt1.o 2016-04-30 18:51:43 +02:00
mach Make padding in struct sockaddr_storage explicit [BZ #20111] 2016-05-23 19:43:09 +02:00
microblaze Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mips Fix MIPS64 memcpy regression. 2016-01-28 01:52:05 +00:00
nacl Fix build with HAVE_AUX_VECTOR 2016-04-11 10:27:25 +02:00
nios2 Maintainence patch for nios2: update ULPS file and localplt.data changes. 2016-01-21 22:58:03 -08:00
nptl Increase fork signal safety for single-threaded processes [BZ #19703] 2016-05-12 15:26:55 +02:00
posix getaddrinfo: Convert from extend_alloca to struct scratch_buffer 2016-05-12 14:07:56 +02:00
powerpc powerpc: Fix operand prefixes 2016-05-04 09:14:52 -03:00
pthread Revert "aio: fix newp->running data race" 2016-05-04 15:52:30 +02:00
s390 S390: Implement mempcpy with help of memcpy. [BZ #19765] 2016-05-24 10:39:13 +02:00
sh Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sparc Add _STRING_INLINE_unaligned and string_private.h 2016-02-18 14:55:29 -02:00
tile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unix Make padding in struct sockaddr_storage explicit [BZ #20111] 2016-05-23 19:43:09 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x86 Remove special L2 cache case for Knights Landing 2016-05-20 14:42:00 -07:00
x86_64 Remove alignments on jump targets in memset 2016-05-19 08:49:55 -07:00