diff mbox series

[rs6000] testsuite fixup pr96139 tests

Message ID 8e5d314579e9051b828167d5b9eb1f94a5daec70.camel@vnet.ibm.com
State New
Headers show
Series [rs6000] testsuite fixup pr96139 tests | expand

Commit Message

will schmidt Sept. 11, 2020, 2:44 p.m. UTC
Hi,
      As reported, the recently added pr96139 tests will fail on older targets
      because the tests are missing the appropriate -mvsx or -maltivec options.
      This adds the options and clarifies the dg-require statements.
    
      sniff-regtested OK when specifying older targets on a power7 host.
      --target_board=unix/'{-mcpu=power4,-mcpu=power5,-mcpu=power6,-mcpu=power7,
      -mcpu=power8,-mcpu=power9}''{-m64,-m32}'"
    
      OK for trunk?
    
    Thanks
    -=Will
    
    gcc/testsuite/ChangeLog:
        * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
        * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
        * gcc.target/powerpc/pr96139-a.c: specify -maltivec option and require.

Comments

Segher Boessenkool Sept. 11, 2020, 5:37 p.m. UTC | #1
Hi!

On Fri, Sep 11, 2020 at 09:44:54AM -0500, will schmidt wrote:
>       As reported, the recently added pr96139 tests will fail on older targets
>       because the tests are missing the appropriate -mvsx or -maltivec options.
>       This adds the options and clarifies the dg-require statements.

>     gcc/testsuite/ChangeLog:
>         * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
>         * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
>         * gcc.target/powerpc/pr96139-a.c: specify -maltivec option and require.

(Capital "S" on each line.)
("and require" isn't clear...  "dg-require"?)
(And the files are -a, -b, -c).

> diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> index b3daee4..12a3383 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> @@ -1,9 +1,9 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -Wall -m32" } */
> +/* { dg-options "-O2 -Wall -m32 -mvsx" } */
>  /* { dg-require-effective-target ilp32 } */
> -/* { dg-require-effective-target powerpc_altivec_ok } */
> +/* { dg-require-effective-target powerpc_vsx_ok } */

This uses vector long long.  Okay.

> --- a/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-b.c

Ditto.

> diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> index 2464b8d..3ada260 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> @@ -1,7 +1,7 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -Wall" } */
> +/* { dg-options "-O2 -Wall -maltivec" } */
>  /* { dg-require-effective-target powerpc_altivec_ok } */

But this one as well, why does it not need VSX like the rest?


Segher
will schmidt Sept. 11, 2020, 7:55 p.m. UTC | #2
On Fri, 2020-09-11 at 12:37 -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Fri, Sep 11, 2020 at 09:44:54AM -0500, will schmidt wrote:
> >       As reported, the recently added pr96139 tests will fail on older targets
> >       because the tests are missing the appropriate -mvsx or -maltivec options.
> >       This adds the options and clarifies the dg-require statements.
> >     gcc/testsuite/ChangeLog:
> >         * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
> >         * gcc.target/powerpc/pr96139-a.c: specify -mvsx option and require.
> >         * gcc.target/powerpc/pr96139-a.c: specify -maltivec option and require.
> 
> (Capital "S" on each line.)
> ("and require" isn't clear...  "dg-require"?)
> (And the files are -a, -b, -c).

Thanks for the review.

I've updated that to read:

gcc/testsuite/ChangeLog:                                                        
	* gcc.target/powerpc/pr96139-a.c: Specify -mvsx option and update the       
	dg-require stanza to match.                                                 
	* gcc.target/powerpc/pr96139-b.c: Same.                                     
	* gcc.target/powerpc/pr96139-c.c: Specify -maltivec option and update       
	the dg-require stanza to match.                                             
                                              

> 
> > diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> > index b3daee4..12a3383 100644
> > --- a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
> > @@ -1,9 +1,9 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -Wall -m32" } */
> > +/* { dg-options "-O2 -Wall -m32 -mvsx" } */
> >  /* { dg-require-effective-target ilp32 } */
> > -/* { dg-require-effective-target powerpc_altivec_ok } */
> > +/* { dg-require-effective-target powerpc_vsx_ok } */
> 
> This uses vector long long.  Okay.
> 
> > --- a/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
> 
> Ditto.
> 
> > diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> > index 2464b8d..3ada260 100644
> > --- a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> > @@ -1,7 +1,7 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -Wall" } */
> > +/* { dg-options "-O2 -Wall -maltivec" } */
> >  /* { dg-require-effective-target powerpc_altivec_ok } */
> 
> But this one as well, why does it not need VSX like the rest?

I made these changes based on the failures reported when I tested
against older targets, and thats all it seems to want.  :-) 

Upon further investigation, it appears that the logic simplifies down
to a BIT_FIELD_REF against the llfoo symbol and the call to printf. 
The actual code generation consists entirely of non-vector instructions
(lis,ori,std,addi,... bl..).  So it simply does not need the vsx
support.

It is still sufficient to trigger the initially reported error, so it
does still serve that purpose.

thanks,
-Will

> 
> 
> Segher
Segher Boessenkool Sept. 11, 2020, 8:16 p.m. UTC | #3
Hi!

On Fri, Sep 11, 2020 at 02:55:03PM -0500, will schmidt wrote:
> > > --- a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> > > +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
> > > @@ -1,7 +1,7 @@
> > >  /* { dg-do run } */
> > > -/* { dg-options "-O2 -Wall" } */
> > > +/* { dg-options "-O2 -Wall -maltivec" } */
> > >  /* { dg-require-effective-target powerpc_altivec_ok } */
> > 
> > But this one as well, why does it not need VSX like the rest?
> 
> I made these changes based on the failures reported when I tested
> against older targets, and thats all it seems to want.  :-) 
> 
> Upon further investigation, it appears that the logic simplifies down
> to a BIT_FIELD_REF against the llfoo symbol and the call to printf. 
> The actual code generation consists entirely of non-vector instructions
> (lis,ori,std,addi,... bl..).  So it simply does not need the vsx
> support.

Ah, this testcase will not actually use vectors at all.  It just needs
-maltivec for altivec.h to work, and for the "vector" keyword.

Okay for trunk.  Thank you!


Segher
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
index b3daee4..12a3383 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c
@@ -1,9 +1,9 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall -m32" } */
+/* { dg-options "-O2 -Wall -m32 -mvsx" } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
 
 #include <stdio.h>
 #include <altivec.h>
 
 void
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-b.c b/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
index 19c1110..379849a 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr96139-b.c
@@ -1,9 +1,9 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall -m64" } */
+/* { dg-options "-O2 -Wall -m64 -mvsx" } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
 
 #include <stdio.h>
 #include <altivec.h>
 
 void
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
index 2464b8d..3ada260 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr96139-c.c
@@ -1,7 +1,7 @@ 
 /* { dg-do run } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-O2 -Wall -maltivec" } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 
 /*
  * Based on test created by sjmunroe for pr96139
  */