Patchwork rs6000: Group processor types

login
register
mail settings
Submitter Segher Boessenkool
Date May 31, 2013, 7:34 a.m.
Message ID <2b5dc3fad7d3eec0987f43a5642e72dc99bd7cfa.1369983960.git.segher@kernel.crashing.org>
Download mbox | patch
Permalink /patch/247858/
State New
Headers show

Comments

Segher Boessenkool - May 31, 2013, 7:34 a.m.
Long lines like this define_attr are hard to read, and patches to
them are hard to read and apply.

Bootstrapped and tested on powerpc64-linux --enable-languages=c,c++,fortran
--disable-libsanitizer, -m64,-m32,-m32/-mpowerpc64, no regressions.  Okay
to apply?


2013-05-31  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* config/rs6000/rs6000-opts.h (enum processor_type): Reorder.
	* config/rs6000/rs6000.md: (cpu): Reorder.  Split long line.
	Fix comment.

---
 gcc/config/rs6000/rs6000-opts.h | 21 +++++++++++++--------
 gcc/config/rs6000/rs6000.md     | 10 +++++++---
 2 files changed, 20 insertions(+), 11 deletions(-)
David Edelsohn - May 31, 2013, 3:19 p.m.
On Fri, May 31, 2013 at 3:34 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> Long lines like this define_attr are hard to read, and patches to
> them are hard to read and apply.
>
> Bootstrapped and tested on powerpc64-linux --enable-languages=c,c++,fortran
> --disable-libsanitizer, -m64,-m32,-m32/-mpowerpc64, no regressions.  Okay
> to apply?
>
>
> 2013-05-31  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/
>         * config/rs6000/rs6000-opts.h (enum processor_type): Reorder.
>         * config/rs6000/rs6000.md: (cpu): Reorder.  Split long line.
>         Fix comment.

Okay, but if you are going to split the lines and group the
processors, I would place Motorola ppc7xx/ppc7xxx on a separate line.

> +(define_attr "cpu"
> +  "ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,
+ ppc750,ppc7400,ppc7450,
> +   ppc403,ppc405,ppc440,ppc476,
> +   ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,ppce6500,
> +   power4,power5,power6,power7,power8,
> +   rs64a,mpccore,cell,ppca2,titan"

I don't have any particularly good grouping for the last 5, although
rs64a and ppca2 are IBM while mpccore is Motorola.

- David

Patch

diff --git a/gcc/config/rs6000/rs6000-opts.h b/gcc/config/rs6000/rs6000-opts.h
index e143a4c..901cfbe 100644
--- a/gcc/config/rs6000/rs6000-opts.h
+++ b/gcc/config/rs6000/rs6000-opts.h
@@ -30,12 +30,6 @@ 
 /* Processor type.  Order must match cpu attribute in MD file.  */
 enum processor_type
  {
-   PROCESSOR_RS64A,
-   PROCESSOR_MPCCORE,
-   PROCESSOR_PPC403,
-   PROCESSOR_PPC405,
-   PROCESSOR_PPC440,
-   PROCESSOR_PPC476,
    PROCESSOR_PPC601,
    PROCESSOR_PPC603,
    PROCESSOR_PPC604,
@@ -45,6 +39,12 @@  enum processor_type
    PROCESSOR_PPC750,
    PROCESSOR_PPC7400,
    PROCESSOR_PPC7450,
+
+   PROCESSOR_PPC403,
+   PROCESSOR_PPC405,
+   PROCESSOR_PPC440,
+   PROCESSOR_PPC476,
+
    PROCESSOR_PPC8540,
    PROCESSOR_PPC8548,
    PROCESSOR_PPCE300C2,
@@ -53,16 +53,21 @@  enum processor_type
    PROCESSOR_PPCE500MC64,
    PROCESSOR_PPCE5500,
    PROCESSOR_PPCE6500,
+
    PROCESSOR_POWER4,
    PROCESSOR_POWER5,
    PROCESSOR_POWER6,
    PROCESSOR_POWER7,
+   PROCESSOR_POWER8,
+
+   PROCESSOR_RS64A,
+   PROCESSOR_MPCCORE,
    PROCESSOR_CELL,
    PROCESSOR_PPCA2,
-   PROCESSOR_TITAN,
-   PROCESSOR_POWER8
+   PROCESSOR_TITAN
 };
 
+
 /* FP processor type.  */
 enum fpu_type_t
 {
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 013a0e3..7569d3e 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -166,9 +166,13 @@  (define_attr "length" ""
 		(const_int 4)))
 
 ;; Processor type -- this attribute must exactly match the processor_type
-;; enumeration in rs6000.h.
-
-(define_attr "cpu" "rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,ppce6500,power4,power5,power6,power7,cell,ppca2,titan,power8"
+;; enumeration in rs6000-opts.h.
+(define_attr "cpu"
+  "ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,
+   ppc403,ppc405,ppc440,ppc476,
+   ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,ppce6500,
+   power4,power5,power6,power7,power8,
+   rs64a,mpccore,cell,ppca2,titan"
   (const (symbol_ref "rs6000_cpu_attr")))