On Tue, Dec 6, 2011 at 6:28 PM, Andrew Pinski <pins...@gmail.com> wrote: > Hi, > This patch adds -march=octeon+ to GCC. > OK? Bootstrapped and tested on mips64-linux-gnu configured with > --with-arch=octeon+ . > > Thanks, > Andrew Pinski > > gcc/ChangeLog: > * mips/mips-cpus.def (octeon+): New CPU. > * config/mips/mips-tables.opt: Regenerate. > * config/mips/mips.h (MIPS_CPP_SET_PROCESSOR): Emit '+' as 'P'. > > testsuite/ChangeLog: > * gcc.target/mips/mult-1.c: Forbit all Octeon processors. > * gcc.target/mips/dmult-1.c: Likewise. > * gcc.target/mips/branch-1.c: Likewise. > * gcc.target/mips/extend-1.c: Likewise.
Woops I forgot the patch. Thanks, Andrew Pinski
Index: testsuite/gcc.target/mips/mult-1.c =================================================================== --- testsuite/gcc.target/mips/mult-1.c (revision 182066) +++ testsuite/gcc.target/mips/mult-1.c (working copy) @@ -1,6 +1,6 @@ /* For SI->DI widening multiplication we should use DINS to combine the two halves. For Octeon use DMUL with explicit widening. */ -/* { dg-options "-O -mgp64 isa_rev>=2 forbid_cpu=octeon" } */ +/* { dg-options "-O -mgp64 isa_rev>=2 forbid_cpu=octeon\[\+0-9\]*" } */ /* { dg-final { scan-assembler "\tdins\t" } } */ /* { dg-final { scan-assembler-not "\tdsll\t" } } */ /* { dg-final { scan-assembler-not "\tdsrl\t" } } */ Index: testsuite/gcc.target/mips/dmult-1.c =================================================================== --- testsuite/gcc.target/mips/dmult-1.c (revision 182066) +++ testsuite/gcc.target/mips/dmult-1.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-options "forbid_cpu=octeon -mgp64" } */ +/* { dg-options "forbid_cpu=octeon\[\+0-9\]* -mgp64" } */ /* { dg-final { scan-assembler "\tdmult\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tdmul\t" } } */ Index: testsuite/gcc.target/mips/branch-1.c =================================================================== --- testsuite/gcc.target/mips/branch-1.c (revision 182066) +++ testsuite/gcc.target/mips/branch-1.c (working copy) @@ -2,7 +2,7 @@ but we test for "bbit" elsewhere. On other targets, we should implement the "if" statements using an "andi" instruction followed by a branch on zero. */ -/* { dg-options "-O2 forbid_cpu=octeon" } */ +/* { dg-options "-O2 forbid_cpu=octeon\[\+0-9\]*" } */ void bar (void); NOMIPS16 void f1 (int x) { if (x & 4) bar (); } Index: testsuite/gcc.target/mips/extend-1.c =================================================================== --- testsuite/gcc.target/mips/extend-1.c (revision 182066) +++ testsuite/gcc.target/mips/extend-1.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-options "-O -mgp64 forbid_cpu=octeon" } */ +/* { dg-options "-O -mgp64 forbid_cpu=octeon\[\+0-9\]*" } */ /* { dg-final { scan-assembler-times "\tdsll\t" 5 } } */ /* { dg-final { scan-assembler-times "\tdsra\t" 5 } } */ /* { dg-final { scan-assembler-not "\tsll\t" } } */ Index: config/mips/mips-tables.opt =================================================================== --- config/mips/mips-tables.opt (revision 182066) +++ config/mips/mips-tables.opt (working copy) @@ -603,3 +603,6 @@ EnumValue Enum(mips_arch_opt_value) String(octeon) Value(80) Canonical +EnumValue +Enum(mips_arch_opt_value) String(octeon+) Value(81) Canonical + Index: config/mips/mips-cpus.def =================================================================== --- config/mips/mips-cpus.def (revision 182066) +++ config/mips/mips-cpus.def (working copy) @@ -145,3 +145,4 @@ /* MIPS64 Release 2 processors. */ MIPS_CPU ("octeon", PROCESSOR_OCTEON, 65, PTF_AVOID_BRANCHLIKELY) +MIPS_CPU ("octeon+", PROCESSOR_OCTEON, 65, PTF_AVOID_BRANCHLIKELY) Index: config/mips/mips.h =================================================================== --- config/mips/mips.h (revision 182066) +++ config/mips/mips.h (working copy) @@ -329,7 +329,10 @@ \ macro = concat ((PREFIX), "_", (INFO)->name, NULL); \ for (p = macro; *p != 0; p++) \ - *p = TOUPPER (*p); \ + if (*p == '+') \ + *p = 'P'; \ + else \ + *p = TOUPPER (*p); \ \ builtin_define (macro); \ builtin_define_with_value ((PREFIX), (INFO)->name, 1); \