Re: [PATCH, rs6000] fix vsxcopy test for power9

2018-02-07 Thread Will Schmidt
On Wed, 2018-02-07 at 12:02 -0600, Segher Boessenkool wrote:
> Hi,
> 
> On Wed, Feb 07, 2018 at 10:59:46AM -0600, Will Schmidt wrote:
> > Noted during review of test results on P9.  The vsxcopy.c test is looking
> > for lxvd2x, stxvd2x instructions in generated code.  For P9 targets, we will
> > instead generate lxv, stxv instructions.
> > Thus, update the test to handle that codegen as well.
> > Sniff-tested on P9.
> > OK for trunk?
> 
> There are many insns that start with "lxv" (or "stxv"); you may want to
> use \m and \M, like:
> 
> > -/* { dg-final { scan-assembler "lxvd2x" } } */
> > -/* { dg-final { scan-assembler "stxvd2x" } } */
> > +/* { dg-final { scan-assembler "lxvd2x|lxv" } } */
> > +/* { dg-final { scan-assembler "stxvd2x|stxv" } } */
> 
> /* { dg-final { scan-assembler {\m(lxvd2x|lxv)\M} } } */
> /* { dg-final { scan-assembler {\m(stxvd2x|stxv)\M} } } */
> 
> ("lxv" without anything more will already also match "lxvd2x", etc.)

> Okay with such a change (if it works ;-) )

updated sniff-test suggests to me that it does.  :-) 
I've used the \m\M bits before, but never surrounding an (a|b)
construct.  something learned.  :-)

Thanks,
-Will



> 
> 
> Segher
> 




Re: [PATCH, rs6000] fix vsxcopy test for power9

2018-02-07 Thread Segher Boessenkool
Hi,

On Wed, Feb 07, 2018 at 10:59:46AM -0600, Will Schmidt wrote:
> Noted during review of test results on P9.  The vsxcopy.c test is looking
> for lxvd2x, stxvd2x instructions in generated code.  For P9 targets, we will
> instead generate lxv, stxv instructions.
> Thus, update the test to handle that codegen as well.
> Sniff-tested on P9.
> OK for trunk?

There are many insns that start with "lxv" (or "stxv"); you may want to
use \m and \M, like:

> -/* { dg-final { scan-assembler "lxvd2x" } } */
> -/* { dg-final { scan-assembler "stxvd2x" } } */
> +/* { dg-final { scan-assembler "lxvd2x|lxv" } } */
> +/* { dg-final { scan-assembler "stxvd2x|stxv" } } */

/* { dg-final { scan-assembler {\m(lxvd2x|lxv)\M} } } */
/* { dg-final { scan-assembler {\m(stxvd2x|stxv)\M} } } */

("lxv" without anything more will already also match "lxvd2x", etc.)

Okay with such a change (if it works ;-) )


Segher


[PATCH, rs6000] fix vsxcopy test for power9

2018-02-07 Thread Will Schmidt

Hi,
Noted during review of test results on P9.  The vsxcopy.c test is looking
for lxvd2x, stxvd2x instructions in generated code.  For P9 targets, we will
instead generate lxv, stxv instructions.
Thus, update the test to handle that codegen as well.
Sniff-tested on P9.
OK for trunk?

Thanks,
-Will

[testsuite]

2018-02-07  Will Schmidt  

* gcc.target/powerpc/vsxcopy.c: Update scan-assembler stanzas.

diff --git a/gcc/testsuite/gcc.target/powerpc/vsxcopy.c 
b/gcc/testsuite/gcc.target/powerpc/vsxcopy.c
index fbe3c67..f877471 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsxcopy.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsxcopy.c
@@ -1,10 +1,10 @@
 /* { dg-do compile { target { powerpc64*-*-* } } } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
 /* { dg-options "-O1 -mvsx" } */
-/* { dg-final { scan-assembler "lxvd2x" } } */
-/* { dg-final { scan-assembler "stxvd2x" } } */
+/* { dg-final { scan-assembler "lxvd2x|lxv" } } */
+/* { dg-final { scan-assembler "stxvd2x|stxv" } } */
 /* { dg-final { scan-assembler-not "xxpermdi" } } */
 
 typedef float vecf __attribute__ ((vector_size (16)));
 extern vecf j, k;