public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
@ 2013-03-11 18:07 Roland McGrath
  2013-03-11 23:35 ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2013-03-11 18:07 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-ports

Updated for current trunk.  No regressions on armv7l-linux-gnueabihf.
OK now?


Thanks,
Roland


ports/ChangeLog.arm
	* sysdeps/arm/memcpy.S: Use r10 instead of r9.
	* sysdeps/arm/memmove.S: Likewise.

--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -189,13 +189,13 @@ ENTRY(memcpy)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		push	{r5 - r9}
+11:		push	{r5 - r8, r10}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
 		cfi_rel_offset (r7, 8)
 		cfi_rel_offset (r8, 12)
-		cfi_rel_offset (r9, 16)
+		cfi_rel_offset (r10, 16)
 
 	PLD(	pld	[r1, #0]		)
 	PLD(	subs	r2, r2, #96		)
@@ -208,7 +208,7 @@ ENTRY(memcpy)
 13:		ldmia	r1!, {r4, r5, r6, r7}
 		mov	r3, lr, PULL #\pull
 		subs	r2, r2, #32
-		ldmia	r1!, {r8, r9, ip, lr}
+		ldmia	r1!, {r8, r10, ip, lr}
 		orr	r3, r3, r4, PUSH #\push
 		mov	r4, r4, PULL #\pull
 		orr	r4, r4, r5, PUSH #\push
@@ -219,23 +219,23 @@ ENTRY(memcpy)
 		mov	r7, r7, PULL #\pull
 		orr	r7, r7, r8, PUSH #\push
 		mov	r8, r8, PULL #\pull
-		orr	r8, r8, r9, PUSH #\push
-		mov	r9, r9, PULL #\pull
-		orr	r9, r9, ip, PUSH #\push
+		orr	r8, r8, r10, PUSH #\push
+		mov	r10, r10, PULL #\pull
+		orr	r10, r10, ip, PUSH #\push
 		mov	ip, ip, PULL #\pull
 		orr	ip, ip, lr, PUSH #\push
-		stmia	r0!, {r3, r4, r5, r6, r7, r8, r9, ip}
+		stmia	r0!, {r3, r4, r5, r6, r7, r8, r10, ip}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		pop	{r5 - r9}
+		pop	{r5 - r8, r10}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
 		cfi_restore (r7)
 		cfi_restore (r8)
-		cfi_restore (r9)
+		cfi_restore (r10)
 
 14:		ands	ip, r2, #28
 		beq	16f
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -204,13 +204,13 @@ ENTRY(memmove)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		push	{r5 - r9}
+11:		push	{r5 - r8, r10}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
 		cfi_rel_offset (r7, 8)
 		cfi_rel_offset (r8, 12)
-		cfi_rel_offset (r9, 16)
+		cfi_rel_offset (r10, 16)
 
 	PLD(	pld	[r1, #-4]		)
 	PLD(	subs	r2, r2, #96		)
@@ -220,15 +220,15 @@ ENTRY(memmove)
 	PLD(	pld	[r1, #-96]		)
 
 12:	PLD(	pld	[r1, #-128]		)
-13:		ldmdb   r1!, {r7, r8, r9, ip}
+13:		ldmdb   r1!, {r7, r8, r10, ip}
 		mov     lr, r3, PUSH #\push
 		subs    r2, r2, #32
 		ldmdb   r1!, {r3, r4, r5, r6}
 		orr     lr, lr, ip, PULL #\pull
 		mov     ip, ip, PUSH #\push
-		orr     ip, ip, r9, PULL #\pull
-		mov     r9, r9, PUSH #\push
-		orr     r9, r9, r8, PULL #\pull
+		orr     ip, ip, r10, PULL #\pull
+		mov     r10, r10, PUSH #\push
+		orr     r10, r10, r8, PULL #\pull
 		mov     r8, r8, PUSH #\push
 		orr     r8, r8, r7, PULL #\pull
 		mov     r7, r7, PUSH #\push
@@ -239,18 +239,18 @@ ENTRY(memmove)
 		orr     r5, r5, r4, PULL #\pull
 		mov     r4, r4, PUSH #\push
 		orr     r4, r4, r3, PULL #\pull
-		stmdb   r0!, {r4 - r9, ip, lr}
+		stmdb   r0!, {r4 - r8, r10, ip, lr}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		pop	{r5 - r9}
+		pop	{r5 - r8, r10}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
 		cfi_restore (r7)
 		cfi_restore (r8)
-		cfi_restore (r9)
+		cfi_restore (r10)
 
 14:		ands	ip, r2, #28
 		beq	16f

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
  2013-03-11 18:07 [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9 Roland McGrath
@ 2013-03-11 23:35 ` Joseph S. Myers
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph S. Myers @ 2013-03-11 23:35 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Mon, 11 Mar 2013, Roland McGrath wrote:

> 	* sysdeps/arm/memcpy.S: Use r10 instead of r9.
> 	* sysdeps/arm/memmove.S: Likewise.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
  2013-02-28 21:16   ` Roland McGrath
@ 2013-02-28 21:23     ` Joseph S. Myers
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph S. Myers @ 2013-02-28 21:23 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Thu, 28 Feb 2013, Roland McGrath wrote:

> > looks like it should be r5-r8, r10.  How was this patch tested?
> 
> Oops, I caught most of those cases but missed the last couple.
> Now fixed on the branch.
> 
> I haven't done any testing at all yet.  I wanted to make sure you didn't
> have some broader objection to the change before I dealt with getting set
> up to do arm-linux-gnueabi builds and test runs.  If you're not willing to
> approve on eyeball validation alone (which is eminently reasonable, of
> course), then I'll get my testing setup in order before asking again.

I think the principle is fine, but this does need testing as illustrated 
by the above issue.  (Unlike Richard's whole new implementations of some 
string functions, I don't think there's any need for big-endian testing 
here; testing for just one endianness suffices.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
  2013-02-28 16:54 ` Joseph S. Myers
@ 2013-02-28 21:16   ` Roland McGrath
  2013-02-28 21:23     ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2013-02-28 21:16 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

> looks like it should be r5-r8, r10.  How was this patch tested?

Oops, I caught most of those cases but missed the last couple.
Now fixed on the branch.

I haven't done any testing at all yet.  I wanted to make sure you didn't
have some broader objection to the change before I dealt with getting set
up to do arm-linux-gnueabi builds and test runs.  If you're not willing to
approve on eyeball validation alone (which is eminently reasonable, of
course), then I'll get my testing setup in order before asking again.

(I also had intended to let Richard's changes settle before I really tried
to get mine in, too.  I'll have many more assembly changes related to
arm-nacl porting, and this was only the simplest one I did first.)


Thanks,
Roland

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
  2013-02-28  1:01 Roland McGrath
@ 2013-02-28 16:54 ` Joseph S. Myers
  2013-02-28 21:16   ` Roland McGrath
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph S. Myers @ 2013-02-28 16:54 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Wed, 27 Feb 2013, Roland McGrath wrote:

> The arm-nacl ABI reserves r9 for the system (as EABI says some variants
> might).  r10 is just the same for other instruction-set and ABI issues,
> so this uses r10 in place of r9.

This will need updating for the push/pop patch that I approved.  Apart 
from that,

> @@ -237,18 +237,18 @@ ENTRY(memmove)
>  		orr     r5, r5, r4, pull #\pull
>  		mov     r4, r4, push #\push
>  		orr     r4, r4, r3, pull #\pull
> -		stmdb   r0!, {r4 - r9, ip, lr}
> +		stmdb   r0!, {r4 - r10, ip, lr}

looks like it should use r4 - r8, r10 rather than r4 - r10, and similarly

> -		ldmfd	sp!, {r5 - r9}
> +		ldmfd	sp!, {r5 - r10}

looks like it should be r5-r8, r10.  How was this patch tested?

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9.
@ 2013-02-28  1:01 Roland McGrath
  2013-02-28 16:54 ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2013-02-28  1:01 UTC (permalink / raw)
  To: libc-ports

The arm-nacl ABI reserves r9 for the system (as EABI says some variants
might).  r10 is just the same for other instruction-set and ABI issues,
so this uses r10 in place of r9.


Thanks,
Roland


ports/ChangeLog.arm
2013-02-27  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/arm/memcpy.S: Use r10 instead of r9.
	* sysdeps/arm/memmove.S: Likewise.

--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -187,13 +187,13 @@ ENTRY(memcpy)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		stmfd	sp!, {r5 - r9}
+11:		stmfd	sp!, {r5 - r8, r10}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
 		cfi_rel_offset (r7, 8)
 		cfi_rel_offset (r8, 12)
-		cfi_rel_offset (r9, 16)
+		cfi_rel_offset (r10, 16)
 
 	PLD(	pld	[r1, #0]		)
 	PLD(	subs	r2, r2, #96		)
@@ -206,7 +206,7 @@ ENTRY(memcpy)
 13:		ldmia	r1!, {r4, r5, r6, r7}
 		mov	r3, lr, pull #\pull
 		subs	r2, r2, #32
-		ldmia	r1!, {r8, r9, ip, lr}
+		ldmia	r1!, {r8, r10, ip, lr}
 		orr	r3, r3, r4, push #\push
 		mov	r4, r4, pull #\pull
 		orr	r4, r4, r5, push #\push
@@ -217,23 +217,23 @@ ENTRY(memcpy)
 		mov	r7, r7, pull #\pull
 		orr	r7, r7, r8, push #\push
 		mov	r8, r8, pull #\pull
-		orr	r8, r8, r9, push #\push
-		mov	r9, r9, pull #\pull
-		orr	r9, r9, ip, push #\push
+		orr	r8, r8, r10, push #\push
+		mov	r10, r10, pull #\pull
+		orr	r10, r10, ip, push #\push
 		mov	ip, ip, pull #\pull
 		orr	ip, ip, lr, push #\push
-		stmia	r0!, {r3, r4, r5, r6, r7, r8, r9, ip}
+		stmia	r0!, {r3, r4, r5, r6, r7, r8, r10, ip}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		ldmfd	sp!, {r5 - r9}
+		ldmfd	sp!, {r5 - r8, r10}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
 		cfi_restore (r7)
 		cfi_restore (r8)
-		cfi_restore (r9)
+		cfi_restore (r10)
 
 14:		ands	ip, r2, #28
 		beq	16f
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -202,13 +202,13 @@ ENTRY(memmove)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		stmfd	sp!, {r5 - r9}
+11:		stmfd	sp!, {r5 - r8, r10}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
 		cfi_rel_offset (r7, 8)
 		cfi_rel_offset (r8, 12)
-		cfi_rel_offset (r9, 16)
+		cfi_rel_offset (r10, 16)
 
 	PLD(	pld	[r1, #-4]		)
 	PLD(	subs	r2, r2, #96		)
@@ -218,15 +218,15 @@ ENTRY(memmove)
 	PLD(	pld	[r1, #-96]		)
 
 12:	PLD(	pld	[r1, #-128]		)
-13:		ldmdb   r1!, {r7, r8, r9, ip}
+13:		ldmdb   r1!, {r7, r8, r10, ip}
 		mov     lr, r3, push #\push
 		subs    r2, r2, #32
 		ldmdb   r1!, {r3, r4, r5, r6}
 		orr     lr, lr, ip, pull #\pull
 		mov     ip, ip, push #\push
-		orr     ip, ip, r9, pull #\pull
-		mov     r9, r9, push #\push
-		orr     r9, r9, r8, pull #\pull
+		orr     ip, ip, r10, pull #\pull
+		mov     r10, r10, push #\push
+		orr     r10, r10, r8, pull #\pull
 		mov     r8, r8, push #\push
 		orr     r8, r8, r7, pull #\pull
 		mov     r7, r7, push #\push
@@ -237,18 +237,18 @@ ENTRY(memmove)
 		orr     r5, r5, r4, pull #\pull
 		mov     r4, r4, push #\push
 		orr     r4, r4, r3, pull #\pull
-		stmdb   r0!, {r4 - r9, ip, lr}
+		stmdb   r0!, {r4 - r10, ip, lr}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		ldmfd	sp!, {r5 - r9}
+		ldmfd	sp!, {r5 - r10}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
 		cfi_restore (r7)
 		cfi_restore (r8)
-		cfi_restore (r9)
+		cfi_restore (r10)
 
 14:		ands	ip, r2, #28
 		beq	16f

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-11 23:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 18:07 [PATCH roland/arm-avoid-r9] ARM: Use r10 instead of r9 Roland McGrath
2013-03-11 23:35 ` Joseph S. Myers
  -- strict thread matches above, loose matches on Subject: below --
2013-02-28  1:01 Roland McGrath
2013-02-28 16:54 ` Joseph S. Myers
2013-02-28 21:16   ` Roland McGrath
2013-02-28 21:23     ` Joseph S. Myers

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).