[testsuite] Fix directives order
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-extract-5.c
blob7b0d80971378f7fd73e927484dd1424a48dcb5bf
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-O2 -mcpu=power8" } */
7 /* { dg-final { scan-assembler-times "vspltw" 6 } } */
8 /* { dg-final { scan-assembler-times "xvcvsxwdp" 4 } } */
9 /* { dg-final { scan-assembler-times "xvcvuxwdp" 4 } } */
10 /* { dg-final { scan-assembler-times "frsp\|xsrsp" 8 } } */
11 /* { dg-final { scan-assembler-not "mtvsrd" } } */
12 /* { dg-final { scan-assembler-not "mtvsrwa" } } */
13 /* { dg-final { scan-assembler-not "mtvsrwz" } } */
14 /* { dg-final { scan-assembler-not "mfvsrd" } } */
15 /* { dg-final { scan-assembler-not "mfvsrwz" } } */
17 #include <altivec.h>
19 #ifndef TYPE
20 #define TYPE float
21 #endif
23 TYPE
24 foo_0s (vector int v)
26 int i = vec_extract (v, 0);
27 return (TYPE) i;
30 TYPE
31 foo_1s (vector int v)
33 int i = vec_extract (v, 1);
34 return (TYPE) i;
37 TYPE
38 foo_2s (vector int v)
40 int i = vec_extract (v, 2);
41 return (TYPE) i;
44 TYPE
45 foo_3s (vector int v)
47 int i = vec_extract (v, 3);
48 return (TYPE) i;
51 TYPE
52 foo_0u (vector unsigned int v)
54 unsigned int u = vec_extract (v, 0);
55 return (TYPE) u;
58 TYPE
59 foo_1u (vector unsigned int v)
61 unsigned int u = vec_extract (v, 1);
62 return (TYPE) u;
65 TYPE
66 foo_2u (vector unsigned int v)
68 unsigned int u = vec_extract (v, 2);
69 return (TYPE) u;
72 TYPE
73 foo_3u (vector unsigned int v)
75 unsigned int u = vec_extract (v, 3);
76 return (TYPE) u;