Add documentation for musttail attribute
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p8vector-builtin-4.c
blobd17af3e32c56bd0d042710d7e8acbf753ed653b0
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O3 -ftree-vectorize -fvect-cost-model=dynamic" } */
4 /* { dg-require-effective-target powerpc_vsx } */
6 #include <altivec.h>
8 typedef vector long long vll_sign;
9 typedef vector unsigned long long vll_uns;
10 typedef vector bool long long vll_bool;
12 typedef vector int vi_sign;
13 typedef vector unsigned int vi_uns;
14 typedef vector bool int vi_bool;
16 typedef vector short vs_sign;
17 typedef vector unsigned short vs_uns;
18 typedef vector bool short vs_bool;
20 typedef vector signed char vc_sign;
21 typedef vector unsigned char vc_uns;
22 typedef vector bool char vc_bool;
24 vll_sign vll_clz_1 (vll_sign a)
26 return __builtin_altivec_vclzd (a);
29 vll_sign vll_clz_2 (vll_sign a)
31 return vec_vclz (a);
34 vll_sign vll_clz_3 (vll_sign a)
36 return vec_vclzd (a);
39 vll_uns vll_clz_4 (vll_uns a)
41 return vec_vclz (a);
44 vll_uns vll_clz_5 (vll_uns a)
46 return vec_vclzd (a);
49 vi_sign vi_clz_1 (vi_sign a)
51 return __builtin_altivec_vclzw (a);
54 vi_sign vi_clz_2 (vi_sign a)
56 return vec_vclz (a);
59 vi_sign vi_clz_3 (vi_sign a)
61 return vec_vclzw (a);
64 vi_uns vi_clz_4 (vi_uns a)
66 return vec_vclz (a);
69 vi_uns vi_clz_5 (vi_uns a)
71 return vec_vclzw (a);
74 vs_sign vs_clz_1 (vs_sign a)
76 return __builtin_altivec_vclzh (a);
79 vs_sign vs_clz_2 (vs_sign a)
81 return vec_vclz (a);
84 vs_sign vs_clz_3 (vs_sign a)
86 return vec_vclzh (a);
89 vs_uns vs_clz_4 (vs_uns a)
91 return vec_vclz (a);
94 vs_uns vs_clz_5 (vs_uns a)
96 return vec_vclzh (a);
99 vc_sign vc_clz_1 (vc_sign a)
101 return __builtin_altivec_vclzb (a);
104 vc_sign vc_clz_2 (vc_sign a)
106 return vec_vclz (a);
109 vc_sign vc_clz_3 (vc_sign a)
111 return vec_vclzb (a);
114 vc_uns vc_clz_4 (vc_uns a)
116 return vec_vclz (a);
119 vc_uns vc_clz_5 (vc_uns a)
121 return vec_vclzb (a);
124 vll_sign vll_popcnt_1 (vll_sign a)
126 return __builtin_altivec_vpopcntd (a);
129 vll_sign vll_popcnt_2 (vll_sign a)
131 return vec_vpopcnt (a);
134 vll_sign vll_popcnt_3 (vll_sign a)
136 return vec_vpopcntd (a);
139 vll_uns vll_popcnt_4 (vll_uns a)
141 return vec_vpopcnt (a);
144 vll_uns vll_popcnt_5 (vll_uns a)
146 return vec_vpopcntd (a);
149 vi_sign vi_popcnt_1 (vi_sign a)
151 return __builtin_altivec_vpopcntw (a);
154 vi_sign vi_popcnt_2 (vi_sign a)
156 return vec_vpopcnt (a);
159 vi_sign vi_popcnt_3 (vi_sign a)
161 return vec_vpopcntw (a);
164 vi_uns vi_popcnt_4 (vi_uns a)
166 return vec_vpopcnt (a);
169 vi_uns vi_popcnt_5 (vi_uns a)
171 return vec_vpopcntw (a);
174 vs_sign vs_popcnt_1 (vs_sign a)
176 return __builtin_altivec_vpopcnth (a);
179 vs_sign vs_popcnt_2 (vs_sign a)
181 return vec_vpopcnt (a);
184 vs_sign vs_popcnt_3 (vs_sign a)
186 return vec_vpopcnth (a);
189 vs_uns vs_popcnt_4 (vs_uns a)
191 return vec_vpopcnt (a);
194 vs_uns vs_popcnt_5 (vs_uns a)
196 return vec_vpopcnth (a);
199 vc_sign vc_popcnt_1 (vc_sign a)
201 return __builtin_altivec_vpopcntb (a);
204 vc_sign vc_popcnt_2 (vc_sign a)
206 return vec_vpopcnt (a);
209 vc_sign vc_popcnt_3 (vc_sign a)
211 return vec_vpopcntb (a);
214 vc_uns vc_popcnt_4 (vc_uns a)
216 return vec_vpopcnt (a);
219 vc_uns vc_popcnt_5 (vc_uns a)
221 return vec_vpopcntb (a);
224 vc_uns vc_gbb_1 (vc_uns a)
226 return __builtin_altivec_vgbbd (a);
229 vc_sign vc_gbb_2 (vc_sign a)
231 return vec_vgbbd (a);
234 vc_uns vc_gbb_3 (vc_uns a)
236 return vec_vgbbd (a);
239 /* { dg-final { scan-assembler-times "vclzd" 5 } } */
240 /* { dg-final { scan-assembler-times "vclzw" 5 } } */
241 /* { dg-final { scan-assembler-times "vclzh" 5 } } */
242 /* { dg-final { scan-assembler-times "vclzb" 5 } } */
244 /* { dg-final { scan-assembler-times "vpopcntd" 5 } } */
245 /* { dg-final { scan-assembler-times "vpopcntw" 5 } } */
246 /* { dg-final { scan-assembler-times "vpopcnth" 5 } } */
247 /* { dg-final { scan-assembler-times "vpopcntb" 5 } } */
249 /* { dg-final { scan-assembler-times "vgbbd" 3 } } */