public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@hack.frob.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-ports@sourceware.org
Subject: [PATCH roland/arm-unified] ARM: Convert string/ assembly to unified syntax.
Date: Mon, 11 Mar 2013 18:22:00 -0000	[thread overview]
Message-ID: <20130311182236.CAA382C071@topped-with-meat.com> (raw)

The assemblers I'm using give warnings about some code being in the older
syntax.  This makes them happy.  Verified that the assembled instructions
are unchanged.

OK?


Thanks,
Roland


ports/ChangeLog.arm
	* sysdeps/arm/memcpy.S: Convert to unified assembly syntax.
	* sysdeps/arm/memmove.S: Likewise.
	* sysdeps/arm/memset.S: Likewise.
	* sysdeps/arm/strlen.S: Likewise.

--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -53,6 +53,7 @@
 #endif
 
 		.text
+		.syntax unified
 
 /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
 
@@ -84,7 +85,7 @@ ENTRY(memcpy)
 
 	CALGN(	ands	ip, r1, #31		)
 	CALGN(	rsb	r3, ip, #32		)
-	CALGN(	sbcnes	r4, r3, r2		)  @ C is always set here
+	CALGN(	sbcsne	r4, r3, r2		)  @ C is always set here
 	CALGN(	bcs	2f			)
 	CALGN(	adr	r4, 6f			)
 	CALGN(	subs	r2, r2, r3		)  @ C gets set
@@ -139,12 +140,12 @@ ENTRY(memcpy)
 		cfi_restore (r8)
 
 8:		movs	r2, r2, lsl #31
-		ldrneb	r3, [r1], #1
-		ldrcsb	r4, [r1], #1
-		ldrcsb	ip, [r1]
-		strneb	r3, [r0], #1
-		strcsb	r4, [r0], #1
-		strcsb	ip, [r0]
+		ldrbne	r3, [r1], #1
+		ldrbcs	r4, [r1], #1
+		ldrbcs	ip, [r1]
+		strbne	r3, [r0], #1
+		strbcs	r4, [r0], #1
+		strbcs	ip, [r0]
 
 #if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
 		pop	{r0, r4, lr}
@@ -160,11 +161,11 @@ ENTRY(memcpy)
 
 9:		rsb	ip, ip, #4
 		cmp	ip, #2
-		ldrgtb	r3, [r1], #1
-		ldrgeb	r4, [r1], #1
+		ldrbgt	r3, [r1], #1
+		ldrbge	r4, [r1], #1
 		ldrb	lr, [r1], #1
-		strgtb	r3, [r0], #1
-		strgeb	r4, [r0], #1
+		strbgt	r3, [r0], #1
+		strbge	r4, [r0], #1
 		subs	r2, r2, ip
 		strb	lr, [r0], #1
 		blt	8b
@@ -185,7 +186,7 @@ ENTRY(memcpy)
 
 	CALGN(	ands	ip, r1, #31		)
 	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	sbcsne	r4, ip, r2		)  @ C is always set here
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -53,6 +53,7 @@
 #endif
 
 		.text
+		.syntax unified
 
 /*
  * Prototype: void *memmove(void *dest, const void *src, size_t n);
@@ -100,7 +101,7 @@ ENTRY(memmove)
 		blt	5f
 
 	CALGN(	ands	ip, r1, #31		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	sbcsne	r4, ip, r2		)  @ C is always set here
 	CALGN(	bcs	2f			)
 	CALGN(	adr	r4, 6f			)
 	CALGN(	subs	r2, r2, ip		)  @ C is set here
@@ -155,12 +156,12 @@ ENTRY(memmove)
 		cfi_restore (r8)
 
 8:		movs	r2, r2, lsl #31
-		ldrneb	r3, [r1, #-1]!
-		ldrcsb	r4, [r1, #-1]!
-		ldrcsb	ip, [r1, #-1]
-		strneb	r3, [r0, #-1]!
-		strcsb	r4, [r0, #-1]!
-		strcsb	ip, [r0, #-1]
+		ldrbne	r3, [r1, #-1]!
+		ldrbcs	r4, [r1, #-1]!
+		ldrbcs	ip, [r1, #-1]
+		strbne	r3, [r0, #-1]!
+		strbcs	r4, [r0, #-1]!
+		strbcs	ip, [r0, #-1]
 
 #if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
 		pop	{r0, r4, lr}
@@ -175,11 +176,11 @@ ENTRY(memmove)
 		cfi_restore_state
 
 9:		cmp	ip, #2
-		ldrgtb	r3, [r1, #-1]!
-		ldrgeb	r4, [r1, #-1]!
+		ldrbgt	r3, [r1, #-1]!
+		ldrbge	r4, [r1, #-1]!
 		ldrb	lr, [r1, #-1]!
-		strgtb	r3, [r0, #-1]!
-		strgeb	r4, [r0, #-1]!
+		strbgt	r3, [r0, #-1]!
+		strbge	r4, [r0, #-1]!
 		subs	r2, r2, ip
 		strb	lr, [r0, #-1]!
 		blt	8b
@@ -200,7 +201,7 @@ ENTRY(memmove)
 
 	CALGN(	ands	ip, r1, #31		)
 	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	sbcsne	r4, ip, r2		)  @ C is always set here
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
--- a/ports/sysdeps/arm/memset.S
+++ b/ports/sysdeps/arm/memset.S
@@ -20,6 +20,9 @@
 #define NO_THUMB
 #include <sysdep.h>
 
+	.text
+	.syntax unified
+
 /* void *memset (dstpp, c, len) */
 
 ENTRY(memset)
@@ -29,7 +32,7 @@ ENTRY(memset)
 
 1:
 	tst	r3, #3		@ aligned yet?
-	strneb	r1, [r3], #1
+	strbne	r1, [r3], #1
 	subne	r2, r2, #1
 	bne	1b
 
@@ -40,27 +43,27 @@ ENTRY(memset)
 
 1:
 	subs	r2, r2, #8
-	stmcsia	r3!, {r1, ip}	@ store up to 32 bytes per loop iteration
-	subcss	r2, r2, #8
-	stmcsia	r3!, {r1, ip}
-	subcss	r2, r2, #8
-	stmcsia	r3!, {r1, ip}
-	subcss	r2, r2, #8
-	stmcsia	r3!, {r1, ip}
+	stmiacs	r3!, {r1, ip}	@ store up to 32 bytes per loop iteration
+	subscs	r2, r2, #8
+	stmiacs	r3!, {r1, ip}
+	subscs	r2, r2, #8
+	stmiacs	r3!, {r1, ip}
+	subscs	r2, r2, #8
+	stmiacs	r3!, {r1, ip}
 	bcs	1b
 
 	and	r2, r2, #7
 2:
 	subs	r2, r2, #1	@ store up to 4 bytes per loop iteration
-	strcsb	r1, [r3], #1
-	subcss	r2, r2, #1
-	strcsb	r1, [r3], #1
-	subcss	r2, r2, #1
-	strcsb	r1, [r3], #1
-	subcss	r2, r2, #1
-	strcsb	r1, [r3], #1
+	strbcs	r1, [r3], #1
+	subscs	r2, r2, #1
+	strbcs	r1, [r3], #1
+	subscs	r2, r2, #1
+	strbcs	r1, [r3], #1
+	subscs	r2, r2, #1
+	strbcs	r1, [r3], #1
 	bcs	2b
-	
+
 	DO_RET(lr)
 END(memset)
 libc_hidden_builtin_def (memset)
--- a/ports/sysdeps/arm/strlen.S
+++ b/ports/sysdeps/arm/strlen.S
@@ -25,6 +25,9 @@
  * exit: r0 = len
  */
 
+	.syntax unified
+	.text
+
 ENTRY(strlen)
 	bic     r1, r0, $3              @ addr of word containing first byte
 	ldr     r2, [r1], $4            @ get the first word

             reply	other threads:[~2013-03-11 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 18:22 Roland McGrath [this message]
2013-03-11 21:19 ` Carlos O'Donell
2013-03-11 21:25   ` Roland McGrath
2013-03-11 23:35 ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130311182236.CAA382C071@topped-with-meat.com \
    --to=roland@hack.frob.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).