diff mbox

rs6000: Make cr5 allocatable

Message ID 10adfaa86a60b1bc978aa12fa58023ad5a1c4ea3.1403098217.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool June 18, 2014, 2:14 p.m. UTC
A comment in rs6000.h says "cr5 is not supposed to be used".  I checked
all ABIs, going as far back as PowerOpen (1994), and found no mention
of this.

Also document cr6 is used by some vector instructions.

Tested on powerpc64-linux, no regressions.  Okay to apply?


Segher


2014-06-18  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* config/rs6000/rs6000.h (FIXED_REGISTERS): Update comment.
	Remove cr5.
	(REG_ALLOC_ORDER): Update comment.  Move cr5 earlier.

---
 gcc/config/rs6000/rs6000.h | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Mike Stump June 18, 2014, 6 p.m. UTC | #1
On Jun 18, 2014, at 7:14 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> A comment in rs6000.h says "cr5 is not supposed to be used".  I checked
> all ABIs,

I usually do a blame and find that change that added it…  Ah, there it is, r341…  let’s see, rms did it!  :-)  Oh well…  never mind.  Kinda amazing the bits lost in time.
David Edelsohn June 18, 2014, 7:47 p.m. UTC | #2
On Wed, Jun 18, 2014 at 10:14 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> A comment in rs6000.h says "cr5 is not supposed to be used".  I checked
> all ABIs, going as far back as PowerOpen (1994), and found no mention
> of this.
>
> Also document cr6 is used by some vector instructions.
>
> Tested on powerpc64-linux, no regressions.  Okay to apply?
>
>
> Segher
>
>
> 2014-06-18  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/
>         * config/rs6000/rs6000.h (FIXED_REGISTERS): Update comment.
>         Remove cr5.
>         (REG_ALLOC_ORDER): Update comment.  Move cr5 earlier.

This is okay.

I have no idea why RMS assumed that cr5 is fixed.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 3bd0104..569ae2d 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -978,8 +978,6 @@  enum data_align { align_abi, align_opt, align_both };
    On RS/6000, r1 is used for the stack.  On Darwin, r2 is available
    as a local register; for all other OS's r2 is the TOC pointer.
 
-   cr5 is not supposed to be used.
-
    On System V implementations, r13 is fixed and not available for use.  */
 
 #define FIXED_REGISTERS  \
@@ -987,7 +985,7 @@  enum data_align { align_abi, align_opt, align_both };
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-   0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1,	   \
+   0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,	   \
    /* AltiVec registers.  */			   \
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
@@ -1048,7 +1046,8 @@  enum data_align { align_abi, align_opt, align_both };
 	fp13 - fp2	(not saved; incoming fp arg registers)
 	fp1		(not saved; return value)
 	fp31 - fp14	(saved; order given to save least number)
-	cr7, cr6	(not saved or special)
+	cr7, cr5	(not saved or special)
+	cr6		(not saved, but used for vector operations)
 	cr1		(not saved, but used for FP operations)
 	cr0		(not saved, but used for arithmetic operations)
 	cr4, cr3, cr2	(saved)
@@ -1061,7 +1060,7 @@  enum data_align { align_abi, align_opt, align_both };
 	r12		(not saved; if used for DImode or DFmode would use r13)
 	ctr		(not saved; when we have the choice ctr is better)
 	lr		(saved)
-	cr5, r1, r2, ap, ca (fixed)
+	r1, r2, ap, ca	(fixed)
 	v0 - v1		(not saved or used for anything)
 	v13 - v3	(not saved; incoming vector arg registers)
 	v2		(not saved; incoming vector arg reg; return value)
@@ -1099,14 +1098,14 @@  enum data_align { align_abi, align_opt, align_both };
    33,								\
    63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51,		\
    50, 49, 48, 47, 46,						\
-   75, 74, 69, 68, 72, 71, 70,					\
+   75, 73, 74, 69, 68, 72, 71, 70,				\
    MAYBE_R2_AVAILABLE						\
    9, 10, 8, 7, 6, 5, 4,					\
    3, EARLY_R12 11, 0,						\
    31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,		\
    18, 17, 16, 15, 14, 13, LATE_R12				\
    66, 65,							\
-   73, 1, MAYBE_R2_FIXED 67, 76,				\
+   1, MAYBE_R2_FIXED 67, 76,					\
    /* AltiVec registers.  */					\
    77, 78,							\
    90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80,			\