1 /* { dg-do compile { target { powerpc64le-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
3 /* { dg-options "-O2 -ftree-vectorize -mcpu=power8 -ffast-math -fvect-cost-model=unlimited" } */
4 
5 /* This tests special handling for various uses of xxpermdi, other than
6    to perform doubleword swaps.  */
7 
foo(_Complex double * self,_Complex double * a,_Complex double * b,int a1,int a2)8 void foo (_Complex double *self, _Complex double *a, _Complex double *b,
9 	  int a1, int a2)
10 {
11   int i, j;
12   for (i = 0; i < a1; ++i)
13     for (j = 0; j < a2; ++j)
14       self[i] = self[i] + a[i,j] * b[j];
15 }
16 
17 /* { dg-final { scan-assembler-times "xxpermdi .*,.*,.*,0" 1 } } */
18 /* { dg-final { scan-assembler-times "xxpermdi .*,.*,.*,1" 1 } } */
19 /* { dg-final { scan-assembler-times "xxpermdi .*,.*,.*,2" 1 } } */
20 /* { dg-final { scan-assembler-times "xxpermdi .*,.*,.*,3" 1 } } */
21