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