about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/sparc32')
-rw-r--r--sysdeps/sparc/sparc32/dl-trampoline.S29
-rw-r--r--sysdeps/sparc/sparc32/elf/start.S4
-rw-r--r--sysdeps/sparc/sparc32/memchr.S21
-rw-r--r--sysdeps/sparc/sparc32/memcpy.S40
-rw-r--r--sysdeps/sparc/sparc32/stpcpy.S14
-rw-r--r--sysdeps/sparc/sparc32/strcat.S78
-rw-r--r--sysdeps/sparc/sparc32/strchr.S33
-rw-r--r--sysdeps/sparc/sparc32/strcmp.S14
-rw-r--r--sysdeps/sparc/sparc32/strcpy.S16
-rw-r--r--sysdeps/sparc/sparc32/strlen.S28
10 files changed, 162 insertions, 115 deletions
diff --git a/sysdeps/sparc/sparc32/dl-trampoline.S b/sysdeps/sparc/sparc32/dl-trampoline.S
index 4b7853029a..b0f86dda4e 100644
--- a/sysdeps/sparc/sparc32/dl-trampoline.S
+++ b/sysdeps/sparc/sparc32/dl-trampoline.S
@@ -30,13 +30,22 @@
 	.globl	_dl_runtime_resolve
 	.type	_dl_runtime_resolve, @function
 _dl_runtime_resolve:
+	cfi_startproc
+
 	save	%sp, -104, %sp
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
+	cfi_register (%o7, %i7)
+
 	ld	[%g2 + 8], %o0
 	srl	%g1, 10, %o1
 	call	_dl_fixup
 	 sub	%o1, 4*12, %o1
 	jmp	%o0
 	 restore
+
+	cfi_endproc
+
 	.size	_dl_runtime_resolve, .-_dl_runtime_resolve
 
 	/* For the profiling cases we pass in our stack frame
@@ -56,6 +65,8 @@ _dl_runtime_resolve:
 	.globl	_dl_profile_save_regs
 	.type	_dl_profile_save_regs, @function
 _dl_profile_save_regs:
+	cfi_startproc
+
 	std	%l0, [%sp + ( 0 * 8)]
 	std	%l2, [%sp + ( 1 * 8)]
 	std	%l4, [%sp + ( 2 * 8)]
@@ -67,6 +78,9 @@ _dl_profile_save_regs:
 	ld	[%sp + (8 * 8)], %l4
 	retl
 	 st	%l4, [%sp + (8 * 8)]
+
+	cfi_endproc
+
 	.size	_dl_profile_save_regs, .-_dl_profile_save_regs
 
 	/* If we are going to call pltexit, then we must replicate
@@ -76,6 +90,8 @@ _dl_profile_save_regs:
 	.globl	_dl_profile_invoke
 	.type	_dl_profile_invoke, @function
 _dl_profile_invoke:
+	cfi_startproc
+
 	sub	%sp, %l0, %sp
 1:
 	srl	%l0, 3, %l7
@@ -112,6 +128,10 @@ _dl_profile_invoke:
 	jmpl	%i7 + 8, %g0
 	 restore
 
+	cfi_endproc
+
+	.size	_dl_profile_invoke, .-_dl_profile_invoke
+
 	/* %g1:	PLT offset loaded by PLT entry
 	 * %g2: callers PC, which is PLT0 + 4, and we store the
 	 *      link map at PLT0 + 12, therefore we add 8 to get
@@ -121,11 +141,17 @@ _dl_profile_invoke:
 	.globl	_dl_runtime_profile
 	.type	_dl_runtime_profile, @function
 _dl_runtime_profile:
+	cfi_startproc
+
 	cmp	%fp, 0
 	be,a	1f
 	 mov	104, %g3
 	sub	%fp, %sp, %g3
 1:	save	%sp, -104, %sp
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
+	cfi_register(%o7, %i7)
+
 	ld	[%g2 + 8], %o0
 	srl	%g1, 10, %o1
 	mov	%i7, %o2
@@ -152,4 +178,7 @@ _dl_runtime_profile:
 
 1:	jmp	%o0
 	 restore
+
+	cfi_endproc
+
 	.size	_dl_runtime_profile, .-_dl_runtime_profile
diff --git a/sysdeps/sparc/sparc32/elf/start.S b/sysdeps/sparc/sparc32/elf/start.S
index 4c7fb5bd23..702dd755e6 100644
--- a/sysdeps/sparc/sparc32/elf/start.S
+++ b/sysdeps/sparc/sparc32/elf/start.S
@@ -48,6 +48,7 @@
 	.global _start
 	.type _start,#function
 _start:
+	cfi_startproc
 
 #ifdef SHARED
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
@@ -59,6 +60,7 @@ _start:
      drop their arguments.  */
 	mov	%g0, %fp
 	sub	%sp, 6*4, %sp
+	cfi_adjust_cfa_offset(6*4)
 
   /* Extract the arguments and environment as encoded on the stack.  The
      argument info starts after one register window (16 words) past the SP.  */
@@ -91,6 +93,8 @@ _start:
   /* Die very horribly if exit returns.  */
 	unimp
 
+	cfi_endproc
+
 	.size _start, .-_start
 
 /* Define a symbol for the first piece of initialized data.  */
diff --git a/sysdeps/sparc/sparc32/memchr.S b/sysdeps/sparc/sparc32/memchr.S
index 0ca56ccdd9..fcd98315db 100644
--- a/sysdeps/sparc/sparc32/memchr.S
+++ b/sysdeps/sparc/sparc32/memchr.S
@@ -32,7 +32,15 @@
 
 	.text
 	.align		4
-0:	cmp		%o2, 0
+ENTRY(__memchr)
+	andcc		%o1, 0xff, %o1
+	sll		%o1, 8, %g6
+	andcc		%o0, 3, %g0
+	or		%o1, %g6, %g6
+	sll		%g6, 16, %o3
+	be		10f
+	 or		%o3, %g6, %g2
+	cmp		%o2, 0
 	be		9f
 	 sethi		%hi(0x80808080), %o4
 	ldub		[%o0], %g4
@@ -64,16 +72,7 @@
 	 clr		%o0
 1:	retl
 	 sub		%o0, 1, %o0
-
-ENTRY(__memchr)
-	andcc		%o1, 0xff, %o1
-	sll		%o1, 8, %g6
-	andcc		%o0, 3, %g0
-	or		%o1, %g6, %g6
-	sll		%g6, 16, %o3
-	bne		0b
-	 or		%o3, %g6, %g2
-	sethi		%hi(0x80808080), %o4
+10:	sethi		%hi(0x80808080), %o4
 	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o5
 5:	and		%o2, 3, %g1
diff --git a/sysdeps/sparc/sparc32/memcpy.S b/sysdeps/sparc/sparc32/memcpy.S
index 35bcef4963..6bd55c06a1 100644
--- a/sysdeps/sparc/sparc32/memcpy.S
+++ b/sysdeps/sparc/sparc32/memcpy.S
@@ -146,28 +146,12 @@
 	.text
 	.align	4
 
-70:	andcc		%o1, 1, %g0
-	be		4f
-	 andcc		%o1, 2, %g0
-
-	ldub		[%o1 - 1], %g2
-	sub		%o1, 1, %o1
-	stb		%g2, [%o0 - 1]
-	sub		%o2, 1, %o2
-	be		3f
-	 sub		%o0, 1, %o0
-4:	lduh		[%o1 - 2], %g2
-	sub		%o1, 2, %o1
-	sth		%g2, [%o0 - 2]
-	sub		%o2, 2, %o2
-	b		3f
-	 sub		%o0, 2, %o0
-
 ENTRY(bcopy)
 	mov		%o0, %o3
 	mov		%o1, %o0
 	mov		%o3, %o1
 END(bcopy)
+
 ENTRY(memmove)
 	cmp		%o0, %o1
 	st		%o0, [%sp + 64]
@@ -185,8 +169,26 @@ ENTRY(memmove)
 	 cmp		%o2, 15
 	bleu		91f
 	 andcc		%o1, 3, %g0
-	bne		70b
-3:	 andcc		%o1, 4, %g0
+	be		3f
+	 nop
+
+	andcc		%o1, 1, %g0
+	be		4f
+	 andcc		%o1, 2, %g0
+
+	ldub		[%o1 - 1], %g2
+	sub		%o1, 1, %o1
+	stb		%g2, [%o0 - 1]
+	sub		%o2, 1, %o2
+	be		3f
+	 sub		%o0, 1, %o0
+4:	lduh		[%o1 - 2], %g2
+	sub		%o1, 2, %o1
+	sth		%g2, [%o0 - 2]
+	sub		%o2, 2, %o2
+	sub		%o0, 2, %o0
+
+3:	andcc		%o1, 4, %g0
 
 	be		2f
 	 mov		%o2, %g1
diff --git a/sysdeps/sparc/sparc32/stpcpy.S b/sysdeps/sparc/sparc32/stpcpy.S
index e6688a9b21..222bc2a445 100644
--- a/sysdeps/sparc/sparc32/stpcpy.S
+++ b/sysdeps/sparc/sparc32/stpcpy.S
@@ -38,7 +38,13 @@
 
 	.text
 	.align		4
-10:	ldub		[%o1], %o5
+
+ENTRY(__stpcpy)
+	andcc		%o1, 3, %g0
+	be		20f
+	 sethi		%hi(0x80808080), %o4
+
+	ldub		[%o1], %o5
 	stb		%o5, [%o0]
 	cmp		%o5, 0
 	add		%o0, 1, %o0
@@ -67,11 +73,7 @@
 1:	retl
 	 add		%o0, -1, %o0
 
-ENTRY(__stpcpy)
-	andcc		%o1, 3, %g0
-	bne		10b
-	 sethi		%hi(0x80808080), %o4
-	or		%o4, %lo(0x80808080), %o3
+20:	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o4
 5:	or		%o4, %lo(0x01010101), %o2
 6:	andcc		%o0, 3, %g0
diff --git a/sysdeps/sparc/sparc32/strcat.S b/sysdeps/sparc/sparc32/strcat.S
index 3709c8a692..4ce0771908 100644
--- a/sysdeps/sparc/sparc32/strcat.S
+++ b/sysdeps/sparc/sparc32/strcat.S
@@ -38,36 +38,14 @@
 
 	.text
 	.align		4
-10:	cmp		%o4, 2
-	be		1f
-	 cmp		%o4, 3
-	ldub		[%o1], %o5
-	add		%o1, 1, %o1
-	stb		%o5, [%o0]
-	be		3f
-	 cmp		%o5, 0
-	be		0f
-	 add		%o0, 1, %o0
-1:	lduh		[%o1], %o5
-	add		%o1, 2, %o1
-	srl		%o5, 8, %o4
-	cmp		%o4, 0
-	stb		%o4, [%o0]
-	bne,a		2f
-	 stb		%o5, [%o0 + 1]
-	retl
-	 mov		%g2, %o0
-2:	andcc		%o5, 0xff, %o5
-	bne		4f
-	 add		%o0, 2, %o0
-	retl
-	 mov 		%g2, %o0
-3:	bne		4f
-	 add		%o0, 1, %o0
-	retl
-	 mov		%g2, %o0
 
-11:	ldub		[%o0], %o5
+ENTRY(strcat)
+	mov		%o0, %g2
+	andcc		%o0, 3, %g0
+	be		30f
+	 sethi		%hi(0x80808080), %o4
+
+	ldub		[%o0], %o5
 	cmp		%o5, 0
 	be		1f
 	 add		%o0, 1, %o0
@@ -93,12 +71,7 @@
 	b		3f
 	 sub		%o0, 1, %o0
 
-ENTRY(strcat)
-	mov		%o0, %g2
-	andcc		%o0, 3, %g0
-	bne		11b
-	 sethi		%hi(0x80808080), %o4
-	or		%o4, %lo(0x80808080), %o3
+30:	or		%o4, %lo(0x80808080), %o3
 7:	sethi		%hi(0x01010101), %o4
 8:	or		%o4, %lo(0x01010101), %o2
 9:	ld		[%o0], %o5
@@ -128,8 +101,39 @@ ENTRY(strcat)
 	 ld		[%o0], %o5
 	sub		%o0, 1, %o0
 3:	andcc		%o1, 3, %o4
-	bne		10b
-4:	 andcc		%o0, 3, %g3
+	be		4f
+	 nop
+
+	cmp		%o4, 2
+	be		11f
+	 cmp		%o4, 3
+	ldub		[%o1], %o5
+	add		%o1, 1, %o1
+	stb		%o5, [%o0]
+	be		13f
+	 cmp		%o5, 0
+	be		0f
+	 add		%o0, 1, %o0
+11:	lduh		[%o1], %o5
+	add		%o1, 2, %o1
+	srl		%o5, 8, %o4
+	cmp		%o4, 0
+	stb		%o4, [%o0]
+	bne,a		12f
+	 stb		%o5, [%o0 + 1]
+	retl
+	 mov		%g2, %o0
+12:	andcc		%o5, 0xff, %o5
+	bne		4f
+	 add		%o0, 2, %o0
+	retl
+	 mov 		%g2, %o0
+13:	bne		4f
+	 add		%o0, 1, %o0
+	retl
+	 mov		%g2, %o0
+
+4:	andcc		%o0, 3, %g3
 	bne		12f
 1:	ld		[%o1], %o5
 	add		%o1, 4, %o1
diff --git a/sysdeps/sparc/sparc32/strchr.S b/sysdeps/sparc/sparc32/strchr.S
index 6120ecd6a3..7c397171f5 100644
--- a/sysdeps/sparc/sparc32/strchr.S
+++ b/sysdeps/sparc/sparc32/strchr.S
@@ -39,9 +39,20 @@
 
 	.text
 	.align		4
-10:	ldub		[%o0], %g4
+ENTRY(strchr)
+	andcc		%o1, 0xff, %o1
+	be		12f
+	 sll		%o1, 8, %o2
+	andcc		%o0, 3, %g0
+	or		%o1, %o2, %o2
+	sethi		%hi(0x80808080), %o4
+	sll		%o2, 16, %o3
+	be		13f
+	 or		%o3, %o2, %g2
+
+	ldub		[%o0], %g4
 	cmp		%g4, %o1
-	be		1f
+	be		11f
 	 add		%o0, 1, %o0
 	cmp		%g4, 0
 	be		9f
@@ -50,7 +61,7 @@
 	 or		%o4, %lo(0x80808080), %o3
 	ldub		[%o0], %g4
 	cmp		%g4, %o1
-	be		1f
+	be		11f
 	 add		%o0, 1, %o0
 	cmp		%g4, 0
 	be		9f
@@ -59,27 +70,17 @@
 	 sethi		%hi(0x01010101), %o5
 	ldub		[%o0], %g4
 	cmp		%g4, %o1
-	be		1f
+	be		11f
 	 add		%o0, 1, %o0
 	cmp		%g4, 0
 	be		9f
 	 or		%o5, %lo(0x01010101), %o2
 	b		6f
 	 ld		[%o0], %g4
-1:	retl
+11:	retl
 	 sub		%o0, 1, %o0
 
-ENTRY(strchr)
-	andcc		%o1, 0xff, %o1
-	be		12f
-	 sll		%o1, 8, %o2
-	andcc		%o0, 3, %g0
-	or		%o1, %o2, %o2
-	sethi		%hi(0x80808080), %o4
-	sll		%o2, 16, %o3
-	bne		10b
-	 or		%o3, %o2, %g2
-	or		%o4, %lo(0x80808080), %o3
+13:	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o5
 5:	or		%o5, %lo(0x01010101), %o2
 7:	ld		[%o0], %g4
diff --git a/sysdeps/sparc/sparc32/strcmp.S b/sysdeps/sparc/sparc32/strcmp.S
index 6723593eed..cf369dd839 100644
--- a/sysdeps/sparc/sparc32/strcmp.S
+++ b/sysdeps/sparc/sparc32/strcmp.S
@@ -38,7 +38,13 @@
 
 	.text
 	.align		4
-10:	ldub		[%o0], %o4
+
+ENTRY(strcmp)
+	andcc		%o0, 3, %g0
+	be		13f
+	 sethi		%hi(0x80808080), %g1
+
+	ldub		[%o0], %o4
 	add		%o0, 1, %o0
 	ldub		[%o1], %o5
 	cmp		%o4, 0
@@ -76,11 +82,7 @@
 2:	retl
 	 mov		%o4, %o0
 
-ENTRY(strcmp)
-	andcc		%o0, 3, %g0
-	bne		10b
-	 sethi		%hi(0x80808080), %g1
-	or		%g1, %lo(0x80808080), %o3
+13:	or		%g1, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %g1
 5:	andcc		%o1, 3, %g2
 	bne		12f
diff --git a/sysdeps/sparc/sparc32/strcpy.S b/sysdeps/sparc/sparc32/strcpy.S
index 787ac9f7c8..f3f337e3f7 100644
--- a/sysdeps/sparc/sparc32/strcpy.S
+++ b/sysdeps/sparc/sparc32/strcpy.S
@@ -38,7 +38,14 @@
 
 	.text
 	.align		4
-1:	ldub		[%o1], %o5
+
+ENTRY(strcpy)
+	mov		%o0, %g2
+	andcc		%o1, 3, %g0
+	be		10f
+	 sethi		%hi(0x80808080), %o4
+
+	ldub		[%o1], %o5
 	stb		%o5, [%o0]
 	cmp		%o5, 0
 	add		%o0, 1, %o0
@@ -65,12 +72,7 @@
 	b		6f
 	 andcc		%o0, 3, %g3
 
-ENTRY(strcpy)
-	mov		%o0, %g2
-	andcc		%o1, 3, %g0
-	bne		1b
-	 sethi		%hi(0x80808080), %o4
-	or		%o4, %lo(0x80808080), %o3
+10:	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o4
 5:	andcc		%o0, 3, %g3
 6:	bne		10f
diff --git a/sysdeps/sparc/sparc32/strlen.S b/sysdeps/sparc/sparc32/strlen.S
index 76466ec9dd..ed92f20e28 100644
--- a/sysdeps/sparc/sparc32/strlen.S
+++ b/sysdeps/sparc/sparc32/strlen.S
@@ -38,39 +38,41 @@
 
 	.text
 	.align		4
-10:	ldub		[%o0], %o5
+
+ENTRY(strlen)
+	mov		%o0, %o1
+	andcc		%o0, 3, %g0
+	be		20f
+	 sethi		%hi(0x80808080), %o4
+
+	ldub		[%o0], %o5
 	cmp		%o5, 0
-	be		1f
+	be		21f
 	 add		%o0, 1, %o0
 	andcc		%o0, 3, %g0
 	be		4f
 	 or		%o4, %lo(0x80808080), %o3
 	ldub		[%o0], %o5
 	cmp		%o5, 0
-	be		2f
+	be		22f
 	 add		%o0, 1, %o0
 	andcc		%o0, 3, %g0
 	be		5f
 	 sethi		%hi(0x01010101), %o4
 	ldub		[%o0], %o5
 	cmp		%o5, 0
-	be		3f
+	be		23f
 	 add		%o0, 1, %o0
 	b		11f
 	 or		%o4, %lo(0x01010101), %o2
-1:	retl
+21:	retl
 	 mov		0, %o0
-2:	retl
+22:	retl
 	 mov		1, %o0
-3:	retl
+23:	retl
 	 mov		2, %o0
 
-ENTRY(strlen)
-	mov		%o0, %o1
-	andcc		%o0, 3, %g0
-	bne		10b
-	 sethi		%hi(0x80808080), %o4
-	or		%o4, %lo(0x80808080), %o3
+20:	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o4
 5:	or		%o4, %lo(0x01010101), %o2
 11:	ld		[%o0], %o5