|
|
077c9d |
commit df3eb8de31a530f285f54f3c41cd7b636816c062
|
|
|
077c9d |
Author: Stefan Liebler <stli@linux.ibm.com>
|
|
|
077c9d |
Date: Tue Dec 18 13:57:06 2018 +0100
|
|
|
077c9d |
|
|
|
077c9d |
S390: Unify 31/64bit memcpy.
|
|
|
077c9d |
|
|
|
077c9d |
The implementation of memcpy/mempcpy for s390-32 (31bit)
|
|
|
077c9d |
and s390-64 (64bit) is nearly the same.
|
|
|
077c9d |
This patch unifies it for maintability reasons.
|
|
|
077c9d |
|
|
|
077c9d |
__mem[p]cpy_z10 and __mem[p]cpy_z196 differs between 31 and 64bit:
|
|
|
077c9d |
-31bit needs .machinemode "zarch_nohighgprs" and llgfr %r4,%r4
|
|
|
077c9d |
-lr vs lgr; lgr can be also used on 31bit as this ifunc variant
|
|
|
077c9d |
is only called if we are on a zarch machine.
|
|
|
077c9d |
|
|
|
077c9d |
__mem[p]cpy_default differs between 31 and 64bit:
|
|
|
077c9d |
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
|
|
|
077c9d |
Solved with 31/64 specific instruction macros).
|
|
|
077c9d |
-The address of mvc instruction is setup in different ways
|
|
|
077c9d |
(larl vs bras). Solved with #if defined __s390x__.
|
|
|
077c9d |
|
|
|
077c9d |
__memcpy_mvcle differs between 31 and 64bit:
|
|
|
077c9d |
-lr vs lgr; ahi vs aghi;
|
|
|
077c9d |
Solved with 31/64bit specific instruction macros.
|
|
|
077c9d |
|
|
|
077c9d |
Otherwise 31/64bit implementation has the same structure of the code.
|
|
|
077c9d |
|
|
|
077c9d |
ChangeLog:
|
|
|
077c9d |
|
|
|
077c9d |
* sysdeps/s390/s390-64/memcpy.S: Move to ...
|
|
|
077c9d |
* sysdeps/s390/memcpy.S: ... here.
|
|
|
077c9d |
Adjust to be usable for 31/64bit.
|
|
|
077c9d |
* sysdeps/s390/s390-32/memcpy.S: Delete File.
|
|
|
077c9d |
* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memcpy.
|
|
|
077c9d |
* sysdeps/s390/s390-32/multiarch/Makefile: Delete file.
|
|
|
077c9d |
* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
|
|
|
077c9d |
* sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Move to ...
|
|
|
077c9d |
* sysdeps/s390/multiarch/memcpy-s390x.S: ... here.
|
|
|
077c9d |
Adjust to be usable for 31/64bit.
|
|
|
077c9d |
* sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Delete File.
|
|
|
077c9d |
* sysdeps/s390/s390-64/multiarch/memcpy.c: Move to ...
|
|
|
077c9d |
* sysdeps/s390/multiarch/memcpy.c: ... here.
|
|
|
077c9d |
* sysdeps/s390/s390-32/multiarch/memcpy.c: Delete File.
|
|
|
077c9d |
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-64/memcpy.S b/sysdeps/s390/memcpy.S
|
|
|
077c9d |
similarity index 52%
|
|
|
077c9d |
rename from sysdeps/s390/s390-64/memcpy.S
|
|
|
077c9d |
rename to sysdeps/s390/memcpy.S
|
|
|
077c9d |
index 2e5490df23d64325..2a6c6b750377c7bb 100644
|
|
|
077c9d |
--- a/sysdeps/s390/s390-64/memcpy.S
|
|
|
077c9d |
+++ b/sysdeps/s390/memcpy.S
|
|
|
077c9d |
@@ -1,4 +1,4 @@
|
|
|
077c9d |
-/* memcpy - copy a block from source to destination. 64 bit S/390 version.
|
|
|
077c9d |
+/* memcpy - copy a block from source to destination. 31/64 bit S/390 version.
|
|
|
077c9d |
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
This file is part of the GNU C Library.
|
|
|
077c9d |
|
|
|
077c9d |
@@ -25,13 +25,31 @@
|
|
|
077c9d |
%r3 = address of source memory area
|
|
|
077c9d |
%r4 = number of bytes to copy. */
|
|
|
077c9d |
|
|
|
077c9d |
-
|
|
|
077c9d |
.text
|
|
|
077c9d |
+
|
|
|
077c9d |
+#if defined __s390x__
|
|
|
077c9d |
+# define LTGR ltgr
|
|
|
077c9d |
+# define CGHI cghi
|
|
|
077c9d |
+# define LGR lgr
|
|
|
077c9d |
+# define AGHI aghi
|
|
|
077c9d |
+# define BRCTG brctg
|
|
|
077c9d |
+#else
|
|
|
077c9d |
+# define LTGR ltr
|
|
|
077c9d |
+# define CGHI chi
|
|
|
077c9d |
+# define LGR lr
|
|
|
077c9d |
+# define AGHI ahi
|
|
|
077c9d |
+# define BRCTG brct
|
|
|
077c9d |
+#endif /* ! defined __s390x__ */
|
|
|
077c9d |
+
|
|
|
077c9d |
ENTRY(__mempcpy)
|
|
|
077c9d |
+#if defined __s390x__
|
|
|
077c9d |
.machine "z900"
|
|
|
077c9d |
- lgr %r1,%r2 # Use as dest
|
|
|
077c9d |
+#else
|
|
|
077c9d |
+ .machine "g5"
|
|
|
077c9d |
+#endif /* ! defined __s390x__ */
|
|
|
077c9d |
+ LGR %r1,%r2 # Use as dest
|
|
|
077c9d |
la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
- j .L_Z900_start
|
|
|
077c9d |
+ j .L_Z900_G5_start
|
|
|
077c9d |
END(__mempcpy)
|
|
|
077c9d |
#ifndef USE_MULTIARCH
|
|
|
077c9d |
libc_hidden_def (__mempcpy)
|
|
|
077c9d |
@@ -40,30 +58,46 @@ libc_hidden_builtin_def (mempcpy)
|
|
|
077c9d |
#endif
|
|
|
077c9d |
|
|
|
077c9d |
ENTRY(memcpy)
|
|
|
077c9d |
+#if defined __s390x__
|
|
|
077c9d |
.machine "z900"
|
|
|
077c9d |
- lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
-.L_Z900_start:
|
|
|
077c9d |
- ltgr %r4,%r4
|
|
|
077c9d |
- je .L_Z900_4
|
|
|
077c9d |
- aghi %r4,-1
|
|
|
077c9d |
- srlg %r5,%r4,8
|
|
|
077c9d |
- ltgr %r5,%r5
|
|
|
077c9d |
- jne .L_Z900_13
|
|
|
077c9d |
-.L_Z900_3:
|
|
|
077c9d |
- larl %r5,.L_Z900_15
|
|
|
077c9d |
- ex %r4,0(%r5)
|
|
|
077c9d |
-.L_Z900_4:
|
|
|
077c9d |
+#else
|
|
|
077c9d |
+ .machine "g5"
|
|
|
077c9d |
+#endif /* ! defined __s390x__ */
|
|
|
077c9d |
+ LGR %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
+.L_Z900_G5_start:
|
|
|
077c9d |
+ LTGR %r4,%r4
|
|
|
077c9d |
+ je .L_Z900_G5_4
|
|
|
077c9d |
+ AGHI %r4,-1
|
|
|
077c9d |
+#if defined __s390x__
|
|
|
077c9d |
+ srlg %r5,%r4,8
|
|
|
077c9d |
+#else
|
|
|
077c9d |
+ lr %r5,%r4
|
|
|
077c9d |
+ srl %r5,8
|
|
|
077c9d |
+#endif /* ! defined __s390x__ */
|
|
|
077c9d |
+ LTGR %r5,%r5
|
|
|
077c9d |
+ jne .L_Z900_G5_13
|
|
|
077c9d |
+.L_Z900_G5_3:
|
|
|
077c9d |
+#if defined __s390x__
|
|
|
077c9d |
+ larl %r5,.L_Z900_G5_15
|
|
|
077c9d |
+# define Z900_G5_EX_D 0
|
|
|
077c9d |
+#else
|
|
|
077c9d |
+ basr %r5,0
|
|
|
077c9d |
+.L_Z900_G5_14:
|
|
|
077c9d |
+# define Z900_G5_EX_D .L_Z900_G5_15-.L_Z900_G5_14
|
|
|
077c9d |
+#endif /* ! defined __s390x__ */
|
|
|
077c9d |
+ ex %r4,Z900_G5_EX_D(%r5)
|
|
|
077c9d |
+.L_Z900_G5_4:
|
|
|
077c9d |
br %r14
|
|
|
077c9d |
-.L_Z900_13:
|
|
|
077c9d |
- cghi %r5,4096 # Switch to mvcle for copies >1MB
|
|
|
077c9d |
+.L_Z900_G5_13:
|
|
|
077c9d |
+ CGHI %r5,4096 # Switch to mvcle for copies >1MB
|
|
|
077c9d |
jh __memcpy_mvcle
|
|
|
077c9d |
-.L_Z900_12:
|
|
|
077c9d |
+.L_Z900_G5_12:
|
|
|
077c9d |
mvc 0(256,%r1),0(%r3)
|
|
|
077c9d |
la %r1,256(%r1)
|
|
|
077c9d |
la %r3,256(%r3)
|
|
|
077c9d |
- brctg %r5,.L_Z900_12
|
|
|
077c9d |
- j .L_Z900_3
|
|
|
077c9d |
-.L_Z900_15:
|
|
|
077c9d |
+ BRCTG %r5,.L_Z900_G5_12
|
|
|
077c9d |
+ j .L_Z900_G5_3
|
|
|
077c9d |
+.L_Z900_G5_15:
|
|
|
077c9d |
mvc 0(1,%r1),0(%r3)
|
|
|
077c9d |
END(memcpy)
|
|
|
077c9d |
#ifndef USE_MULTIARCH
|
|
|
077c9d |
@@ -74,15 +108,21 @@ ENTRY(__memcpy_mvcle)
|
|
|
077c9d |
# Using as standalone function will result in unexpected
|
|
|
077c9d |
# results since the length field is incremented by 1 in order to
|
|
|
077c9d |
# compensate the changes already done in the functions above.
|
|
|
077c9d |
- lgr %r0,%r2 # backup return dest [ + n ]
|
|
|
077c9d |
- aghi %r4,1 # length + 1
|
|
|
077c9d |
- lgr %r5,%r4 # source length
|
|
|
077c9d |
- lgr %r4,%r3 # source address
|
|
|
077c9d |
- lgr %r2,%r1 # destination address
|
|
|
077c9d |
- lgr %r3,%r5 # destination length = source length
|
|
|
077c9d |
+ LGR %r0,%r2 # backup return dest [ + n ]
|
|
|
077c9d |
+ AGHI %r4,1 # length + 1
|
|
|
077c9d |
+ LGR %r5,%r4 # source length
|
|
|
077c9d |
+ LGR %r4,%r3 # source address
|
|
|
077c9d |
+ LGR %r2,%r1 # destination address
|
|
|
077c9d |
+ LGR %r3,%r5 # destination length = source length
|
|
|
077c9d |
.L_MVCLE_1:
|
|
|
077c9d |
mvcle %r2,%r4,0 # thats it, MVCLE is your friend
|
|
|
077c9d |
jo .L_MVCLE_1
|
|
|
077c9d |
- lgr %r2,%r0 # return destination address
|
|
|
077c9d |
+ LGR %r2,%r0 # return destination address
|
|
|
077c9d |
br %r14
|
|
|
077c9d |
END(__memcpy_mvcle)
|
|
|
077c9d |
+
|
|
|
077c9d |
+#undef LTGR
|
|
|
077c9d |
+#undef CGHI
|
|
|
077c9d |
+#undef LGR
|
|
|
077c9d |
+#undef AGHI
|
|
|
077c9d |
+#undef BRCTG
|
|
|
077c9d |
diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile
|
|
|
077c9d |
index c893ebc5659fd4ae..3cbd5fad69e355a5 100644
|
|
|
077c9d |
--- a/sysdeps/s390/multiarch/Makefile
|
|
|
077c9d |
+++ b/sysdeps/s390/multiarch/Makefile
|
|
|
077c9d |
@@ -19,7 +19,7 @@ sysdep_routines += strlen strlen-vx strlen-c \
|
|
|
077c9d |
rawmemchr rawmemchr-vx rawmemchr-c \
|
|
|
077c9d |
memccpy memccpy-vx memccpy-c \
|
|
|
077c9d |
memrchr memrchr-vx memrchr-c \
|
|
|
077c9d |
- mempcpy
|
|
|
077c9d |
+ mempcpy memcpy memcpy-s390x
|
|
|
077c9d |
endif
|
|
|
077c9d |
|
|
|
077c9d |
ifeq ($(subdir),wcsmbs)
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S b/sysdeps/s390/multiarch/memcpy-s390x.S
|
|
|
077c9d |
similarity index 89%
|
|
|
077c9d |
rename from sysdeps/s390/s390-64/multiarch/memcpy-s390x.S
|
|
|
077c9d |
rename to sysdeps/s390/multiarch/memcpy-s390x.S
|
|
|
077c9d |
index 6d60a70834c32120..b38caac72b8742e6 100644
|
|
|
077c9d |
--- a/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S
|
|
|
077c9d |
+++ b/sysdeps/s390/multiarch/memcpy-s390x.S
|
|
|
077c9d |
@@ -1,4 +1,4 @@
|
|
|
077c9d |
-/* CPU specific memcpy implementations. 64 bit S/390 version.
|
|
|
077c9d |
+/* CPU specific memcpy implementations. 31/64 bit S/390 version.
|
|
|
077c9d |
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
This file is part of the GNU C Library.
|
|
|
077c9d |
|
|
|
077c9d |
@@ -31,6 +31,7 @@
|
|
|
077c9d |
|
|
|
077c9d |
ENTRY(____mempcpy_z196)
|
|
|
077c9d |
.machine "z196"
|
|
|
077c9d |
+ .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
lgr %r1,%r2 # Use as dest
|
|
|
077c9d |
la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
j .L_Z196_start
|
|
|
077c9d |
@@ -38,8 +39,12 @@ END(____mempcpy_z196)
|
|
|
077c9d |
|
|
|
077c9d |
ENTRY(__memcpy_z196)
|
|
|
077c9d |
.machine "z196"
|
|
|
077c9d |
+ .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
.L_Z196_start:
|
|
|
077c9d |
+# if !defined __s390x__
|
|
|
077c9d |
+ llgfr %r4,%r4
|
|
|
077c9d |
+# endif /* !defined __s390x__ */
|
|
|
077c9d |
ltgr %r4,%r4
|
|
|
077c9d |
je .L_Z196_4
|
|
|
077c9d |
aghi %r4,-1
|
|
|
077c9d |
@@ -68,6 +73,7 @@ END(__memcpy_z196)
|
|
|
077c9d |
|
|
|
077c9d |
ENTRY(____mempcpy_z10)
|
|
|
077c9d |
.machine "z10"
|
|
|
077c9d |
+ .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
lgr %r1,%r2 # Use as dest
|
|
|
077c9d |
la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
j .L_Z10_start
|
|
|
077c9d |
@@ -75,8 +81,12 @@ END(____mempcpy_z10)
|
|
|
077c9d |
|
|
|
077c9d |
ENTRY(__memcpy_z10)
|
|
|
077c9d |
.machine "z10"
|
|
|
077c9d |
+ .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
.L_Z10_start:
|
|
|
077c9d |
+# if !defined __s390x__
|
|
|
077c9d |
+ llgfr %r4,%r4
|
|
|
077c9d |
+# endif /* !defined __s390x__ */
|
|
|
077c9d |
cgije %r4,0,.L_Z10_4
|
|
|
077c9d |
aghi %r4,-1
|
|
|
077c9d |
srlg %r5,%r4,8
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.c b/sysdeps/s390/multiarch/memcpy.c
|
|
|
077c9d |
similarity index 100%
|
|
|
077c9d |
rename from sysdeps/s390/s390-32/multiarch/memcpy.c
|
|
|
077c9d |
rename to sysdeps/s390/multiarch/memcpy.c
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-32/memcpy.S b/sysdeps/s390/s390-32/memcpy.S
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index 493cc18aba67d6ec..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-32/memcpy.S
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,89 +0,0 @@
|
|
|
077c9d |
-/* memcpy - copy a block from source to destination. S/390 version.
|
|
|
077c9d |
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
- This file is part of the GNU C Library.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
077c9d |
- modify it under the terms of the GNU Lesser General Public
|
|
|
077c9d |
- License as published by the Free Software Foundation; either
|
|
|
077c9d |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
077c9d |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
077c9d |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
077c9d |
- Lesser General Public License for more details.
|
|
|
077c9d |
-
|
|
|
077c9d |
- You should have received a copy of the GNU Lesser General Public
|
|
|
077c9d |
- License along with the GNU C Library; if not, see
|
|
|
077c9d |
- <http://www.gnu.org/licenses/>. */
|
|
|
077c9d |
-
|
|
|
077c9d |
-
|
|
|
077c9d |
-#include "sysdep.h"
|
|
|
077c9d |
-#include "asm-syntax.h"
|
|
|
077c9d |
-
|
|
|
077c9d |
-/* INPUT PARAMETERS
|
|
|
077c9d |
- %r2 = address of destination memory area
|
|
|
077c9d |
- %r3 = address of source memory area
|
|
|
077c9d |
- %r4 = number of bytes to copy. */
|
|
|
077c9d |
-
|
|
|
077c9d |
- .text
|
|
|
077c9d |
-ENTRY(__mempcpy)
|
|
|
077c9d |
- .machine "g5"
|
|
|
077c9d |
- lr %r1,%r2 # Use as dest
|
|
|
077c9d |
- la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
- j .L_G5_start
|
|
|
077c9d |
-END(__mempcpy)
|
|
|
077c9d |
-#ifndef USE_MULTIARCH
|
|
|
077c9d |
-libc_hidden_def (__mempcpy)
|
|
|
077c9d |
-weak_alias (__mempcpy, mempcpy)
|
|
|
077c9d |
-libc_hidden_builtin_def (mempcpy)
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(memcpy)
|
|
|
077c9d |
- .machine "g5"
|
|
|
077c9d |
- lr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
-.L_G5_start:
|
|
|
077c9d |
- ltr %r4,%r4
|
|
|
077c9d |
- je .L_G5_99
|
|
|
077c9d |
- ahi %r4,-1
|
|
|
077c9d |
- lr %r5,%r4
|
|
|
077c9d |
- srl %r5,8
|
|
|
077c9d |
- ltr %r5,%r5
|
|
|
077c9d |
- jne .L_G5_13
|
|
|
077c9d |
-.L_G5_4:
|
|
|
077c9d |
- basr %r5,0
|
|
|
077c9d |
-.L_G5_16:
|
|
|
077c9d |
- ex %r4,.L_G5_17-.L_G5_16(%r5)
|
|
|
077c9d |
-.L_G5_99:
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-.L_G5_13:
|
|
|
077c9d |
- chi %r5,4096 # Switch to mvcle for copies >1MB
|
|
|
077c9d |
- jh __memcpy_mvcle
|
|
|
077c9d |
-.L_G5_12:
|
|
|
077c9d |
- mvc 0(256,%r1),0(%r3)
|
|
|
077c9d |
- la %r1,256(%r1)
|
|
|
077c9d |
- la %r3,256(%r3)
|
|
|
077c9d |
- brct %r5,.L_G5_12
|
|
|
077c9d |
- j .L_G5_4
|
|
|
077c9d |
-.L_G5_17:
|
|
|
077c9d |
- mvc 0(1,%r1),0(%r3)
|
|
|
077c9d |
-END(memcpy)
|
|
|
077c9d |
-#ifndef USE_MULTIARCH
|
|
|
077c9d |
-libc_hidden_builtin_def (memcpy)
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(__memcpy_mvcle)
|
|
|
077c9d |
- # Using as standalone function will result in unexpected
|
|
|
077c9d |
- # results since the length field is incremented by 1 in order to
|
|
|
077c9d |
- # compensate the changes already done in the functions above.
|
|
|
077c9d |
- lr %r0,%r2 # backup return dest [ + n ]
|
|
|
077c9d |
- ahi %r4,1 # length + 1
|
|
|
077c9d |
- lr %r5,%r4 # source length
|
|
|
077c9d |
- lr %r4,%r3 # source address
|
|
|
077c9d |
- lr %r2,%r1 # destination address
|
|
|
077c9d |
- lr %r3,%r5 # destination length = source length
|
|
|
077c9d |
-.L_MVCLE_1:
|
|
|
077c9d |
- mvcle %r2,%r4,0 # thats it, MVCLE is your friend
|
|
|
077c9d |
- jo .L_MVCLE_1
|
|
|
077c9d |
- lr %r2,%r0 # return destination address
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-END(__memcpy_mvcle)
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-32/multiarch/Makefile b/sysdeps/s390/s390-32/multiarch/Makefile
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index 82a7492eb8436479..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-32/multiarch/Makefile
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,3 +0,0 @@
|
|
|
077c9d |
-ifeq ($(subdir),string)
|
|
|
077c9d |
-sysdep_routines += memcpy memcpy-s390
|
|
|
077c9d |
-endif
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy-s390.S b/sysdeps/s390/s390-32/multiarch/memcpy-s390.S
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index aad13bd07c31dab9..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-32/multiarch/memcpy-s390.S
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,128 +0,0 @@
|
|
|
077c9d |
-/* CPU specific memcpy implementations. 32 bit S/390 version.
|
|
|
077c9d |
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
- This file is part of the GNU C Library.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
077c9d |
- modify it under the terms of the GNU Lesser General Public
|
|
|
077c9d |
- License as published by the Free Software Foundation; either
|
|
|
077c9d |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
077c9d |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
077c9d |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
077c9d |
- Lesser General Public License for more details.
|
|
|
077c9d |
-
|
|
|
077c9d |
- You should have received a copy of the GNU Lesser General Public
|
|
|
077c9d |
- License along with the GNU C Library; if not, see
|
|
|
077c9d |
- <http://www.gnu.org/licenses/>. */
|
|
|
077c9d |
-
|
|
|
077c9d |
-
|
|
|
077c9d |
-#include "sysdep.h"
|
|
|
077c9d |
-#include "asm-syntax.h"
|
|
|
077c9d |
-
|
|
|
077c9d |
-/* INPUT PARAMETERS
|
|
|
077c9d |
- %r2 = target operands address
|
|
|
077c9d |
- %r3 = source operands address
|
|
|
077c9d |
- %r4 = number of bytes to copy. */
|
|
|
077c9d |
-
|
|
|
077c9d |
- .text
|
|
|
077c9d |
-
|
|
|
077c9d |
-#if defined SHARED && IS_IN (libc)
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(____mempcpy_z196)
|
|
|
077c9d |
- .machine "z196"
|
|
|
077c9d |
- .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
- lr %r1,%r2 # Use as dest
|
|
|
077c9d |
- la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
- j .L_Z196_start
|
|
|
077c9d |
-END(____mempcpy_z196)
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(__memcpy_z196)
|
|
|
077c9d |
- .machine "z196"
|
|
|
077c9d |
- .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
- lr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
-.L_Z196_start:
|
|
|
077c9d |
- llgfr %r4,%r4
|
|
|
077c9d |
- ltgr %r4,%r4
|
|
|
077c9d |
- je .L_Z196_4
|
|
|
077c9d |
- aghi %r4,-1
|
|
|
077c9d |
- srlg %r5,%r4,8
|
|
|
077c9d |
- ltgr %r5,%r5
|
|
|
077c9d |
- jne .L_Z196_5
|
|
|
077c9d |
-.L_Z196_3:
|
|
|
077c9d |
- exrl %r4,.L_Z196_14
|
|
|
077c9d |
-.L_Z196_4:
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-.L_Z196_5:
|
|
|
077c9d |
- cgfi %r5,262144 # Switch to mvcle for copies >64MB
|
|
|
077c9d |
- jh __memcpy_mvcle
|
|
|
077c9d |
-.L_Z196_2:
|
|
|
077c9d |
- pfd 1,768(%r3)
|
|
|
077c9d |
- pfd 2,768(%r1)
|
|
|
077c9d |
- mvc 0(256,%r1),0(%r3)
|
|
|
077c9d |
- aghi %r5,-1
|
|
|
077c9d |
- la %r1,256(%r1)
|
|
|
077c9d |
- la %r3,256(%r3)
|
|
|
077c9d |
- jne .L_Z196_2
|
|
|
077c9d |
- j .L_Z196_3
|
|
|
077c9d |
-.L_Z196_14:
|
|
|
077c9d |
- mvc 0(1,%r1),0(%r3)
|
|
|
077c9d |
-END(__memcpy_z196)
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(____mempcpy_z10)
|
|
|
077c9d |
- .machine "z10"
|
|
|
077c9d |
- .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
- lr %r1,%r2 # Use as dest
|
|
|
077c9d |
- la %r2,0(%r4,%r2) # Return dest + n
|
|
|
077c9d |
- j .L_Z10_start
|
|
|
077c9d |
-END(____mempcpy_z10)
|
|
|
077c9d |
-
|
|
|
077c9d |
-ENTRY(__memcpy_z10)
|
|
|
077c9d |
- .machine "z10"
|
|
|
077c9d |
- .machinemode "zarch_nohighgprs"
|
|
|
077c9d |
- lr %r1,%r2 # r1: Use as dest ; r2: Return dest
|
|
|
077c9d |
-.L_Z10_start:
|
|
|
077c9d |
- llgfr %r4,%r4
|
|
|
077c9d |
- cgije %r4,0,.L_Z10_4
|
|
|
077c9d |
- aghi %r4,-1
|
|
|
077c9d |
- srlg %r5,%r4,8
|
|
|
077c9d |
- cgijlh %r5,0,.L_Z10_13
|
|
|
077c9d |
-.L_Z10_3:
|
|
|
077c9d |
- exrl %r4,.L_Z10_15
|
|
|
077c9d |
-.L_Z10_4:
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-.L_Z10_13:
|
|
|
077c9d |
- cgfi %r5,65535 # Switch to mvcle for copies >16MB
|
|
|
077c9d |
- jh __memcpy_mvcle
|
|
|
077c9d |
-.L_Z10_12:
|
|
|
077c9d |
- pfd 1,768(%r3)
|
|
|
077c9d |
- pfd 2,768(%r1)
|
|
|
077c9d |
- mvc 0(256,%r1),0(%r3)
|
|
|
077c9d |
- la %r1,256(%r1)
|
|
|
077c9d |
- la %r3,256(%r3)
|
|
|
077c9d |
- brctg %r5,.L_Z10_12
|
|
|
077c9d |
- j .L_Z10_3
|
|
|
077c9d |
-.L_Z10_15:
|
|
|
077c9d |
- mvc 0(1,%r1),0(%r3)
|
|
|
077c9d |
-END(__memcpy_z10)
|
|
|
077c9d |
-
|
|
|
077c9d |
-# define __mempcpy ____mempcpy_default
|
|
|
077c9d |
-#endif /* SHARED && IS_IN (libc) */
|
|
|
077c9d |
-
|
|
|
077c9d |
-#define memcpy __memcpy_default
|
|
|
077c9d |
-#include "../memcpy.S"
|
|
|
077c9d |
-#undef memcpy
|
|
|
077c9d |
-
|
|
|
077c9d |
-#if defined SHARED && IS_IN (libc)
|
|
|
077c9d |
-.globl __GI_memcpy
|
|
|
077c9d |
-.set __GI_memcpy,__memcpy_default
|
|
|
077c9d |
-.globl __GI_mempcpy
|
|
|
077c9d |
-.set __GI_mempcpy,____mempcpy_default
|
|
|
077c9d |
-.globl __GI___mempcpy
|
|
|
077c9d |
-.set __GI___mempcpy,____mempcpy_default
|
|
|
077c9d |
-#else
|
|
|
077c9d |
-.globl memcpy
|
|
|
077c9d |
-.set memcpy,__memcpy_default
|
|
|
077c9d |
-.weak mempcpy
|
|
|
077c9d |
-.set mempcpy,__mempcpy
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-64/multiarch/Makefile b/sysdeps/s390/s390-64/multiarch/Makefile
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index 8a043e3327a1527a..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-64/multiarch/Makefile
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,3 +0,0 @@
|
|
|
077c9d |
-ifeq ($(subdir),string)
|
|
|
077c9d |
-sysdep_routines += memcpy memcpy-s390x
|
|
|
077c9d |
-endif
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.c b/sysdeps/s390/s390-64/multiarch/memcpy.c
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index c9577a854a0c7e68..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-64/multiarch/memcpy.c
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,27 +0,0 @@
|
|
|
077c9d |
-/* Multiple versions of memcpy.
|
|
|
077c9d |
- Copyright (C) 2015-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
- This file is part of the GNU C Library.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
077c9d |
- modify it under the terms of the GNU Lesser General Public
|
|
|
077c9d |
- License as published by the Free Software Foundation; either
|
|
|
077c9d |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
077c9d |
-
|
|
|
077c9d |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
077c9d |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
077c9d |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
077c9d |
- Lesser General Public License for more details.
|
|
|
077c9d |
-
|
|
|
077c9d |
- You should have received a copy of the GNU Lesser General Public
|
|
|
077c9d |
- License along with the GNU C Library; if not, see
|
|
|
077c9d |
- <http://www.gnu.org/licenses/>. */
|
|
|
077c9d |
-
|
|
|
077c9d |
-/* In the static lib memcpy is needed before the reloc is resolved. */
|
|
|
077c9d |
-#if defined SHARED && IS_IN (libc)
|
|
|
077c9d |
-# define memcpy __redirect_memcpy
|
|
|
077c9d |
-# include <string.h>
|
|
|
077c9d |
-# undef memcpy
|
|
|
077c9d |
-# include <ifunc-resolve.h>
|
|
|
077c9d |
-
|
|
|
077c9d |
-s390_libc_ifunc (__redirect_memcpy, __memcpy, memcpy)
|
|
|
077c9d |
-#endif
|