[rs6000] clean up vec_neg related test options

Message ID 1528835120.27596.9.camel@brimstone.rchland.ibm.com
State New
Headers show
Series
  • [rs6000] clean up vec_neg related test options
Related show

Commit Message

will schmidt June 12, 2018, 8:25 p.m.
Hi,
  A few of our vec_neg related tests are failing in some environments.
Clean up the options and requires stanzas to avoid running the tests where
the vec_neg() intrinsic does not work.

OK for trunk?
Thanks
-Will
    
[testsuite]
    
2018-06-12  Will Schmidt  <will_schmidt@vnet.ibm.com>
    
	* gcc.target/powerpc/fold-vec-neg-int.p8.c: Specify powerpc_p8vector_ok
	requirement for this test.
	* gcc.target/powerpc/fold-vec-neg-int.c: Specify powerpc_p8vector_ok
	requirement, and -mpower8-vector compile option.

Comments

Segher Boessenkool June 14, 2018, 10:16 p.m. | #1
Hi!

On Tue, Jun 12, 2018 at 03:25:20PM -0500, Will Schmidt wrote:
> --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> @@ -1,11 +1,11 @@

>  /* Verify that overloaded built-ins for vec_neg with int

>     inputs produce the right code.  */

>  

>  /* { dg-do compile } */

> -/* { dg-require-effective-target powerpc_altivec_ok } */

> -/* { dg-options "-maltivec -O2" } */

> +/* { dg-require-effective-target powerpc_p8vector_ok } */

> +/* { dg-options "-mpower8-vector -maltivec -O2" } */


So this test now will only run on systems that support -mpower8-vector.
Is that okay?  If so, okay for trunk.  Thanks!


Segher
will schmidt June 15, 2018, 2:16 p.m. | #2
On Thu, 2018-06-14 at 17:16 -0500, Segher Boessenkool wrote:
> Hi!

> 

> On Tue, Jun 12, 2018 at 03:25:20PM -0500, Will Schmidt wrote:

> > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> > @@ -1,11 +1,11 @@

> >  /* Verify that overloaded built-ins for vec_neg with int

> >     inputs produce the right code.  */

> >  

> >  /* { dg-do compile } */

> > -/* { dg-require-effective-target powerpc_altivec_ok } */

> > -/* { dg-options "-maltivec -O2" } */

> > +/* { dg-require-effective-target powerpc_p8vector_ok } */

> > +/* { dg-options "-mpower8-vector -maltivec -O2" } */

> 

> So this test now will only run on systems that support -mpower8-vector.

> Is that okay?  If so, okay for trunk.  Thanks!


Correct.  I am assuming that the error message otherwise generated is on
the up-and-up.  :-)

/home/willschm/gcc/gcc-mainline-baseline/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c:13:10: error: builtin function '__builtin_altivec_neg_v4si' requires the '-mpower8-vector' option^M

The remainder of the vec-neg related tests are also limited to P8 and
newer.

thanks,
-Will

> 

> Segher

>
Peter Bergner June 15, 2018, 6:58 p.m. | #3
On 6/12/18 3:25 PM, Will Schmidt wrote:
> diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> index 4f35856..4cdcc35 100644

> --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c

> @@ -1,11 +1,11 @@

>  /* Verify that overloaded built-ins for vec_neg with int

>     inputs produce the right code.  */

> 

>  /* { dg-do compile } */

> -/* { dg-require-effective-target powerpc_altivec_ok } */

> -/* { dg-options "-maltivec -O2" } */

> +/* { dg-require-effective-target powerpc_p8vector_ok } */

> +/* { dg-options "-mpower8-vector -maltivec -O2" } */


-mpower8-vector automatically enables -mvsx and -maltivec, so you
don't need the -maltivec option above.



> diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c

> index 91067ab..07a41e4 100644

> --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c

> +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c

> @@ -1,10 +1,10 @@

>  /* Verify that overloaded built-ins for vec_neg with int

>     inputs produce the right code when -mcpu=power8 is specified.  */

> 

>  /* { dg-do compile } */

> -/* { dg-require-effective-target powerpc_altivec_ok } */

> +/* { dg-require-effective-target powerpc_p8vector_ok } */

>  /* { dg-options "-maltivec -O2 -mcpu=power8" } */

>  /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */


Similarly, -mcpu=power8 also enables -maltivec so you can remove it.

Peter

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c
index 4f35856..4cdcc35 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c
@@ -1,11 +1,11 @@ 
 /* Verify that overloaded built-ins for vec_neg with int
    inputs produce the right code.  */
 
 /* { dg-do compile } */
-/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -O2" } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mpower8-vector -maltivec -O2" } */
 
 #include <altivec.h>
 
 vector signed int
 test1 (vector signed int x)
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c
index 91067ab..07a41e4 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c
@@ -1,10 +1,10 @@ 
 /* Verify that overloaded built-ins for vec_neg with int
    inputs produce the right code when -mcpu=power8 is specified.  */
 
 /* { dg-do compile } */
-/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
 /* { dg-options "-maltivec -O2 -mcpu=power8" } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
 
 #include <altivec.h>