public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] fix-up int128 fold vector multiply tests
@ 2017-10-09 21:34 Will Schmidt
  2017-10-10  0:24 ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: Will Schmidt @ 2017-10-09 21:34 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, Bill Schmidt, David Edelsohn

Hi

[PATCH, rs6000] fix-up int128 fold vector multiply tests
 
    Fix up a few issues with the tests.
    - add -O2 to int128-p8 test, and firm up the -mcpu options
    - update the set of expected instructions for the int128-p9 test.
    - replace the float128_hw requirement with power8_vector_ok
    for the int128-p9 test.

sniff-tested P6 and newer.
OK for trunk?
Thanks,
-Will

2017-10-09  Will Schmidt <will_schmidt@vnet.ibm.com>
	* gcc.target/powerpc/fold-vec-mult-int128-p8.c: Update options
	* gcc.target/powerpc/fold-vec-mult-int128-p9.c: Update expected
	instruction list.

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
index 97d6b945..5ced2cd 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
@@ -3,11 +3,12 @@
 
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_p8vector_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-mpower8-vector" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mpower8-vector -mcpu=power8 -O2" } */
 /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */
 
 #include "altivec.h"
 
 vector signed __int128
@@ -20,7 +21,7 @@ vector unsigned __int128
 test2 (vector unsigned __int128 x, vector unsigned __int128 y)
 {
   return vec_mul (x, y);
 }
 
-/* { dg-final { scan-assembler-times "\[ \t\]mulld " 6 } } */
+/* { dg-final { scan-assembler-times "\[ \t\]mulld" 6 } } */
 /* { dg-final { scan-assembler-times "\[ \t\]mulhdu" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
index e81ea5f..a226ae0 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
@@ -1,10 +1,10 @@
 /* Verify that overloaded built-ins for vec_mul with __int128
    inputs produce the right results.  */
 
 /* { dg-do compile } */
-/* { dg-require-effective-target powerpc_float128_hw_ok } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
 /* { dg-options "-mcpu=power9 -O2" } */
 /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */
 
@@ -20,6 +20,7 @@ vector unsigned __int128
 test2 (vector unsigned __int128 x, vector unsigned __int128 y)
 {
   return vec_mul (x, y);
 }
 
-/* { dg-final { scan-assembler-times "\[ \t\]xsmulqp" 2 } } */
+/* { dg-final { scan-assembler-times "\[ \t\]mulld" 4 } } */
+/* { dg-final { scan-assembler-times "\[ \t\]mulhdu" 2 } } */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, rs6000] fix-up int128 fold vector multiply tests
  2017-10-09 21:34 [PATCH, rs6000] fix-up int128 fold vector multiply tests Will Schmidt
@ 2017-10-10  0:24 ` Segher Boessenkool
  2017-10-10 16:30   ` [PATCH, rs6000] (v2) " Will Schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Segher Boessenkool @ 2017-10-10  0:24 UTC (permalink / raw)
  To: Will Schmidt; +Cc: GCC Patches, Bill Schmidt, David Edelsohn

Hi Will,

On Mon, Oct 09, 2017 at 04:27:54PM -0500, Will Schmidt wrote:
>     Fix up a few issues with the tests.
>     - add -O2 to int128-p8 test, and firm up the -mcpu options
>     - update the set of expected instructions for the int128-p9 test.
>     - replace the float128_hw requirement with power8_vector_ok
>     for the int128-p9 test.

> -/* { dg-final { scan-assembler-times "\[ \t\]mulld " 6 } } */
> +/* { dg-final { scan-assembler-times "\[ \t\]mulld" 6 } } */

Why this?  (Better/easier would be to use \m and \M btw.)

> diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> index e81ea5f..a226ae0 100644
> --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> @@ -1,10 +1,10 @@
>  /* Verify that overloaded built-ins for vec_mul with __int128
>     inputs produce the right results.  */
>  
>  /* { dg-do compile } */
> -/* { dg-require-effective-target powerpc_float128_hw_ok } */
> +/* { dg-require-effective-target powerpc_p8vector_ok } */
>  /* { dg-require-effective-target int128 } */
>  /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
>  /* { dg-options "-mcpu=power9 -O2" } */
>  /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */

This looks curious, too.  With the change it will no longer work if you
built GCC with a version of binutils that doesn't support p9, I think?
Not that people should do that.


Segher

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, rs6000] (v2) fix-up int128 fold vector multiply tests
  2017-10-10  0:24 ` Segher Boessenkool
@ 2017-10-10 16:30   ` Will Schmidt
  2017-10-10 17:19     ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: Will Schmidt @ 2017-10-10 16:30 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches, Bill Schmidt, David Edelsohn

On Mon, 2017-10-09 at 17:22 -0500, Segher Boessenkool wrote:
> Hi Will,
> 
> On Mon, Oct 09, 2017 at 04:27:54PM -0500, Will Schmidt wrote:
> >     Fix up a few issues with the tests.
> >     - add -O2 to int128-p8 test, and firm up the -mcpu options
> >     - update the set of expected instructions for the int128-p9 test.
> >     - replace the float128_hw requirement with power8_vector_ok
> >     for the int128-p9 test.
> 
> > -/* { dg-final { scan-assembler-times "\[ \t\]mulld " 6 } } */
> > +/* { dg-final { scan-assembler-times "\[ \t\]mulld" 6 } } */
> 
> Why this?  (Better/easier would be to use \m and \M btw.)

hmm, yeah, intended this to be a whitespace cleanup but that was in
error.  The dg-final section now reads as:

/* { dg-final { scan-assembler-times {\mmulld\M} 6 } } */
/* { dg-final { scan-assembler-times {\mmulhdu\M} 2 } } */

> 
> > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> > index e81ea5f..a226ae0 100644
> > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
> > @@ -1,10 +1,10 @@
> >  /* Verify that overloaded built-ins for vec_mul with __int128
> >     inputs produce the right results.  */
> >  
> >  /* { dg-do compile } */
> > -/* { dg-require-effective-target powerpc_float128_hw_ok } */
> > +/* { dg-require-effective-target powerpc_p8vector_ok } */
> >  /* { dg-require-effective-target int128 } */
> >  /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
> >  /* { dg-options "-mcpu=power9 -O2" } */
> >  /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */
> 
> This looks curious, too.  With the change it will no longer work if you
> built GCC with a version of binutils that doesn't support p9, I think?
> Not that people should do that.

Right.  On at least one (older) system i've got I do trigger an error,
before making this change.
	cc1: warning: will not generate power9 instructions because
	assembler lacks power9 support.

so the intent is to clear that one up.

The check on this one should probably be for p9 vector though. 
> +/* { dg-require-effective-target powerpc_p9vector_ok } */

So..   [v2].  :-)


---><---


        [PATCH, rs6000] fix-up int128 fold vector multiply tests
    
        Fix up a few issues with the tests.
        - add -O2 to int128-p8 test, and firm up the -mcpu and -mpower*-vector options
        - update the set of expected instructions for the int128-p9 test.
        - remove the float128_hw requirement from the int128-p9 test.
    
        2017-10-10  Will Schmidt <will_schmidt@vnet.ibm.com>
        	* gcc.target/powerpc/fold-vec-mult-int128-p8.c: Update options
        	* gcc.target/powerpc/fold-vec-mult-int128-p9.c: Update expected
    	instruction list.

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
index 97d6b945..b1cf0a7 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p8.c
@@ -3,11 +3,12 @@
 
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_p8vector_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-mpower8-vector" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mpower8-vector -mcpu=power8 -O2" } */
 /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */
 
 #include "altivec.h"
 
 vector signed __int128
@@ -20,7 +21,7 @@ vector unsigned __int128
 test2 (vector unsigned __int128 x, vector unsigned __int128 y)
 {
   return vec_mul (x, y);
 }
 
-/* { dg-final { scan-assembler-times "\[ \t\]mulld " 6 } } */
-/* { dg-final { scan-assembler-times "\[ \t\]mulhdu" 2 } } */
+/* { dg-final { scan-assembler-times {\mmulld\M} 6 } } */
+/* { dg-final { scan-assembler-times {\mmulhdu\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
index e81ea5f..6571884 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c
@@ -1,13 +1,13 @@
 /* Verify that overloaded built-ins for vec_mul with __int128
    inputs produce the right results.  */
 
 /* { dg-do compile } */
-/* { dg-require-effective-target powerpc_float128_hw_ok } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
-/* { dg-options "-mcpu=power9 -O2" } */
+/* { dg-options "-mpower9-vector -mcpu=power9 -O2" } */
 /* { dg-additional-options "-maix64" { target powerpc-ibm-aix* } } */
 
 #include "altivec.h"
 
 vector signed __int128
@@ -20,6 +20,7 @@ vector unsigned __int128
 test2 (vector unsigned __int128 x, vector unsigned __int128 y)
 {
   return vec_mul (x, y);
 }
 
-/* { dg-final { scan-assembler-times "\[ \t\]xsmulqp" 2 } } */
+/* { dg-final { scan-assembler-times {\mmulld\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mmulhdu\M} 2 } } */







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, rs6000] (v2) fix-up int128 fold vector multiply tests
  2017-10-10 16:30   ` [PATCH, rs6000] (v2) " Will Schmidt
@ 2017-10-10 17:19     ` Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2017-10-10 17:19 UTC (permalink / raw)
  To: Will Schmidt; +Cc: GCC Patches, Bill Schmidt, David Edelsohn

On Tue, Oct 10, 2017 at 10:52:37AM -0500, Will Schmidt wrote:
>         [PATCH, rs6000] fix-up int128 fold vector multiply tests
>     
>         Fix up a few issues with the tests.
>         - add -O2 to int128-p8 test, and firm up the -mcpu and -mpower*-vector options
>         - update the set of expected instructions for the int128-p9 test.
>         - remove the float128_hw requirement from the int128-p9 test.
>     
>         2017-10-10  Will Schmidt <will_schmidt@vnet.ibm.com>
>         	* gcc.target/powerpc/fold-vec-mult-int128-p8.c: Update options
>         	* gcc.target/powerpc/fold-vec-mult-int128-p9.c: Update expected
>     	instruction list.

Thanks for the update.  This looks fine I think; okay for trunk.


Segher

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-10 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 21:34 [PATCH, rs6000] fix-up int128 fold vector multiply tests Will Schmidt
2017-10-10  0:24 ` Segher Boessenkool
2017-10-10 16:30   ` [PATCH, rs6000] (v2) " Will Schmidt
2017-10-10 17:19     ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).