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