rs6000/testsuite: Allow xxperm* instead of only vperm*
authorSegher Boessenkool <segher@kernel.crashing.org>
Mon, 8 Jun 2020 22:34:21 +0000 (22:34 +0000)
committerSegher Boessenkool <segher@kernel.crashing.org>
Tue, 9 Jun 2020 00:59:12 +0000 (00:59 +0000)
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).

2020-06-09  Segher Boessenkool  <segher@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
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c
gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c
gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c
gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c
gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c

index d907eaedf3d183fa4823aedbee59946d73a3fdbb..56a89f3f79b8535dde3705b384e60be92cb1dfff 100644 (file)
@@ -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 } } */
index 7ceca9ec26baf9b68e62cc876f6f29298135124c..c982bc2232f231d6e8561c37df827d6e7a0e09c7 100644 (file)
@@ -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 } } */
index c9cfb0ded9d5cdeb6efab5af97073033dc754a29..64b8ac78deaabe3bfc9561fc43dbfb3f8d28ccd4 100644 (file)
@@ -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 } } */
index a2fdc26e5e3d4bca06ec5583853d95f5b71817fd..a6dd59524cb8b346202de6f865bcc9bdecb18449 100644 (file)
@@ -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 } } */
index 1333d882e0ee0b8436a81d2064fa2b64f83bd8d2..3cc757da5646c141d32e7da40ade75e6d50b3889 100644 (file)
@@ -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 } } */
index 0d3cb0aa1238a8c035ea61bd36e4855fefbc42a3..54fccd26e01eae3a7ead9bbcdc0a96f0938cdcf6 100644 (file)
@@ -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 } } */
index de5303a8b4db54ba3be34dd674507ae99dc522ea..6a5d1a7df96784e73e8550ead4371bd86ebf4ea5 100644 (file)
@@ -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 } } */
index 6a7baf31b4329d549c85f411c937034a463ec1b6..93843c09f35a1387010081c62ab9912cbfe8a3d4 100644 (file)
@@ -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>
index 04c67109befc9feb2ec0eac8b03d3ebb2e56d9fd..dcfa270a1ee2e7b7e15eab1444afa62363e3c71c 100644 (file)
@@ -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 } } */
index 43d2e855e0d45da44ab340894bf6fdf58d32b7d0..2d81de1bea03ff4ae674d0d46df2bc7b595ba62e 100644 (file)
@@ -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 } } */