1 /* { dg-do compile { target { powerpc64le-*-* } } } */
2 /* { dg-options "-O2 -mdejagnu-cpu=power8 -maltivec" } */
3 
4 /* The expansion for vector character multiply introduces a vperm operation.
5    This tests that changing the vperm mask allows us to remove all swaps
6    from the generated code.  */
7 
8 #include <altivec.h>
9 
10 void abort ();
11 
12 vector unsigned char r;
13 vector unsigned char v =
14   { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
15 vector unsigned char i =
16   { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
17 
main()18 int main ()
19 {
20   int j;
21   r = v * i;
22   return 0;
23 }
24 
25 /* { dg-final { scan-assembler-times "vperm" 1 } } */
26 /* { dg-final { scan-assembler-not "xxpermdi" } } */
27