On Fri, Sep 25, 2020 at 10:41:05AM -0500, will schmidt wrote: > On Thu, 2020-09-24 at 19:40 -0500, Segher Boessenkool wrote: > > > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend- > > > char.c > > > @@ -0,0 +1,168 @@ > > > +/* > > > + * Test of vec_xl_sext and vec_xl_zext (load into rightmost > > > + * vector element and zero/sign extend). */ > > > + > > > +/* { dg-do compile {target power10_ok} } */ > > > +/* { dg-do run {target power10_hw} } */ > > > +/* { dg-require-effective-target power10_ok } */ > > > +/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ > > > > If you dg_require it, why test it on the "dg-do compile" line? It > > will > > *work* with it of course, but it is puzzling :-) > > I've had both compile-time and run-time versions of the test. In this > case I wanted to try to handle both, so compile when I can compile it, > and run when I can run it, etc. > > If that combo doesn't work the way I expect it to, i'll need to split > them out into separate tests.
It works, but it does the same thing as /* { dg-do compile } */ /* { dg-do run {target power10_hw} } */ /* { dg-require-effective-target power10_ok } */ /* { dg-options "-mdejagnu-cpu=power10 -O2" } */ (so just that first line simplified). > > > +/* { dg-do compile {target power10_ok} } */ > > > +/* { dg-do run {target power10_hw} } */ > > > +/* { dg-require-effective-target power10_ok } */ > > > +/* { dg-options "-mdejagnu-cpu=power10 -O0" } */ > > > > Please comment here what that -O0 is for? So that we still know when > > we > > read it decades from now ;-) > > I've got it commented at least once, I'll make sure to get all the > instances covered. Ah I didn't see that one instance. > > > +/* { dg-final { scan-assembler-times {\mlxvrwx\M} 2 } } */ > > > +/* { dg-final { scan-assembler-times {\mlwax\M} 0 } } */ > > > > Maybe all of {\mlwa} here? > > lwax was sufficient for what I sniff-tested. I'll double-check. Yes, but lwa and lwaux can happen as well... With a scan-assembler-not (which this is equivalent to), it is a good idea to throw a wide net in general. If the compiler starts using (say) lwa, you won't notice otherwise. (The particular regex I gave also catches lwat and lwarx, but do we actually care? :-) ) Segher