about summary refs log tree commit diff
path: root/sysdeps/sparc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-16 19:40:31 -0700
committerDavid S. Miller <davem@davemloft.net>2015-04-17 10:26:14 -0700
commitaa4980fc31e9ce176fe954bd0f29bcd65a61556a (patch)
tree61bc6a99b44a56bcf031f73116d1f6507ac84b49 /sysdeps/sparc
parentd1e44df1fa5fefd8a083f6c1e909bbcdc97c6438 (diff)
downloadglibc-aa4980fc31e9ce176fe954bd0f29bcd65a61556a.tar.gz
glibc-aa4980fc31e9ce176fe954bd0f29bcd65a61556a.tar.xz
glibc-aa4980fc31e9ce176fe954bd0f29bcd65a61556a.zip
Sparc memchr/memcmp/strncmp fixes from Il'ya Malakhov.
	[BZ #17825]
	* sysdeps/sparc/sparc64/memchr.S: Fix signedness handling of length.
	* sysdeps/sparc/sparc64/memcmp.S: Likewise.
	* sysdeps/sparc/sparc64/strncmp.S: Likewise.
Diffstat (limited to 'sysdeps/sparc')
-rw-r--r--sysdeps/sparc/sparc64/memchr.S3
-rw-r--r--sysdeps/sparc/sparc64/memcmp.S4
-rw-r--r--sysdeps/sparc/sparc64/strncmp.S4
3 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S
index 23ed62ea4d..d92bad156c 100644
--- a/sysdeps/sparc/sparc64/memchr.S
+++ b/sysdeps/sparc/sparc64/memchr.S
@@ -63,7 +63,8 @@ ENTRY(__memchr)
 	be,pn		%XCC, 12f			/* CTI				*/
 #endif
 	 sll		%o1, 8, %g3			/* IEU0		Group		*/
-	add		%o0, %o2, %o2			/* IEU1				*/
+	addcc		%o0, %o2, %o2			/* IEU1				*/
+	movcs		%XCC, -1, %o2			/* IEU0		Group		*/
 
 	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/
 	or		%g3, %o1, %g3			/* IEU1				*/
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index 18ed0ce77a..552307edeb 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -51,7 +51,7 @@ ENTRY(memcmp)
 2:	mov		%g1, %o3			/* IEU0		Group		*/
 	subcc		%o2, 8, %o2			/* IEU1				*/
 
-	bl,pn		%XCC, 5f			/* CTI				*/
+	bcs,pn		%XCC, 5f			/* CTI				*/
 	 ldxa		[%o0] ASI_PNF, %g1		/* Load		Group		*/
 	mov		%g2, %o4			/* IEU0				*/
 	ldxa		[%o0 + %o1] ASI_PNF, %g2	/* Load		Group		*/
@@ -125,7 +125,7 @@ ENTRY(memcmp)
 
 	ldxa		[%o0] ASI_PNF, %g5		/* Load				*/
 	subcc		%o2, 8, %o2			/* IEU1		Group		*/
-	bl,pn		%XCC, 6b			/* CTI				*/
+	bcs,pn		%XCC, 6b			/* CTI				*/
 	 or		%o4, %o5, %o4			/* IEU0				*/
 
 	cmp		%o3, %o4			/* IEU1		Group		*/
diff --git a/sysdeps/sparc/sparc64/strncmp.S b/sysdeps/sparc/sparc64/strncmp.S
index cf8f56e712..233b62b20a 100644
--- a/sysdeps/sparc/sparc64/strncmp.S
+++ b/sysdeps/sparc/sparc64/strncmp.S
@@ -72,7 +72,7 @@ ENTRY(strncmp)
 
 	add		%o0, 8, %o0			/* IEU1				*/
 2:	subcc		%o2, 8, %o2			/* IEU1		Group		*/
-	bl,pn		%XCC, 5f			/* CTI				*/
+	bcs,pn		%XCC, 5f			/* CTI				*/
 	 add		%o1, 8, %o1			/* IEU0				*/
 
 	sub		%g4, %g1, %g3			/* IEU0		Group		*/
@@ -310,7 +310,7 @@ ENTRY(strncmp)
 	addcc		%o0, 8, %o0			/* IEU1				*/
 	srlx		%o4, %g6, %o5			/* IEU0				*/
 	subcc		%o2, 8, %o2			/* IEU1		Group		*/
-	bl,pn		%XCC, 5b			/* CTI				*/
+	bcs,pn		%XCC, 5b			/* CTI				*/
 
 	 or		%o3, %o5, %o3			/* IEU0				*/
 	cmp		%g4, %o3			/* IEU1		Group		*/