diff mbox

[testsuite] MIPS: Downgrade from R6 to R5 to prevent redundant testing of branch-cost-1.c.

Message ID A614194ED15B4844BC4C9FB7F21FCD9222532CDF@HHMAIL01.hh.imgtec.org
State New
Headers show

Commit Message

Toma Tabacu Nov. 15, 2016, 3:03 p.m. UTC
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Toma Tabacu
> Sent: 15 November 2016 14:00
> To: gcc-patches@gcc.gnu.org
> Cc: Matthew Fortune; catherine_moore@mentor.com
> Subject: [PATCH,testsuite] MIPS: Downgrade from R6 to R5 to prevent
> redundant testing of branch-cost-1.c.
> 
> Hi,
> 
> The branch-cost-1.c test uses the isa>=4 option to ensure the existence of the
> MOVN/MOVZ instructions. This, however, does not take into account R6
> targets,
> which are accepted by the isa>=4 option but do not support MOVN/MOVZ.
> 
> This particular test does not fail on R6, because it is checking for the
> absence of MOVN/MOVZ, but it is redundant.
> 
> This patch fixes this by replacing isa>=4 with (HAS_MOVN), which will only
> accept targets in the [MIPS IV, R5] interval.
> 
> Tested with mips-img-linux-gnu.
> 
> Regards,
> Toma Tabacu
> 
> gcc/testsuite/ChangeLog:
> 
> 2016-11-15  Toma Tabacu  <toma.tabacu@imgtec.com>
> 
> 	* gcc.target/mips/branch-cost-1.c: Use (HAS_MOVN) instead of isa>=4,
> 	in order to downgrade to R5.
> 
> diff --git a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> index 61c3029..7f7ebbe 100644
> --- a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> +++ b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> @@ -1,4 +1,4 @@
> -/* { dg-options "-mbranch-cost=1 isa>=4" } */
> +/* { dg-options "-mbranch-cost=1 (HAS_MOVN)" } */
>  /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
>  NOMIPS16 int
>  foo (int x, int y, int z, int k)

The version below has a slightly more precise ChangeLog entry.

Regards,
Toma Tabacu

gcc/testsuite/ChangeLog:

2016-11-15  Toma Tabacu  <toma.tabacu@imgtec.com>

	* gcc.target/mips/branch-cost-1.c (dg-options): Use (HAS_MOVN) instead
	of isa>=4, in order to downgrade to R5.

Comments

Moore, Catherine Nov. 17, 2016, 11:09 p.m. UTC | #1
> gcc/testsuite/ChangeLog:
> 
> 2016-11-15  Toma Tabacu  <toma.tabacu@imgtec.com>
> 
> 	* gcc.target/mips/branch-cost-1.c (dg-options): Use
> (HAS_MOVN) instead
> 	of isa>=4, in order to downgrade to R5.
> 
> diff --git a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> index 61c3029..7f7ebbe 100644
> --- a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> +++ b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> @@ -1,4 +1,4 @@
> -/* { dg-options "-mbranch-cost=1 isa>=4" } */
> +/* { dg-options "-mbranch-cost=1 (HAS_MOVN)" } */
>  /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
>  NOMIPS16 int
>  foo (int x, int y, int z, int k)

I committed this patch for you.  Have you requested  write access to the repository?
Catherine
Matthew Fortune Nov. 18, 2016, 12:53 p.m. UTC | #2
Moore, Catherine <Catherine_Moore@mentor.com> writes:
> > gcc/testsuite/ChangeLog:
> >
> > 2016-11-15  Toma Tabacu  <toma.tabacu@imgtec.com>
> >
> > 	* gcc.target/mips/branch-cost-1.c (dg-options): Use
> > (HAS_MOVN) instead
> > 	of isa>=4, in order to downgrade to R5.
> >
> > diff --git a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> > b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> > index 61c3029..7f7ebbe 100644
> > --- a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> > +++ b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
> > @@ -1,4 +1,4 @@
> > -/* { dg-options "-mbranch-cost=1 isa>=4" } */
> > +/* { dg-options "-mbranch-cost=1 (HAS_MOVN)" } */
> >  /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
> >  NOMIPS16 int
> >  foo (int x, int y, int z, int k)
> 
> I committed this patch for you.  Have you requested  write access to the
> repository?

I was thinking the same thing given Toma has now submitted a few patches.

Please fill out the form below and reference either myself or Catherine:

https://sourceware.org/cgi-bin/pdw/ps_form.cgi

Thanks,
Matthew
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
index 61c3029..7f7ebbe 100644
--- a/gcc/testsuite/gcc.target/mips/branch-cost-1.c
+++ b/gcc/testsuite/gcc.target/mips/branch-cost-1.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-mbranch-cost=1 isa>=4" } */
+/* { dg-options "-mbranch-cost=1 (HAS_MOVN)" } */
 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
 NOMIPS16 int
 foo (int x, int y, int z, int k)