public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] Improve Thumb allocation order
@ 2016-11-30 17:33 Wilco Dijkstra
  2016-12-06 15:02 ` Wilco Dijkstra
  2016-12-15 20:56 ` Richard Earnshaw (lists)
  0 siblings, 2 replies; 4+ messages in thread
From: Wilco Dijkstra @ 2016-11-30 17:33 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd

Thumb uses a special register allocation order to increase the use of low
registers.  Oddly enough, LR appears before R12, which means that LR must
be saved and restored even if R12 is available.  Swapping R12 and LR means
this simple example now uses R12 as a temporary (just like ARM):

int f(long long a, long long b)
{
  if (a < b) return 1;
  return a + b;
}

	cmp	r0, r2
	sbcs	ip, r1, r3
	ite	ge
	addge	r0, r0, r2
	movlt	r0, #1
	bx	lr

Bootstrap OK. CSibe benchmarks unchanged.

ChangeLog:
2016-11-30  Wilco Dijkstra  <wdijkstr@arm.com>

        * gcc/config/arm/arm.c (thumb_core_reg_alloc_order): Swap R12 and R14.

--
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 43c78f6148a5306fb0079ee2eba12f3763652bcc..29dcefd23762ba861b458b8860eb4b4856a9cb02 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26455,7 +26455,7 @@ arm_mangle_type (const_tree type)
 static const int thumb_core_reg_alloc_order[] =
 {
    3,  2,  1,  0,  4,  5,  6,  7,
-  14, 12,  8,  9, 10, 11
+  12, 14,  8,  9, 10, 11
 };
 
 /* Adjust register allocation order when compiling for Thumb.  */

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

* Re: [PATCH][ARM] Improve Thumb allocation order
  2016-11-30 17:33 [PATCH][ARM] Improve Thumb allocation order Wilco Dijkstra
@ 2016-12-06 15:02 ` Wilco Dijkstra
  2016-12-14 16:39   ` Wilco Dijkstra
  2016-12-15 20:56 ` Richard Earnshaw (lists)
  1 sibling, 1 reply; 4+ messages in thread
From: Wilco Dijkstra @ 2016-12-06 15:02 UTC (permalink / raw)
  To: GCC Patches, Kyrylo Tkachov; +Cc: nd


ping


From: Wilco Dijkstra
Sent: 30 November 2016 17:32
To: GCC Patches
Cc: nd
Subject: [PATCH][ARM] Improve Thumb allocation order
    
Thumb uses a special register allocation order to increase the use of low
registers.  Oddly enough, LR appears before R12, which means that LR must
be saved and restored even if R12 is available.  Swapping R12 and LR means
this simple example now uses R12 as a temporary (just like ARM):

int f(long long a, long long b)
{
  if (a < b) return 1;
  return a + b;
}

        cmp     r0, r2
        sbcs    ip, r1, r3
        ite     ge
        addge   r0, r0, r2
        movlt   r0, #1
        bx      lr

Bootstrap OK. CSibe benchmarks unchanged.

ChangeLog:
2016-11-30  Wilco Dijkstra  <wdijkstr@arm.com>

        * gcc/config/arm/arm.c (thumb_core_reg_alloc_order): Swap R12 and R14.

--
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 43c78f6148a5306fb0079ee2eba12f3763652bcc..29dcefd23762ba861b458b8860eb4b4856a9cb02 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26455,7 +26455,7 @@ arm_mangle_type (const_tree type)
 static const int thumb_core_reg_alloc_order[] =
 {
    3,  2,  1,  0,  4,  5,  6,  7,
-  14, 12,  8,  9, 10, 11
+  12, 14,  8,  9, 10, 11
 };
 
 /* Adjust register allocation order when compiling for Thumb.  */

    

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

* Re: [PATCH][ARM] Improve Thumb allocation order
  2016-12-06 15:02 ` Wilco Dijkstra
@ 2016-12-14 16:39   ` Wilco Dijkstra
  0 siblings, 0 replies; 4+ messages in thread
From: Wilco Dijkstra @ 2016-12-14 16:39 UTC (permalink / raw)
  To: GCC Patches, Kyrylo Tkachov; +Cc: nd

    

ping


From: Wilco Dijkstra
Sent: 30 November 2016 17:32
To: GCC Patches
Cc: nd
Subject: [PATCH][ARM] Improve Thumb allocation order
    
Thumb uses a special register allocation order to increase the use of low
registers.  Oddly enough, LR appears before R12, which means that LR must
be saved and restored even if R12 is available.  Swapping R12 and LR means
this simple example now uses R12 as a temporary (just like ARM):

int f(long long a, long long b)
{
  if (a < b) return 1;
  return a + b;
}

        cmp     r0, r2
        sbcs    ip, r1, r3
        ite     ge
        addge   r0, r0, r2
        movlt   r0, #1
        bx      lr

Bootstrap OK. CSibe benchmarks unchanged.

ChangeLog:
2016-11-30  Wilco Dijkstra  <wdijkstr@arm.com>

        * gcc/config/arm/arm.c (thumb_core_reg_alloc_order): Swap R12 and R14.

--
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 43c78f6148a5306fb0079ee2eba12f3763652bcc..29dcefd23762ba861b458b8860eb4b4856a9cb02 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26455,7 +26455,7 @@ arm_mangle_type (const_tree type)
 static const int thumb_core_reg_alloc_order[] =
 {
    3,  2,  1,  0,  4,  5,  6,  7,
-  14, 12,  8,  9, 10, 11
+  12, 14,  8,  9, 10, 11
 };
 
 /* Adjust register allocation order when compiling for Thumb.  */

        

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

* Re: [PATCH][ARM] Improve Thumb allocation order
  2016-11-30 17:33 [PATCH][ARM] Improve Thumb allocation order Wilco Dijkstra
  2016-12-06 15:02 ` Wilco Dijkstra
@ 2016-12-15 20:56 ` Richard Earnshaw (lists)
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Earnshaw (lists) @ 2016-12-15 20:56 UTC (permalink / raw)
  To: Wilco Dijkstra, GCC Patches; +Cc: nd

On 30/11/16 17:32, Wilco Dijkstra wrote:
> Thumb uses a special register allocation order to increase the use of low
> registers.  Oddly enough, LR appears before R12, which means that LR must
> be saved and restored even if R12 is available.  Swapping R12 and LR means
> this simple example now uses R12 as a temporary (just like ARM):
> 
> int f(long long a, long long b)
> {
>   if (a < b) return 1;
>   return a + b;
> }
> 
> 	cmp	r0, r2
> 	sbcs	ip, r1, r3
> 	ite	ge
> 	addge	r0, r0, r2
> 	movlt	r0, #1
> 	bx	lr
> 
> Bootstrap OK. CSibe benchmarks unchanged.
> 
> ChangeLog:
> 2016-11-30  Wilco Dijkstra  <wdijkstr@arm.com>
> 
>         * gcc/config/arm/arm.c (thumb_core_reg_alloc_order): Swap R12 and R14.
> 

OK.

R.

> --
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 43c78f6148a5306fb0079ee2eba12f3763652bcc..29dcefd23762ba861b458b8860eb4b4856a9cb02 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -26455,7 +26455,7 @@ arm_mangle_type (const_tree type)
>  static const int thumb_core_reg_alloc_order[] =
>  {
>     3,  2,  1,  0,  4,  5,  6,  7,
> -  14, 12,  8,  9, 10, 11
> +  12, 14,  8,  9, 10, 11
>  };
>  
>  /* Adjust register allocation order when compiling for Thumb.  */
> 

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

end of thread, other threads:[~2016-12-15 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30 17:33 [PATCH][ARM] Improve Thumb allocation order Wilco Dijkstra
2016-12-06 15:02 ` Wilco Dijkstra
2016-12-14 16:39   ` Wilco Dijkstra
2016-12-15 20:56 ` Richard Earnshaw (lists)

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