|
|
077c9d |
commit e099aab060df178a7fcd5a55282650fe45ccea66
|
|
|
077c9d |
Author: Stefan Liebler <stli@linux.ibm.com>
|
|
|
077c9d |
Date: Tue Dec 18 13:57:07 2018 +0100
|
|
|
077c9d |
|
|
|
077c9d |
S390: Remove s390 specific implementation of bcopy.
|
|
|
077c9d |
|
|
|
077c9d |
Nowadays gcc is automatically replacing a call to bcopy
|
|
|
077c9d |
with a call to memmove. Thus only old binaries will call
|
|
|
077c9d |
the s390 specific bcopy implementation.
|
|
|
077c9d |
|
|
|
077c9d |
The s390 specific implementation is using an own
|
|
|
077c9d |
implementation for memcpy in the forward case and is
|
|
|
077c9d |
relying on memmove in the backward case.
|
|
|
077c9d |
|
|
|
077c9d |
After removing the s390 specific bcopy, the common code
|
|
|
077c9d |
bcopy is used. It just performs a tail call to memmove.
|
|
|
077c9d |
|
|
|
077c9d |
ChangeLog:
|
|
|
077c9d |
* sysdeps/s390/s390-32/bcopy.S: Remove.
|
|
|
077c9d |
* sysdeps/s390/s390-64/bcopy.S: Likewise.
|
|
|
077c9d |
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-32/bcopy.S b/sysdeps/s390/s390-32/bcopy.S
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index 560e04fdee93dafb..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-32/bcopy.S
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,85 +0,0 @@
|
|
|
077c9d |
-/* bcopy -- copy a block from source to destination. S/390 version.
|
|
|
077c9d |
- This file is part of the GNU C Library.
|
|
|
077c9d |
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
|
|
|
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 |
-/* INPUT PARAMETERS
|
|
|
077c9d |
- %r2 = address of source
|
|
|
077c9d |
- %r3 = address of destination
|
|
|
077c9d |
- %r4 = number of bytes to copy. */
|
|
|
077c9d |
-
|
|
|
077c9d |
-#include "sysdep.h"
|
|
|
077c9d |
-#include "asm-syntax.h"
|
|
|
077c9d |
-
|
|
|
077c9d |
- .text
|
|
|
077c9d |
-ENTRY(__bcopy)
|
|
|
077c9d |
- ltr %r1,%r4 # zero bcopy ?
|
|
|
077c9d |
- jz .L4
|
|
|
077c9d |
- clr %r2,%r3 # check against destructive overlap
|
|
|
077c9d |
- jnl .L0
|
|
|
077c9d |
- alr %r1,%r2
|
|
|
077c9d |
- clr %r1,%r3
|
|
|
077c9d |
- jh .L7
|
|
|
077c9d |
-.L0: ahi %r4,-1 # length - 1
|
|
|
077c9d |
- lr %r1,%r4
|
|
|
077c9d |
- srl %r1,8
|
|
|
077c9d |
- ltr %r1,%r1 # < 256 bytes to move ?
|
|
|
077c9d |
- jz .L2
|
|
|
077c9d |
- chi %r1,255 # > 1MB to move ?
|
|
|
077c9d |
- jh .L5
|
|
|
077c9d |
-.L1: mvc 0(256,%r3),0(%r2) # move in 256 byte chunks
|
|
|
077c9d |
- la %r2,256(%r2)
|
|
|
077c9d |
- la %r3,256(%r3)
|
|
|
077c9d |
- brct %r1,.L1
|
|
|
077c9d |
-.L2: bras %r1,.L3 # setup base pointer for execute
|
|
|
077c9d |
- mvc 0(1,%r3),0(%r2) # instruction for execute
|
|
|
077c9d |
-.L3: ex %r4,0(%r1) # execute mvc with length ((%r4)&255)+1
|
|
|
077c9d |
-.L4: br %r14
|
|
|
077c9d |
-
|
|
|
077c9d |
- # data copies > 1MB are faster with mvcle.
|
|
|
077c9d |
-.L5: ahi %r4,1 # length + 1
|
|
|
077c9d |
- lr %r5,%r4 # source length
|
|
|
077c9d |
- lr %r4,%r2 # source address
|
|
|
077c9d |
- lr %r2,%r3 # set destination
|
|
|
077c9d |
- lr %r3,%r5 # destination length = source length
|
|
|
077c9d |
-.L6: mvcle %r2,%r4,0 # thats it, MVCLE is your friend
|
|
|
077c9d |
- jo .L6
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-.L7: # destructive overlay, can not use mvcle
|
|
|
077c9d |
- lr %r1,%r2 # bcopy is called with source,dest
|
|
|
077c9d |
- lr %r2,%r3 # memmove with dest,source! Oh, well...
|
|
|
077c9d |
- lr %r3,%r1
|
|
|
077c9d |
- basr %r1,0
|
|
|
077c9d |
-.L8:
|
|
|
077c9d |
-#ifdef PIC
|
|
|
077c9d |
- al %r1,.L9-.L8(%r1) # get address of global offset table
|
|
|
077c9d |
- # load address of memmove
|
|
|
077c9d |
- l %r1,memmove@GOT(%r1)
|
|
|
077c9d |
- br %r1
|
|
|
077c9d |
-.L9: .long _GLOBAL_OFFSET_TABLE_-.L8
|
|
|
077c9d |
-#else
|
|
|
077c9d |
- al %r1,.L9-.L8(%r1) # load address of memmove
|
|
|
077c9d |
- br %r1 # jump to memmove
|
|
|
077c9d |
-.L9: .long memmove-.L8
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
-
|
|
|
077c9d |
-END(__bcopy)
|
|
|
077c9d |
-
|
|
|
077c9d |
-#ifndef NO_WEAK_ALIAS
|
|
|
077c9d |
-weak_alias (__bcopy, bcopy)
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
-
|
|
|
077c9d |
diff --git a/sysdeps/s390/s390-64/bcopy.S b/sysdeps/s390/s390-64/bcopy.S
|
|
|
077c9d |
deleted file mode 100644
|
|
|
077c9d |
index 806dd15d0203d32a..0000000000000000
|
|
|
077c9d |
--- a/sysdeps/s390/s390-64/bcopy.S
|
|
|
077c9d |
+++ /dev/null
|
|
|
077c9d |
@@ -1,71 +0,0 @@
|
|
|
077c9d |
-/* bcopy -- copy a block from source to destination. 64 bit S/390 version.
|
|
|
077c9d |
- This file is part of the GNU C Library.
|
|
|
077c9d |
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
|
|
|
077c9d |
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
|
|
|
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 |
-/* INPUT PARAMETERS
|
|
|
077c9d |
- %r2 = address of source
|
|
|
077c9d |
- %r3 = address of destination
|
|
|
077c9d |
- %r4 = number of bytes to copy. */
|
|
|
077c9d |
-
|
|
|
077c9d |
-#include "sysdep.h"
|
|
|
077c9d |
-#include "asm-syntax.h"
|
|
|
077c9d |
-
|
|
|
077c9d |
- .text
|
|
|
077c9d |
-ENTRY(__bcopy)
|
|
|
077c9d |
- ltgr %r1,%r4 # zero bcopy ?
|
|
|
077c9d |
- jz .L4
|
|
|
077c9d |
- clgr %r2,%r3 # check against destructive overlap
|
|
|
077c9d |
- jnl .L0
|
|
|
077c9d |
- algr %r1,%r2
|
|
|
077c9d |
- clgr %r1,%r3
|
|
|
077c9d |
- jh .L7
|
|
|
077c9d |
-.L0: aghi %r4,-1 # length - 1
|
|
|
077c9d |
- srlg %r1,%r4,8
|
|
|
077c9d |
- ltgr %r1,%r1 # < 256 bytes to move ?
|
|
|
077c9d |
- jz .L2
|
|
|
077c9d |
- cghi %r1,255 # > 1MB to move ?
|
|
|
077c9d |
- jh .L5
|
|
|
077c9d |
-.L1: mvc 0(256,%r3),0(%r2) # move in 256 byte chunks
|
|
|
077c9d |
- la %r2,256(%r2)
|
|
|
077c9d |
- la %r3,256(%r3)
|
|
|
077c9d |
- brctg %r1,.L1
|
|
|
077c9d |
-.L2: bras %r1,.L3 # setup base pointer for execute
|
|
|
077c9d |
- mvc 0(1,%r3),0(%r2) # instruction for execute
|
|
|
077c9d |
-.L3: ex %r4,0(%r1) # execute mvc with length ((%r4)&255)+1
|
|
|
077c9d |
-.L4: br %r14
|
|
|
077c9d |
- # data copies > 1MB are faster with mvcle.
|
|
|
077c9d |
-.L5: aghi %r4,1 # length + 1
|
|
|
077c9d |
- lgr %r5,%r4 # source length
|
|
|
077c9d |
- lgr %r4,%r2 # source address
|
|
|
077c9d |
- lgr %r2,%r3 # set destination
|
|
|
077c9d |
- lgr %r3,%r5 # destination length = source length
|
|
|
077c9d |
-.L6: mvcle %r2,%r4,0 # thats it, MVCLE is your friend
|
|
|
077c9d |
- jo .L6
|
|
|
077c9d |
- br %r14
|
|
|
077c9d |
-.L7: # destructive overlay, can not use mvcle
|
|
|
077c9d |
- lgr %r1,%r2 # bcopy is called with source,dest
|
|
|
077c9d |
- lgr %r2,%r3 # memmove with dest,source! Oh, well...
|
|
|
077c9d |
- lgr %r3,%r1
|
|
|
077c9d |
- jg HIDDEN_BUILTIN_JUMPTARGET(memmove)
|
|
|
077c9d |
-
|
|
|
077c9d |
-END(__bcopy)
|
|
|
077c9d |
-
|
|
|
077c9d |
-#ifndef NO_WEAK_ALIAS
|
|
|
077c9d |
-weak_alias (__bcopy, bcopy)
|
|
|
077c9d |
-#endif
|
|
|
077c9d |
-
|