1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-O2 -mvsx" } */
6 vector
float b
= {0.0f
, 0.0f
, 0.0f
, 0.0f
};
9 vector
float foo1 (vector
float x
)
11 vector
int c
= {0, 1, 4, 5};
12 return __builtin_shuffle (x
, b
, c
);
15 vector
float foo2 (vector
float x
)
17 vector
int c
= {2, 3, 4, 5};
18 return __builtin_shuffle (x
, b
, c
);
21 vector
float foo3 (vector
float x
)
23 vector
int c
= {0, 1, 6, 7};
24 return __builtin_shuffle (x
, b
, c
);
27 vector
float foo4 (vector
float x
)
29 vector
int c
= {2, 3, 6, 7};
30 return __builtin_shuffle (x
, b
, c
);
33 vector
unsigned char foo5 (vector
unsigned char x
)
35 vector
unsigned char c
= {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7};
36 return __builtin_shuffle (x
, c
);
39 vector
unsigned char foo6 (vector
unsigned char x
)
41 vector
unsigned char c
= {8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15};
42 return __builtin_shuffle (x
, c
);
45 vector
unsigned char foo7 (vector
unsigned char x
)
47 vector
unsigned char c
= {8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7};
48 return __builtin_shuffle (x
, c
);
51 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 7 { target has_arch_pwr9 } } } */
52 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 7 { target { {! has_arch_pwr9} && be } } } } */
53 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 11 { target { {! has_arch_pwr9} && le } } } } */