1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_p8vector_ok } */
3 /* { dg-options "-mdejagnu-cpu=power8 -O2 -fdump-tree-gimple" } */
4 
5 /* Verify that overloaded built-ins for "eqv", "nand" and "orc" do not
6    produce VIEW_CONVERT_EXPR operations on their operands.  Like so:
7 
8   _1 = VIEW_CONVERT_EXPR<__vector signed int>(x);
9   _2 = VIEW_CONVERT_EXPR<__vector signed int>(y);
10   _3 = __builtin_altivec_vand (_1, _2);
11   D.3245 = VIEW_CONVERT_EXPR<bcvec_t>(_3);
12 */
13 
14 typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) char bcvec_t;
15 typedef __attribute__((altivec(vector__))) signed char scvec_t;
16 typedef __attribute__((altivec(vector__))) unsigned char ucvec_t;
17 
18 typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) short bsvec_t;
19 typedef __attribute__((altivec(vector__))) signed short ssvec_t;
20 typedef __attribute__((altivec(vector__))) unsigned short usvec_t;
21 
22 typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) int bivec_t;
23 typedef __attribute__((altivec(vector__))) signed int sivec_t;
24 typedef __attribute__((altivec(vector__))) unsigned int uivec_t;
25 
26 typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) long long bllvec_t;
27 typedef __attribute__((altivec(vector__))) signed long long sllvec_t;
28 typedef __attribute__((altivec(vector__))) unsigned long long ullvec_t;
29 
30 typedef __attribute__((altivec(vector__))) double dvec_t;
31 typedef __attribute__((altivec(vector__))) float fvec_t;
32 
33 bcvec_t
eqv_0(bcvec_t x,bcvec_t y)34 eqv_0 (bcvec_t x, bcvec_t y)
35 {
36   return __builtin_vec_eqv (x, y);
37 }
38 
39 scvec_t
eqv_1(scvec_t x,scvec_t y)40 eqv_1 (scvec_t x, scvec_t y)
41 {
42   return __builtin_vec_eqv (x, y);
43 }
44 
45 ucvec_t
eqv_2(ucvec_t x,ucvec_t y)46 eqv_2 (ucvec_t x, ucvec_t y)
47 {
48   return __builtin_vec_eqv (x, y);
49 }
50 
51 bsvec_t
eqv_3(bsvec_t x,bsvec_t y)52 eqv_3 (bsvec_t x, bsvec_t y)
53 {
54   return __builtin_vec_eqv (x, y);
55 }
56 
57 ssvec_t
eqv_4(ssvec_t x,ssvec_t y)58 eqv_4 (ssvec_t x, ssvec_t y)
59 {
60   return __builtin_vec_eqv (x, y);
61 }
62 
63 usvec_t
eqv_5(usvec_t x,usvec_t y)64 eqv_5 (usvec_t x, usvec_t y)
65 {
66   return __builtin_vec_eqv (x, y);
67 }
68 
69 bivec_t
eqv_6(bivec_t x,bivec_t y)70 eqv_6 (bivec_t x, bivec_t y)
71 {
72   return __builtin_vec_eqv (x, y);
73 }
74 
75 sivec_t
eqv_7(sivec_t x,sivec_t y)76 eqv_7 (sivec_t x, sivec_t y)
77 {
78   return __builtin_vec_eqv (x, y);
79 }
80 
81 uivec_t
eqv_8(uivec_t x,uivec_t y)82 eqv_8 (uivec_t x, uivec_t y)
83 {
84   return __builtin_vec_eqv (x, y);
85 }
86 
87 bllvec_t
eqv_9(bllvec_t x,bllvec_t y)88 eqv_9 (bllvec_t x, bllvec_t y)
89 {
90   return __builtin_vec_eqv (x, y);
91 }
92 
93 sllvec_t
eqv_10(sllvec_t x,sllvec_t y)94 eqv_10 (sllvec_t x, sllvec_t y)
95 {
96   return __builtin_vec_eqv (x, y);
97 }
98 
99 ullvec_t
eqv_11(ullvec_t x,ullvec_t y)100 eqv_11 (ullvec_t x, ullvec_t y)
101 {
102   return __builtin_vec_eqv (x, y);
103 }
104 
105 dvec_t
eqv_12(dvec_t x,dvec_t y)106 eqv_12 (dvec_t x, dvec_t y)
107 {
108   return __builtin_vec_eqv (x, y);
109 }
110 
111 fvec_t
eqv_13(fvec_t x,fvec_t y)112 eqv_13 (fvec_t x, fvec_t y)
113 {
114   return __builtin_vec_eqv (x, y);
115 }
116 
117 bcvec_t
nand_0(bcvec_t x,bcvec_t y)118 nand_0 (bcvec_t x, bcvec_t y)
119 {
120   return __builtin_vec_nand (x, y);
121 }
122 
123 scvec_t
nand_1(scvec_t x,scvec_t y)124 nand_1 (scvec_t x, scvec_t y)
125 {
126   return __builtin_vec_nand (x, y);
127 }
128 
129 ucvec_t
nand_2(ucvec_t x,ucvec_t y)130 nand_2 (ucvec_t x, ucvec_t y)
131 {
132   return __builtin_vec_nand (x, y);
133 }
134 
135 bsvec_t
nand_3(bsvec_t x,bsvec_t y)136 nand_3 (bsvec_t x, bsvec_t y)
137 {
138   return __builtin_vec_nand (x, y);
139 }
140 
141 ssvec_t
nand_4(ssvec_t x,ssvec_t y)142 nand_4 (ssvec_t x, ssvec_t y)
143 {
144   return __builtin_vec_nand (x, y);
145 }
146 
147 usvec_t
nand_5(usvec_t x,usvec_t y)148 nand_5 (usvec_t x, usvec_t y)
149 {
150   return __builtin_vec_nand (x, y);
151 }
152 
153 bivec_t
nand_6(bivec_t x,bivec_t y)154 nand_6 (bivec_t x, bivec_t y)
155 {
156   return __builtin_vec_nand (x, y);
157 }
158 
159 sivec_t
nand_7(sivec_t x,sivec_t y)160 nand_7 (sivec_t x, sivec_t y)
161 {
162   return __builtin_vec_nand (x, y);
163 }
164 
165 uivec_t
nand_8(uivec_t x,uivec_t y)166 nand_8 (uivec_t x, uivec_t y)
167 {
168   return __builtin_vec_nand (x, y);
169 }
170 
171 bllvec_t
nand_9(bllvec_t x,bllvec_t y)172 nand_9 (bllvec_t x, bllvec_t y)
173 {
174   return __builtin_vec_nand (x, y);
175 }
176 
177 sllvec_t
nand_10(sllvec_t x,sllvec_t y)178 nand_10 (sllvec_t x, sllvec_t y)
179 {
180   return __builtin_vec_nand (x, y);
181 }
182 
183 ullvec_t
nand_11(ullvec_t x,ullvec_t y)184 nand_11 (ullvec_t x, ullvec_t y)
185 {
186   return __builtin_vec_nand (x, y);
187 }
188 
189 dvec_t
nand_12(dvec_t x,dvec_t y)190 nand_12 (dvec_t x, dvec_t y)
191 {
192   return __builtin_vec_nand (x, y);
193 }
194 
195 fvec_t
nand_13(fvec_t x,fvec_t y)196 nand_13 (fvec_t x, fvec_t y)
197 {
198   return __builtin_vec_nand (x, y);
199 }
200 
201 bcvec_t
orc_0(bcvec_t x,bcvec_t y)202 orc_0 (bcvec_t x, bcvec_t y)
203 {
204   return __builtin_vec_orc (x, y);
205 }
206 
207 scvec_t
orc_1(scvec_t x,scvec_t y)208 orc_1 (scvec_t x, scvec_t y)
209 {
210   return __builtin_vec_orc (x, y);
211 }
212 
213 ucvec_t
orc_2(ucvec_t x,ucvec_t y)214 orc_2 (ucvec_t x, ucvec_t y)
215 {
216   return __builtin_vec_orc (x, y);
217 }
218 
219 bsvec_t
orc_3(bsvec_t x,bsvec_t y)220 orc_3 (bsvec_t x, bsvec_t y)
221 {
222   return __builtin_vec_orc (x, y);
223 }
224 
225 ssvec_t
orc_4(ssvec_t x,ssvec_t y)226 orc_4 (ssvec_t x, ssvec_t y)
227 {
228   return __builtin_vec_orc (x, y);
229 }
230 
231 usvec_t
orc_5(usvec_t x,usvec_t y)232 orc_5 (usvec_t x, usvec_t y)
233 {
234   return __builtin_vec_orc (x, y);
235 }
236 
237 bivec_t
orc_6(bivec_t x,bivec_t y)238 orc_6 (bivec_t x, bivec_t y)
239 {
240   return __builtin_vec_orc (x, y);
241 }
242 
243 sivec_t
orc_7(sivec_t x,sivec_t y)244 orc_7 (sivec_t x, sivec_t y)
245 {
246   return __builtin_vec_orc (x, y);
247 }
248 
249 uivec_t
orc_8(uivec_t x,uivec_t y)250 orc_8 (uivec_t x, uivec_t y)
251 {
252   return __builtin_vec_orc (x, y);
253 }
254 
255 bllvec_t
orc_9(bllvec_t x,bllvec_t y)256 orc_9 (bllvec_t x, bllvec_t y)
257 {
258   return __builtin_vec_orc (x, y);
259 }
260 
261 sllvec_t
orc_10(sllvec_t x,sllvec_t y)262 orc_10 (sllvec_t x, sllvec_t y)
263 {
264   return __builtin_vec_orc (x, y);
265 }
266 
267 ullvec_t
orc_11(ullvec_t x,ullvec_t y)268 orc_11 (ullvec_t x, ullvec_t y)
269 {
270   return __builtin_vec_orc (x, y);
271 }
272 
273 dvec_t
orc_12(dvec_t x,dvec_t y)274 orc_12 (dvec_t x, dvec_t y)
275 {
276   return __builtin_vec_orc (x, y);
277 }
278 
279 fvec_t
orc_13(fvec_t x,fvec_t y)280 orc_13 (fvec_t x, fvec_t y)
281 {
282   return __builtin_vec_orc (x, y);
283 }
284 
285 /* { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } } */
286