On Tue, 2020-06-09 at 01:00 +0000, Segher Boessenkool wrote: > Some testcases failed (esp. with --with-cpu=power9) after my change > to > prefer xxperm over vperm when all else is equal. Fix that. (This > also > tightens the relevant REs somewhat). > > Tested on way too many configurations. Committed to trunk. >
Hi, A post-commit review .. (since I authored many of the fold-vec-* tests, i had to chime in) this looks good to me, appreciate the effort. Thanks :-) -Will > > Segher > > > 2020-06-09 Segher Boessenkool <seg...@kernel.crashing.org> > > gcc/testsuite/ > * gcc.target/powerpc/fold-vec-perm-char.c: Allow both > vperm/vpermr and > xxperm/xxpermr. > * gcc.target/powerpc/fold-vec-perm-double.c: Ditto. > * gcc.target/powerpc/fold-vec-perm-float.c: Ditto. > * gcc.target/powerpc/fold-vec-perm-int.c: Ditto. > * gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto. > * gcc.target/powerpc/fold-vec-perm-pixel.c: Ditto. > * gcc.target/powerpc/fold-vec-perm-short.c: Ditto. > * gcc.target/powerpc/lvsl-lvsr.c: Ditto. > * gcc.target/powerpc/vec-mult-char-2.c: Ditto. > * gcc.target/powerpc/vsx-vector-6.p9.c: Also allow xxpermr. > > --- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c | 2 +- > gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c | 2 +- > gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c | 2 +- > gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c | 2 +- > gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c | 2 +- > 10 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c > index d907eae..56a89f3 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c > @@ -28,4 +28,4 @@ testuc (vector unsigned char vuc2, vector unsigned > char vuc3, > return vec_perm (vuc2, vuc3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 3 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c > index 7ceca9e..c982bc2 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c > @@ -14,4 +14,4 @@ testd (vector double vd2, vector double vd3, vector > unsigned char vuc) > return vec_perm (vd2, vd3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 1 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c > index c9cfb0d..64b8ac7 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c > @@ -13,4 +13,4 @@ testf (vector float vf2, vector float vf3, vector > unsigned char vuc) > return vec_perm (vf2, vf3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 1 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c > index a2fdc26..a6dd595 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c > @@ -28,4 +28,4 @@ testui (vector unsigned int vui2, vector unsigned > int vui3, > return vec_perm (vui2, vui3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 3 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm- > longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm- > longlong.c > index 1333d88..3cc757d 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c > @@ -29,4 +29,4 @@ testul (vector unsigned long long vul2, vector > unsigned long long vul3, > return vec_perm (vul2, vul3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 3 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c > index 0d3cb0a..54fccd2 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c > @@ -13,4 +13,4 @@ testpx (vector pixel px2, vector pixel px3, vector > unsigned char vuc) > return vec_perm (px2, px3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 1 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c > b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c > index de5303a..6a5d1a7 100644 > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c > @@ -26,4 +26,4 @@ testus (vector unsigned short vus2, vector unsigned > short vus3, vector unsigned > return vec_perm (vus2, vus3, vuc); > } > > -/* { dg-final { scan-assembler-times "vperm" 3 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > b/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > index 6a7baf3..93843c0 100644 > --- a/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > +++ b/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > @@ -7,7 +7,7 @@ > /* { dg-final { scan-assembler-times "lvsl" 2 } } */ > /* { dg-final { scan-assembler-times "lvsr" 2 } } */ > /* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxv\M} 2 } } */ > -/* { dg-final { scan-assembler-times "vperm" 2 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 2 } } */ > > > #include <altivec.h> > diff --git a/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c > b/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c > index 04c6710..dcfa270 100644 > --- a/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c > +++ b/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c > @@ -18,4 +18,4 @@ vector signed char vmulsi(vector signed char v, > > /* { dg-final { scan-assembler-times "vmulesb" 2 } } */ > /* { dg-final { scan-assembler-times "vmulosb" 2 } } */ > -/* { dg-final { scan-assembler-times "vperm" 2 } } */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 2 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c > b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c > index 43d2e85..2d81de1 100644 > --- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c > @@ -9,7 +9,7 @@ > /* { dg-final { scan-assembler-times {\mvmaxub\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mvmsumshs\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mvmsumuhs\M} 1 } } */ > -/* { dg-final { scan-assembler-times {\m(?:vpermr?|xxperm)\M} 1 } } > */ > +/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mxvabsdp\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mxvadddp\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mxvcmpeqdp\M} 9 } } */