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