diff mbox series

[rs6000] fix vsxcopy test for power9

Message ID 1518022786.11602.266.camel@brimstone.rchland.ibm.com
State New
Headers show
Series [rs6000] fix vsxcopy test for power9 | expand

Commit Message

will schmidt Feb. 7, 2018, 4:59 p.m. UTC
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  <will_schmidt@vnet.ibm.com>

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

Comments

Segher Boessenkool Feb. 7, 2018, 6:02 p.m. UTC | #1
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
will schmidt Feb. 7, 2018, 10:59 p.m. UTC | #2
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
>
diff mbox series

Patch

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;