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