about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-21 20:12:29 -0800
committerDavid S. Miller <davem@davemloft.net>2010-02-25 23:58:50 -0800
commitdbcaf07c326e18b14d19aebe011b9ffbe4a45972 (patch)
treed1fc3b26dcb5fb91d2f863c74886ce879cf49bb4 /sysdeps
parent34a407de9661ff8e938d152445b750becb247f7c (diff)
downloadglibc-dbcaf07c326e18b14d19aebe011b9ffbe4a45972.tar.gz
glibc-dbcaf07c326e18b14d19aebe011b9ffbe4a45972.tar.xz
glibc-dbcaf07c326e18b14d19aebe011b9ffbe4a45972.zip
sparc: Reimplement 64-bit aligned copy routines and remove from memcpy files.
2010-02-25  David S. Miller  <davem@davemloft.net>

	* sysdeps/sparc/sparc64/Makefile: Add align-cpy rule.
	* sysdeps/sparc/sparc64/align-cpy.S: New.
	* sysdeps/sparc/sparc64/memcpy.S (__align_cpy_1, __align_cpy_2,
	__align_cpy_4, __align_cpy_8, __align_cpy_16): Remove.
	* sysdeps/sparc/sparc64/sparcv9b/memcpy.S (__align_cpy_1,
	__align_cpy_2, __align_cpy_4, __align_cpy_8, __align_cpy_16):
	Remove.
	* sysdeps/sparc/sparc64/sparcv9v/memcpy.S (__align_cpy_1,
	__align_cpy_2, __align_cpy_4, __align_cpy_8, __align_cpy_16):
	Remove.
	* sysdeps/sparc/sparc64/sparcv9v2/memcpy.S (__align_cpy_1,
	__align_cpy_2, __align_cpy_4, __align_cpy_8, __align_cpy_16):
	Remove.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/sparc/sparc64/Makefile4
-rw-r--r--sysdeps/sparc/sparc64/align-cpy.S85
-rw-r--r--sysdeps/sparc/sparc64/memcpy.S63
-rw-r--r--sysdeps/sparc/sparc64/sparcv9b/memcpy.S7
-rw-r--r--sysdeps/sparc/sparc64/sparcv9v/memcpy.S7
-rw-r--r--sysdeps/sparc/sparc64/sparcv9v2/memcpy.S7
6 files changed, 89 insertions, 84 deletions
diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile
index 3bb0238832..1a859dffc0 100644
--- a/sysdeps/sparc/sparc64/Makefile
+++ b/sysdeps/sparc/sparc64/Makefile
@@ -6,3 +6,7 @@ endif
 ifeq ($(subdir),csu)
 CFLAGS-initfini.s += -mcpu=v9
 endif
+
+ifeq ($(subdir),string)
+sysdep_routines += align-cpy
+endif
diff --git a/sysdeps/sparc/sparc64/align-cpy.S b/sysdeps/sparc/sparc64/align-cpy.S
new file mode 100644
index 0000000000..bae788fe44
--- /dev/null
+++ b/sysdeps/sparc/sparc64/align-cpy.S
@@ -0,0 +1,85 @@
+/* Aligned copy routines specified by Sparc V9 ABI.
+   For 64-bit sparc.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller (davem@davemloft.net)
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+	.text
+	.align	8
+ENTRY(__align_cpy_8)
+10:	cmp	%o0, %o1
+	be,pn	%xcc, 9f
+	 mov	%o0, %o3
+	subcc	%o2, 0x08, %o2
+	be,pn	%xcc, 8f
+1:	 ldx	[%o1 + 0x00], %o5
+	ldx	[%o1 + 0x08], %o4
+	subcc	%o2, 0x10, %o2
+	add	%o1, 0x10, %o1
+	stx	%o5, [%o3 + 0x00]
+	stx	%o4, [%o3 + 0x08]
+	bg,pt	%xcc, 1b
+	 add	%o3, 0x10, %o3
+	bne,pn	%xcc, 9f
+	 nop
+	ldx	[%o1 + 0x00], %o5
+8:	stx	%o5, [%o3 + 0x00]
+9:	retl
+	 nop
+END(__align_cpy_8)
+
+	.align	8
+ENTRY(__align_cpy_4)
+20:	cmp	%o0, %o1
+	be,pn	%xcc, 9f
+	 mov	%o0, %o3
+	subcc	%o2, 0x04, %o2
+	be,pn	%xcc, 8f
+1:	 lduw	[%o1 + 0x00], %o5
+	lduw	[%o1 + 0x04], %o4
+	subcc	%o2, 0x08, %o2
+	add	%o1, 0x08, %o1
+	stw	%o5, [%o3 + 0x00]
+	stw	%o4, [%o3 + 0x04]
+	bg,pt	%xcc, 1b
+	 add	%o3, 0x08, %o3
+	bne,pn	%xcc, 9f
+	 nop
+	lduw	[%o1 + 0x00], %o5
+8:	stw	%o5, [%o3 + 0x00]
+9:	retl
+	 nop
+END(__align_cpy_4)
+
+	.align	8
+ENTRY(__align_cpy_2)
+	or	%o0, %o1, %o3
+	or	%o2, %o3, %o3
+	andcc	%o3, 0x7, %g0
+	be,pt	%xcc, 10b
+	 andcc	%o3, 0x3, %g0
+	be,pt	%xcc, 20b
+	 mov	%o7, %g1
+	call	HIDDEN_JUMPTARGET(memcpy)
+	 mov	%o7, %g1
+END(__align_cpy_2)
+
+weak_alias (__align_cpy_8, __align_cpy_16)
+weak_alias (__align_cpy_2, __align_cpy_1)
diff --git a/sysdeps/sparc/sparc64/memcpy.S b/sysdeps/sparc/sparc64/memcpy.S
index 5993358017..709d366304 100644
--- a/sysdeps/sparc/sparc64/memcpy.S
+++ b/sysdeps/sparc/sparc64/memcpy.S
@@ -446,65 +446,6 @@ ENTRY(__memcpy_large)
 	 mov		%g4, %o0
 END(__memcpy_large)
 
-#ifdef USE_BPR
-
-	/* void *__align_cpy_4(void *dest, void *src, size_t n)
-	 * SPARC v9 SYSV ABI
-	 * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 3))
-	 */
-
-	.align		32
-ENTRY(__align_cpy_4)
-	mov		%o0, %g4			/* IEU0		Group		*/
-	cmp		%o2, 15				/* IEU1				*/
-	bleu,pn		%xcc, 208b			/* CTI				*/
-	 cmp		%o2, (64 * 6)			/* IEU1		Group		*/
-	bgeu,pn		%xcc, 200b			/* CTI				*/
-	 andcc		%o0, 7, %g2			/* IEU1		Group		*/
-	ba,pt		%xcc, 216f			/* CTI				*/
-	 andcc		%o1, 4, %g0			/* IEU1		Group		*/
-END(__align_cpy_4)
-
-	/* void *__align_cpy_8(void *dest, void *src, size_t n)
-	 * SPARC v9 SYSV ABI
-	 * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 7))
-	 */
-
-	.align		32
-ENTRY(__align_cpy_8)
-	mov		%o0, %g4			/* IEU0		Group		*/
-	cmp		%o2, 15				/* IEU1				*/
-	bleu,pn		%xcc, 208b			/* CTI				*/
-	 cmp		%o2, (64 * 6)			/* IEU1		Group		*/
-	bgeu,pn		%xcc, 201b			/* CTI				*/
-	 andcc		%o0, 0x38, %g5			/* IEU1		Group		*/
-	andcc		%o2, -128, %g6			/* IEU1		Group		*/
-	bne,a,pt	%xcc, 82f + 4			/* CTI				*/
-	 ldx		[%o1], %g1			/* Load				*/
-	ba,pt		%xcc, 41f			/* CTI		Group		*/
-	 andcc		%o2, 0x70, %g6			/* IEU1				*/
-END(__align_cpy_8)
-
-	/* void *__align_cpy_16(void *dest, void *src, size_t n)
-	 * SPARC v9 SYSV ABI
-	 * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 15))
-	 */
-
-	.align		32
-ENTRY(__align_cpy_16)
-	mov		%o0, %g4			/* IEU0		Group		*/
-	cmp		%o2, (64 * 6)			/* IEU1				*/
-	bgeu,pn		%xcc, 201b			/* CTI				*/
-	 andcc		%o0, 0x38, %g5			/* IEU1		Group		*/
-	andcc		%o2, -128, %g6			/* IEU1		Group		*/
-	bne,a,pt	%xcc, 82f + 4			/* CTI				*/
-	 ldx		[%o1], %g1			/* Load				*/
-	ba,pt		%xcc, 41f			/* CTI		Group		*/
-	 andcc		%o2, 0x70, %g6			/* IEU1				*/
-END(__align_cpy_16)
-
-#endif
-
 	.align		32
 ENTRY(memcpy)
 210:
@@ -917,9 +858,5 @@ ENTRY(memmove)
 	 mov		%g4, %o0
 END(memmove)
 
-#ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
-#endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)
diff --git a/sysdeps/sparc/sparc64/sparcv9b/memcpy.S b/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
index 760d526630..2a4146feeb 100644
--- a/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
+++ b/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
@@ -599,12 +599,5 @@ ENTRY(memmove)
 	 mov		%g4, %o0
 END(memmove)
 
-#ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
-weak_alias (memcpy, __align_cpy_4)
-weak_alias (memcpy, __align_cpy_8)
-weak_alias (memcpy, __align_cpy_16)
-#endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)
diff --git a/sysdeps/sparc/sparc64/sparcv9v/memcpy.S b/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
index ad2b0f742c..61db9ff81f 100644
--- a/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
+++ b/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
@@ -585,12 +585,5 @@ ENTRY(memmove)
 	 mov		%g4, %o0
 END(memmove)
 
-#ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
-weak_alias (memcpy, __align_cpy_4)
-weak_alias (memcpy, __align_cpy_8)
-weak_alias (memcpy, __align_cpy_16)
-#endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)
diff --git a/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S b/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
index b261f461a4..2b1444ec7f 100644
--- a/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
+++ b/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
@@ -735,12 +735,5 @@ ENTRY(memmove)
 	 mov		%g4, %o0
 END(memmove)
 
-#ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
-weak_alias (memcpy, __align_cpy_4)
-weak_alias (memcpy, __align_cpy_8)
-weak_alias (memcpy, __align_cpy_16)
-#endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)