OSDN Git Service

cda0a5c200912ad26b382d0ac44bc740c88d74c2
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / altivec.h
1 /* PowerPC AltiVec include file.
2    Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3    Contributed by Aldy Hernandez (aldyh@redhat.com).
4
5    This file is part of GCC.
6
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 2, or (at your
10    option) any later version.
11
12    GCC is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GCC; see the file COPYING.  If not, write to the
19    Free Software Foundation, 59 Temple Place - Suite 330, Boston,
20    MA 02111-1307, USA.  */
21
22 /* As a special exception, if you include this header file into source
23    files compiled by GCC, this header file does not by itself cause
24    the resulting executable to be covered by the GNU General Public
25    License.  This exception does not however invalidate any other
26    reasons why the executable file might be covered by the GNU General
27    Public License.  */
28
29 /* Implemented to conform to the specification included in the AltiVec
30    Technology Programming Interface Manual (ALTIVECPIM/D 6/1999 Rev 0).  */
31
32 #ifndef _ALTIVEC_H
33 #define _ALTIVEC_H 1
34
35 #if !defined(__VEC__) || !defined(__ALTIVEC__)
36 #error Use the "-maltivec" flag to enable PowerPC AltiVec support
37 #endif
38
39 /* If __APPLE_ALTIVEC__ is defined, the compiler supports 'vector',
40    'pixel' and 'bool' as context-sensitive AltiVec keywords (in 
41    non-AltiVec contexts, they revert to their original meanings,
42    if any), so we do not need to define them as macros.  */
43
44 #if !defined(__APPLE_ALTIVEC__)
45 /* You are allowed to undef these for C++ compatibility.  */
46 #define vector __vector
47 #define pixel __pixel
48 #define bool __bool
49 #endif
50
51 /* Condition register codes for AltiVec predicates. */
52
53 #define __CR6_EQ                0
54 #define __CR6_EQ_REV            1
55 #define __CR6_LT                2
56 #define __CR6_LT_REV            3
57
58 /* These are easy... Same exact arguments.  */
59
60 #define vec_vaddcuw vec_addc
61 #define vec_vand vec_and
62 #define vec_vandc vec_andc
63 #define vec_vrfip vec_ceil
64 #define vec_vcmpbfp vec_cmpb
65 #define vec_vcmpgefp vec_cmpge
66 #define vec_vctsxs vec_cts
67 #define vec_vctuxs vec_ctu
68 #define vec_vexptefp vec_expte
69 #define vec_vrfim vec_floor
70 #define vec_lvx vec_ld
71 #define vec_lvxl vec_ldl
72 #define vec_vlogefp vec_loge
73 #define vec_vmaddfp vec_madd
74 #define vec_vmhaddshs vec_madds
75 #define vec_vmladduhm vec_mladd
76 #define vec_vmhraddshs vec_mradds
77 #define vec_vnmsubfp vec_nmsub
78 #define vec_vnor vec_nor
79 #define vec_vor vec_or
80 #define vec_vpkpx vec_packpx
81 #define vec_vperm vec_perm
82 #define vec_vrefp vec_re
83 #define vec_vrfin vec_round
84 #define vec_vrsqrtefp vec_rsqrte
85 #define vec_vsel vec_sel
86 #define vec_vsldoi vec_sld
87 #define vec_vsl vec_sll
88 #define vec_vslo vec_slo
89 #define vec_vspltisb vec_splat_s8
90 #define vec_vspltish vec_splat_s16
91 #define vec_vspltisw vec_splat_s32
92 #define vec_vsr vec_srl
93 #define vec_vsro vec_sro
94 #define vec_stvx vec_st
95 #define vec_stvxl vec_stl
96 #define vec_vsubcuw vec_subc
97 #define vec_vsum2sws vec_sum2s
98 #define vec_vsumsws vec_sums
99 #define vec_vrfiz vec_trunc
100 #define vec_vxor vec_xor
101
102 #ifdef __cplusplus
103
104 extern "C++" {
105
106 /* Prototypes for builtins that take literals and must always be
107    inlined.  */
108 inline vector float vec_ctf (vector unsigned int, const int) __attribute__ ((always_inline));
109 inline vector float vec_ctf (vector signed int, const int) __attribute__ ((always_inline));
110 inline vector float vec_vcfsx (vector signed int a1, const int a2) __attribute__ ((always_inline));
111 inline vector float vec_vcfux (vector unsigned int a1, const int a2) __attribute__ ((always_inline));
112 inline vector signed int vec_cts (vector float, const int) __attribute__ ((always_inline));
113 inline vector unsigned int vec_ctu (vector float, const int) __attribute__ ((always_inline));
114 inline void vec_dss (const int) __attribute__ ((always_inline));
115
116 inline void vec_dst (const vector unsigned char *, int, const int) __attribute__ ((always_inline));
117 inline void vec_dst (const vector signed char *, int, const int) __attribute__ ((always_inline));
118 inline void vec_dst (const vector bool char *, int, const int) __attribute__ ((always_inline));
119 inline void vec_dst (const vector unsigned short *, int, const int) __attribute__ ((always_inline));
120 inline void vec_dst (const vector signed short *, int, const int) __attribute__ ((always_inline));
121 inline void vec_dst (const vector bool short *, int, const int) __attribute__ ((always_inline));
122 inline void vec_dst (const vector pixel *, int, const int) __attribute__ ((always_inline));
123 inline void vec_dst (const vector unsigned int *, int, const int) __attribute__ ((always_inline));
124 inline void vec_dst (const vector signed int *, int, const int) __attribute__ ((always_inline));
125 inline void vec_dst (const vector bool int *, int, const int) __attribute__ ((always_inline));
126 inline void vec_dst (const vector float *, int, const int) __attribute__ ((always_inline));
127 inline void vec_dst (const unsigned char *, int, const int) __attribute__ ((always_inline));
128 inline void vec_dst (const signed char *, int, const int) __attribute__ ((always_inline));
129 inline void vec_dst (const unsigned short *, int, const int) __attribute__ ((always_inline));
130 inline void vec_dst (const short *, int, const int) __attribute__ ((always_inline));
131 inline void vec_dst (const unsigned int *, int, const int) __attribute__ ((always_inline));
132 inline void vec_dst (const int *, int, const int) __attribute__ ((always_inline));
133 inline void vec_dst (const unsigned long *, int, const int) __attribute__ ((always_inline));
134 inline void vec_dst (const long *, int, const int) __attribute__ ((always_inline));
135 inline void vec_dst (const float *, int, const int) __attribute__ ((always_inline));
136
137 inline void vec_dstst (const vector unsigned char *, int, const int) __attribute__ ((always_inline));
138 inline void vec_dstst (const vector signed char *, int, const int) __attribute__ ((always_inline));
139 inline void vec_dstst (const vector bool char *, int, const int) __attribute__ ((always_inline));
140 inline void vec_dstst (const vector unsigned short *, int, const int) __attribute__ ((always_inline));
141 inline void vec_dstst (const vector signed short *, int, const int) __attribute__ ((always_inline));
142 inline void vec_dstst (const vector bool short *, int, const int) __attribute__ ((always_inline));
143 inline void vec_dstst (const vector pixel *, int, const int) __attribute__ ((always_inline));
144 inline void vec_dstst (const vector unsigned int *, int, const int) __attribute__ ((always_inline));
145 inline void vec_dstst (const vector signed int *, int, const int) __attribute__ ((always_inline));
146 inline void vec_dstst (const vector bool int *, int, const int) __attribute__ ((always_inline));
147 inline void vec_dstst (const vector float *, int, const int) __attribute__ ((always_inline));
148 inline void vec_dstst (const unsigned char *, int, const int) __attribute__ ((always_inline));
149 inline void vec_dstst (const signed char *, int, const int) __attribute__ ((always_inline));
150 inline void vec_dstst (const unsigned short *, int, const int) __attribute__ ((always_inline));
151 inline void vec_dstst (const short *, int, const int) __attribute__ ((always_inline));
152 inline void vec_dstst (const unsigned int *, int, const int) __attribute__ ((always_inline));
153 inline void vec_dstst (const int *, int, const int) __attribute__ ((always_inline));
154 inline void vec_dstst (const unsigned long *, int, const int) __attribute__ ((always_inline));
155 inline void vec_dstst (const long *, int, const int) __attribute__ ((always_inline));
156 inline void vec_dstst (const float *, int, const int) __attribute__ ((always_inline));
157
158 inline void vec_dststt (const vector unsigned char *, int, const int) __attribute__ ((always_inline));
159 inline void vec_dststt (const vector signed char *, int, const int) __attribute__ ((always_inline));
160 inline void vec_dststt (const vector bool char *, int, const int) __attribute__ ((always_inline));
161 inline void vec_dststt (const vector unsigned short *, int, const int) __attribute__ ((always_inline));
162 inline void vec_dststt (const vector signed short *, int, const int) __attribute__ ((always_inline));
163 inline void vec_dststt (const vector bool short *, int, const int) __attribute__ ((always_inline));
164 inline void vec_dststt (const vector pixel *, int, const int) __attribute__ ((always_inline));
165 inline void vec_dststt (const vector unsigned int *, int, const int) __attribute__ ((always_inline));
166 inline void vec_dststt (const vector signed int *, int, const int) __attribute__ ((always_inline));
167 inline void vec_dststt (const vector bool int *, int, const int) __attribute__ ((always_inline));
168 inline void vec_dststt (const vector float *, int, const int) __attribute__ ((always_inline));
169 inline void vec_dststt (const unsigned char *, int, const int) __attribute__ ((always_inline));
170 inline void vec_dststt (const signed char *, int, const int) __attribute__ ((always_inline));
171 inline void vec_dststt (const unsigned short *, int, const int) __attribute__ ((always_inline));
172 inline void vec_dststt (const short *, int, const int) __attribute__ ((always_inline));
173 inline void vec_dststt (const unsigned int *, int, const int) __attribute__ ((always_inline));
174 inline void vec_dststt (const int *, int, const int) __attribute__ ((always_inline));
175 inline void vec_dststt (const unsigned long *, int, const int) __attribute__ ((always_inline));
176 inline void vec_dststt (const long *, int, const int) __attribute__ ((always_inline));
177 inline void vec_dststt (const float *, int, const int) __attribute__ ((always_inline));
178
179 inline void vec_dstt (const vector unsigned char *, int, const int) __attribute__ ((always_inline));
180 inline void vec_dstt (const vector signed char *, int, const int) __attribute__ ((always_inline));
181 inline void vec_dstt (const vector bool char *, int, const int) __attribute__ ((always_inline));
182 inline void vec_dstt (const vector unsigned short *, int, const int) __attribute__ ((always_inline));
183 inline void vec_dstt (const vector signed short *, int, const int) __attribute__ ((always_inline));
184 inline void vec_dstt (const vector bool short *, int, const int) __attribute__ ((always_inline));
185 inline void vec_dstt (const vector pixel *, int, const int) __attribute__ ((always_inline));
186 inline void vec_dstt (const vector unsigned int *, int, const int) __attribute__ ((always_inline));
187 inline void vec_dstt (const vector signed int *, int, const int) __attribute__ ((always_inline));
188 inline void vec_dstt (const vector bool int *, int, const int) __attribute__ ((always_inline));
189 inline void vec_dstt (const vector float *, int, const int) __attribute__ ((always_inline));
190 inline void vec_dstt (const unsigned char *, int, const int) __attribute__ ((always_inline));
191 inline void vec_dstt (const signed char *, int, const int) __attribute__ ((always_inline));
192 inline void vec_dstt (const unsigned short *, int, const int) __attribute__ ((always_inline));
193 inline void vec_dstt (const short *, int, const int) __attribute__ ((always_inline));
194 inline void vec_dstt (const unsigned int *, int, const int) __attribute__ ((always_inline));
195 inline void vec_dstt (const int *, int, const int) __attribute__ ((always_inline));
196 inline void vec_dstt (const unsigned long *, int, const int) __attribute__ ((always_inline));
197 inline void vec_dstt (const long *, int, const int) __attribute__ ((always_inline));
198 inline void vec_dstt (const float *, int, const int) __attribute__ ((always_inline));
199
200 inline vector float vec_sld (vector float, vector float, const int) __attribute__ ((always_inline));
201 inline vector signed int vec_sld (vector signed int, vector signed int, const int) __attribute__ ((always_inline));
202 inline vector unsigned int vec_sld (vector unsigned int, vector unsigned int, const int) __attribute__ ((always_inline));
203 inline vector bool int vec_sld (vector bool int, vector bool int, const int) __attribute__ ((always_inline));
204 inline vector signed short vec_sld (vector signed short, vector signed short, const int) __attribute__ ((always_inline));
205 inline vector unsigned short vec_sld (vector unsigned short, vector unsigned short, const int) __attribute__ ((always_inline));
206 inline vector bool short vec_sld (vector bool short, vector bool short, const int) __attribute__ ((always_inline));
207 inline vector pixel vec_sld (vector pixel, vector pixel, const int) __attribute__ ((always_inline));
208 inline vector signed char vec_sld (vector signed char, vector signed char, const int) __attribute__ ((always_inline));
209 inline vector unsigned char vec_sld (vector unsigned char, vector unsigned char, const int) __attribute__ ((always_inline));
210 inline vector bool char vec_sld (vector bool char, vector bool char, const int) __attribute__ ((always_inline));
211 inline vector signed char vec_splat (vector signed char, const int) __attribute__ ((always_inline));
212 inline vector unsigned char vec_splat (vector unsigned char, const int) __attribute__ ((always_inline));
213 inline vector bool char vec_splat (vector bool char, const int) __attribute__ ((always_inline));
214 inline vector signed short vec_splat (vector signed short, const int) __attribute__ ((always_inline));
215 inline vector unsigned short vec_splat (vector unsigned short, const int) __attribute__ ((always_inline));
216 inline vector bool short vec_splat (vector bool short, const int) __attribute__ ((always_inline));
217 inline vector pixel vec_splat (vector pixel, const int) __attribute__ ((always_inline));
218 inline vector float vec_splat (vector float, const int) __attribute__ ((always_inline));
219 inline vector signed int vec_splat (vector signed int, const int) __attribute__ ((always_inline));
220 inline vector unsigned int vec_splat (vector unsigned int, const int) __attribute__ ((always_inline));
221 inline vector bool int vec_splat (vector bool int, const int) __attribute__ ((always_inline));
222 inline vector signed char vec_splat_s8 (const int) __attribute__ ((always_inline));
223 inline vector signed short vec_splat_s16 (const int) __attribute__ ((always_inline));
224 inline vector signed int vec_splat_s32 (const int) __attribute__ ((always_inline));
225 inline vector unsigned char vec_splat_u8 (const int) __attribute__ ((always_inline));
226 inline vector unsigned short vec_splat_u16 (const int) __attribute__ ((always_inline));
227 inline vector unsigned int vec_splat_u32 (const int) __attribute__ ((always_inline));
228 inline vector float vec_vspltw (vector float a1, const int a2) __attribute__ ((always_inline));
229 inline vector bool int vec_vspltw (vector bool int a1, const int a2) __attribute__ ((always_inline));
230 inline vector signed int vec_vspltw (vector signed int a1, const int a2) __attribute__ ((always_inline));
231 inline vector unsigned int vec_vspltw (vector unsigned int a1, const int a2) __attribute__ ((always_inline));
232 inline vector bool short vec_vsplth (vector bool short a1, const int a2) __attribute__ ((always_inline));
233 inline vector signed short vec_vsplth (vector signed short a1, const int a2) __attribute__ ((always_inline));
234 inline vector unsigned short vec_vsplth (vector unsigned short a1, const int a2) __attribute__ ((always_inline));
235 inline vector pixel vec_vsplth (vector pixel a1, const int a2) __attribute__ ((always_inline));
236 inline vector bool char vec_vspltb (vector bool char a1, const int a2) __attribute__ ((always_inline));
237 inline vector signed char vec_vspltb (vector signed char a1, const int a2) __attribute__ ((always_inline));
238 inline vector unsigned char vec_vspltb (vector unsigned char a1, const int a2) __attribute__ ((always_inline));
239
240 /* vec_step */
241
242 template<typename _Tp>
243 struct __vec_step_help
244 {
245   // All proper vector types will specialize _S_elem.
246 };
247
248 template<>
249 struct __vec_step_help<vector signed short>
250 {
251   static const int _S_elem = 8;
252 };
253
254 template<>
255 struct __vec_step_help<vector unsigned short>
256 {
257   static const int _S_elem = 8;
258 };
259
260 template<>
261 struct __vec_step_help<vector bool short>
262 {
263   static const int _S_elem = 8;
264 };
265
266 template<>
267 struct __vec_step_help<vector pixel>
268 {
269   static const int _S_elem = 8;
270 };
271
272 template<>
273 struct __vec_step_help<vector signed int>
274 {
275   static const int _S_elem = 4;
276 };
277
278 template<>
279 struct __vec_step_help<vector unsigned int>
280 {
281   static const int _S_elem = 4;
282 };
283
284 template<>
285 struct __vec_step_help<vector bool int>
286 {
287   static const int _S_elem = 4;
288 };
289
290 template<>
291 struct __vec_step_help<vector unsigned char>
292 {
293   static const int _S_elem = 16;
294 };
295
296 template<>
297 struct __vec_step_help<vector signed char>
298 {
299   static const int _S_elem = 16;
300 };
301
302 template<>
303 struct __vec_step_help<vector bool char>
304 {
305   static const int _S_elem = 16;
306 };
307
308 template<>
309 struct __vec_step_help<vector float>
310 {
311   static const int _S_elem = 4;
312 };
313
314 #define vec_step(t)  __vec_step_help<typeof(t)>::_S_elem
315
316 /* vec_abs */
317
318 inline vector signed char
319 vec_abs (vector signed char a1)
320 {
321   return __builtin_altivec_abs_v16qi (a1);
322 }
323
324 inline vector signed short
325 vec_abs (vector signed short a1)
326 {
327   return __builtin_altivec_abs_v8hi (a1);
328 }
329
330 inline vector signed int
331 vec_abs (vector signed int a1)
332 {
333   return __builtin_altivec_abs_v4si (a1);
334 }
335
336 inline vector float
337 vec_abs (vector float a1)
338 {
339   return __builtin_altivec_abs_v4sf (a1);
340 }
341
342 /* vec_abss */
343
344 inline vector signed char
345 vec_abss (vector signed char a1)
346 {
347   return __builtin_altivec_abss_v16qi (a1);
348 }
349
350 inline vector signed short
351 vec_abss (vector signed short a1)
352 {
353   return __builtin_altivec_abss_v8hi (a1);
354 }
355
356 inline vector signed int
357 vec_abss (vector signed int a1)
358 {
359   return __builtin_altivec_abss_v4si (a1);
360 }
361
362 /* vec_add */
363
364 inline vector signed char
365 vec_add (vector bool char a1, vector signed char a2)
366 {
367   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
368 }
369
370 inline vector signed char
371 vec_add (vector signed char a1, vector bool char a2)
372 {
373   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
374 }
375
376 inline vector signed char
377 vec_add (vector signed char a1, vector signed char a2)
378 {
379   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
380 }
381
382 inline vector unsigned char
383 vec_add (vector bool char a1, vector unsigned char a2)
384 {
385   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
386 }
387
388 inline vector unsigned char
389 vec_add (vector unsigned char a1, vector bool char a2)
390 {
391   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
392 }
393
394 inline vector unsigned char
395 vec_add (vector unsigned char a1, vector unsigned char a2)
396 {
397   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
398 }
399
400 inline vector signed short
401 vec_add (vector bool short a1, vector signed short a2)
402 {
403   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
404 }
405
406 inline vector signed short
407 vec_add (vector signed short a1, vector bool short a2)
408 {
409   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
410 }
411
412 inline vector signed short
413 vec_add (vector signed short a1, vector signed short a2)
414 {
415   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
416 }
417
418 inline vector unsigned short
419 vec_add (vector bool short a1, vector unsigned short a2)
420 {
421   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
422 }
423
424 inline vector unsigned short
425 vec_add (vector unsigned short a1, vector bool short a2)
426 {
427   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
428 }
429
430 inline vector unsigned short
431 vec_add (vector unsigned short a1, vector unsigned short a2)
432 {
433   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
434 }
435
436 inline vector signed int
437 vec_add (vector bool int a1, vector signed int a2)
438 {
439   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
440 }
441
442 inline vector signed int
443 vec_add (vector signed int a1, vector bool int a2)
444 {
445   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
446 }
447
448 inline vector signed int
449 vec_add (vector signed int a1, vector signed int a2)
450 {
451   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
452 }
453
454 inline vector unsigned int
455 vec_add (vector bool int a1, vector unsigned int a2)
456 {
457   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
458 }
459
460 inline vector unsigned int
461 vec_add (vector unsigned int a1, vector bool int a2)
462 {
463   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
464 }
465
466 inline vector unsigned int
467 vec_add (vector unsigned int a1, vector unsigned int a2)
468 {
469   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
470 }
471
472 inline vector float
473 vec_add (vector float a1, vector float a2)
474 {
475   return (vector float) __builtin_altivec_vaddfp ((vector float) a1, (vector float) a2);
476 }
477
478 /* vec_vaddfp */
479
480 inline vector float
481 vec_vaddfp (vector float a1, vector float a2)
482 {
483   return (vector float) __builtin_altivec_vaddfp ((vector float) a1, (vector float) a2);
484 }
485
486 /* vec_vadduwm */
487
488 inline vector signed int
489 vec_vadduwm (vector bool int a1, vector signed int a2)
490 {
491   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
492 }
493
494 inline vector signed int
495 vec_vadduwm (vector signed int a1, vector bool int a2)
496 {
497   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
498 }
499
500 inline vector signed int
501 vec_vadduwm (vector signed int a1, vector signed int a2)
502 {
503   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
504 }
505
506 inline vector unsigned int
507 vec_vadduwm (vector bool int a1, vector unsigned int a2)
508 {
509   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
510 }
511
512 inline vector unsigned int
513 vec_vadduwm (vector unsigned int a1, vector bool int a2)
514 {
515   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
516 }
517
518 inline vector unsigned int
519 vec_vadduwm (vector unsigned int a1, vector unsigned int a2)
520 {
521   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
522 }
523
524 /* vec_vadduhm */
525
526 inline vector signed short
527 vec_vadduhm (vector bool short a1, vector signed short a2)
528 {
529   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
530 }
531
532 inline vector signed short
533 vec_vadduhm (vector signed short a1, vector bool short a2)
534 {
535   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
536 }
537
538 inline vector signed short
539 vec_vadduhm (vector signed short a1, vector signed short a2)
540 {
541   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
542 }
543
544 inline vector unsigned short
545 vec_vadduhm (vector bool short a1, vector unsigned short a2)
546 {
547   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
548 }
549
550 inline vector unsigned short
551 vec_vadduhm (vector unsigned short a1, vector bool short a2)
552 {
553   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
554 }
555
556 inline vector unsigned short
557 vec_vadduhm (vector unsigned short a1, vector unsigned short a2)
558 {
559   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
560 }
561
562 /* vec_vaddubm */
563
564 inline vector signed char
565 vec_vaddubm (vector bool char a1, vector signed char a2)
566 {
567   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
568 }
569
570 inline vector signed char
571 vec_vaddubm (vector signed char a1, vector bool char a2)
572 {
573   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
574 }
575
576 inline vector signed char
577 vec_vaddubm (vector signed char a1, vector signed char a2)
578 {
579   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
580 }
581
582 inline vector unsigned char
583 vec_vaddubm (vector bool char a1, vector unsigned char a2)
584 {
585   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
586 }
587
588 inline vector unsigned char
589 vec_vaddubm (vector unsigned char a1, vector bool char a2)
590 {
591   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
592 }
593
594 inline vector unsigned char
595 vec_vaddubm (vector unsigned char a1, vector unsigned char a2)
596 {
597   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
598 }
599
600 /* vec_addc */
601
602 inline vector unsigned int
603 vec_addc (vector unsigned int a1, vector unsigned int a2)
604 {
605   return (vector unsigned int) __builtin_altivec_vaddcuw ((vector signed int) a1, (vector signed int) a2);
606 }
607
608 /* vec_adds */
609
610 inline vector unsigned char
611 vec_adds (vector bool char a1, vector unsigned char a2)
612 {
613   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
614 }
615
616 inline vector unsigned char
617 vec_adds (vector unsigned char a1, vector bool char a2)
618 {
619   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
620 }
621
622 inline vector unsigned char
623 vec_adds (vector unsigned char a1, vector unsigned char a2)
624 {
625   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
626 }
627
628 inline vector signed char
629 vec_adds (vector bool char a1, vector signed char a2)
630 {
631   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
632 }
633
634 inline vector signed char
635 vec_adds (vector signed char a1, vector bool char a2)
636 {
637   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
638 }
639
640 inline vector signed char
641 vec_adds (vector signed char a1, vector signed char a2)
642 {
643   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
644 }
645
646 inline vector unsigned short
647 vec_adds (vector bool short a1, vector unsigned short a2)
648 {
649   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
650 }
651
652 inline vector unsigned short
653 vec_adds (vector unsigned short a1, vector bool short a2)
654 {
655   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
656 }
657
658 inline vector unsigned short
659 vec_adds (vector unsigned short a1, vector unsigned short a2)
660 {
661   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
662 }
663
664 inline vector signed short
665 vec_adds (vector bool short a1, vector signed short a2)
666 {
667   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
668 }
669
670 inline vector signed short
671 vec_adds (vector signed short a1, vector bool short a2)
672 {
673   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
674 }
675
676 inline vector signed short
677 vec_adds (vector signed short a1, vector signed short a2)
678 {
679   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
680 }
681
682 inline vector unsigned int
683 vec_adds (vector bool int a1, vector unsigned int a2)
684 {
685   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
686 }
687
688 inline vector unsigned int
689 vec_adds (vector unsigned int a1, vector bool int a2)
690 {
691   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
692 }
693
694 inline vector unsigned int
695 vec_adds (vector unsigned int a1, vector unsigned int a2)
696 {
697   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
698 }
699
700 inline vector signed int
701 vec_adds (vector bool int a1, vector signed int a2)
702 {
703   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
704 }
705
706 inline vector signed int
707 vec_adds (vector signed int a1, vector bool int a2)
708 {
709   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
710 }
711
712 inline vector signed int
713 vec_adds (vector signed int a1, vector signed int a2)
714 {
715   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
716 }
717
718 /* vec_vaddsws */
719
720 inline vector signed int
721 vec_vaddsws (vector bool int a1, vector signed int a2)
722 {
723   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
724 }
725
726 inline vector signed int
727 vec_vaddsws (vector signed int a1, vector bool int a2)
728 {
729   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
730 }
731
732 inline vector signed int
733 vec_vaddsws (vector signed int a1, vector signed int a2)
734 {
735   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
736 }
737
738 /* vec_vadduws */
739
740 inline vector unsigned int
741 vec_vadduws (vector bool int a1, vector unsigned int a2)
742 {
743   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
744 }
745
746 inline vector unsigned int
747 vec_vadduws (vector unsigned int a1, vector bool int a2)
748 {
749   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
750 }
751
752 inline vector unsigned int
753 vec_vadduws (vector unsigned int a1, vector unsigned int a2)
754 {
755   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
756 }
757
758 /* vec_vaddshs */
759
760 inline vector signed short
761 vec_vaddshs (vector bool short a1, vector signed short a2)
762 {
763   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
764 }
765
766 inline vector signed short
767 vec_vaddshs (vector signed short a1, vector bool short a2)
768 {
769   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
770 }
771
772 inline vector signed short
773 vec_vaddshs (vector signed short a1, vector signed short a2)
774 {
775   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
776 }
777
778 /* vec_vadduhs */
779
780 inline vector unsigned short
781 vec_vadduhs (vector bool short a1, vector unsigned short a2)
782 {
783   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
784 }
785
786 inline vector unsigned short
787 vec_vadduhs (vector unsigned short a1, vector bool short a2)
788 {
789   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
790 }
791
792 inline vector unsigned short
793 vec_vadduhs (vector unsigned short a1, vector unsigned short a2)
794 {
795   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
796 }
797
798 /* vec_vaddsbs */
799
800 inline vector signed char
801 vec_vaddsbs (vector bool char a1, vector signed char a2)
802 {
803   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
804 }
805
806 inline vector signed char
807 vec_vaddsbs (vector signed char a1, vector bool char a2)
808 {
809   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
810 }
811
812 inline vector signed char
813 vec_vaddsbs (vector signed char a1, vector signed char a2)
814 {
815   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
816 }
817
818 /* vec_vaddubs */
819
820 inline vector unsigned char
821 vec_vaddubs (vector bool char a1, vector unsigned char a2)
822 {
823   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
824 }
825
826 inline vector unsigned char
827 vec_vaddubs (vector unsigned char a1, vector bool char a2)
828 {
829   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
830 }
831
832 inline vector unsigned char
833 vec_vaddubs (vector unsigned char a1, vector unsigned char a2)
834 {
835   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
836 }
837
838 /* vec_and */
839
840 inline vector float
841 vec_and (vector float a1, vector float a2)
842 {
843   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
844 }
845
846 inline vector float
847 vec_and (vector float a1, vector bool int a2)
848 {
849   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
850 }
851
852 inline vector float
853 vec_and (vector bool int a1, vector float a2)
854 {
855   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
856 }
857
858 inline vector bool int
859 vec_and (vector bool int a1, vector bool int a2)
860 {
861   return (vector bool int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
862 }
863
864 inline vector signed int
865 vec_and (vector bool int a1, vector signed int a2)
866 {
867   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
868 }
869
870 inline vector signed int
871 vec_and (vector signed int a1, vector bool int a2)
872 {
873   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
874 }
875
876 inline vector signed int
877 vec_and (vector signed int a1, vector signed int a2)
878 {
879   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
880 }
881
882 inline vector unsigned int
883 vec_and (vector bool int a1, vector unsigned int a2)
884 {
885   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
886 }
887
888 inline vector unsigned int
889 vec_and (vector unsigned int a1, vector bool int a2)
890 {
891   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
892 }
893
894 inline vector unsigned int
895 vec_and (vector unsigned int a1, vector unsigned int a2)
896 {
897   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
898 }
899
900 inline vector bool short
901 vec_and (vector bool short a1, vector bool short a2)
902 {
903   return (vector bool short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
904 }
905
906 inline vector signed short
907 vec_and (vector bool short a1, vector signed short a2)
908 {
909   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
910 }
911
912 inline vector signed short
913 vec_and (vector signed short a1, vector bool short a2)
914 {
915   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
916 }
917
918 inline vector signed short
919 vec_and (vector signed short a1, vector signed short a2)
920 {
921   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
922 }
923
924 inline vector unsigned short
925 vec_and (vector bool short a1, vector unsigned short a2)
926 {
927   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
928 }
929
930 inline vector unsigned short
931 vec_and (vector unsigned short a1, vector bool short a2)
932 {
933   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
934 }
935
936 inline vector unsigned short
937 vec_and (vector unsigned short a1, vector unsigned short a2)
938 {
939   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
940 }
941
942 inline vector signed char
943 vec_and (vector bool char a1, vector signed char a2)
944 {
945   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
946 }
947
948 inline vector bool char
949 vec_and (vector bool char a1, vector bool char a2)
950 {
951   return (vector bool char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
952 }
953
954 inline vector signed char
955 vec_and (vector signed char a1, vector bool char a2)
956 {
957   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
958 }
959
960 inline vector signed char
961 vec_and (vector signed char a1, vector signed char a2)
962 {
963   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
964 }
965
966 inline vector unsigned char
967 vec_and (vector bool char a1, vector unsigned char a2)
968 {
969   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
970 }
971
972 inline vector unsigned char
973 vec_and (vector unsigned char a1, vector bool char a2)
974 {
975   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
976 }
977
978 inline vector unsigned char
979 vec_and (vector unsigned char a1, vector unsigned char a2)
980 {
981   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
982 }
983
984 /* vec_andc */
985
986 inline vector float
987 vec_andc (vector float a1, vector float a2)
988 {
989   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
990 }
991
992 inline vector float
993 vec_andc (vector float a1, vector bool int a2)
994 {
995   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
996 }
997
998 inline vector float
999 vec_andc (vector bool int a1, vector float a2)
1000 {
1001   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1002 }
1003
1004 inline vector bool int
1005 vec_andc (vector bool int a1, vector bool int a2)
1006 {
1007   return (vector bool int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1008 }
1009
1010 inline vector signed int
1011 vec_andc (vector bool int a1, vector signed int a2)
1012 {
1013   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1014 }
1015
1016 inline vector signed int
1017 vec_andc (vector signed int a1, vector bool int a2)
1018 {
1019   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1020 }
1021
1022 inline vector signed int
1023 vec_andc (vector signed int a1, vector signed int a2)
1024 {
1025   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1026 }
1027
1028 inline vector unsigned int
1029 vec_andc (vector bool int a1, vector unsigned int a2)
1030 {
1031   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1032 }
1033
1034 inline vector unsigned int
1035 vec_andc (vector unsigned int a1, vector bool int a2)
1036 {
1037   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1038 }
1039
1040 inline vector unsigned int
1041 vec_andc (vector unsigned int a1, vector unsigned int a2)
1042 {
1043   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1044 }
1045
1046 inline vector bool short
1047 vec_andc (vector bool short a1, vector bool short a2)
1048 {
1049   return (vector bool short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1050 }
1051
1052 inline vector signed short
1053 vec_andc (vector bool short a1, vector signed short a2)
1054 {
1055   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1056 }
1057
1058 inline vector signed short
1059 vec_andc (vector signed short a1, vector bool short a2)
1060 {
1061   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1062 }
1063
1064 inline vector signed short
1065 vec_andc (vector signed short a1, vector signed short a2)
1066 {
1067   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1068 }
1069
1070 inline vector unsigned short
1071 vec_andc (vector bool short a1, vector unsigned short a2)
1072 {
1073   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1074 }
1075
1076 inline vector unsigned short
1077 vec_andc (vector unsigned short a1, vector bool short a2)
1078 {
1079   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1080 }
1081
1082 inline vector unsigned short
1083 vec_andc (vector unsigned short a1, vector unsigned short a2)
1084 {
1085   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1086 }
1087
1088 inline vector signed char
1089 vec_andc (vector bool char a1, vector signed char a2)
1090 {
1091   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1092 }
1093
1094 inline vector bool char
1095 vec_andc (vector bool char a1, vector bool char a2)
1096 {
1097   return (vector bool char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1098 }
1099
1100 inline vector signed char
1101 vec_andc (vector signed char a1, vector bool char a2)
1102 {
1103   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1104 }
1105
1106 inline vector signed char
1107 vec_andc (vector signed char a1, vector signed char a2)
1108 {
1109   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1110 }
1111
1112 inline vector unsigned char
1113 vec_andc (vector bool char a1, vector unsigned char a2)
1114 {
1115   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1116 }
1117
1118 inline vector unsigned char
1119 vec_andc (vector unsigned char a1, vector bool char a2)
1120 {
1121   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1122 }
1123
1124 inline vector unsigned char
1125 vec_andc (vector unsigned char a1, vector unsigned char a2)
1126 {
1127   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1128 }
1129
1130 /* vec_avg */
1131
1132 inline vector unsigned char
1133 vec_avg (vector unsigned char a1, vector unsigned char a2)
1134 {
1135   return (vector unsigned char) __builtin_altivec_vavgub ((vector signed char) a1, (vector signed char) a2);
1136 }
1137
1138 inline vector signed char
1139 vec_avg (vector signed char a1, vector signed char a2)
1140 {
1141   return (vector signed char) __builtin_altivec_vavgsb ((vector signed char) a1, (vector signed char) a2);
1142 }
1143
1144 inline vector unsigned short
1145 vec_avg (vector unsigned short a1, vector unsigned short a2)
1146 {
1147   return (vector unsigned short) __builtin_altivec_vavguh ((vector signed short) a1, (vector signed short) a2);
1148 }
1149
1150 inline vector signed short
1151 vec_avg (vector signed short a1, vector signed short a2)
1152 {
1153   return (vector signed short) __builtin_altivec_vavgsh ((vector signed short) a1, (vector signed short) a2);
1154 }
1155
1156 inline vector unsigned int
1157 vec_avg (vector unsigned int a1, vector unsigned int a2)
1158 {
1159   return (vector unsigned int) __builtin_altivec_vavguw ((vector signed int) a1, (vector signed int) a2);
1160 }
1161
1162 inline vector signed int
1163 vec_avg (vector signed int a1, vector signed int a2)
1164 {
1165   return (vector signed int) __builtin_altivec_vavgsw ((vector signed int) a1, (vector signed int) a2);
1166 }
1167
1168 /* vec_vavgsw */
1169
1170 inline vector signed int
1171 vec_vavgsw (vector signed int a1, vector signed int a2)
1172 {
1173   return (vector signed int) __builtin_altivec_vavgsw ((vector signed int) a1, (vector signed int) a2);
1174 }
1175
1176 /* vec_vavguw */
1177
1178 inline vector unsigned int
1179 vec_vavguw (vector unsigned int a1, vector unsigned int a2)
1180 {
1181   return (vector unsigned int) __builtin_altivec_vavguw ((vector signed int) a1, (vector signed int) a2);
1182 }
1183
1184 /* vec_vavgsh */
1185
1186 inline vector signed short
1187 vec_vavgsh (vector signed short a1, vector signed short a2)
1188 {
1189   return (vector signed short) __builtin_altivec_vavgsh ((vector signed short) a1, (vector signed short) a2);
1190 }
1191
1192 /* vec_vavguh */
1193
1194 inline vector unsigned short
1195 vec_vavguh (vector unsigned short a1, vector unsigned short a2)
1196 {
1197   return (vector unsigned short) __builtin_altivec_vavguh ((vector signed short) a1, (vector signed short) a2);
1198 }
1199
1200 /* vec_vavgsb */
1201
1202 inline vector signed char
1203 vec_vavgsb (vector signed char a1, vector signed char a2)
1204 {
1205   return (vector signed char) __builtin_altivec_vavgsb ((vector signed char) a1, (vector signed char) a2);
1206 }
1207
1208 /* vec_vavgub */
1209
1210 inline vector unsigned char
1211 vec_vavgub (vector unsigned char a1, vector unsigned char a2)
1212 {
1213   return (vector unsigned char) __builtin_altivec_vavgub ((vector signed char) a1, (vector signed char) a2);
1214 }
1215
1216 /* vec_ceil */
1217
1218 inline vector float
1219 vec_ceil (vector float a1)
1220 {
1221   return (vector float) __builtin_altivec_vrfip ((vector float) a1);
1222 }
1223
1224 /* vec_cmpb */
1225
1226 inline vector signed int
1227 vec_cmpb (vector float a1, vector float a2)
1228 {
1229   return (vector signed int) __builtin_altivec_vcmpbfp ((vector float) a1, (vector float) a2);
1230 }
1231
1232 /* vec_cmpeq */
1233
1234 inline vector bool char
1235 vec_cmpeq (vector signed char a1, vector signed char a2)
1236 {
1237   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1238 }
1239
1240 inline vector bool char
1241 vec_cmpeq (vector unsigned char a1, vector unsigned char a2)
1242 {
1243   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1244 }
1245
1246 inline vector bool short
1247 vec_cmpeq (vector signed short a1, vector signed short a2)
1248 {
1249   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1250 }
1251
1252 inline vector bool short
1253 vec_cmpeq (vector unsigned short a1, vector unsigned short a2)
1254 {
1255   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1256 }
1257
1258 inline vector bool int
1259 vec_cmpeq (vector signed int a1, vector signed int a2)
1260 {
1261   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1262 }
1263
1264 inline vector bool int
1265 vec_cmpeq (vector unsigned int a1, vector unsigned int a2)
1266 {
1267   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1268 }
1269
1270 inline vector bool int
1271 vec_cmpeq (vector float a1, vector float a2)
1272 {
1273   return (vector bool int) __builtin_altivec_vcmpeqfp ((vector float) a1, (vector float) a2);
1274 }
1275
1276 /* vec_vcmpeqfp */
1277
1278 inline vector bool int
1279 vec_vcmpeqfp (vector float a1, vector float a2)
1280 {
1281   return (vector bool int) __builtin_altivec_vcmpeqfp ((vector float) a1, (vector float) a2);
1282 }
1283
1284 /* vec_vcmpequw */
1285
1286 inline vector bool int
1287 vec_vcmpequw (vector signed int a1, vector signed int a2)
1288 {
1289   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1290 }
1291
1292 inline vector bool int
1293 vec_vcmpequw (vector unsigned int a1, vector unsigned int a2)
1294 {
1295   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1296 }
1297
1298 /* vec_vcmpequh */
1299
1300 inline vector bool short
1301 vec_vcmpequh (vector signed short a1, vector signed short a2)
1302 {
1303   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1304 }
1305
1306 inline vector bool short
1307 vec_vcmpequh (vector unsigned short a1, vector unsigned short a2)
1308 {
1309   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1310 }
1311
1312 /* vec_vcmpequb */
1313
1314 inline vector bool char
1315 vec_vcmpequb (vector signed char a1, vector signed char a2)
1316 {
1317   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1318 }
1319
1320 inline vector bool char
1321 vec_vcmpequb (vector unsigned char a1, vector unsigned char a2)
1322 {
1323   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1324 }
1325
1326 /* vec_cmpge */
1327
1328 inline vector bool int
1329 vec_cmpge (vector float a1, vector float a2)
1330 {
1331   return (vector bool int) __builtin_altivec_vcmpgefp ((vector float) a1, (vector float) a2);
1332 }
1333
1334 /* vec_cmpgt */
1335
1336 inline vector bool char
1337 vec_cmpgt (vector unsigned char a1, vector unsigned char a2)
1338 {
1339   return (vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) a1, (vector signed char) a2);
1340 }
1341
1342 inline vector bool char
1343 vec_cmpgt (vector signed char a1, vector signed char a2)
1344 {
1345   return (vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) a1, (vector signed char) a2);
1346 }
1347
1348 inline vector bool short
1349 vec_cmpgt (vector unsigned short a1, vector unsigned short a2)
1350 {
1351   return (vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) a1, (vector signed short) a2);
1352 }
1353
1354 inline vector bool short
1355 vec_cmpgt (vector signed short a1, vector signed short a2)
1356 {
1357   return (vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) a1, (vector signed short) a2);
1358 }
1359
1360 inline vector bool int
1361 vec_cmpgt (vector unsigned int a1, vector unsigned int a2)
1362 {
1363   return (vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) a1, (vector signed int) a2);
1364 }
1365
1366 inline vector bool int
1367 vec_cmpgt (vector signed int a1, vector signed int a2)
1368 {
1369   return (vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) a1, (vector signed int) a2);
1370 }
1371
1372 inline vector bool int
1373 vec_cmpgt (vector float a1, vector float a2)
1374 {
1375   return (vector bool int) __builtin_altivec_vcmpgtfp ((vector float) a1, (vector float) a2);
1376 }
1377
1378 /* vec_vcmpgtfp */
1379
1380 inline vector bool int
1381 vec_vcmpgtfp (vector float a1, vector float a2)
1382 {
1383   return (vector bool int) __builtin_altivec_vcmpgtfp ((vector float) a1, (vector float) a2);
1384 }
1385
1386 /* vec_vcmpgtsw */
1387
1388 inline vector bool int
1389 vec_vcmpgtsw (vector signed int a1, vector signed int a2)
1390 {
1391   return (vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) a1, (vector signed int) a2);
1392 }
1393
1394 /* vec_vcmpgtuw */
1395
1396 inline vector bool int
1397 vec_vcmpgtuw (vector unsigned int a1, vector unsigned int a2)
1398 {
1399   return (vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) a1, (vector signed int) a2);
1400 }
1401
1402 /* vec_vcmpgtsh */
1403
1404 inline vector bool short
1405 vec_vcmpgtsh (vector signed short a1, vector signed short a2)
1406 {
1407   return (vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) a1, (vector signed short) a2);
1408 }
1409
1410 /* vec_vcmpgtuh */
1411
1412 inline vector bool short
1413 vec_vcmpgtuh (vector unsigned short a1, vector unsigned short a2)
1414 {
1415   return (vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) a1, (vector signed short) a2);
1416 }
1417
1418 /* vec_vcmpgtsb */
1419
1420 inline vector bool char
1421 vec_vcmpgtsb (vector signed char a1, vector signed char a2)
1422 {
1423   return (vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) a1, (vector signed char) a2);
1424 }
1425
1426 /* vec_vcmpgtub */
1427
1428 inline vector bool char
1429 vec_vcmpgtub (vector unsigned char a1, vector unsigned char a2)
1430 {
1431   return (vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) a1, (vector signed char) a2);
1432 }
1433
1434 /* vec_cmple */
1435
1436 inline vector bool int
1437 vec_cmple (vector float a1, vector float a2)
1438 {
1439   return (vector bool int) __builtin_altivec_vcmpgefp ((vector float) a2, (vector float) a1);
1440 }
1441
1442 /* vec_cmplt */
1443
1444 inline vector bool char
1445 vec_cmplt (vector unsigned char a1, vector unsigned char a2)
1446 {
1447   return (vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) a2, (vector signed char) a1);
1448 }
1449
1450 inline vector bool char
1451 vec_cmplt (vector signed char a1, vector signed char a2)
1452 {
1453   return (vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) a2, (vector signed char) a1);
1454 }
1455
1456 inline vector bool short
1457 vec_cmplt (vector unsigned short a1, vector unsigned short a2)
1458 {
1459   return (vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) a2, (vector signed short) a1);
1460 }
1461
1462 inline vector bool short
1463 vec_cmplt (vector signed short a1, vector signed short a2)
1464 {
1465   return (vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) a2, (vector signed short) a1);
1466 }
1467
1468 inline vector bool int
1469 vec_cmplt (vector unsigned int a1, vector unsigned int a2)
1470 {
1471   return (vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) a2, (vector signed int) a1);
1472 }
1473
1474 inline vector bool int
1475 vec_cmplt (vector signed int a1, vector signed int a2)
1476 {
1477   return (vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) a2, (vector signed int) a1);
1478 }
1479
1480 inline vector bool int
1481 vec_cmplt (vector float a1, vector float a2)
1482 {
1483   return (vector bool int) __builtin_altivec_vcmpgtfp ((vector float) a2, (vector float) a1);
1484 }
1485
1486 /* vec_ctf */
1487
1488 inline vector float
1489 vec_ctf (vector unsigned int a1, const int a2)
1490 {
1491   return (vector float) __builtin_altivec_vcfux ((vector signed int) a1, a2);
1492 }
1493
1494 inline vector float
1495 vec_ctf (vector signed int a1, const int a2)
1496 {
1497   return (vector float) __builtin_altivec_vcfsx ((vector signed int) a1, a2);
1498 }
1499
1500 /* vec_vcfsx */
1501
1502 inline vector float
1503 vec_vcfsx (vector signed int a1, const int a2)
1504 {
1505   return (vector float) __builtin_altivec_vcfsx ((vector signed int) a1, a2);
1506 }
1507
1508 /* vec_vcfux */
1509
1510 inline vector float
1511 vec_vcfux (vector unsigned int a1, const int a2)
1512 {
1513   return (vector float) __builtin_altivec_vcfux ((vector signed int) a1, a2);
1514 }
1515
1516 /* vec_cts */
1517
1518 inline vector signed int
1519 vec_cts (vector float a1, const int a2)
1520 {
1521   return (vector signed int) __builtin_altivec_vctsxs ((vector float) a1, a2);
1522 }
1523
1524 /* vec_ctu */
1525
1526 inline vector unsigned int
1527 vec_ctu (vector float a1, const int a2)
1528 {
1529   return (vector unsigned int) __builtin_altivec_vctuxs ((vector float) a1, a2);
1530 }
1531
1532 /* vec_dss */
1533
1534 inline void
1535 vec_dss (const int a1)
1536 {
1537   __builtin_altivec_dss (a1);
1538 }
1539
1540 /* vec_dssall */
1541
1542 inline void
1543 vec_dssall (void)
1544 {
1545   __builtin_altivec_dssall ();
1546 }
1547
1548 /* vec_dst */
1549
1550 inline void
1551 vec_dst (const vector unsigned char *a1, int a2, const int a3)
1552 {
1553   __builtin_altivec_dst ((void *) a1, a2, a3);
1554 }
1555
1556 inline void
1557 vec_dst (const vector signed char *a1, int a2, const int a3)
1558 {
1559   __builtin_altivec_dst ((void *) a1, a2, a3);
1560 }
1561
1562 inline void
1563 vec_dst (const vector bool char *a1, int a2, const int a3)
1564 {
1565   __builtin_altivec_dst ((void *) a1, a2, a3);
1566 }
1567
1568 inline void
1569 vec_dst (const vector unsigned short *a1, int a2, const int a3)
1570 {
1571   __builtin_altivec_dst ((void *) a1, a2, a3);
1572 }
1573
1574 inline void
1575 vec_dst (const vector signed short *a1, int a2, const int a3)
1576 {
1577   __builtin_altivec_dst ((void *) a1, a2, a3);
1578 }
1579
1580 inline void
1581 vec_dst (const vector bool short *a1, int a2, const int a3)
1582 {
1583   __builtin_altivec_dst ((void *) a1, a2, a3);
1584 }
1585
1586 inline void
1587 vec_dst (const vector pixel *a1, int a2, const int a3)
1588 {
1589   __builtin_altivec_dst ((void *) a1, a2, a3);
1590 }
1591
1592 inline void
1593 vec_dst (const vector unsigned int *a1, int a2, const int a3)
1594 {
1595   __builtin_altivec_dst ((void *) a1, a2, a3);
1596 }
1597
1598 inline void
1599 vec_dst (const vector signed int *a1, int a2, const int a3)
1600 {
1601   __builtin_altivec_dst ((void *) a1, a2, a3);
1602 }
1603
1604 inline void
1605 vec_dst (const vector bool int *a1, int a2, const int a3)
1606 {
1607   __builtin_altivec_dst ((void *) a1, a2, a3);
1608 }
1609
1610 inline void
1611 vec_dst (const vector float *a1, int a2, const int a3)
1612 {
1613   __builtin_altivec_dst ((void *) a1, a2, a3);
1614 }
1615
1616 inline void
1617 vec_dst (const unsigned char *a1, int a2, const int a3)
1618 {
1619   __builtin_altivec_dst ((void *) a1, a2, a3);
1620 }
1621
1622 inline void
1623 vec_dst (const signed char *a1, int a2, const int a3)
1624 {
1625   __builtin_altivec_dst ((void *) a1, a2, a3);
1626 }
1627
1628 inline void
1629 vec_dst (const unsigned short *a1, int a2, const int a3)
1630 {
1631   __builtin_altivec_dst ((void *) a1, a2, a3);
1632 }
1633
1634 inline void
1635 vec_dst (const short *a1, int a2, const int a3)
1636 {
1637   __builtin_altivec_dst ((void *) a1, a2, a3);
1638 }
1639
1640 inline void
1641 vec_dst (const unsigned int *a1, int a2, const int a3)
1642 {
1643   __builtin_altivec_dst ((void *) a1, a2, a3);
1644 }
1645
1646 inline void
1647 vec_dst (const int *a1, int a2, const int a3)
1648 {
1649   __builtin_altivec_dst ((void *) a1, a2, a3);
1650 }
1651
1652 inline void
1653 vec_dst (const unsigned long *a1, int a2, const int a3)
1654 {
1655   __builtin_altivec_dst ((void *) a1, a2, a3);
1656 }
1657
1658 inline void
1659 vec_dst (const long *a1, int a2, const int a3)
1660 {
1661   __builtin_altivec_dst ((void *) a1, a2, a3);
1662 }
1663
1664 inline void
1665 vec_dst (float *a1, int a2, const int a3)
1666 {
1667   __builtin_altivec_dst ((void *) a1, a2, a3);
1668 }
1669
1670 /* vec_dstst */
1671
1672 inline void
1673 vec_dstst (const vector unsigned char *a1, int a2, const int a3)
1674 {
1675   __builtin_altivec_dstst ((void *) a1, a2, a3);
1676 }
1677
1678 inline void
1679 vec_dstst (const vector signed char *a1, int a2, const int a3)
1680 {
1681   __builtin_altivec_dstst ((void *) a1, a2, a3);
1682 }
1683
1684 inline void
1685 vec_dstst (const vector bool char *a1, int a2, const int a3)
1686 {
1687   __builtin_altivec_dstst ((void *) a1, a2, a3);
1688 }
1689
1690 inline void
1691 vec_dstst (const vector unsigned short *a1, int a2, const int a3)
1692 {
1693   __builtin_altivec_dstst ((void *) a1, a2, a3);
1694 }
1695
1696 inline void
1697 vec_dstst (const vector signed short *a1, int a2, const int a3)
1698 {
1699   __builtin_altivec_dstst ((void *) a1, a2, a3);
1700 }
1701
1702 inline void
1703 vec_dstst (const vector bool short *a1, int a2, const int a3)
1704 {
1705   __builtin_altivec_dstst ((void *) a1, a2, a3);
1706 }
1707
1708 inline void
1709 vec_dstst (const vector pixel *a1, int a2, const int a3)
1710 {
1711   __builtin_altivec_dstst ((void *) a1, a2, a3);
1712 }
1713
1714 inline void
1715 vec_dstst (const vector unsigned int *a1, int a2, const int a3)
1716 {
1717   __builtin_altivec_dstst ((void *) a1, a2, a3);
1718 }
1719
1720 inline void
1721 vec_dstst (const vector signed int *a1, int a2, const int a3)
1722 {
1723   __builtin_altivec_dstst ((void *) a1, a2, a3);
1724 }
1725
1726 inline void
1727 vec_dstst (const vector bool int *a1, int a2, const int a3)
1728 {
1729   __builtin_altivec_dstst ((void *) a1, a2, a3);
1730 }
1731
1732 inline void
1733 vec_dstst (const vector float *a1, int a2, const int a3)
1734 {
1735   __builtin_altivec_dstst ((void *) a1, a2, a3);
1736 }
1737
1738 inline void
1739 vec_dstst (const unsigned char *a1, int a2, const int a3)
1740 {
1741   __builtin_altivec_dstst ((void *) a1, a2, a3);
1742 }
1743
1744 inline void
1745 vec_dstst (const signed char *a1, int a2, const int a3)
1746 {
1747   __builtin_altivec_dstst ((void *) a1, a2, a3);
1748 }
1749
1750 inline void
1751 vec_dstst (const unsigned short *a1, int a2, const int a3)
1752 {
1753   __builtin_altivec_dstst ((void *) a1, a2, a3);
1754 }
1755
1756 inline void
1757 vec_dstst (const short *a1, int a2, const int a3)
1758 {
1759   __builtin_altivec_dstst ((void *) a1, a2, a3);
1760 }
1761
1762 inline void
1763 vec_dstst (const unsigned int *a1, int a2, const int a3)
1764 {
1765   __builtin_altivec_dstst ((void *) a1, a2, a3);
1766 }
1767
1768 inline void
1769 vec_dstst (const int *a1, int a2, const int a3)
1770 {
1771   __builtin_altivec_dstst ((void *) a1, a2, a3);
1772 }
1773
1774 inline void
1775 vec_dstst (const unsigned long *a1, int a2, const int a3)
1776 {
1777   __builtin_altivec_dstst ((void *) a1, a2, a3);
1778 }
1779
1780 inline void
1781 vec_dstst (const long *a1, int a2, const int a3)
1782 {
1783   __builtin_altivec_dstst ((void *) a1, a2, a3);
1784 }
1785
1786 inline void
1787 vec_dstst (float *a1, int a2, const int a3)
1788 {
1789   __builtin_altivec_dstst ((void *) a1, a2, a3);
1790 }
1791
1792 /* vec_dststt */
1793
1794 inline void
1795 vec_dststt (const vector unsigned char *a1, int a2, const int a3)
1796 {
1797   __builtin_altivec_dststt ((void *) a1, a2, a3);
1798 }
1799
1800 inline void
1801 vec_dststt (const vector signed char *a1, int a2, const int a3)
1802 {
1803   __builtin_altivec_dststt ((void *) a1, a2, a3);
1804 }
1805
1806 inline void
1807 vec_dststt (const vector bool char *a1, int a2, const int a3)
1808 {
1809   __builtin_altivec_dststt ((void *) a1, a2, a3);
1810 }
1811
1812 inline void
1813 vec_dststt (const vector unsigned short *a1, int a2, const int a3)
1814 {
1815   __builtin_altivec_dststt ((void *) a1, a2, a3);
1816 }
1817
1818 inline void
1819 vec_dststt (const vector signed short *a1, int a2, const int a3)
1820 {
1821   __builtin_altivec_dststt ((void *) a1, a2, a3);
1822 }
1823
1824 inline void
1825 vec_dststt (const vector bool short *a1, int a2, const int a3)
1826 {
1827   __builtin_altivec_dststt ((void *) a1, a2, a3);
1828 }
1829
1830 inline void
1831 vec_dststt (const vector pixel *a1, int a2, const int a3)
1832 {
1833   __builtin_altivec_dststt ((void *) a1, a2, a3);
1834 }
1835
1836 inline void
1837 vec_dststt (const vector unsigned int *a1, int a2, const int a3)
1838 {
1839   __builtin_altivec_dststt ((void *) a1, a2, a3);
1840 }
1841
1842 inline void
1843 vec_dststt (const vector signed int *a1, int a2, const int a3)
1844 {
1845   __builtin_altivec_dststt ((void *) a1, a2, a3);
1846 }
1847
1848 inline void
1849 vec_dststt (const vector bool int *a1, int a2, const int a3)
1850 {
1851   __builtin_altivec_dststt ((void *) a1, a2, a3);
1852 }
1853
1854 inline void
1855 vec_dststt (const vector float *a1, int a2, const int a3)
1856 {
1857   __builtin_altivec_dststt ((void *) a1, a2, a3);
1858 }
1859
1860 inline void
1861 vec_dststt (const unsigned char *a1, int a2, const int a3)
1862 {
1863   __builtin_altivec_dststt ((void *) a1, a2, a3);
1864 }
1865
1866 inline void
1867 vec_dststt (const signed char *a1, int a2, const int a3)
1868 {
1869   __builtin_altivec_dststt ((void *) a1, a2, a3);
1870 }
1871
1872 inline void
1873 vec_dststt (const unsigned short *a1, int a2, const int a3)
1874 {
1875   __builtin_altivec_dststt ((void *) a1, a2, a3);
1876 }
1877
1878 inline void
1879 vec_dststt (const short *a1, int a2, const int a3)
1880 {
1881   __builtin_altivec_dststt ((void *) a1, a2, a3);
1882 }
1883
1884 inline void
1885 vec_dststt (const unsigned int *a1, int a2, const int a3)
1886 {
1887   __builtin_altivec_dststt ((void *) a1, a2, a3);
1888 }
1889
1890 inline void
1891 vec_dststt (const int *a1, int a2, const int a3)
1892 {
1893   __builtin_altivec_dststt ((void *) a1, a2, a3);
1894 }
1895
1896 inline void
1897 vec_dststt (const unsigned long *a1, int a2, const int a3)
1898 {
1899   __builtin_altivec_dststt ((void *) a1, a2, a3);
1900 }
1901
1902 inline void
1903 vec_dststt (const long *a1, int a2, const int a3)
1904 {
1905   __builtin_altivec_dststt ((void *) a1, a2, a3);
1906 }
1907
1908 inline void
1909 vec_dststt (float *a1, int a2, const int a3)
1910 {
1911   __builtin_altivec_dststt ((void *) a1, a2, a3);
1912 }
1913
1914 /* vec_dstt */
1915
1916 inline void
1917 vec_dstt (const vector unsigned char *a1, int a2, const int a3)
1918 {
1919   __builtin_altivec_dstt ((void *) a1, a2, a3);
1920 }
1921
1922 inline void
1923 vec_dstt (const vector signed char *a1, int a2, const int a3)
1924 {
1925   __builtin_altivec_dstt ((void *) a1, a2, a3);
1926 }
1927
1928 inline void
1929 vec_dstt (const vector bool char *a1, int a2, const int a3)
1930 {
1931   __builtin_altivec_dstt ((void *) a1, a2, a3);
1932 }
1933
1934 inline void
1935 vec_dstt (const vector unsigned short *a1, int a2, const int a3)
1936 {
1937   __builtin_altivec_dstt ((void *) a1, a2, a3);
1938 }
1939
1940 inline void
1941 vec_dstt (const vector signed short *a1, int a2, const int a3)
1942 {
1943   __builtin_altivec_dstt ((void *) a1, a2, a3);
1944 }
1945
1946 inline void
1947 vec_dstt (const vector bool short *a1, int a2, const int a3)
1948 {
1949   __builtin_altivec_dstt ((void *) a1, a2, a3);
1950 }
1951
1952 inline void
1953 vec_dstt (const vector pixel *a1, int a2, const int a3)
1954 {
1955   __builtin_altivec_dstt ((void *) a1, a2, a3);
1956 }
1957
1958 inline void
1959 vec_dstt (const vector unsigned int *a1, int a2, const int a3)
1960 {
1961   __builtin_altivec_dstt ((void *) a1, a2, a3);
1962 }
1963
1964 inline void
1965 vec_dstt (const vector signed int *a1, int a2, const int a3)
1966 {
1967   __builtin_altivec_dstt ((void *) a1, a2, a3);
1968 }
1969
1970 inline void
1971 vec_dstt (const vector bool int *a1, int a2, const int a3)
1972 {
1973   __builtin_altivec_dstt ((void *) a1, a2, a3);
1974 }
1975
1976 inline void
1977 vec_dstt (const vector float *a1, int a2, const int a3)
1978 {
1979   __builtin_altivec_dstt ((void *) a1, a2, a3);
1980 }
1981
1982 inline void
1983 vec_dstt (const unsigned char *a1, int a2, const int a3)
1984 {
1985   __builtin_altivec_dstt ((void *) a1, a2, a3);
1986 }
1987
1988 inline void
1989 vec_dstt (const signed char *a1, int a2, const int a3)
1990 {
1991   __builtin_altivec_dstt ((void *) a1, a2, a3);
1992 }
1993
1994 inline void
1995 vec_dstt (const unsigned short *a1, int a2, const int a3)
1996 {
1997   __builtin_altivec_dstt ((void *) a1, a2, a3);
1998 }
1999
2000 inline void
2001 vec_dstt (const short *a1, int a2, const int a3)
2002 {
2003   __builtin_altivec_dstt ((void *) a1, a2, a3);
2004 }
2005
2006 inline void
2007 vec_dstt (const unsigned int *a1, int a2, const int a3)
2008 {
2009   __builtin_altivec_dstt ((void *) a1, a2, a3);
2010 }
2011
2012 inline void
2013 vec_dstt (const int *a1, int a2, const int a3)
2014 {
2015   __builtin_altivec_dstt ((void *) a1, a2, a3);
2016 }
2017
2018 inline void
2019 vec_dstt (const unsigned long *a1, int a2, const int a3)
2020 {
2021   __builtin_altivec_dstt ((void *) a1, a2, a3);
2022 }
2023
2024 inline void
2025 vec_dstt (const long *a1, int a2, const int a3)
2026 {
2027   __builtin_altivec_dstt ((void *) a1, a2, a3);
2028 }
2029
2030 inline void
2031 vec_dstt (float *a1, int a2, const int a3)
2032 {
2033   __builtin_altivec_dstt ((void *) a1, a2, a3);
2034 }
2035
2036 /* vec_expte */
2037
2038 inline vector float
2039 vec_expte (vector float a1)
2040 {
2041   return (vector float) __builtin_altivec_vexptefp ((vector float) a1);
2042 }
2043
2044 /* vec_floor */
2045
2046 inline vector float
2047 vec_floor (vector float a1)
2048 {
2049   return (vector float) __builtin_altivec_vrfim ((vector float) a1);
2050 }
2051
2052 /* vec_ld */
2053
2054 inline vector float
2055 vec_ld (int a1, const vector float *a2)
2056 {
2057   return (vector float) __builtin_altivec_lvx (a1, (void *) a2);
2058 }
2059
2060 inline vector float
2061 vec_ld (int a1, const float *a2)
2062 {
2063   return (vector float) __builtin_altivec_lvx (a1, (void *) a2);
2064 }
2065
2066 inline vector bool int
2067 vec_ld (int a1, const vector bool int *a2)
2068 {
2069   return (vector bool int) __builtin_altivec_lvx (a1, (void *) a2);
2070 }
2071
2072 inline vector signed int
2073 vec_ld (int a1, const vector signed int *a2)
2074 {
2075   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
2076 }
2077
2078 inline vector signed int
2079 vec_ld (int a1, const int *a2)
2080 {
2081   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
2082 }
2083
2084 inline vector signed int
2085 vec_ld (int a1, const long *a2)
2086 {
2087   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
2088 }
2089
2090 inline vector unsigned int
2091 vec_ld (int a1, const vector unsigned int *a2)
2092 {
2093   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2094 }
2095
2096 inline vector unsigned int
2097 vec_ld (int a1, const unsigned int *a2)
2098 {
2099   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2100 }
2101
2102 inline vector unsigned int
2103 vec_ld (int a1, const unsigned long *a2)
2104 {
2105   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2106 }
2107
2108 inline vector bool short
2109 vec_ld (int a1, const vector bool short *a2)
2110 {
2111   return (vector bool short) __builtin_altivec_lvx (a1, (void *) a2);
2112 }
2113
2114 inline vector pixel
2115 vec_ld (int a1, const vector pixel *a2)
2116 {
2117   return (vector pixel) __builtin_altivec_lvx (a1, (void *) a2);
2118 }
2119
2120 inline vector signed short
2121 vec_ld (int a1, const vector signed short *a2)
2122 {
2123   return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2);
2124 }
2125
2126 inline vector signed short
2127 vec_ld (int a1, const short *a2)
2128 {
2129   return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2);
2130 }
2131
2132 inline vector unsigned short
2133 vec_ld (int a1, const vector unsigned short *a2)
2134 {
2135   return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2);
2136 }
2137
2138 inline vector unsigned short
2139 vec_ld (int a1, const unsigned short *a2)
2140 {
2141   return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2);
2142 }
2143
2144 inline vector bool char
2145 vec_ld (int a1, const vector bool char *a2)
2146 {
2147   return (vector bool char) __builtin_altivec_lvx (a1, (void *) a2);
2148 }
2149
2150 inline vector signed char
2151 vec_ld (int a1, const vector signed char *a2)
2152 {
2153   return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2);
2154 }
2155
2156 inline vector signed char
2157 vec_ld (int a1, const signed char *a2)
2158 {
2159   return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2);
2160 }
2161
2162 inline vector unsigned char
2163 vec_ld (int a1, const vector unsigned char *a2)
2164 {
2165   return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2);
2166 }
2167
2168 inline vector unsigned char
2169 vec_ld (int a1, const unsigned char *a2)
2170 {
2171   return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2);
2172 }
2173
2174 /* vec_lde */
2175
2176 inline vector signed char
2177 vec_lde (int a1, const signed char *a2)
2178 {
2179   return (vector signed char) __builtin_altivec_lvebx (a1, (void *) a2);
2180 }
2181
2182 inline vector unsigned char
2183 vec_lde (int a1, const unsigned char *a2)
2184 {
2185   return (vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2);
2186 }
2187
2188 inline vector signed short
2189 vec_lde (int a1, const short *a2)
2190 {
2191   return (vector signed short) __builtin_altivec_lvehx (a1, (void *) a2);
2192 }
2193
2194 inline vector unsigned short
2195 vec_lde (int a1, const unsigned short *a2)
2196 {
2197   return (vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2);
2198 }
2199
2200 inline vector float
2201 vec_lde (int a1, const float *a2)
2202 {
2203   return (vector float) __builtin_altivec_lvewx (a1, (void *) a2);
2204 }
2205
2206 inline vector signed int
2207 vec_lde (int a1, const int *a2)
2208 {
2209   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2210 }
2211
2212 inline vector unsigned int
2213 vec_lde (int a1, const unsigned int *a2)
2214 {
2215   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2216 }
2217
2218 inline vector signed int
2219 vec_lde (int a1, const long *a2)
2220 {
2221   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2222 }
2223
2224 inline vector unsigned int
2225 vec_lde (int a1, const unsigned long *a2)
2226 {
2227   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2228 }
2229
2230 /* vec_lvewx */
2231
2232 inline vector float
2233 vec_lvewx (int a1, const float *a2)
2234 {
2235   return (vector float) __builtin_altivec_lvewx (a1, (void *) a2);
2236 }
2237
2238 inline vector signed int
2239 vec_lvewx (int a1, const int *a2)
2240 {
2241   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2242 }
2243
2244 inline vector unsigned int
2245 vec_lvewx (int a1, const unsigned int *a2)
2246 {
2247   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2248 }
2249
2250 inline vector signed int
2251 vec_lvewx (int a1, const long *a2)
2252 {
2253   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2254 }
2255
2256 inline vector unsigned int
2257 vec_lvewx (int a1, const unsigned long *a2)
2258 {
2259   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2260 }
2261
2262 /* vec_lvehx */
2263
2264 inline vector signed short
2265 vec_lvehx (int a1, const short *a2)
2266 {
2267   return (vector signed short) __builtin_altivec_lvehx (a1, (void *) a2);
2268 }
2269
2270 inline vector unsigned short
2271 vec_lvehx (int a1, const unsigned short *a2)
2272 {
2273   return (vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2);
2274 }
2275
2276 /* vec_lvebx */
2277
2278 inline vector signed char
2279 vec_lvebx (int a1, const signed char *a2)
2280 {
2281   return (vector signed char) __builtin_altivec_lvebx (a1, (void *) a2);
2282 }
2283
2284 inline vector unsigned char
2285 vec_lvebx (int a1, const int *a2)
2286 {
2287   return (vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2);
2288 }
2289
2290 /* vec_ldl */
2291
2292 inline vector float
2293 vec_ldl (int a1, const vector float *a2)
2294 {
2295   return (vector float) __builtin_altivec_lvxl (a1, (void *) a2);
2296 }
2297
2298 inline vector float
2299 vec_ldl (int a1, const float *a2)
2300 {
2301   return (vector float) __builtin_altivec_lvxl (a1, (void *) a2);
2302 }
2303
2304 inline vector bool int
2305 vec_ldl (int a1, const vector bool int *a2)
2306 {
2307   return (vector bool int) __builtin_altivec_lvxl (a1, (void *) a2);
2308 }
2309
2310 inline vector signed int
2311 vec_ldl (int a1, const vector signed int *a2)
2312 {
2313   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2314 }
2315
2316 inline vector signed int
2317 vec_ldl (int a1, const int *a2)
2318 {
2319   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2320 }
2321
2322 inline vector signed int
2323 vec_ldl (int a1, const long *a2)
2324 {
2325   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2326 }
2327
2328 inline vector unsigned int
2329 vec_ldl (int a1, const vector unsigned int *a2)
2330 {
2331   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2332 }
2333
2334 inline vector unsigned int
2335 vec_ldl (int a1, const unsigned int *a2)
2336 {
2337   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2338 }
2339
2340 inline vector unsigned int
2341 vec_ldl (int a1, const unsigned long *a2)
2342 {
2343   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2344 }
2345
2346 inline vector bool short
2347 vec_ldl (int a1, const vector bool short *a2)
2348 {
2349   return (vector bool short) __builtin_altivec_lvxl (a1, (void *) a2);
2350 }
2351
2352 inline vector pixel
2353 vec_ldl (int a1, const vector pixel *a2)
2354 {
2355   return (vector pixel) __builtin_altivec_lvxl (a1, (void *) a2);
2356 }
2357
2358 inline vector signed short
2359 vec_ldl (int a1, const vector signed short *a2)
2360 {
2361   return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2);
2362 }
2363
2364 inline vector signed short
2365 vec_ldl (int a1, const short *a2)
2366 {
2367   return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2);
2368 }
2369
2370 inline vector unsigned short
2371 vec_ldl (int a1, const vector unsigned short *a2)
2372 {
2373   return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2);
2374 }
2375
2376 inline vector unsigned short
2377 vec_ldl (int a1, const unsigned short *a2)
2378 {
2379   return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2);
2380 }
2381
2382 inline vector bool char
2383 vec_ldl (int a1, const vector bool char *a2)
2384 {
2385   return (vector bool char) __builtin_altivec_lvxl (a1, (void *) a2);
2386 }
2387
2388 inline vector signed char
2389 vec_ldl (int a1, const vector signed char *a2)
2390 {
2391   return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2);
2392 }
2393
2394 inline vector signed char
2395 vec_ldl (int a1, const signed char *a2)
2396 {
2397   return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2);
2398 }
2399
2400 inline vector unsigned char
2401 vec_ldl (int a1, const vector unsigned char *a2)
2402 {
2403   return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2);
2404 }
2405
2406 inline vector unsigned char
2407 vec_ldl (int a1, const unsigned char *a2)
2408 {
2409   return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2);
2410 }
2411
2412 /* vec_loge */
2413
2414 inline vector float
2415 vec_loge (vector float a1)
2416 {
2417   return (vector float) __builtin_altivec_vlogefp ((vector float) a1);
2418 }
2419
2420 /* vec_lvsl */
2421
2422 inline vector unsigned char
2423 vec_lvsl (int a1, const volatile unsigned char *a2)
2424 {
2425   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2426 }
2427
2428 inline vector unsigned char
2429 vec_lvsl (int a1, const volatile signed char *a2)
2430 {
2431   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2432 }
2433
2434 inline vector unsigned char
2435 vec_lvsl (int a1, const volatile unsigned short *a2)
2436 {
2437   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2438 }
2439
2440 inline vector unsigned char
2441 vec_lvsl (int a1, const volatile short *a2)
2442 {
2443   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2444 }
2445
2446 inline vector unsigned char
2447 vec_lvsl (int a1, const volatile unsigned int *a2)
2448 {
2449   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2450 }
2451
2452 inline vector unsigned char
2453 vec_lvsl (int a1, const volatile int *a2)
2454 {
2455   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2456 }
2457
2458 inline vector unsigned char
2459 vec_lvsl (int a1, const volatile unsigned long *a2)
2460 {
2461   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2462 }
2463
2464 inline vector unsigned char
2465 vec_lvsl (int a1, const volatile long *a2)
2466 {
2467   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2468 }
2469
2470 inline vector unsigned char
2471 vec_lvsl (int a1, const volatile float *a2)
2472 {
2473   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2474 }
2475
2476 /* vec_lvsr */
2477
2478 inline vector unsigned char
2479 vec_lvsr (int a1, const volatile unsigned char *a2)
2480 {
2481   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2482 }
2483
2484 inline vector unsigned char
2485 vec_lvsr (int a1, const volatile signed char *a2)
2486 {
2487   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2488 }
2489
2490 inline vector unsigned char
2491 vec_lvsr (int a1, const volatile unsigned short *a2)
2492 {
2493   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2494 }
2495
2496 inline vector unsigned char
2497 vec_lvsr (int a1, const volatile short *a2)
2498 {
2499   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2500 }
2501
2502 inline vector unsigned char
2503 vec_lvsr (int a1, const volatile unsigned int *a2)
2504 {
2505   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2506 }
2507
2508 inline vector unsigned char
2509 vec_lvsr (int a1, const volatile int *a2)
2510 {
2511   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2512 }
2513
2514 inline vector unsigned char
2515 vec_lvsr (int a1, const volatile unsigned long *a2)
2516 {
2517   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2518 }
2519
2520 inline vector unsigned char
2521 vec_lvsr (int a1, const volatile long *a2)
2522 {
2523   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2524 }
2525
2526 inline vector unsigned char
2527 vec_lvsr (int a1, const volatile float *a2)
2528 {
2529   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2530 }
2531
2532 /* vec_madd */
2533
2534 inline vector float
2535 vec_madd (vector float a1, vector float a2, vector float a3)
2536 {
2537   return (vector float) __builtin_altivec_vmaddfp ((vector float) a1, (vector float) a2, (vector float) a3);
2538 }
2539
2540 /* vec_madds */
2541
2542 inline vector signed short
2543 vec_madds (vector signed short a1, vector signed short a2, vector signed short a3)
2544 {
2545   return (vector signed short) __builtin_altivec_vmhaddshs ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
2546 }
2547
2548 /* vec_max */
2549
2550 inline vector unsigned char
2551 vec_max (vector bool char a1, vector unsigned char a2)
2552 {
2553   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2554 }
2555
2556 inline vector unsigned char
2557 vec_max (vector unsigned char a1, vector bool char a2)
2558 {
2559   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2560 }
2561
2562 inline vector unsigned char
2563 vec_max (vector unsigned char a1, vector unsigned char a2)
2564 {
2565   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2566 }
2567
2568 inline vector signed char
2569 vec_max (vector bool char a1, vector signed char a2)
2570 {
2571   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2572 }
2573
2574 inline vector signed char
2575 vec_max (vector signed char a1, vector bool char a2)
2576 {
2577   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2578 }
2579
2580 inline vector signed char
2581 vec_max (vector signed char a1, vector signed char a2)
2582 {
2583   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2584 }
2585
2586 inline vector unsigned short
2587 vec_max (vector bool short a1, vector unsigned short a2)
2588 {
2589   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2590 }
2591
2592 inline vector unsigned short
2593 vec_max (vector unsigned short a1, vector bool short a2)
2594 {
2595   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2596 }
2597
2598 inline vector unsigned short
2599 vec_max (vector unsigned short a1, vector unsigned short a2)
2600 {
2601   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2602 }
2603
2604 inline vector signed short
2605 vec_max (vector bool short a1, vector signed short a2)
2606 {
2607   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2608 }
2609
2610 inline vector signed short
2611 vec_max (vector signed short a1, vector bool short a2)
2612 {
2613   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2614 }
2615
2616 inline vector signed short
2617 vec_max (vector signed short a1, vector signed short a2)
2618 {
2619   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2620 }
2621
2622 inline vector unsigned int
2623 vec_max (vector bool int a1, vector unsigned int a2)
2624 {
2625   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2626 }
2627
2628 inline vector unsigned int
2629 vec_max (vector unsigned int a1, vector bool int a2)
2630 {
2631   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2632 }
2633
2634 inline vector unsigned int
2635 vec_max (vector unsigned int a1, vector unsigned int a2)
2636 {
2637   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2638 }
2639
2640 inline vector signed int
2641 vec_max (vector bool int a1, vector signed int a2)
2642 {
2643   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2644 }
2645
2646 inline vector signed int
2647 vec_max (vector signed int a1, vector bool int a2)
2648 {
2649   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2650 }
2651
2652 inline vector signed int
2653 vec_max (vector signed int a1, vector signed int a2)
2654 {
2655   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2656 }
2657
2658 inline vector float
2659 vec_max (vector float a1, vector float a2)
2660 {
2661   return (vector float) __builtin_altivec_vmaxfp ((vector float) a1, (vector float) a2);
2662 }
2663
2664 /* vec_vmaxfp */
2665
2666 inline vector float
2667 vec_vmaxfp (vector float a1, vector float a2)
2668 {
2669   return (vector float) __builtin_altivec_vmaxfp ((vector float) a1, (vector float) a2);
2670 }
2671
2672 /* vec_vmaxsw */
2673
2674 inline vector signed int
2675 vec_vmaxsw (vector bool int a1, vector signed int a2)
2676 {
2677   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2678 }
2679
2680 inline vector signed int
2681 vec_vmaxsw (vector signed int a1, vector bool int a2)
2682 {
2683   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2684 }
2685
2686 inline vector signed int
2687 vec_vmaxsw (vector signed int a1, vector signed int a2)
2688 {
2689   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2690 }
2691
2692 /* vec_vmaxuw */
2693
2694 inline vector unsigned int
2695 vec_vmaxuw (vector bool int a1, vector unsigned int a2)
2696 {
2697   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2698 }
2699
2700 inline vector unsigned int
2701 vec_vmaxuw (vector unsigned int a1, vector bool int a2)
2702 {
2703   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2704 }
2705
2706 inline vector unsigned int
2707 vec_vmaxuw (vector unsigned int a1, vector unsigned int a2)
2708 {
2709   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2710 }
2711
2712 /* vec_vmaxsh */
2713
2714 inline vector signed short
2715 vec_vmaxsh (vector bool short a1, vector signed short a2)
2716 {
2717   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2718 }
2719
2720 inline vector signed short
2721 vec_vmaxsh (vector signed short a1, vector bool short a2)
2722 {
2723   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2724 }
2725
2726 inline vector signed short
2727 vec_vmaxsh (vector signed short a1, vector signed short a2)
2728 {
2729   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2730 }
2731
2732 /* vec_vmaxuh */
2733
2734 inline vector unsigned short
2735 vec_vmaxuh (vector bool short a1, vector unsigned short a2)
2736 {
2737   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2738 }
2739
2740 inline vector unsigned short
2741 vec_vmaxuh (vector unsigned short a1, vector bool short a2)
2742 {
2743   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2744 }
2745
2746 inline vector unsigned short
2747 vec_vmaxuh (vector unsigned short a1, vector unsigned short a2)
2748 {
2749   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2750 }
2751
2752 /* vec_vmaxsb */
2753
2754 inline vector signed char
2755 vec_vmaxsb (vector bool char a1, vector signed char a2)
2756 {
2757   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2758 }
2759
2760 inline vector signed char
2761 vec_vmaxsb (vector signed char a1, vector bool char a2)
2762 {
2763   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2764 }
2765
2766 inline vector signed char
2767 vec_vmaxsb (vector signed char a1, vector signed char a2)
2768 {
2769   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2770 }
2771
2772 /* vec_vmaxub */
2773
2774 inline vector unsigned char
2775 vec_vmaxub (vector bool char a1, vector unsigned char a2)
2776 {
2777   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2778 }
2779
2780 inline vector unsigned char
2781 vec_vmaxub (vector unsigned char a1, vector bool char a2)
2782 {
2783   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2784 }
2785
2786 inline vector unsigned char
2787 vec_vmaxub (vector unsigned char a1, vector unsigned char a2)
2788 {
2789   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2790 }
2791
2792 /* vec_mergeh */
2793
2794 inline vector bool char
2795 vec_mergeh (vector bool char a1, vector bool char a2)
2796 {
2797   return (vector bool char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2798 }
2799
2800 inline vector signed char
2801 vec_mergeh (vector signed char a1, vector signed char a2)
2802 {
2803   return (vector signed char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2804 }
2805
2806 inline vector unsigned char
2807 vec_mergeh (vector unsigned char a1, vector unsigned char a2)
2808 {
2809   return (vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2810 }
2811
2812 inline vector bool short
2813 vec_mergeh (vector bool short a1, vector bool short a2)
2814 {
2815   return (vector bool short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2816 }
2817
2818 inline vector pixel
2819 vec_mergeh (vector pixel a1, vector pixel a2)
2820 {
2821   return (vector pixel) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2822 }
2823
2824 inline vector signed short
2825 vec_mergeh (vector signed short a1, vector signed short a2)
2826 {
2827   return (vector signed short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2828 }
2829
2830 inline vector unsigned short
2831 vec_mergeh (vector unsigned short a1, vector unsigned short a2)
2832 {
2833   return (vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2834 }
2835
2836 inline vector float
2837 vec_mergeh (vector float a1, vector float a2)
2838 {
2839   return (vector float) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2840 }
2841
2842 inline vector bool int
2843 vec_mergeh (vector bool int a1, vector bool int a2)
2844 {
2845   return (vector bool int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2846 }
2847
2848 inline vector signed int
2849 vec_mergeh (vector signed int a1, vector signed int a2)
2850 {
2851   return (vector signed int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2852 }
2853
2854 inline vector unsigned int
2855 vec_mergeh (vector unsigned int a1, vector unsigned int a2)
2856 {
2857   return (vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2858 }
2859
2860 /* vec_vmrghw */
2861
2862 inline vector float
2863 vec_vmrghw (vector float a1, vector float a2)
2864 {
2865   return (vector float) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2866 }
2867
2868 inline vector bool int
2869 vec_vmrghw (vector bool int a1, vector bool int a2)
2870 {
2871   return (vector bool int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2872 }
2873
2874 inline vector signed int
2875 vec_vmrghw (vector signed int a1, vector signed int a2)
2876 {
2877   return (vector signed int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2878 }
2879
2880 inline vector unsigned int
2881 vec_vmrghw (vector unsigned int a1, vector unsigned int a2)
2882 {
2883   return (vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2884 }
2885
2886 /* vec_vmrghh */
2887
2888 inline vector bool short
2889 vec_vmrghh (vector bool short a1, vector bool short a2)
2890 {
2891   return (vector bool short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2892 }
2893
2894 inline vector signed short
2895 vec_vmrghh (vector signed short a1, vector signed short a2)
2896 {
2897   return (vector signed short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2898 }
2899
2900 inline vector unsigned short
2901 vec_vmrghh (vector unsigned short a1, vector unsigned short a2)
2902 {
2903   return (vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2904 }
2905
2906 inline vector pixel
2907 vec_vmrghh (vector pixel a1, vector pixel a2)
2908 {
2909   return (vector pixel) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2910 }
2911
2912 /* vec_vmrghb */
2913
2914 inline vector bool char
2915 vec_vmrghb (vector bool char a1, vector bool char a2)
2916 {
2917   return (vector bool char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2918 }
2919
2920 inline vector signed char
2921 vec_vmrghb (vector signed char a1, vector signed char a2)
2922 {
2923   return (vector signed char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2924 }
2925
2926 inline vector unsigned char
2927 vec_vmrghb (vector unsigned char a1, vector unsigned char a2)
2928 {
2929   return (vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2930 }
2931
2932 /* vec_mergel */
2933
2934 inline vector bool char
2935 vec_mergel (vector bool char a1, vector bool char a2)
2936 {
2937   return (vector bool char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2938 }
2939
2940 inline vector signed char
2941 vec_mergel (vector signed char a1, vector signed char a2)
2942 {
2943   return (vector signed char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2944 }
2945
2946 inline vector unsigned char
2947 vec_mergel (vector unsigned char a1, vector unsigned char a2)
2948 {
2949   return (vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2950 }
2951
2952 inline vector bool short
2953 vec_mergel (vector bool short a1, vector bool short a2)
2954 {
2955   return (vector bool short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2956 }
2957
2958 inline vector pixel
2959 vec_mergel (vector pixel a1, vector pixel a2)
2960 {
2961   return (vector pixel) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2962 }
2963
2964 inline vector signed short
2965 vec_mergel (vector signed short a1, vector signed short a2)
2966 {
2967   return (vector signed short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2968 }
2969
2970 inline vector unsigned short
2971 vec_mergel (vector unsigned short a1, vector unsigned short a2)
2972 {
2973   return (vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2974 }
2975
2976 inline vector float
2977 vec_mergel (vector float a1, vector float a2)
2978 {
2979   return (vector float) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2980 }
2981
2982 inline vector bool int
2983 vec_mergel (vector bool int a1, vector bool int a2)
2984 {
2985   return (vector bool int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2986 }
2987
2988 inline vector signed int
2989 vec_mergel (vector signed int a1, vector signed int a2)
2990 {
2991   return (vector signed int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2992 }
2993
2994 inline vector unsigned int
2995 vec_mergel (vector unsigned int a1, vector unsigned int a2)
2996 {
2997   return (vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2998 }
2999
3000 /* vec_vmrglw */
3001
3002 inline vector float
3003 vec_vmrglw (vector float a1, vector float a2)
3004 {
3005   return (vector float) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
3006 }
3007
3008 inline vector signed int
3009 vec_vmrglw (vector signed int a1, vector signed int a2)
3010 {
3011   return (vector signed int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
3012 }
3013
3014 inline vector unsigned int
3015 vec_vmrglw (vector unsigned int a1, vector unsigned int a2)
3016 {
3017   return (vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
3018 }
3019
3020 inline vector bool int
3021 vec_vmrglw (vector bool int a1, vector bool int a2)
3022 {
3023   return (vector bool int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
3024 }
3025
3026 /* vec_vmrglh */
3027
3028 inline vector bool short
3029 vec_vmrglh (vector bool short a1, vector bool short a2)
3030 {
3031   return (vector bool short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
3032 }
3033
3034 inline vector signed short
3035 vec_vmrglh (vector signed short a1, vector signed short a2)
3036 {
3037   return (vector signed short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
3038 }
3039
3040 inline vector unsigned short
3041 vec_vmrglh (vector unsigned short a1, vector unsigned short a2)
3042 {
3043   return (vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
3044 }
3045
3046 inline vector pixel
3047 vec_vmrglh (vector pixel a1, vector pixel a2)
3048 {
3049   return (vector pixel) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
3050 }
3051
3052 /* vec_vmrglb */
3053
3054 inline vector bool char
3055 vec_vmrglb (vector bool char a1, vector bool char a2)
3056 {
3057   return (vector bool char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
3058 }
3059
3060 inline vector signed char
3061 vec_vmrglb (vector signed char a1, vector signed char a2)
3062 {
3063   return (vector signed char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
3064 }
3065
3066 inline vector unsigned char
3067 vec_vmrglb (vector unsigned char a1, vector unsigned char a2)
3068 {
3069   return (vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
3070 }
3071
3072 /* vec_mfvscr */
3073
3074 inline vector unsigned short
3075 vec_mfvscr (void)
3076 {
3077   return (vector unsigned short) __builtin_altivec_mfvscr ();
3078 }
3079
3080 /* vec_min */
3081
3082 inline vector unsigned char
3083 vec_min (vector bool char a1, vector unsigned char a2)
3084 {
3085   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3086 }
3087
3088 inline vector unsigned char
3089 vec_min (vector unsigned char a1, vector bool char a2)
3090 {
3091   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3092 }
3093
3094 inline vector unsigned char
3095 vec_min (vector unsigned char a1, vector unsigned char a2)
3096 {
3097   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3098 }
3099
3100 inline vector signed char
3101 vec_min (vector bool char a1, vector signed char a2)
3102 {
3103   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3104 }
3105
3106 inline vector signed char
3107 vec_min (vector signed char a1, vector bool char a2)
3108 {
3109   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3110 }
3111
3112 inline vector signed char
3113 vec_min (vector signed char a1, vector signed char a2)
3114 {
3115   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3116 }
3117
3118 inline vector unsigned short
3119 vec_min (vector bool short a1, vector unsigned short a2)
3120 {
3121   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3122 }
3123
3124 inline vector unsigned short
3125 vec_min (vector unsigned short a1, vector bool short a2)
3126 {
3127   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3128 }
3129
3130 inline vector unsigned short
3131 vec_min (vector unsigned short a1, vector unsigned short a2)
3132 {
3133   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3134 }
3135
3136 inline vector signed short
3137 vec_min (vector bool short a1, vector signed short a2)
3138 {
3139   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3140 }
3141
3142 inline vector signed short
3143 vec_min (vector signed short a1, vector bool short a2)
3144 {
3145   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3146 }
3147
3148 inline vector signed short
3149 vec_min (vector signed short a1, vector signed short a2)
3150 {
3151   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3152 }
3153
3154 inline vector unsigned int
3155 vec_min (vector bool int a1, vector unsigned int a2)
3156 {
3157   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3158 }
3159
3160 inline vector unsigned int
3161 vec_min (vector unsigned int a1, vector bool int a2)
3162 {
3163   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3164 }
3165
3166 inline vector unsigned int
3167 vec_min (vector unsigned int a1, vector unsigned int a2)
3168 {
3169   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3170 }
3171
3172 inline vector signed int
3173 vec_min (vector bool int a1, vector signed int a2)
3174 {
3175   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3176 }
3177
3178 inline vector signed int
3179 vec_min (vector signed int a1, vector bool int a2)
3180 {
3181   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3182 }
3183
3184 inline vector signed int
3185 vec_min (vector signed int a1, vector signed int a2)
3186 {
3187   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3188 }
3189
3190 inline vector float
3191 vec_min (vector float a1, vector float a2)
3192 {
3193   return (vector float) __builtin_altivec_vminfp ((vector float) a1, (vector float) a2);
3194 }
3195
3196 /* vec_vminfp */
3197
3198 inline vector float
3199 vec_vminfp (vector float a1, vector float a2)
3200 {
3201   return (vector float) __builtin_altivec_vminfp ((vector float) a1, (vector float) a2);
3202 }
3203
3204 /* vec_vminsw */
3205
3206 inline vector signed int
3207 vec_vminsw (vector bool int a1, vector signed int a2)
3208 {
3209   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3210 }
3211
3212 inline vector signed int
3213 vec_vminsw (vector signed int a1, vector bool int a2)
3214 {
3215   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3216 }
3217
3218 inline vector signed int
3219 vec_vminsw (vector signed int a1, vector signed int a2)
3220 {
3221   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3222 }
3223
3224 /* vec_vminuw */
3225
3226 inline vector unsigned int
3227 vec_vminuw (vector bool int a1, vector unsigned int a2)
3228 {
3229   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3230 }
3231
3232 inline vector unsigned int
3233 vec_vminuw (vector unsigned int a1, vector bool int a2)
3234 {
3235   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3236 }
3237
3238 inline vector unsigned int
3239 vec_vminuw (vector unsigned int a1, vector unsigned int a2)
3240 {
3241   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3242 }
3243
3244 /* vec_vminsh */
3245
3246 inline vector signed short
3247 vec_vminsh (vector bool short a1, vector signed short a2)
3248 {
3249   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3250 }
3251
3252 inline vector signed short
3253 vec_vminsh (vector signed short a1, vector bool short a2)
3254 {
3255   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3256 }
3257
3258 inline vector signed short
3259 vec_vminsh (vector signed short a1, vector signed short a2)
3260 {
3261   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3262 }
3263
3264 /* vec_vminuh */
3265
3266 inline vector unsigned short
3267 vec_vminuh (vector bool short a1, vector unsigned short a2)
3268 {
3269   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3270 }
3271
3272 inline vector unsigned short
3273 vec_vminuh (vector unsigned short a1, vector bool short a2)
3274 {
3275   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3276 }
3277
3278 inline vector unsigned short
3279 vec_vminuh (vector unsigned short a1, vector unsigned short a2)
3280 {
3281   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3282 }
3283
3284 /* vec_vminsb */
3285
3286 inline vector signed char
3287 vec_vminsb (vector bool char a1, vector signed char a2)
3288 {
3289   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3290 }
3291
3292 inline vector signed char
3293 vec_vminsb (vector signed char a1, vector bool char a2)
3294 {
3295   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3296 }
3297
3298 inline vector signed char
3299 vec_vminsb (vector signed char a1, vector signed char a2)
3300 {
3301   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3302 }
3303
3304 /* vec_vminub */
3305
3306 inline vector unsigned char
3307 vec_vminub (vector bool char a1, vector unsigned char a2)
3308 {
3309   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3310 }
3311
3312 inline vector unsigned char
3313 vec_vminub (vector unsigned char a1, vector bool char a2)
3314 {
3315   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3316 }
3317
3318 inline vector unsigned char
3319 vec_vminub (vector unsigned char a1, vector unsigned char a2)
3320 {
3321   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3322 }
3323
3324 /* vec_mladd */
3325
3326 inline vector signed short
3327 vec_mladd (vector signed short a1, vector signed short a2, vector signed short a3)
3328 {
3329   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3330 }
3331
3332 inline vector signed short
3333 vec_mladd (vector signed short a1, vector unsigned short a2, vector unsigned short a3)
3334 {
3335   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3336 }
3337
3338 inline vector signed short
3339 vec_mladd (vector unsigned short a1, vector signed short a2, vector signed short a3)
3340 {
3341   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3342 }
3343
3344 inline vector unsigned short
3345 vec_mladd (vector unsigned short a1, vector unsigned short a2, vector unsigned short a3)
3346 {
3347   return (vector unsigned short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3348 }
3349
3350 /* vec_mradds */
3351
3352 inline vector signed short
3353 vec_mradds (vector signed short a1, vector signed short a2, vector signed short a3)
3354 {
3355   return (vector signed short) __builtin_altivec_vmhraddshs ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3356 }
3357
3358 /* vec_msum */
3359
3360 inline vector unsigned int
3361 vec_msum (vector unsigned char a1, vector unsigned char a2, vector unsigned int a3)
3362 {
3363   return (vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3364 }
3365
3366 inline vector signed int
3367 vec_msum (vector signed char a1, vector unsigned char a2, vector signed int a3)
3368 {
3369   return (vector signed int) __builtin_altivec_vmsummbm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3370 }
3371
3372 inline vector unsigned int
3373 vec_msum (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3374 {
3375   return (vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3376 }
3377
3378 inline vector signed int
3379 vec_msum (vector signed short a1, vector signed short a2, vector signed int a3)
3380 {
3381   return (vector signed int) __builtin_altivec_vmsumshm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3382 }
3383
3384 /* vec_vmsumshm */
3385
3386 inline vector signed int
3387 vec_vmsumshm (vector signed short a1, vector signed short a2, vector signed int a3)
3388 {
3389   return (vector signed int) __builtin_altivec_vmsumshm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3390 }
3391
3392 /* vec_vmsumuhm */
3393
3394 inline vector unsigned int
3395 vec_vmsumuhm (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3396 {
3397   return (vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3398 }
3399
3400 /* vec_vmsummbm */
3401
3402 inline vector signed int
3403 vec_vmsummbm (vector signed char a1, vector unsigned char a2, vector signed int a3)
3404 {
3405   return (vector signed int) __builtin_altivec_vmsummbm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3406 }
3407
3408 /* vec_vmsumubm */
3409
3410 inline vector unsigned int
3411 vec_vmsumubm (vector unsigned char a1, vector unsigned char a2, vector unsigned int a3)
3412 {
3413   return (vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3414 }
3415
3416 /* vec_msums */
3417
3418 inline vector unsigned int
3419 vec_msums (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3420 {
3421   return (vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3422 }
3423
3424 inline vector signed int
3425 vec_msums (vector signed short a1, vector signed short a2, vector signed int a3)
3426 {
3427   return (vector signed int) __builtin_altivec_vmsumshs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3428 }
3429
3430 /* vec_vmsumshs */
3431
3432 inline vector signed int
3433 vec_vmsumshs (vector signed short a1, vector signed short a2, vector signed int a3)
3434 {
3435   return (vector signed int) __builtin_altivec_vmsumshs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3436 }
3437
3438 /* vec_vmsumuhs */
3439
3440 inline vector unsigned int
3441 vec_vmsumuhs (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3442 {
3443   return (vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3444 }
3445
3446 /* vec_mtvscr */
3447
3448 inline void
3449 vec_mtvscr (vector signed int a1)
3450 {
3451   __builtin_altivec_mtvscr ((vector signed int) a1);
3452 }
3453
3454 inline void
3455 vec_mtvscr (vector unsigned int a1)
3456 {
3457   __builtin_altivec_mtvscr ((vector signed int) a1);
3458 }
3459
3460 inline void
3461 vec_mtvscr (vector bool int a1)
3462 {
3463   __builtin_altivec_mtvscr ((vector signed int) a1);
3464 }
3465
3466 inline void
3467 vec_mtvscr (vector signed short a1)
3468 {
3469   __builtin_altivec_mtvscr ((vector signed int) a1);
3470 }
3471
3472 inline void
3473 vec_mtvscr (vector unsigned short a1)
3474 {
3475   __builtin_altivec_mtvscr ((vector signed int) a1);
3476 }
3477
3478 inline void
3479 vec_mtvscr (vector bool short a1)
3480 {
3481   __builtin_altivec_mtvscr ((vector signed int) a1);
3482 }
3483
3484 inline void
3485 vec_mtvscr (vector pixel a1)
3486 {
3487   __builtin_altivec_mtvscr ((vector signed int) a1);
3488 }
3489
3490 inline void
3491 vec_mtvscr (vector signed char a1)
3492 {
3493   __builtin_altivec_mtvscr ((vector signed int) a1);
3494 }
3495
3496 inline void
3497 vec_mtvscr (vector unsigned char a1)
3498 {
3499   __builtin_altivec_mtvscr ((vector signed int) a1);
3500 }
3501
3502 inline void
3503 vec_mtvscr (vector bool char a1)
3504 {
3505   __builtin_altivec_mtvscr ((vector signed int) a1);
3506 }
3507
3508 /* vec_mule */
3509
3510 inline vector unsigned short
3511 vec_mule (vector unsigned char a1, vector unsigned char a2)
3512 {
3513   return (vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) a1, (vector signed char) a2);
3514 }
3515
3516 inline vector signed short
3517 vec_mule (vector signed char a1, vector signed char a2)
3518 {
3519   return (vector signed short) __builtin_altivec_vmulesb ((vector signed char) a1, (vector signed char) a2);
3520 }
3521
3522 inline vector unsigned int
3523 vec_mule (vector unsigned short a1, vector unsigned short a2)
3524 {
3525   return (vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) a1, (vector signed short) a2);
3526 }
3527
3528 inline vector signed int
3529 vec_mule (vector signed short a1, vector signed short a2)
3530 {
3531   return (vector signed int) __builtin_altivec_vmulesh ((vector signed short) a1, (vector signed short) a2);
3532 }
3533
3534 /* vec_vmulesh */
3535
3536 inline vector signed int
3537 vec_vmulesh (vector signed short a1, vector signed short a2)
3538 {
3539   return (vector signed int) __builtin_altivec_vmulesh ((vector signed short) a1, (vector signed short) a2);
3540 }
3541
3542 /* vec_vmuleuh */
3543
3544 inline vector unsigned int
3545 vec_vmuleuh (vector unsigned short a1, vector unsigned short a2)
3546 {
3547   return (vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) a1, (vector signed short) a2);
3548 }
3549
3550 /* vec_vmulesb */
3551
3552 inline vector signed short
3553 vec_vmulesb (vector signed char a1, vector signed char a2)
3554 {
3555   return (vector signed short) __builtin_altivec_vmuleub ((vector signed char) a1, (vector signed char) a2);
3556 }
3557
3558 /* vec_vmuleub */
3559
3560 inline vector unsigned short
3561 vec_vmuleub (vector unsigned char a1, vector unsigned char a2)
3562 {
3563   return (vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) a1, (vector signed char) a2);
3564 }
3565
3566 /* vec_mulo */
3567
3568 inline vector unsigned short
3569 vec_mulo (vector unsigned char a1, vector unsigned char a2)
3570 {
3571   return (vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) a1, (vector signed char) a2);
3572 }
3573
3574 inline vector signed short
3575 vec_mulo (vector signed char a1, vector signed char a2)
3576 {
3577   return (vector signed short) __builtin_altivec_vmulosb ((vector signed char) a1, (vector signed char) a2);
3578 }
3579
3580 inline vector unsigned int
3581 vec_mulo (vector unsigned short a1, vector unsigned short a2)
3582 {
3583   return (vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) a1, (vector signed short) a2);
3584 }
3585
3586 inline vector signed int
3587 vec_mulo (vector signed short a1, vector signed short a2)
3588 {
3589   return (vector signed int) __builtin_altivec_vmulosh ((vector signed short) a1, (vector signed short) a2);
3590 }
3591
3592 /* vec_vmulosh */
3593
3594 inline vector signed int
3595 vec_vmulosh (vector signed short a1, vector signed short a2)
3596 {
3597   return (vector signed int) __builtin_altivec_vmulosh ((vector signed short) a1, (vector signed short) a2);
3598 }
3599
3600 /* vec_vmulouh */
3601
3602 inline vector unsigned int
3603 vec_vmulouh (vector unsigned short a1, vector unsigned short a2)
3604 {
3605   return (vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) a1, (vector signed short) a2);
3606 }
3607
3608 /* vec_vmulosb */
3609
3610 inline vector signed short
3611 vec_vmulosb (vector signed char a1, vector signed char a2)
3612 {
3613   return (vector signed short) __builtin_altivec_vmulosb ((vector signed char) a1, (vector signed char) a2);
3614 }
3615
3616 /* vec_vmuloub */
3617
3618 inline vector unsigned short
3619 vec_vmuloub (vector unsigned char a1, vector unsigned char a2)
3620 {
3621   return (vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) a1, (vector signed char) a2);
3622 }
3623
3624 /* vec_nmsub */
3625
3626 inline vector float
3627 vec_nmsub (vector float a1, vector float a2, vector float a3)
3628 {
3629   return (vector float) __builtin_altivec_vnmsubfp ((vector float) a1, (vector float) a2, (vector float) a3);
3630 }
3631
3632 /* vec_nor */
3633
3634 inline vector float
3635 vec_nor (vector float a1, vector float a2)
3636 {
3637   return (vector float) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3638 }
3639
3640 inline vector signed int
3641 vec_nor (vector signed int a1, vector signed int a2)
3642 {
3643   return (vector signed int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3644 }
3645
3646 inline vector unsigned int
3647 vec_nor (vector unsigned int a1, vector unsigned int a2)
3648 {
3649   return (vector unsigned int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3650 }
3651
3652 inline vector bool int
3653 vec_nor (vector bool int a1, vector bool int a2)
3654 {
3655   return (vector bool int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3656 }
3657
3658 inline vector signed short
3659 vec_nor (vector signed short a1, vector signed short a2)
3660 {
3661   return (vector signed short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3662 }
3663
3664 inline vector unsigned short
3665 vec_nor (vector unsigned short a1, vector unsigned short a2)
3666 {
3667   return (vector unsigned short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3668 }
3669
3670 inline vector bool short
3671 vec_nor (vector bool short a1, vector bool short a2)
3672 {
3673   return (vector bool short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3674 }
3675
3676 inline vector signed char
3677 vec_nor (vector signed char a1, vector signed char a2)
3678 {
3679   return (vector signed char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3680 }
3681
3682 inline vector unsigned char
3683 vec_nor (vector unsigned char a1, vector unsigned char a2)
3684 {
3685   return (vector unsigned char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3686 }
3687
3688 inline vector bool char
3689 vec_nor (vector bool char a1, vector bool char a2)
3690 {
3691   return (vector bool char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3692 }
3693
3694 /* vec_or */
3695
3696 inline vector float
3697 vec_or (vector float a1, vector float a2)
3698 {
3699   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3700 }
3701
3702 inline vector float
3703 vec_or (vector float a1, vector bool int a2)
3704 {
3705   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3706 }
3707
3708 inline vector float
3709 vec_or (vector bool int a1, vector float a2)
3710 {
3711   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3712 }
3713
3714 inline vector bool int
3715 vec_or (vector bool int a1, vector bool int a2)
3716 {
3717   return (vector bool int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3718 }
3719
3720 inline vector signed int
3721 vec_or (vector bool int a1, vector signed int a2)
3722 {
3723   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3724 }
3725
3726 inline vector signed int
3727 vec_or (vector signed int a1, vector bool int a2)
3728 {
3729   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3730 }
3731
3732 inline vector signed int
3733 vec_or (vector signed int a1, vector signed int a2)
3734 {
3735   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3736 }
3737
3738 inline vector unsigned int
3739 vec_or (vector bool int a1, vector unsigned int a2)
3740 {
3741   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3742 }
3743
3744 inline vector unsigned int
3745 vec_or (vector unsigned int a1, vector bool int a2)
3746 {
3747   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3748 }
3749
3750 inline vector unsigned int
3751 vec_or (vector unsigned int a1, vector unsigned int a2)
3752 {
3753   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3754 }
3755
3756 inline vector bool short
3757 vec_or (vector bool short a1, vector bool short a2)
3758 {
3759   return (vector bool short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3760 }
3761
3762 inline vector signed short
3763 vec_or (vector bool short a1, vector signed short a2)
3764 {
3765   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3766 }
3767
3768 inline vector signed short
3769 vec_or (vector signed short a1, vector bool short a2)
3770 {
3771   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3772 }
3773
3774 inline vector signed short
3775 vec_or (vector signed short a1, vector signed short a2)
3776 {
3777   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3778 }
3779
3780 inline vector unsigned short
3781 vec_or (vector bool short a1, vector unsigned short a2)
3782 {
3783   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3784 }
3785
3786 inline vector unsigned short
3787 vec_or (vector unsigned short a1, vector bool short a2)
3788 {
3789   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3790 }
3791
3792 inline vector unsigned short
3793 vec_or (vector unsigned short a1, vector unsigned short a2)
3794 {
3795   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3796 }
3797
3798 inline vector signed char
3799 vec_or (vector bool char a1, vector signed char a2)
3800 {
3801   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3802 }
3803
3804 inline vector bool char
3805 vec_or (vector bool char a1, vector bool char a2)
3806 {
3807   return (vector bool char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3808 }
3809
3810 inline vector signed char
3811 vec_or (vector signed char a1, vector bool char a2)
3812 {
3813   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3814 }
3815
3816 inline vector signed char
3817 vec_or (vector signed char a1, vector signed char a2)
3818 {
3819   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3820 }
3821
3822 inline vector unsigned char
3823 vec_or (vector bool char a1, vector unsigned char a2)
3824 {
3825   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3826 }
3827
3828 inline vector unsigned char
3829 vec_or (vector unsigned char a1, vector bool char a2)
3830 {
3831   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3832 }
3833
3834 inline vector unsigned char
3835 vec_or (vector unsigned char a1, vector unsigned char a2)
3836 {
3837   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3838 }
3839
3840 /* vec_pack */
3841
3842 inline vector signed char
3843 vec_pack (vector signed short a1, vector signed short a2)
3844 {
3845   return (vector signed char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3846 }
3847
3848 inline vector unsigned char
3849 vec_pack (vector unsigned short a1, vector unsigned short a2)
3850 {
3851   return (vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3852 }
3853
3854 inline vector bool char
3855 vec_pack (vector bool short a1, vector bool short a2)
3856 {
3857   return (vector bool char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3858 }
3859
3860 inline vector signed short
3861 vec_pack (vector signed int a1, vector signed int a2)
3862 {
3863   return (vector signed short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3864 }
3865
3866 inline vector unsigned short
3867 vec_pack (vector unsigned int a1, vector unsigned int a2)
3868 {
3869   return (vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3870 }
3871
3872 inline vector bool short
3873 vec_pack (vector bool int a1, vector bool int a2)
3874 {
3875   return (vector bool short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3876 }
3877
3878 /* vec_vpkuwum */
3879
3880 inline vector bool short
3881 vec_vpkuwum (vector bool int a1, vector bool int a2)
3882 {
3883   return (vector bool short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3884 }
3885
3886 inline vector signed short
3887 vec_vpkuwum (vector signed int a1, vector signed int a2)
3888 {
3889   return (vector signed short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3890 }
3891
3892 inline vector unsigned short
3893 vec_vpkuwum (vector unsigned int a1, vector unsigned int a2)
3894 {
3895   return (vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3896 }
3897
3898 /* vec_vpkuhum */
3899
3900 inline vector bool char
3901 vec_vpkuhum (vector bool short a1, vector bool short a2)
3902 {
3903   return (vector bool char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3904 }
3905
3906 inline vector signed char
3907 vec_vpkuhum (vector signed short a1, vector signed short a2)
3908 {
3909   return (vector signed char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3910 }
3911
3912 inline vector unsigned char
3913 vec_vpkuhum (vector unsigned short a1, vector unsigned short a2)
3914 {
3915   return (vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3916 }
3917
3918 /* vec_packpx */
3919
3920 inline vector pixel
3921 vec_packpx (vector unsigned int a1, vector unsigned int a2)
3922 {
3923   return (vector pixel) __builtin_altivec_vpkpx ((vector signed int) a1, (vector signed int) a2);
3924 }
3925
3926 /* vec_packs */
3927
3928 inline vector unsigned char
3929 vec_packs (vector unsigned short a1, vector unsigned short a2)
3930 {
3931   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3932 }
3933
3934 inline vector signed char
3935 vec_packs (vector signed short a1, vector signed short a2)
3936 {
3937   return (vector signed char) __builtin_altivec_vpkshss ((vector signed short) a1, (vector signed short) a2);
3938 }
3939
3940 inline vector unsigned short
3941 vec_packs (vector unsigned int a1, vector unsigned int a2)
3942 {
3943   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
3944 }
3945
3946 inline vector signed short
3947 vec_packs (vector signed int a1, vector signed int a2)
3948 {
3949   return (vector signed short) __builtin_altivec_vpkswss ((vector signed int) a1, (vector signed int) a2);
3950 }
3951
3952 /* vec_vpkswss */
3953
3954 inline vector signed short
3955 vec_vpkswss (vector signed int a1, vector signed int a2)
3956 {
3957   return (vector signed short) __builtin_altivec_vpkswss ((vector signed int) a1, (vector signed int) a2);
3958 }
3959
3960 /* vec_vpkuwus */
3961
3962 inline vector unsigned short
3963 vec_vpkuwus (vector unsigned int a1, vector unsigned int a2)
3964 {
3965   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
3966 }
3967
3968 /* vec_vpkshss */
3969
3970 inline vector signed char
3971 vec_vpkshss (vector signed short a1, vector signed short a2)
3972 {
3973   return (vector signed char) __builtin_altivec_vpkshss ((vector signed short) a1, (vector signed short) a2);
3974 }
3975
3976 /* vec_vpkuhus */
3977
3978 inline vector unsigned char
3979 vec_vpkuhus (vector unsigned short a1, vector unsigned short a2)
3980 {
3981   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3982 }
3983
3984 /* vec_packsu */
3985
3986 inline vector unsigned char
3987 vec_packsu (vector unsigned short a1, vector unsigned short a2)
3988 {
3989   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3990 }
3991
3992 inline vector unsigned char
3993 vec_packsu (vector signed short a1, vector signed short a2)
3994 {
3995   return (vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) a1, (vector signed short) a2);
3996 }
3997
3998 inline vector unsigned short
3999 vec_packsu (vector unsigned int a1, vector unsigned int a2)
4000 {
4001   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
4002 }
4003
4004 inline vector unsigned short
4005 vec_packsu (vector signed int a1, vector signed int a2)
4006 {
4007   return (vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) a1, (vector signed int) a2);
4008 }
4009
4010 /* vec_vpkswus */
4011
4012 inline vector unsigned short
4013 vec_vpkswus (vector signed int a1, vector signed int a2)
4014 {
4015   return (vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) a1, (vector signed int) a2);
4016 }
4017
4018 /* vec_vpkshus */
4019
4020 inline vector unsigned char
4021 vec_vpkshus (vector signed short a1, vector signed short a2)
4022 {
4023   return (vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) a1, (vector signed short) a2);
4024 }
4025
4026 /* vec_perm */
4027
4028 inline vector float
4029 vec_perm (vector float a1, vector float a2, vector unsigned char a3)
4030 {
4031   return (vector float) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4032 }
4033
4034 inline vector signed int
4035 vec_perm (vector signed int a1, vector signed int a2, vector unsigned char a3)
4036 {
4037   return (vector signed int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4038 }
4039
4040 inline vector unsigned int
4041 vec_perm (vector unsigned int a1, vector unsigned int a2, vector unsigned char a3)
4042 {
4043   return (vector unsigned int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4044 }
4045
4046 inline vector bool int
4047 vec_perm (vector bool int a1, vector bool int a2, vector unsigned char a3)
4048 {
4049   return (vector bool int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4050 }
4051
4052 inline vector signed short
4053 vec_perm (vector signed short a1, vector signed short a2, vector unsigned char a3)
4054 {
4055   return (vector signed short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4056 }
4057
4058 inline vector unsigned short
4059 vec_perm (vector unsigned short a1, vector unsigned short a2, vector unsigned char a3)
4060 {
4061   return (vector unsigned short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4062 }
4063
4064 inline vector bool short
4065 vec_perm (vector bool short a1, vector bool short a2, vector unsigned char a3)
4066 {
4067   return (vector bool short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4068 }
4069
4070 inline vector pixel
4071 vec_perm (vector pixel a1, vector pixel a2, vector unsigned char a3)
4072 {
4073   return (vector pixel) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4074 }
4075
4076 inline vector signed char
4077 vec_perm (vector signed char a1, vector signed char a2, vector unsigned char a3)
4078 {
4079   return (vector signed char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4080 }
4081
4082 inline vector unsigned char
4083 vec_perm (vector unsigned char a1, vector unsigned char a2, vector unsigned char a3)
4084 {
4085   return (vector unsigned char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4086 }
4087
4088 inline vector bool char
4089 vec_perm (vector bool char a1, vector bool char a2, vector unsigned char a3)
4090 {
4091   return (vector bool char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
4092 }
4093
4094 /* vec_re */
4095
4096 inline vector float
4097 vec_re (vector float a1)
4098 {
4099   return (vector float) __builtin_altivec_vrefp ((vector float) a1);
4100 }
4101
4102 /* vec_rl */
4103
4104 inline vector signed char
4105 vec_rl (vector signed char a1, vector unsigned char a2)
4106 {
4107   return (vector signed char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
4108 }
4109
4110 inline vector unsigned char
4111 vec_rl (vector unsigned char a1, vector unsigned char a2)
4112 {
4113   return (vector unsigned char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
4114 }
4115
4116 inline vector signed short
4117 vec_rl (vector signed short a1, vector unsigned short a2)
4118 {
4119   return (vector signed short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
4120 }
4121
4122 inline vector unsigned short
4123 vec_rl (vector unsigned short a1, vector unsigned short a2)
4124 {
4125   return (vector unsigned short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
4126 }
4127
4128 inline vector signed int
4129 vec_rl (vector signed int a1, vector unsigned int a2)
4130 {
4131   return (vector signed int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
4132 }
4133
4134 inline vector unsigned int
4135 vec_rl (vector unsigned int a1, vector unsigned int a2)
4136 {
4137   return (vector unsigned int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
4138 }
4139
4140 /* vec_vrlw */
4141
4142 inline vector signed int
4143 vec_vrlw (vector signed int a1, vector unsigned int a2)
4144 {
4145   return (vector signed int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
4146 }
4147
4148 inline vector unsigned int
4149 vec_vrlw (vector unsigned int a1, vector unsigned int a2)
4150 {
4151   return (vector unsigned int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
4152 }
4153
4154 /* vec_vrlh */
4155
4156 inline vector signed short
4157 vec_vrlh (vector signed short a1, vector unsigned short a2)
4158 {
4159   return (vector signed short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
4160 }
4161
4162 inline vector unsigned short
4163 vec_vrlh (vector unsigned short a1, vector unsigned short a2)
4164 {
4165   return (vector unsigned short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
4166 }
4167
4168 /* vec_vrlb */
4169
4170 inline vector signed char
4171 vec_vrlb (vector signed char a1, vector unsigned char a2)
4172 {
4173   return (vector signed char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
4174 }
4175
4176 inline vector unsigned char
4177 vec_vrlb (vector unsigned char a1, vector unsigned char a2)
4178 {
4179   return (vector unsigned char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
4180 }
4181
4182 /* vec_round */
4183
4184 inline vector float
4185 vec_round (vector float a1)
4186 {
4187   return (vector float) __builtin_altivec_vrfin ((vector float) a1);
4188 }
4189
4190 /* vec_rsqrte */
4191
4192 inline vector float
4193 vec_rsqrte (vector float a1)
4194 {
4195   return (vector float) __builtin_altivec_vrsqrtefp ((vector float) a1);
4196 }
4197
4198 /* vec_sel */
4199
4200 inline vector float
4201 vec_sel (vector float a1, vector float a2, vector bool int a3)
4202 {
4203   return (vector float) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4204 }
4205
4206 inline vector float
4207 vec_sel (vector float a1, vector float a2, vector unsigned int a3)
4208 {
4209   return (vector float) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4210 }
4211
4212 inline vector signed int
4213 vec_sel (vector signed int a1, vector signed int a2, vector bool int a3)
4214 {
4215   return (vector signed int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4216 }
4217
4218 inline vector signed int
4219 vec_sel (vector signed int a1, vector signed int a2, vector unsigned int a3)
4220 {
4221   return (vector signed int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4222 }
4223
4224 inline vector unsigned int
4225 vec_sel (vector unsigned int a1, vector unsigned int a2, vector bool int a3)
4226 {
4227   return (vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4228 }
4229
4230 inline vector unsigned int
4231 vec_sel (vector unsigned int a1, vector unsigned int a2, vector unsigned int a3)
4232 {
4233   return (vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4234 }
4235
4236 inline vector bool int
4237 vec_sel (vector bool int a1, vector bool int a2, vector bool int a3)
4238 {
4239   return (vector bool int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4240 }
4241
4242 inline vector bool int
4243 vec_sel (vector bool int a1, vector bool int a2, vector unsigned int a3)
4244 {
4245   return (vector bool int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4246 }
4247
4248 inline vector signed short
4249 vec_sel (vector signed short a1, vector signed short a2, vector bool short a3)
4250 {
4251   return (vector signed short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4252 }
4253
4254 inline vector signed short
4255 vec_sel (vector signed short a1, vector signed short a2, vector unsigned short a3)
4256 {
4257   return (vector signed short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4258 }
4259
4260 inline vector unsigned short
4261 vec_sel (vector unsigned short a1, vector unsigned short a2, vector bool short a3)
4262 {
4263   return (vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4264 }
4265
4266 inline vector unsigned short
4267 vec_sel (vector unsigned short a1, vector unsigned short a2, vector unsigned short a3)
4268 {
4269   return (vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4270 }
4271
4272 inline vector bool short
4273 vec_sel (vector bool short a1, vector bool short a2, vector bool short a3)
4274 {
4275   return (vector bool short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4276 }
4277
4278 inline vector bool short
4279 vec_sel (vector bool short a1, vector bool short a2, vector unsigned short a3)
4280 {
4281   return (vector bool short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4282 }
4283
4284 inline vector signed char
4285 vec_sel (vector signed char a1, vector signed char a2, vector bool char a3)
4286 {
4287   return (vector signed char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4288 }
4289
4290 inline vector signed char
4291 vec_sel (vector signed char a1, vector signed char a2, vector unsigned char a3)
4292 {
4293   return (vector signed char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4294 }
4295
4296 inline vector unsigned char
4297 vec_sel (vector unsigned char a1, vector unsigned char a2, vector bool char a3)
4298 {
4299   return (vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4300 }
4301
4302 inline vector unsigned char
4303 vec_sel (vector unsigned char a1, vector unsigned char a2, vector unsigned char a3)
4304 {
4305   return (vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4306 }
4307
4308 inline vector bool char
4309 vec_sel (vector bool char a1, vector bool char a2, vector bool char a3)
4310 {
4311   return (vector bool char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4312 }
4313
4314 inline vector bool char
4315 vec_sel (vector bool char a1, vector bool char a2, vector unsigned char a3)
4316 {
4317   return (vector bool char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4318 }
4319
4320 /* vec_sl */
4321
4322 inline vector signed char
4323 vec_sl (vector signed char a1, vector unsigned char a2)
4324 {
4325   return (vector signed char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4326 }
4327
4328 inline vector unsigned char
4329 vec_sl (vector unsigned char a1, vector unsigned char a2)
4330 {
4331   return (vector unsigned char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4332 }
4333
4334 inline vector signed short
4335 vec_sl (vector signed short a1, vector unsigned short a2)
4336 {
4337   return (vector signed short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4338 }
4339
4340 inline vector unsigned short
4341 vec_sl (vector unsigned short a1, vector unsigned short a2)
4342 {
4343   return (vector unsigned short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4344 }
4345
4346 inline vector signed int
4347 vec_sl (vector signed int a1, vector unsigned int a2)
4348 {
4349   return (vector signed int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4350 }
4351
4352 inline vector unsigned int
4353 vec_sl (vector unsigned int a1, vector unsigned int a2)
4354 {
4355   return (vector unsigned int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4356 }
4357
4358 /* vec_vslw */
4359
4360 inline vector signed int
4361 vec_vslw (vector signed int a1, vector unsigned int a2)
4362 {
4363   return (vector signed int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4364 }
4365
4366 inline vector unsigned int
4367 vec_vslw (vector unsigned int a1, vector unsigned int a2)
4368 {
4369   return (vector unsigned int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4370 }
4371
4372 /* vec_vslh */
4373
4374 inline vector signed short
4375 vec_vslh (vector signed short a1, vector unsigned short a2)
4376 {
4377   return (vector signed short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4378 }
4379
4380 inline vector unsigned short
4381 vec_vslh (vector unsigned short a1, vector unsigned short a2)
4382 {
4383   return (vector unsigned short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4384 }
4385
4386 /* vec_vslb */
4387
4388 inline vector signed char
4389 vec_vslb (vector signed char a1, vector unsigned char a2)
4390 {
4391   return (vector signed char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4392 }
4393
4394 inline vector unsigned char
4395 vec_vslb (vector unsigned char a1, vector unsigned char a2)
4396 {
4397   return (vector unsigned char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4398 }
4399
4400 /* vec_sld */
4401
4402 inline vector float
4403 vec_sld (vector float a1, vector float a2, const int a3)
4404 {
4405   return (vector float) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4406 }
4407
4408 inline vector signed int
4409 vec_sld (vector signed int a1, vector signed int a2, const int a3)
4410 {
4411   return (vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4412 }
4413
4414 inline vector unsigned int
4415 vec_sld (vector unsigned int a1, vector unsigned int a2, const int a3)
4416 {
4417   return (vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4418 }
4419
4420 inline vector bool int
4421 vec_sld (vector bool int a1, vector bool int a2, const int a3)
4422 {
4423   return (vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4424 }
4425
4426 inline vector signed short
4427 vec_sld (vector signed short a1, vector signed short a2, const int a3)
4428 {
4429   return (vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4430 }
4431
4432 inline vector unsigned short
4433 vec_sld (vector unsigned short a1, vector unsigned short a2, const int a3)
4434 {
4435   return (vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4436 }
4437
4438 inline vector bool short
4439 vec_sld (vector bool short a1, vector bool short a2, const int a3)
4440 {
4441   return (vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4442 }
4443
4444 inline vector pixel
4445 vec_sld (vector pixel a1, vector pixel a2, const int a3)
4446 {
4447   return (vector pixel) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4448 }
4449
4450 inline vector signed char
4451 vec_sld (vector signed char a1, vector signed char a2, const int a3)
4452 {
4453   return (vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4454 }
4455
4456 inline vector unsigned char
4457 vec_sld (vector unsigned char a1, vector unsigned char a2, const int a3)
4458 {
4459   return (vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4460 }
4461
4462 inline vector bool char
4463 vec_sld (vector bool char a1, vector bool char a2, const int a3)
4464 {
4465   return (vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4466 }
4467
4468 /* vec_sll */
4469
4470 inline vector signed int
4471 vec_sll (vector signed int a1, vector unsigned int a2)
4472 {
4473   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4474 }
4475
4476 inline vector signed int
4477 vec_sll (vector signed int a1, vector unsigned short a2)
4478 {
4479   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4480 }
4481
4482 inline vector signed int
4483 vec_sll (vector signed int a1, vector unsigned char a2)
4484 {
4485   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4486 }
4487
4488 inline vector unsigned int
4489 vec_sll (vector unsigned int a1, vector unsigned int a2)
4490 {
4491   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4492 }
4493
4494 inline vector unsigned int
4495 vec_sll (vector unsigned int a1, vector unsigned short a2)
4496 {
4497   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4498 }
4499
4500 inline vector unsigned int
4501 vec_sll (vector unsigned int a1, vector unsigned char a2)
4502 {
4503   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4504 }
4505
4506 inline vector bool int
4507 vec_sll (vector bool int a1, vector unsigned int a2)
4508 {
4509   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4510 }
4511
4512 inline vector bool int
4513 vec_sll (vector bool int a1, vector unsigned short a2)
4514 {
4515   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4516 }
4517
4518 inline vector bool int
4519 vec_sll (vector bool int a1, vector unsigned char a2)
4520 {
4521   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4522 }
4523
4524 inline vector signed short
4525 vec_sll (vector signed short a1, vector unsigned int a2)
4526 {
4527   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4528 }
4529
4530 inline vector signed short
4531 vec_sll (vector signed short a1, vector unsigned short a2)
4532 {
4533   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4534 }
4535
4536 inline vector signed short
4537 vec_sll (vector signed short a1, vector unsigned char a2)
4538 {
4539   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4540 }
4541
4542 inline vector unsigned short
4543 vec_sll (vector unsigned short a1, vector unsigned int a2)
4544 {
4545   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4546 }
4547
4548 inline vector unsigned short
4549 vec_sll (vector unsigned short a1, vector unsigned short a2)
4550 {
4551   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4552 }
4553
4554 inline vector unsigned short
4555 vec_sll (vector unsigned short a1, vector unsigned char a2)
4556 {
4557   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4558 }
4559
4560 inline vector bool short
4561 vec_sll (vector bool short a1, vector unsigned int a2)
4562 {
4563   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4564 }
4565
4566 inline vector bool short
4567 vec_sll (vector bool short a1, vector unsigned short a2)
4568 {
4569   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4570 }
4571
4572 inline vector bool short
4573 vec_sll (vector bool short a1, vector unsigned char a2)
4574 {
4575   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4576 }
4577
4578 inline vector pixel
4579 vec_sll (vector pixel a1, vector unsigned int a2)
4580 {
4581   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4582 }
4583
4584 inline vector pixel
4585 vec_sll (vector pixel a1, vector unsigned short a2)
4586 {
4587   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4588 }
4589
4590 inline vector pixel
4591 vec_sll (vector pixel a1, vector unsigned char a2)
4592 {
4593   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4594 }
4595
4596 inline vector signed char
4597 vec_sll (vector signed char a1, vector unsigned int a2)
4598 {
4599   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4600 }
4601
4602 inline vector signed char
4603 vec_sll (vector signed char a1, vector unsigned short a2)
4604 {
4605   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4606 }
4607
4608 inline vector signed char
4609 vec_sll (vector signed char a1, vector unsigned char a2)
4610 {
4611   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4612 }
4613
4614 inline vector unsigned char
4615 vec_sll (vector unsigned char a1, vector unsigned int a2)
4616 {
4617   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4618 }
4619
4620 inline vector unsigned char
4621 vec_sll (vector unsigned char a1, vector unsigned short a2)
4622 {
4623   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4624 }
4625
4626 inline vector unsigned char
4627 vec_sll (vector unsigned char a1, vector unsigned char a2)
4628 {
4629   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4630 }
4631
4632 inline vector bool char
4633 vec_sll (vector bool char a1, vector unsigned int a2)
4634 {
4635   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4636 }
4637
4638 inline vector bool char
4639 vec_sll (vector bool char a1, vector unsigned short a2)
4640 {
4641   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4642 }
4643
4644 inline vector bool char
4645 vec_sll (vector bool char a1, vector unsigned char a2)
4646 {
4647   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4648 }
4649
4650 /* vec_slo */
4651
4652 inline vector float
4653 vec_slo (vector float a1, vector signed char a2)
4654 {
4655   return (vector float) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4656 }
4657
4658 inline vector float
4659 vec_slo (vector float a1, vector unsigned char a2)
4660 {
4661   return (vector float) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4662 }
4663
4664 inline vector signed int
4665 vec_slo (vector signed int a1, vector signed char a2)
4666 {
4667   return (vector signed int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4668 }
4669
4670 inline vector signed int
4671 vec_slo (vector signed int a1, vector unsigned char a2)
4672 {
4673   return (vector signed int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4674 }
4675
4676 inline vector unsigned int
4677 vec_slo (vector unsigned int a1, vector signed char a2)
4678 {
4679   return (vector unsigned int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4680 }
4681
4682 inline vector unsigned int
4683 vec_slo (vector unsigned int a1, vector unsigned char a2)
4684 {
4685   return (vector unsigned int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4686 }
4687
4688 inline vector signed short
4689 vec_slo (vector signed short a1, vector signed char a2)
4690 {
4691   return (vector signed short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4692 }
4693
4694 inline vector signed short
4695 vec_slo (vector signed short a1, vector unsigned char a2)
4696 {
4697   return (vector signed short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4698 }
4699
4700 inline vector unsigned short
4701 vec_slo (vector unsigned short a1, vector signed char a2)
4702 {
4703   return (vector unsigned short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4704 }
4705
4706 inline vector unsigned short
4707 vec_slo (vector unsigned short a1, vector unsigned char a2)
4708 {
4709   return (vector unsigned short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4710 }
4711
4712 inline vector pixel
4713 vec_slo (vector pixel a1, vector signed char a2)
4714 {
4715   return (vector pixel) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4716 }
4717
4718 inline vector pixel
4719 vec_slo (vector pixel a1, vector unsigned char a2)
4720 {
4721   return (vector pixel) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4722 }
4723
4724 inline vector signed char
4725 vec_slo (vector signed char a1, vector signed char a2)
4726 {
4727   return (vector signed char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4728 }
4729
4730 inline vector signed char
4731 vec_slo (vector signed char a1, vector unsigned char a2)
4732 {
4733   return (vector signed char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4734 }
4735
4736 inline vector unsigned char
4737 vec_slo (vector unsigned char a1, vector signed char a2)
4738 {
4739   return (vector unsigned char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4740 }
4741
4742 inline vector unsigned char
4743 vec_slo (vector unsigned char a1, vector unsigned char a2)
4744 {
4745   return (vector unsigned char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4746 }
4747
4748 /* vec_splat */
4749
4750 inline vector signed char
4751 vec_splat (vector signed char a1, const int a2)
4752 {
4753   return (vector signed char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4754 }
4755
4756 inline vector unsigned char
4757 vec_splat (vector unsigned char a1, const int a2)
4758 {
4759   return (vector unsigned char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4760 }
4761
4762 inline vector bool char
4763 vec_splat (vector bool char a1, const int a2)
4764 {
4765   return (vector bool char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4766 }
4767
4768 inline vector signed short
4769 vec_splat (vector signed short a1, const int a2)
4770 {
4771   return (vector signed short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4772 }
4773
4774 inline vector unsigned short
4775 vec_splat (vector unsigned short a1, const int a2)
4776 {
4777   return (vector unsigned short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4778 }
4779
4780 inline vector bool short
4781 vec_splat (vector bool short a1, const int a2)
4782 {
4783   return (vector bool short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4784 }
4785
4786 inline vector pixel
4787 vec_splat (vector pixel a1, const int a2)
4788 {
4789   return (vector pixel) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4790 }
4791
4792 inline vector float
4793 vec_splat (vector float a1, const int a2)
4794 {
4795   return (vector float) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4796 }
4797
4798 inline vector signed int
4799 vec_splat (vector signed int a1, const int a2)
4800 {
4801   return (vector signed int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4802 }
4803
4804 inline vector unsigned int
4805 vec_splat (vector unsigned int a1, const int a2)
4806 {
4807   return (vector unsigned int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4808 }
4809
4810 inline vector bool int
4811 vec_splat (vector bool int a1, const int a2)
4812 {
4813   return (vector bool int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4814 }
4815
4816 /* vec_vspltw */
4817
4818 inline vector float
4819 vec_vspltw (vector float a1, const int a2)
4820 {
4821   return (vector float) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4822 }
4823
4824 inline vector signed int
4825 vec_vspltw (vector signed int a1, const int a2)
4826 {
4827   return (vector signed int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4828 }
4829
4830 inline vector unsigned int
4831 vec_vspltw (vector unsigned int a1, const int a2)
4832 {
4833   return (vector unsigned int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4834 }
4835
4836 inline vector bool int
4837 vec_vspltw (vector bool int a1, const int a2)
4838 {
4839   return (vector bool int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4840 }
4841
4842 /* vec_vsplth */
4843
4844 inline vector bool short
4845 vec_vsplth (vector bool short a1, const int a2)
4846 {
4847   return (vector bool short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4848 }
4849
4850 inline vector signed short
4851 vec_vsplth (vector signed short a1, const int a2)
4852 {
4853   return (vector signed short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4854 }
4855
4856 inline vector unsigned short
4857 vec_vsplth (vector unsigned short a1, const int a2)
4858 {
4859   return (vector unsigned short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4860 }
4861
4862 inline vector pixel
4863 vec_vsplth (vector pixel a1, const int a2)
4864 {
4865   return (vector pixel) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4866 }
4867
4868 /* vec_vspltb */
4869
4870 inline vector signed char
4871 vec_vspltb (vector signed char a1, const int a2)
4872 {
4873   return (vector signed char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4874 }
4875
4876 inline vector unsigned char
4877 vec_vspltb (vector unsigned char a1, const int a2)
4878 {
4879   return (vector unsigned char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4880 }
4881
4882 inline vector bool char
4883 vec_vspltb (vector bool char a1, const int a2)
4884 {
4885   return (vector bool char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4886 }
4887
4888 /* vec_splat_s8 */
4889
4890 inline vector signed char
4891 vec_splat_s8 (const int a1)
4892 {
4893   return (vector signed char) __builtin_altivec_vspltisb (a1);
4894 }
4895
4896 /* vec_splat_s16 */
4897
4898 inline vector signed short
4899 vec_splat_s16 (const int a1)
4900 {
4901   return (vector signed short) __builtin_altivec_vspltish (a1);
4902 }
4903
4904 /* vec_splat_s32 */
4905
4906 inline vector signed int
4907 vec_splat_s32 (const int a1)
4908 {
4909   return (vector signed int) __builtin_altivec_vspltisw (a1);
4910 }
4911
4912 /* vec_splat_u8 */
4913
4914 inline vector unsigned char
4915 vec_splat_u8 (const int a1)
4916 {
4917   return (vector unsigned char) __builtin_altivec_vspltisb (a1);
4918 }
4919
4920 /* vec_splat_u16 */
4921
4922 inline vector unsigned short
4923 vec_splat_u16 (const int a1)
4924 {
4925   return (vector unsigned short) __builtin_altivec_vspltish (a1);
4926 }
4927
4928 /* vec_splat_u32 */
4929
4930 inline vector unsigned int
4931 vec_splat_u32 (const int a1)
4932 {
4933   return (vector unsigned int) __builtin_altivec_vspltisw (a1);
4934 }
4935
4936 /* vec_sr */
4937
4938 inline vector signed char
4939 vec_sr (vector signed char a1, vector unsigned char a2)
4940 {
4941   return (vector signed char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4942 }
4943
4944 inline vector unsigned char
4945 vec_sr (vector unsigned char a1, vector unsigned char a2)
4946 {
4947   return (vector unsigned char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4948 }
4949
4950 inline vector signed short
4951 vec_sr (vector signed short a1, vector unsigned short a2)
4952 {
4953   return (vector signed short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4954 }
4955
4956 inline vector unsigned short
4957 vec_sr (vector unsigned short a1, vector unsigned short a2)
4958 {
4959   return (vector unsigned short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4960 }
4961
4962 inline vector signed int
4963 vec_sr (vector signed int a1, vector unsigned int a2)
4964 {
4965   return (vector signed int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4966 }
4967
4968 inline vector unsigned int
4969 vec_sr (vector unsigned int a1, vector unsigned int a2)
4970 {
4971   return (vector unsigned int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4972 }
4973
4974 /* vec_vsrw */
4975
4976 inline vector signed int
4977 vec_vsrw (vector signed int a1, vector unsigned int a2)
4978 {
4979   return (vector signed int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4980 }
4981
4982 inline vector unsigned int
4983 vec_vsrw (vector unsigned int a1, vector unsigned int a2)
4984 {
4985   return (vector unsigned int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4986 }
4987
4988 /* vec_vsrh */
4989
4990 inline vector signed short
4991 vec_vsrh (vector signed short a1, vector unsigned short a2)
4992 {
4993   return (vector signed short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4994 }
4995
4996 inline vector unsigned short
4997 vec_vsrh (vector unsigned short a1, vector unsigned short a2)
4998 {
4999   return (vector unsigned short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
5000 }
5001
5002 /* vec_vsrb */
5003
5004 inline vector signed char
5005 vec_vsrb (vector signed char a1, vector unsigned char a2)
5006 {
5007   return (vector signed char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
5008 }
5009
5010 inline vector unsigned char
5011 vec_vsrb (vector unsigned char a1, vector unsigned char a2)
5012 {
5013   return (vector unsigned char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
5014 }
5015
5016 /* vec_sra */
5017
5018 inline vector signed char
5019 vec_sra (vector signed char a1, vector unsigned char a2)
5020 {
5021   return (vector signed char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
5022 }
5023
5024 inline vector unsigned char
5025 vec_sra (vector unsigned char a1, vector unsigned char a2)
5026 {
5027   return (vector unsigned char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
5028 }
5029
5030 inline vector signed short
5031 vec_sra (vector signed short a1, vector unsigned short a2)
5032 {
5033   return (vector signed short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
5034 }
5035
5036 inline vector unsigned short
5037 vec_sra (vector unsigned short a1, vector unsigned short a2)
5038 {
5039   return (vector unsigned short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
5040 }
5041
5042 inline vector signed int
5043 vec_sra (vector signed int a1, vector unsigned int a2)
5044 {
5045   return (vector signed int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
5046 }
5047
5048 inline vector unsigned int
5049 vec_sra (vector unsigned int a1, vector unsigned int a2)
5050 {
5051   return (vector unsigned int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
5052 }
5053
5054 /* vec_vsraw */
5055
5056 inline vector signed int
5057 vec_vsraw (vector signed int a1, vector unsigned int a2)
5058 {
5059   return (vector signed int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
5060 }
5061
5062 inline vector unsigned int
5063 vec_vsraw (vector unsigned int a1, vector unsigned int a2)
5064 {
5065   return (vector unsigned int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
5066 }
5067
5068 /* vec_vsrah */
5069
5070 inline vector signed short
5071 vec_vsrah (vector signed short a1, vector unsigned short a2)
5072 {
5073   return (vector signed short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
5074 }
5075
5076 inline vector unsigned short
5077 vec_vsrah (vector unsigned short a1, vector unsigned short a2)
5078 {
5079   return (vector unsigned short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
5080 }
5081
5082 /* vec_vsrab */
5083
5084 inline vector signed char
5085 vec_vsrab (vector signed char a1, vector unsigned char a2)
5086 {
5087   return (vector signed char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
5088 }
5089
5090 inline vector unsigned char
5091 vec_vsrab (vector unsigned char a1, vector unsigned char a2)
5092 {
5093   return (vector unsigned char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
5094 }
5095
5096 /* vec_srl */
5097
5098 inline vector signed int
5099 vec_srl (vector signed int a1, vector unsigned int a2)
5100 {
5101   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5102 }
5103
5104 inline vector signed int
5105 vec_srl (vector signed int a1, vector unsigned short a2)
5106 {
5107   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5108 }
5109
5110 inline vector signed int
5111 vec_srl (vector signed int a1, vector unsigned char a2)
5112 {
5113   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5114 }
5115
5116 inline vector unsigned int
5117 vec_srl (vector unsigned int a1, vector unsigned int a2)
5118 {
5119   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5120 }
5121
5122 inline vector unsigned int
5123 vec_srl (vector unsigned int a1, vector unsigned short a2)
5124 {
5125   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5126 }
5127
5128 inline vector unsigned int
5129 vec_srl (vector unsigned int a1, vector unsigned char a2)
5130 {
5131   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5132 }
5133
5134 inline vector bool int
5135 vec_srl (vector bool int a1, vector unsigned int a2)
5136 {
5137   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5138 }
5139
5140 inline vector bool int
5141 vec_srl (vector bool int a1, vector unsigned short a2)
5142 {
5143   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5144 }
5145
5146 inline vector bool int
5147 vec_srl (vector bool int a1, vector unsigned char a2)
5148 {
5149   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5150 }
5151
5152 inline vector signed short
5153 vec_srl (vector signed short a1, vector unsigned int a2)
5154 {
5155   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5156 }
5157
5158 inline vector signed short
5159 vec_srl (vector signed short a1, vector unsigned short a2)
5160 {
5161   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5162 }
5163
5164 inline vector signed short
5165 vec_srl (vector signed short a1, vector unsigned char a2)
5166 {
5167   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5168 }
5169
5170 inline vector unsigned short
5171 vec_srl (vector unsigned short a1, vector unsigned int a2)
5172 {
5173   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5174 }
5175
5176 inline vector unsigned short
5177 vec_srl (vector unsigned short a1, vector unsigned short a2)
5178 {
5179   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5180 }
5181
5182 inline vector unsigned short
5183 vec_srl (vector unsigned short a1, vector unsigned char a2)
5184 {
5185   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5186 }
5187
5188 inline vector bool short
5189 vec_srl (vector bool short a1, vector unsigned int a2)
5190 {
5191   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5192 }
5193
5194 inline vector bool short
5195 vec_srl (vector bool short a1, vector unsigned short a2)
5196 {
5197   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5198 }
5199
5200 inline vector bool short
5201 vec_srl (vector bool short a1, vector unsigned char a2)
5202 {
5203   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5204 }
5205
5206 inline vector pixel
5207 vec_srl (vector pixel a1, vector unsigned int a2)
5208 {
5209   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5210 }
5211
5212 inline vector pixel
5213 vec_srl (vector pixel a1, vector unsigned short a2)
5214 {
5215   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5216 }
5217
5218 inline vector pixel
5219 vec_srl (vector pixel a1, vector unsigned char a2)
5220 {
5221   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5222 }
5223
5224 inline vector signed char
5225 vec_srl (vector signed char a1, vector unsigned int a2)
5226 {
5227   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5228 }
5229
5230 inline vector signed char
5231 vec_srl (vector signed char a1, vector unsigned short a2)
5232 {
5233   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5234 }
5235
5236 inline vector signed char
5237 vec_srl (vector signed char a1, vector unsigned char a2)
5238 {
5239   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5240 }
5241
5242 inline vector unsigned char
5243 vec_srl (vector unsigned char a1, vector unsigned int a2)
5244 {
5245   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5246 }
5247
5248 inline vector unsigned char
5249 vec_srl (vector unsigned char a1, vector unsigned short a2)
5250 {
5251   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5252 }
5253
5254 inline vector unsigned char
5255 vec_srl (vector unsigned char a1, vector unsigned char a2)
5256 {
5257   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5258 }
5259
5260 inline vector bool char
5261 vec_srl (vector bool char a1, vector unsigned int a2)
5262 {
5263   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5264 }
5265
5266 inline vector bool char
5267 vec_srl (vector bool char a1, vector unsigned short a2)
5268 {
5269   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5270 }
5271
5272 inline vector bool char
5273 vec_srl (vector bool char a1, vector unsigned char a2)
5274 {
5275   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5276 }
5277
5278 /* vec_sro */
5279
5280 inline vector float
5281 vec_sro (vector float a1, vector signed char a2)
5282 {
5283   return (vector float) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5284 }
5285
5286 inline vector float
5287 vec_sro (vector float a1, vector unsigned char a2)
5288 {
5289   return (vector float) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5290 }
5291
5292 inline vector signed int
5293 vec_sro (vector signed int a1, vector signed char a2)
5294 {
5295   return (vector signed int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5296 }
5297
5298 inline vector signed int
5299 vec_sro (vector signed int a1, vector unsigned char a2)
5300 {
5301   return (vector signed int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5302 }
5303
5304 inline vector unsigned int
5305 vec_sro (vector unsigned int a1, vector signed char a2)
5306 {
5307   return (vector unsigned int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5308 }
5309
5310 inline vector unsigned int
5311 vec_sro (vector unsigned int a1, vector unsigned char a2)
5312 {
5313   return (vector unsigned int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5314 }
5315
5316 inline vector signed short
5317 vec_sro (vector signed short a1, vector signed char a2)
5318 {
5319   return (vector signed short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5320 }
5321
5322 inline vector signed short
5323 vec_sro (vector signed short a1, vector unsigned char a2)
5324 {
5325   return (vector signed short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5326 }
5327
5328 inline vector unsigned short
5329 vec_sro (vector unsigned short a1, vector signed char a2)
5330 {
5331   return (vector unsigned short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5332 }
5333
5334 inline vector unsigned short
5335 vec_sro (vector unsigned short a1, vector unsigned char a2)
5336 {
5337   return (vector unsigned short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5338 }
5339
5340 inline vector pixel
5341 vec_sro (vector pixel a1, vector signed char a2)
5342 {
5343   return (vector pixel) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5344 }
5345
5346 inline vector pixel
5347 vec_sro (vector pixel a1, vector unsigned char a2)
5348 {
5349   return (vector pixel) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5350 }
5351
5352 inline vector signed char
5353 vec_sro (vector signed char a1, vector signed char a2)
5354 {
5355   return (vector signed char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5356 }
5357
5358 inline vector signed char
5359 vec_sro (vector signed char a1, vector unsigned char a2)
5360 {
5361   return (vector signed char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5362 }
5363
5364 inline vector unsigned char
5365 vec_sro (vector unsigned char a1, vector signed char a2)
5366 {
5367   return (vector unsigned char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5368 }
5369
5370 inline vector unsigned char
5371 vec_sro (vector unsigned char a1, vector unsigned char a2)
5372 {
5373   return (vector unsigned char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5374 }
5375
5376 /* vec_st */
5377
5378 inline void
5379 vec_st (vector float a1, int a2, vector float *a3)
5380 {
5381   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5382 }
5383
5384 inline void
5385 vec_st (vector float a1, int a2, float *a3)
5386 {
5387   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5388 }
5389
5390 inline void
5391 vec_st (vector signed int a1, int a2, vector signed int *a3)
5392 {
5393   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5394 }
5395
5396 inline void
5397 vec_st (vector signed int a1, int a2, int *a3)
5398 {
5399   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5400 }
5401
5402 inline void
5403 vec_st (vector unsigned int a1, int a2, vector unsigned int *a3)
5404 {
5405   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5406 }
5407
5408 inline void
5409 vec_st (vector unsigned int a1, int a2, unsigned int *a3)
5410 {
5411   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5412 }
5413
5414 inline void
5415 vec_st (vector bool int a1, int a2, vector bool int *a3)
5416 {
5417   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5418 }
5419
5420 inline void
5421 vec_st (vector bool int a1, int a2, unsigned int *a3)
5422 {
5423   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5424 }
5425
5426 inline void
5427 vec_st (vector bool int a1, int a2, int *a3)
5428 {
5429   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5430 }
5431
5432 inline void
5433 vec_st (vector signed short a1, int a2, vector signed short *a3)
5434 {
5435   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5436 }
5437
5438 inline void
5439 vec_st (vector signed short a1, int a2, short *a3)
5440 {
5441   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5442 }
5443
5444 inline void
5445 vec_st (vector unsigned short a1, int a2, vector unsigned short *a3)
5446 {
5447   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5448 }
5449
5450 inline void
5451 vec_st (vector unsigned short a1, int a2, unsigned short *a3)
5452 {
5453   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5454 }
5455
5456 inline void
5457 vec_st (vector bool short a1, int a2, vector bool short *a3)
5458 {
5459   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5460 }
5461
5462 inline void
5463 vec_st (vector bool short a1, int a2, unsigned short *a3)
5464 {
5465   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5466 }
5467
5468 inline void
5469 vec_st (vector pixel a1, int a2, vector pixel *a3)
5470 {
5471   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5472 }
5473
5474 inline void
5475 vec_st (vector pixel a1, int a2, unsigned short *a3)
5476 {
5477   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5478 }
5479
5480 inline void
5481 vec_st (vector pixel a1, int a2, short *a3)
5482 {
5483   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5484 }
5485
5486 inline void
5487 vec_st (vector bool short a1, int a2, short *a3)
5488 {
5489   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5490 }
5491
5492 inline void
5493 vec_st (vector signed char a1, int a2, vector signed char *a3)
5494 {
5495   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5496 }
5497
5498 inline void
5499 vec_st (vector signed char a1, int a2, signed char *a3)
5500 {
5501   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5502 }
5503
5504 inline void
5505 vec_st (vector unsigned char a1, int a2, vector unsigned char *a3)
5506 {
5507   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5508 }
5509
5510 inline void
5511 vec_st (vector unsigned char a1, int a2, unsigned char *a3)
5512 {
5513   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5514 }
5515
5516 inline void
5517 vec_st (vector bool char a1, int a2, vector bool char *a3)
5518 {
5519   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5520 }
5521
5522 inline void
5523 vec_st (vector bool char a1, int a2, unsigned char *a3)
5524 {
5525   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5526 }
5527
5528 inline void
5529 vec_st (vector bool char a1, int a2, signed char *a3)
5530 {
5531   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5532 }
5533
5534 /* vec_ste */
5535
5536 inline void
5537 vec_ste (vector signed char a1, int a2, signed char *a3)
5538 {
5539   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5540 }
5541
5542 inline void
5543 vec_ste (vector unsigned char a1, int a2, unsigned char *a3)
5544 {
5545   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5546 }
5547
5548 inline void
5549 vec_ste (vector bool char a1, int a2, signed char *a3)
5550 {
5551   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5552 }
5553
5554 inline void
5555 vec_ste (vector bool char a1, int a2, unsigned char *a3)
5556 {
5557   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5558 }
5559
5560 inline void
5561 vec_ste (vector signed short a1, int a2, short *a3)
5562 {
5563   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5564 }
5565
5566 inline void
5567 vec_ste (vector unsigned short a1, int a2, unsigned short *a3)
5568 {
5569   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5570 }
5571
5572 inline void
5573 vec_ste (vector bool short a1, int a2, short *a3)
5574 {
5575   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5576 }
5577
5578 inline void
5579 vec_ste (vector bool short a1, int a2, unsigned short *a3)
5580 {
5581   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5582 }
5583
5584 inline void
5585 vec_ste (vector pixel a1, int a2, short *a3)
5586 {
5587   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5588 }
5589
5590 inline void
5591 vec_ste (vector pixel a1, int a2, unsigned short *a3)
5592 {
5593   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5594 }
5595
5596 inline void
5597 vec_ste (vector float a1, int a2, float *a3)
5598 {
5599   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5600 }
5601
5602 inline void
5603 vec_ste (vector signed int a1, int a2, int *a3)
5604 {
5605   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5606 }
5607
5608 inline void
5609 vec_ste (vector unsigned int a1, int a2, unsigned int *a3)
5610 {
5611   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5612 }
5613
5614 inline void
5615 vec_ste (vector bool int a1, int a2, int *a3)
5616 {
5617   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5618 }
5619
5620 inline void
5621 vec_ste (vector bool int a1, int a2, unsigned int *a3)
5622 {
5623   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5624 }
5625
5626 /* vec_stvewx */
5627
5628 inline void
5629 vec_stvewx (vector float a1, int a2, void *a3)
5630 {
5631   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5632 }
5633
5634 inline void
5635 vec_stvewx (vector signed int a1, int a2, void *a3)
5636 {
5637   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5638 }
5639
5640 inline void
5641 vec_stvewx (vector unsigned int a1, int a2, void *a3)
5642 {
5643   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5644 }
5645
5646 /* vec_stvehx */
5647
5648 inline void
5649 vec_stvehx (vector signed short a1, int a2, void *a3)
5650 {
5651   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5652 }
5653
5654 inline void
5655 vec_stvehx (vector unsigned short a1, int a2, void *a3)
5656 {
5657   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5658 }
5659
5660 /* vec_stvebx */
5661
5662 inline void
5663 vec_stvebx (vector signed char a1, int a2, void *a3)
5664 {
5665   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5666 }
5667
5668 inline void
5669 vec_stvebx (vector unsigned char a1, int a2, void *a3)
5670 {
5671   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5672 }
5673
5674 /* vec_stl */
5675
5676 inline void
5677 vec_stl (vector float a1, int a2, vector float *a3)
5678 {
5679   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5680 }
5681
5682 inline void
5683 vec_stl (vector float a1, int a2, float *a3)
5684 {
5685   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5686 }
5687
5688 inline void
5689 vec_stl (vector signed int a1, int a2, vector signed int *a3)
5690 {
5691   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5692 }
5693
5694 inline void
5695 vec_stl (vector signed int a1, int a2, int *a3)
5696 {
5697   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5698 }
5699
5700 inline void
5701 vec_stl (vector unsigned int a1, int a2, vector unsigned int *a3)
5702 {
5703   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5704 }
5705
5706 inline void
5707 vec_stl (vector unsigned int a1, int a2, unsigned int *a3)
5708 {
5709   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5710 }
5711
5712 inline void
5713 vec_stl (vector bool int a1, int a2, vector bool int *a3)
5714 {
5715   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5716 }
5717
5718 inline void
5719 vec_stl (vector bool int a1, int a2, unsigned int *a3)
5720 {
5721   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5722 }
5723
5724 inline void
5725 vec_stl (vector bool int a1, int a2, int *a3)
5726 {
5727   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5728 }
5729
5730 inline void
5731 vec_stl (vector signed short a1, int a2, vector signed short *a3)
5732 {
5733   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5734 }
5735
5736 inline void
5737 vec_stl (vector signed short a1, int a2, short *a3)
5738 {
5739   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5740 }
5741
5742 inline void
5743 vec_stl (vector unsigned short a1, int a2, vector unsigned short *a3)
5744 {
5745   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5746 }
5747
5748 inline void
5749 vec_stl (vector unsigned short a1, int a2, unsigned short *a3)
5750 {
5751   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5752 }
5753
5754 inline void
5755 vec_stl (vector bool short a1, int a2, vector bool short *a3)
5756 {
5757   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5758 }
5759
5760 inline void
5761 vec_stl (vector bool short a1, int a2, unsigned short *a3)
5762 {
5763   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5764 }
5765
5766 inline void
5767 vec_stl (vector bool short a1, int a2, short *a3)
5768 {
5769   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5770 }
5771
5772 inline void
5773 vec_stl (vector pixel a1, int a2, vector pixel *a3)
5774 {
5775   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5776 }
5777
5778 inline void
5779 vec_stl (vector pixel a1, int a2, unsigned short *a3)
5780 {
5781   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5782 }
5783
5784 inline void
5785 vec_stl (vector pixel a1, int a2, short *a3)
5786 {
5787   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5788 }
5789
5790 inline void
5791 vec_stl (vector signed char a1, int a2, vector signed char *a3)
5792 {
5793   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5794 }
5795
5796 inline void
5797 vec_stl (vector signed char a1, int a2, signed char *a3)
5798 {
5799   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5800 }
5801
5802 inline void
5803 vec_stl (vector unsigned char a1, int a2, vector unsigned char *a3)
5804 {
5805   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5806 }
5807
5808 inline void
5809 vec_stl (vector unsigned char a1, int a2, unsigned char *a3)
5810 {
5811   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5812 }
5813
5814 inline void
5815 vec_stl (vector bool char a1, int a2, vector bool char *a3)
5816 {
5817   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5818 }
5819
5820 inline void
5821 vec_stl (vector bool char a1, int a2, unsigned char *a3)
5822 {
5823   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5824 }
5825
5826 inline void
5827 vec_stl (vector bool char a1, int a2, signed char *a3)
5828 {
5829   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5830 }
5831
5832 /* vec_sub */
5833
5834 inline vector signed char
5835 vec_sub (vector bool char a1, vector signed char a2)
5836 {
5837   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5838 }
5839
5840 inline vector signed char
5841 vec_sub (vector signed char a1, vector bool char a2)
5842 {
5843   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5844 }
5845
5846 inline vector signed char
5847 vec_sub (vector signed char a1, vector signed char a2)
5848 {
5849   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5850 }
5851
5852 inline vector unsigned char
5853 vec_sub (vector bool char a1, vector unsigned char a2)
5854 {
5855   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5856 }
5857
5858 inline vector unsigned char
5859 vec_sub (vector unsigned char a1, vector bool char a2)
5860 {
5861   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5862 }
5863
5864 inline vector unsigned char
5865 vec_sub (vector unsigned char a1, vector unsigned char a2)
5866 {
5867   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5868 }
5869
5870 inline vector signed short
5871 vec_sub (vector bool short a1, vector signed short a2)
5872 {
5873   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5874 }
5875
5876 inline vector signed short
5877 vec_sub (vector signed short a1, vector bool short a2)
5878 {
5879   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5880 }
5881
5882 inline vector signed short
5883 vec_sub (vector signed short a1, vector signed short a2)
5884 {
5885   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5886 }
5887
5888 inline vector unsigned short
5889 vec_sub (vector bool short a1, vector unsigned short a2)
5890 {
5891   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5892 }
5893
5894 inline vector unsigned short
5895 vec_sub (vector unsigned short a1, vector bool short a2)
5896 {
5897   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5898 }
5899
5900 inline vector unsigned short
5901 vec_sub (vector unsigned short a1, vector unsigned short a2)
5902 {
5903   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5904 }
5905
5906 inline vector signed int
5907 vec_sub (vector bool int a1, vector signed int a2)
5908 {
5909   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5910 }
5911
5912 inline vector signed int
5913 vec_sub (vector signed int a1, vector bool int a2)
5914 {
5915   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5916 }
5917
5918 inline vector signed int
5919 vec_sub (vector signed int a1, vector signed int a2)
5920 {
5921   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5922 }
5923
5924 inline vector unsigned int
5925 vec_sub (vector bool int a1, vector unsigned int a2)
5926 {
5927   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5928 }
5929
5930 inline vector unsigned int
5931 vec_sub (vector unsigned int a1, vector bool int a2)
5932 {
5933   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5934 }
5935
5936 inline vector unsigned int
5937 vec_sub (vector unsigned int a1, vector unsigned int a2)
5938 {
5939   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5940 }
5941
5942 inline vector float
5943 vec_sub (vector float a1, vector float a2)
5944 {
5945   return (vector float) __builtin_altivec_vsubfp ((vector float) a1, (vector float) a2);
5946 }
5947
5948 /* vec_vsubfp */
5949
5950 inline vector float
5951 vec_vsubfp (vector float a1, vector float a2)
5952 {
5953   return (vector float) __builtin_altivec_vsubfp ((vector float) a1, (vector float) a2);
5954 }
5955
5956 /* vec_vsubuwm */
5957
5958 inline vector signed int
5959 vec_vsubuwm (vector bool int a1, vector signed int a2)
5960 {
5961   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5962 }
5963
5964 inline vector signed int
5965 vec_vsubuwm (vector signed int a1, vector bool int a2)
5966 {
5967   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5968 }
5969
5970 inline vector signed int
5971 vec_vsubuwm (vector signed int a1, vector signed int a2)
5972 {
5973   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5974 }
5975
5976 inline vector unsigned int
5977 vec_vsubuwm (vector bool int a1, vector unsigned int a2)
5978 {
5979   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5980 }
5981
5982 inline vector unsigned int
5983 vec_vsubuwm (vector unsigned int a1, vector bool int a2)
5984 {
5985   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5986 }
5987
5988 inline vector unsigned int
5989 vec_vsubuwm (vector unsigned int a1, vector unsigned int a2)
5990 {
5991   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5992 }
5993
5994 /* vec_vsubuhm */
5995
5996 inline vector signed short
5997 vec_vsubuhm (vector bool short a1, vector signed short a2)
5998 {
5999   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6000 }
6001
6002 inline vector signed short
6003 vec_vsubuhm (vector signed short a1, vector bool short a2)
6004 {
6005   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6006 }
6007
6008 inline vector signed short
6009 vec_vsubuhm (vector signed short a1, vector signed short a2)
6010 {
6011   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6012 }
6013
6014 inline vector unsigned short
6015 vec_vsubuhm (vector bool short a1, vector unsigned short a2)
6016 {
6017   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6018 }
6019
6020 inline vector unsigned short
6021 vec_vsubuhm (vector unsigned short a1, vector bool short a2)
6022 {
6023   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6024 }
6025
6026 inline vector unsigned short
6027 vec_vsubuhm (vector unsigned short a1, vector unsigned short a2)
6028 {
6029   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
6030 }
6031
6032 /* vec_vsububm */
6033
6034 inline vector signed char
6035 vec_vsububm (vector bool char a1, vector signed char a2)
6036 {
6037   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6038 }
6039
6040 inline vector signed char
6041 vec_vsububm (vector signed char a1, vector bool char a2)
6042 {
6043   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6044 }
6045
6046 inline vector signed char
6047 vec_vsububm (vector signed char a1, vector signed char a2)
6048 {
6049   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6050 }
6051
6052 inline vector unsigned char
6053 vec_vsububm (vector bool char a1, vector unsigned char a2)
6054 {
6055   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6056 }
6057
6058 inline vector unsigned char
6059 vec_vsububm (vector unsigned char a1, vector bool char a2)
6060 {
6061   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6062 }
6063
6064 inline vector unsigned char
6065 vec_vsububm (vector unsigned char a1, vector unsigned char a2)
6066 {
6067   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
6068 }
6069
6070 /* vec_subc */
6071
6072 inline vector unsigned int
6073 vec_subc (vector unsigned int a1, vector unsigned int a2)
6074 {
6075   return (vector unsigned int) __builtin_altivec_vsubcuw ((vector signed int) a1, (vector signed int) a2);
6076 }
6077
6078 /* vec_subs */
6079
6080 inline vector unsigned char
6081 vec_subs (vector bool char a1, vector unsigned char a2)
6082 {
6083   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6084 }
6085
6086 inline vector unsigned char
6087 vec_subs (vector unsigned char a1, vector bool char a2)
6088 {
6089   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6090 }
6091
6092 inline vector unsigned char
6093 vec_subs (vector unsigned char a1, vector unsigned char a2)
6094 {
6095   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6096 }
6097
6098 inline vector signed char
6099 vec_subs (vector bool char a1, vector signed char a2)
6100 {
6101   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6102 }
6103
6104 inline vector signed char
6105 vec_subs (vector signed char a1, vector bool char a2)
6106 {
6107   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6108 }
6109
6110 inline vector signed char
6111 vec_subs (vector signed char a1, vector signed char a2)
6112 {
6113   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6114 }
6115
6116 inline vector unsigned short
6117 vec_subs (vector bool short a1, vector unsigned short a2)
6118 {
6119   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6120 }
6121
6122 inline vector unsigned short
6123 vec_subs (vector unsigned short a1, vector bool short a2)
6124 {
6125   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6126 }
6127
6128 inline vector unsigned short
6129 vec_subs (vector unsigned short a1, vector unsigned short a2)
6130 {
6131   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6132 }
6133
6134 inline vector signed short
6135 vec_subs (vector bool short a1, vector signed short a2)
6136 {
6137   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6138 }
6139
6140 inline vector signed short
6141 vec_subs (vector signed short a1, vector bool short a2)
6142 {
6143   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6144 }
6145
6146 inline vector signed short
6147 vec_subs (vector signed short a1, vector signed short a2)
6148 {
6149   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6150 }
6151
6152 inline vector unsigned int
6153 vec_subs (vector bool int a1, vector unsigned int a2)
6154 {
6155   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6156 }
6157
6158 inline vector unsigned int
6159 vec_subs (vector unsigned int a1, vector bool int a2)
6160 {
6161   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6162 }
6163
6164 inline vector unsigned int
6165 vec_subs (vector unsigned int a1, vector unsigned int a2)
6166 {
6167   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6168 }
6169
6170 inline vector signed int
6171 vec_subs (vector bool int a1, vector signed int a2)
6172 {
6173   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6174 }
6175
6176 inline vector signed int
6177 vec_subs (vector signed int a1, vector bool int a2)
6178 {
6179   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6180 }
6181
6182 inline vector signed int
6183 vec_subs (vector signed int a1, vector signed int a2)
6184 {
6185   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6186 }
6187
6188 /* vec_vsubsws */
6189
6190 inline vector signed int
6191 vec_vsubsws (vector bool int a1, vector signed int a2)
6192 {
6193   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6194 }
6195
6196 inline vector signed int
6197 vec_vsubsws (vector signed int a1, vector bool int a2)
6198 {
6199   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6200 }
6201
6202 inline vector signed int
6203 vec_vsubsws (vector signed int a1, vector signed int a2)
6204 {
6205   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
6206 }
6207
6208 /* vec_vsubuws */
6209
6210 inline vector unsigned int
6211 vec_vsubuws (vector bool int a1, vector unsigned int a2)
6212 {
6213   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6214 }
6215
6216 inline vector unsigned int
6217 vec_vsubuws (vector unsigned int a1, vector bool int a2)
6218 {
6219   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6220 }
6221
6222 inline vector unsigned int
6223 vec_vsubuws (vector unsigned int a1, vector unsigned int a2)
6224 {
6225   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
6226 }
6227
6228 /* vec_vsubshs */
6229
6230 inline vector signed short
6231 vec_vsubshs (vector bool short a1, vector signed short a2)
6232 {
6233   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6234 }
6235
6236 inline vector signed short
6237 vec_vsubshs (vector signed short a1, vector bool short a2)
6238 {
6239   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6240 }
6241
6242 inline vector signed short
6243 vec_vsubshs (vector signed short a1, vector signed short a2)
6244 {
6245   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
6246 }
6247
6248 /* vec_vsubuhs */
6249
6250 inline vector unsigned short
6251 vec_vsubuhs (vector bool short a1, vector unsigned short a2)
6252 {
6253   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6254 }
6255
6256 inline vector unsigned short
6257 vec_vsubuhs (vector unsigned short a1, vector bool short a2)
6258 {
6259   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6260 }
6261
6262 inline vector unsigned short
6263 vec_vsubuhs (vector unsigned short a1, vector unsigned short a2)
6264 {
6265   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
6266 }
6267
6268 /* vec_vsubsbs */
6269
6270 inline vector signed char
6271 vec_vsubsbs (vector bool char a1, vector signed char a2)
6272 {
6273   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6274 }
6275
6276 inline vector signed char
6277 vec_vsubsbs (vector signed char a1, vector bool char a2)
6278 {
6279   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6280 }
6281
6282 inline vector signed char
6283 vec_vsubsbs (vector signed char a1, vector signed char a2)
6284 {
6285   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
6286 }
6287
6288 /* vec_vsububs */
6289
6290 inline vector unsigned char
6291 vec_vsububs (vector bool char a1, vector unsigned char a2)
6292 {
6293   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6294 }
6295
6296 inline vector unsigned char
6297 vec_vsububs (vector unsigned char a1, vector bool char a2)
6298 {
6299   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6300 }
6301
6302 inline vector unsigned char
6303 vec_vsububs (vector unsigned char a1, vector unsigned char a2)
6304 {
6305   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
6306 }
6307
6308 /* vec_sum4s */
6309
6310 inline vector unsigned int
6311 vec_sum4s (vector unsigned char a1, vector unsigned int a2)
6312 {
6313   return (vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) a1, (vector signed int) a2);
6314 }
6315
6316 inline vector signed int
6317 vec_sum4s (vector signed char a1, vector signed int a2)
6318 {
6319   return (vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) a1, (vector signed int) a2);
6320 }
6321
6322 inline vector signed int
6323 vec_sum4s (vector signed short a1, vector signed int a2)
6324 {
6325   return (vector signed int) __builtin_altivec_vsum4shs ((vector signed short) a1, (vector signed int) a2);
6326 }
6327
6328 /* vec_vsum4shs */
6329
6330 inline vector signed int
6331 vec_vsum4shs (vector signed short a1, vector signed int a2)
6332 {
6333   return (vector signed int) __builtin_altivec_vsum4shs ((vector signed short) a1, (vector signed int) a2);
6334 }
6335
6336 /* vec_vsum4sbs */
6337
6338 inline vector signed int
6339 vec_vsum4sbs (vector signed char a1, vector signed int a2)
6340 {
6341   return (vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) a1, (vector signed int) a2);
6342 }
6343
6344 /* vec_vsum4ubs */
6345
6346 inline vector unsigned int
6347 vec_vsum4ubs (vector unsigned char a1, vector unsigned int a2)
6348 {
6349   return (vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) a1, (vector signed int) a2);
6350 }
6351
6352 /* vec_sum2s */
6353
6354 inline vector signed int
6355 vec_sum2s (vector signed int a1, vector signed int a2)
6356 {
6357   return (vector signed int) __builtin_altivec_vsum2sws ((vector signed int) a1, (vector signed int) a2);
6358 }
6359
6360 /* vec_sums */
6361
6362 inline vector signed int
6363 vec_sums (vector signed int a1, vector signed int a2)
6364 {
6365   return (vector signed int) __builtin_altivec_vsumsws ((vector signed int) a1, (vector signed int) a2);
6366 }
6367
6368 /* vec_trunc */
6369
6370 inline vector float
6371 vec_trunc (vector float a1)
6372 {
6373   return (vector float) __builtin_altivec_vrfiz ((vector float) a1);
6374 }
6375
6376 /* vec_unpackh */
6377
6378 inline vector signed short
6379 vec_unpackh (vector signed char a1)
6380 {
6381   return (vector signed short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6382 }
6383
6384 inline vector bool short
6385 vec_unpackh (vector bool char a1)
6386 {
6387   return (vector bool short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6388 }
6389
6390 inline vector signed int
6391 vec_unpackh (vector signed short a1)
6392 {
6393   return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6394 }
6395
6396 inline vector bool int
6397 vec_unpackh (vector bool short a1)
6398 {
6399   return (vector bool int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6400 }
6401
6402 inline vector unsigned int
6403 vec_unpackh (vector pixel a1)
6404 {
6405   return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1);
6406 }
6407
6408 /* vec_vupkhsh */
6409
6410 inline vector bool int
6411 vec_vupkhsh (vector bool short a1)
6412 {
6413   return (vector bool int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6414 }
6415
6416 inline vector signed int
6417 vec_vupkhsh (vector signed short a1)
6418 {
6419   return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6420 }
6421
6422 /* vec_vupkhpx */
6423
6424 inline vector unsigned int
6425 vec_vupkhpx (vector pixel a1)
6426 {
6427   return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1);
6428 }
6429
6430 /* vec_vupkhsb */
6431
6432 inline vector bool short
6433 vec_vupkhsb (vector bool char a1)
6434 {
6435   return (vector bool short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6436 }
6437
6438 inline vector signed short
6439 vec_vupkhsb (vector signed char a1)
6440 {
6441   return (vector signed short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6442 }
6443
6444 /* vec_unpackl */
6445
6446 inline vector signed short
6447 vec_unpackl (vector signed char a1)
6448 {
6449   return (vector signed short) __builtin_altivec_vupklsb ((vector signed char) a1);
6450 }
6451
6452 inline vector bool short
6453 vec_unpackl (vector bool char a1)
6454 {
6455   return (vector bool short) __builtin_altivec_vupklsb ((vector signed char) a1);
6456 }
6457
6458 inline vector unsigned int
6459 vec_unpackl (vector pixel a1)
6460 {
6461   return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1);
6462 }
6463
6464 inline vector signed int
6465 vec_unpackl (vector signed short a1)
6466 {
6467   return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1);
6468 }
6469
6470 inline vector bool int
6471 vec_unpackl (vector bool short a1)
6472 {
6473   return (vector bool int) __builtin_altivec_vupklsh ((vector signed short) a1);
6474 }
6475
6476 /* vec_vupklpx */
6477
6478 inline vector unsigned int
6479 vec_vupklpx (vector pixel a1)
6480 {
6481   return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1);
6482 }
6483
6484 /* vec_upklsh */
6485
6486 inline vector bool int
6487 vec_vupklsh (vector bool short a1)
6488 {
6489   return (vector bool int) __builtin_altivec_vupklsh ((vector signed short) a1);
6490 }
6491
6492 inline vector signed int
6493 vec_vupklsh (vector signed short a1)
6494 {
6495   return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1);
6496 }
6497
6498 /* vec_vupklsb */
6499
6500 inline vector bool short
6501 vec_vupklsb (vector bool char a1)
6502 {
6503   return (vector bool short) __builtin_altivec_vupklsb ((vector signed char) a1);
6504 }
6505
6506 inline vector signed short
6507 vec_vupklsb (vector signed char a1)
6508 {
6509   return (vector signed short) __builtin_altivec_vupklsb ((vector signed char) a1);
6510 }
6511
6512 /* vec_xor */
6513
6514 inline vector float
6515 vec_xor (vector float a1, vector float a2)
6516 {
6517   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6518 }
6519
6520 inline vector float
6521 vec_xor (vector float a1, vector bool int a2)
6522 {
6523   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6524 }
6525
6526 inline vector float
6527 vec_xor (vector bool int a1, vector float a2)
6528 {
6529   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6530 }
6531
6532 inline vector bool int
6533 vec_xor (vector bool int a1, vector bool int a2)
6534 {
6535   return (vector bool int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6536 }
6537
6538 inline vector signed int
6539 vec_xor (vector bool int a1, vector signed int a2)
6540 {
6541   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6542 }
6543
6544 inline vector signed int
6545 vec_xor (vector signed int a1, vector bool int a2)
6546 {
6547   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6548 }
6549
6550 inline vector signed int
6551 vec_xor (vector signed int a1, vector signed int a2)
6552 {
6553   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6554 }
6555
6556 inline vector unsigned int
6557 vec_xor (vector bool int a1, vector unsigned int a2)
6558 {
6559   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6560 }
6561
6562 inline vector unsigned int
6563 vec_xor (vector unsigned int a1, vector bool int a2)
6564 {
6565   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6566 }
6567
6568 inline vector unsigned int
6569 vec_xor (vector unsigned int a1, vector unsigned int a2)
6570 {
6571   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6572 }
6573
6574 inline vector bool short
6575 vec_xor (vector bool short a1, vector bool short a2)
6576 {
6577   return (vector bool short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6578 }
6579
6580 inline vector signed short
6581 vec_xor (vector bool short a1, vector signed short a2)
6582 {
6583   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6584 }
6585
6586 inline vector signed short
6587 vec_xor (vector signed short a1, vector bool short a2)
6588 {
6589   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6590 }
6591
6592 inline vector signed short
6593 vec_xor (vector signed short a1, vector signed short a2)
6594 {
6595   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6596 }
6597
6598 inline vector unsigned short
6599 vec_xor (vector bool short a1, vector unsigned short a2)
6600 {
6601   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6602 }
6603
6604 inline vector unsigned short
6605 vec_xor (vector unsigned short a1, vector bool short a2)
6606 {
6607   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6608 }
6609
6610 inline vector unsigned short
6611 vec_xor (vector unsigned short a1, vector unsigned short a2)
6612 {
6613   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6614 }
6615
6616 inline vector signed char
6617 vec_xor (vector bool char a1, vector signed char a2)
6618 {
6619   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6620 }
6621
6622 inline vector bool char
6623 vec_xor (vector bool char a1, vector bool char a2)
6624 {
6625   return (vector bool char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6626 }
6627
6628 inline vector signed char
6629 vec_xor (vector signed char a1, vector bool char a2)
6630 {
6631   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6632 }
6633
6634 inline vector signed char
6635 vec_xor (vector signed char a1, vector signed char a2)
6636 {
6637   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6638 }
6639
6640 inline vector unsigned char
6641 vec_xor (vector bool char a1, vector unsigned char a2)
6642 {
6643   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6644 }
6645
6646 inline vector unsigned char
6647 vec_xor (vector unsigned char a1, vector bool char a2)
6648 {
6649   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6650 }
6651
6652 inline vector unsigned char
6653 vec_xor (vector unsigned char a1, vector unsigned char a2)
6654 {
6655   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6656 }
6657
6658 /* vec_all_eq */
6659
6660 inline int
6661 vec_all_eq (vector signed char a1, vector bool char a2)
6662 {
6663   return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, (vector signed char) a2);
6664 }
6665
6666 inline int
6667 vec_all_eq (vector signed char a1, vector signed char a2)
6668 {
6669   return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, a2);
6670 }
6671
6672 inline int
6673 vec_all_eq (vector unsigned char a1, vector bool char a2)
6674 {
6675   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6676 }
6677
6678 inline int
6679 vec_all_eq (vector unsigned char a1, vector unsigned char a2)
6680 {
6681   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6682 }
6683
6684 inline int
6685 vec_all_eq (vector bool char a1, vector bool char a2)
6686 {
6687   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6688 }
6689
6690 inline int
6691 vec_all_eq (vector bool char a1, vector unsigned char a2)
6692 {
6693   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6694 }
6695
6696 inline int
6697 vec_all_eq (vector bool char a1, vector signed char a2)
6698 {
6699   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6700 }
6701
6702 inline int
6703 vec_all_eq (vector signed short a1, vector bool short a2)
6704 {
6705   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6706 }
6707
6708 inline int
6709 vec_all_eq (vector signed short a1, vector signed short a2)
6710 {
6711   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6712 }
6713
6714 inline int
6715 vec_all_eq (vector unsigned short a1, vector bool short a2)
6716 {
6717   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6718 }
6719
6720 inline int
6721 vec_all_eq (vector unsigned short a1, vector unsigned short a2)
6722 {
6723   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6724 }
6725
6726 inline int
6727 vec_all_eq (vector bool short a1, vector bool short a2)
6728 {
6729   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6730 }
6731
6732 inline int
6733 vec_all_eq (vector bool short a1, vector unsigned short a2)
6734 {
6735   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6736 }
6737
6738 inline int
6739 vec_all_eq (vector bool short a1, vector signed short a2)
6740 {
6741   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6742 }
6743
6744 inline int
6745 vec_all_eq (vector pixel a1, vector pixel a2)
6746 {
6747   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6748 }
6749
6750 inline int
6751 vec_all_eq (vector signed int a1, vector bool int a2)
6752 {
6753   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6754 }
6755
6756 inline int
6757 vec_all_eq (vector signed int a1, vector signed int a2)
6758 {
6759   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6760 }
6761
6762 inline int
6763 vec_all_eq (vector unsigned int a1, vector bool int a2)
6764 {
6765   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6766 }
6767
6768 inline int
6769 vec_all_eq (vector unsigned int a1, vector unsigned int a2)
6770 {
6771   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6772 }
6773
6774 inline int
6775 vec_all_eq (vector bool int a1, vector bool int a2)
6776 {
6777   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6778 }
6779
6780 inline int
6781 vec_all_eq (vector bool int a1, vector unsigned int a2)
6782 {
6783   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6784 }
6785
6786 inline int
6787 vec_all_eq (vector bool int a1, vector signed int a2)
6788 {
6789   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6790 }
6791
6792 inline int
6793 vec_all_eq (vector float a1, vector float a2)
6794 {
6795   return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a2);
6796 }
6797
6798 /* vec_all_ge */
6799
6800 inline int
6801 vec_all_ge (vector bool char a1, vector unsigned char a2)
6802 {
6803   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6804 }
6805
6806 inline int
6807 vec_all_ge (vector unsigned char a1, vector bool char a2)
6808 {
6809   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6810 }
6811
6812 inline int
6813 vec_all_ge (vector unsigned char a1, vector unsigned char a2)
6814 {
6815   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6816 }
6817
6818 inline int
6819 vec_all_ge (vector bool char a1, vector signed char a2)
6820 {
6821   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6822 }
6823
6824 inline int
6825 vec_all_ge (vector signed char a1, vector bool char a2)
6826 {
6827   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6828 }
6829
6830 inline int
6831 vec_all_ge (vector signed char a1, vector signed char a2)
6832 {
6833   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6834 }
6835
6836 inline int
6837 vec_all_ge (vector bool short a1, vector unsigned short a2)
6838 {
6839   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6840 }
6841
6842 inline int
6843 vec_all_ge (vector unsigned short a1, vector bool short a2)
6844 {
6845   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6846 }
6847
6848 inline int
6849 vec_all_ge (vector unsigned short a1, vector unsigned short a2)
6850 {
6851   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6852 }
6853
6854 inline int
6855 vec_all_ge (vector signed short a1, vector signed short a2)
6856 {
6857   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6858 }
6859
6860 inline int
6861 vec_all_ge (vector bool short a1, vector signed short a2)
6862 {
6863   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6864 }
6865
6866 inline int
6867 vec_all_ge (vector signed short a1, vector bool short a2)
6868 {
6869   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6870 }
6871
6872 inline int
6873 vec_all_ge (vector bool int a1, vector unsigned int a2)
6874 {
6875   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6876 }
6877
6878 inline int
6879 vec_all_ge (vector unsigned int a1, vector bool int a2)
6880 {
6881   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6882 }
6883
6884 inline int
6885 vec_all_ge (vector unsigned int a1, vector unsigned int a2)
6886 {
6887   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6888 }
6889
6890 inline int
6891 vec_all_ge (vector bool int a1, vector signed int a2)
6892 {
6893   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6894 }
6895
6896 inline int
6897 vec_all_ge (vector signed int a1, vector bool int a2)
6898 {
6899   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6900 }
6901
6902 inline int
6903 vec_all_ge (vector signed int a1, vector signed int a2)
6904 {
6905   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6906 }
6907
6908 inline int
6909 vec_all_ge (vector float a1, vector float a2)
6910 {
6911   return __builtin_altivec_vcmpgefp_p (__CR6_LT, a1, a2);
6912 }
6913
6914 /* vec_all_gt */
6915
6916 inline int
6917 vec_all_gt (vector bool char a1, vector unsigned char a2)
6918 {
6919   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6920 }
6921
6922 inline int
6923 vec_all_gt (vector unsigned char a1, vector bool char a2)
6924 {
6925   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6926 }
6927
6928 inline int
6929 vec_all_gt (vector unsigned char a1, vector unsigned char a2)
6930 {
6931   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6932 }
6933
6934 inline int
6935 vec_all_gt (vector bool char a1, vector signed char a2)
6936 {
6937   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6938 }
6939
6940 inline int
6941 vec_all_gt (vector signed char a1, vector bool char a2)
6942 {
6943   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6944 }
6945
6946 inline int
6947 vec_all_gt (vector signed char a1, vector signed char a2)
6948 {
6949   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6950 }
6951
6952 inline int
6953 vec_all_gt (vector bool short a1, vector unsigned short a2)
6954 {
6955   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6956 }
6957
6958 inline int
6959 vec_all_gt (vector unsigned short a1, vector bool short a2)
6960 {
6961   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6962 }
6963
6964 inline int
6965 vec_all_gt (vector unsigned short a1, vector unsigned short a2)
6966 {
6967   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6968 }
6969
6970 inline int
6971 vec_all_gt (vector bool short a1, vector signed short a2)
6972 {
6973   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6974 }
6975
6976 inline int
6977 vec_all_gt (vector signed short a1, vector bool short a2)
6978 {
6979   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6980 }
6981
6982 inline int
6983 vec_all_gt (vector signed short a1, vector signed short a2)
6984 {
6985   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6986 }
6987
6988 inline int
6989 vec_all_gt (vector bool int a1, vector unsigned int a2)
6990 {
6991   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6992 }
6993
6994 inline int
6995 vec_all_gt (vector unsigned int a1, vector bool int a2)
6996 {
6997   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6998 }
6999
7000 inline int
7001 vec_all_gt (vector unsigned int a1, vector unsigned int a2)
7002 {
7003   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
7004 }
7005
7006 inline int
7007 vec_all_gt (vector bool int a1, vector signed int a2)
7008 {
7009   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
7010 }
7011
7012 inline int
7013 vec_all_gt (vector signed int a1, vector bool int a2)
7014 {
7015   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
7016 }
7017
7018 inline int
7019 vec_all_gt (vector signed int a1, vector signed int a2)
7020 {
7021   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
7022 }
7023
7024 inline int
7025 vec_all_gt (vector float a1, vector float a2)
7026 {
7027   return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a1, a2);
7028 }
7029
7030 /* vec_all_in */
7031
7032 inline int
7033 vec_all_in (vector float a1, vector float a2)
7034 {
7035   return __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2);
7036 }
7037
7038 /* vec_all_le */
7039
7040 inline int
7041 vec_all_le (vector bool char a1, vector unsigned char a2)
7042 {
7043   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7044 }
7045
7046 inline int
7047 vec_all_le (vector unsigned char a1, vector bool char a2)
7048 {
7049   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7050 }
7051
7052 inline int
7053 vec_all_le (vector unsigned char a1, vector unsigned char a2)
7054 {
7055   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7056 }
7057
7058 inline int
7059 vec_all_le (vector bool char a1, vector signed char a2)
7060 {
7061   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7062 }
7063
7064 inline int
7065 vec_all_le (vector signed char a1, vector bool char a2)
7066 {
7067   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7068 }
7069
7070 inline int
7071 vec_all_le (vector signed char a1, vector signed char a2)
7072 {
7073   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7074 }
7075
7076 inline int
7077 vec_all_le (vector bool short a1, vector unsigned short a2)
7078 {
7079   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7080 }
7081
7082 inline int
7083 vec_all_le (vector unsigned short a1, vector bool short a2)
7084 {
7085   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7086 }
7087
7088 inline int
7089 vec_all_le (vector unsigned short a1, vector unsigned short a2)
7090 {
7091   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7092 }
7093
7094 inline int
7095 vec_all_le (vector bool short a1, vector signed short a2)
7096 {
7097   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7098 }
7099
7100 inline int
7101 vec_all_le (vector signed short a1, vector bool short a2)
7102 {
7103   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7104 }
7105
7106 inline int
7107 vec_all_le (vector signed short a1, vector signed short a2)
7108 {
7109   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7110 }
7111
7112 inline int
7113 vec_all_le (vector bool int a1, vector unsigned int a2)
7114 {
7115   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7116 }
7117
7118 inline int
7119 vec_all_le (vector unsigned int a1, vector bool int a2)
7120 {
7121   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7122 }
7123
7124 inline int
7125 vec_all_le (vector unsigned int a1, vector unsigned int a2)
7126 {
7127   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7128 }
7129
7130 inline int
7131 vec_all_le (vector bool int a1, vector signed int a2)
7132 {
7133   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7134 }
7135
7136 inline int
7137 vec_all_le (vector signed int a1, vector bool int a2)
7138 {
7139   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7140 }
7141
7142 inline int
7143 vec_all_le (vector signed int a1, vector signed int a2)
7144 {
7145   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7146 }
7147
7148 inline int
7149 vec_all_le (vector float a1, vector float a2)
7150 {
7151   return __builtin_altivec_vcmpgefp_p (__CR6_LT, a2, a1);
7152 }
7153
7154 /* vec_all_lt */
7155
7156 inline int
7157 vec_all_lt (vector bool char a1, vector unsigned char a2)
7158 {
7159   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7160 }
7161
7162 inline int
7163 vec_all_lt (vector unsigned char a1, vector bool char a2)
7164 {
7165   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7166 }
7167
7168 inline int
7169 vec_all_lt (vector unsigned char a1, vector unsigned char a2)
7170 {
7171   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7172 }
7173
7174 inline int
7175 vec_all_lt (vector bool char a1, vector signed char a2)
7176 {
7177   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7178 }
7179
7180 inline int
7181 vec_all_lt (vector signed char a1, vector bool char a2)
7182 {
7183   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7184 }
7185
7186 inline int
7187 vec_all_lt (vector signed char a1, vector signed char a2)
7188 {
7189   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
7190 }
7191
7192 inline int
7193 vec_all_lt (vector bool short a1, vector unsigned short a2)
7194 {
7195   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7196 }
7197
7198 inline int
7199 vec_all_lt (vector unsigned short a1, vector bool short a2)
7200 {
7201   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7202 }
7203
7204 inline int
7205 vec_all_lt (vector unsigned short a1, vector unsigned short a2)
7206 {
7207   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7208 }
7209
7210 inline int
7211 vec_all_lt (vector bool short a1, vector signed short a2)
7212 {
7213   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7214 }
7215
7216 inline int
7217 vec_all_lt (vector signed short a1, vector bool short a2)
7218 {
7219   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7220 }
7221
7222 inline int
7223 vec_all_lt (vector signed short a1, vector signed short a2)
7224 {
7225   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
7226 }
7227
7228 inline int
7229 vec_all_lt (vector bool int a1, vector unsigned int a2)
7230 {
7231   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7232 }
7233
7234 inline int
7235 vec_all_lt (vector unsigned int a1, vector bool int a2)
7236 {
7237   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7238 }
7239
7240 inline int
7241 vec_all_lt (vector unsigned int a1, vector unsigned int a2)
7242 {
7243   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7244 }
7245
7246 inline int
7247 vec_all_lt (vector bool int a1, vector signed int a2)
7248 {
7249   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7250 }
7251
7252 inline int
7253 vec_all_lt (vector signed int a1, vector bool int a2)
7254 {
7255   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7256 }
7257
7258 inline int
7259 vec_all_lt (vector signed int a1, vector signed int a2)
7260 {
7261   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
7262 }
7263
7264 inline int
7265 vec_all_lt (vector float a1, vector float a2)
7266 {
7267   return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a2, a1);
7268 }
7269
7270 /* vec_all_nan */
7271
7272 inline int
7273 vec_all_nan (vector float a1)
7274 {
7275   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1);
7276 }
7277
7278 /* vec_all_ne */
7279
7280 inline int
7281 vec_all_ne (vector signed char a1, vector bool char a2)
7282 {
7283   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7284 }
7285
7286 inline int
7287 vec_all_ne (vector signed char a1, vector signed char a2)
7288 {
7289   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7290 }
7291
7292 inline int
7293 vec_all_ne (vector unsigned char a1, vector bool char a2)
7294 {
7295   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7296 }
7297
7298 inline int
7299 vec_all_ne (vector unsigned char a1, vector unsigned char a2)
7300 {
7301   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7302 }
7303
7304 inline int
7305 vec_all_ne (vector bool char a1, vector bool char a2)
7306 {
7307   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7308 }
7309
7310 inline int
7311 vec_all_ne (vector bool char a1, vector unsigned char a2)
7312 {
7313   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7314 }
7315
7316 inline int
7317 vec_all_ne (vector bool char a1, vector signed char a2)
7318 {
7319   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
7320 }
7321
7322 inline int
7323 vec_all_ne (vector signed short a1, vector bool short a2)
7324 {
7325   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7326 }
7327
7328 inline int
7329 vec_all_ne (vector signed short a1, vector signed short a2)
7330 {
7331   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7332 }
7333
7334 inline int
7335 vec_all_ne (vector unsigned short a1, vector bool short a2)
7336 {
7337   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7338 }
7339
7340 inline int
7341 vec_all_ne (vector unsigned short a1, vector unsigned short a2)
7342 {
7343   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7344 }
7345
7346 inline int
7347 vec_all_ne (vector bool short a1, vector bool short a2)
7348 {
7349   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7350 }
7351
7352 inline int
7353 vec_all_ne (vector bool short a1, vector unsigned short a2)
7354 {
7355   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7356 }
7357
7358 inline int
7359 vec_all_ne (vector bool short a1, vector signed short a2)
7360 {
7361   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7362 }
7363
7364 inline int
7365 vec_all_ne (vector pixel a1, vector pixel a2)
7366 {
7367   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
7368 }
7369
7370 inline int
7371 vec_all_ne (vector signed int a1, vector bool int a2)
7372 {
7373   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7374 }
7375
7376 inline int
7377 vec_all_ne (vector signed int a1, vector signed int a2)
7378 {
7379   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7380 }
7381
7382 inline int
7383 vec_all_ne (vector unsigned int a1, vector bool int a2)
7384 {
7385   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7386 }
7387
7388 inline int
7389 vec_all_ne (vector unsigned int a1, vector unsigned int a2)
7390 {
7391   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7392 }
7393
7394 inline int
7395 vec_all_ne (vector bool int a1, vector bool int a2)
7396 {
7397   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7398 }
7399
7400 inline int
7401 vec_all_ne (vector bool int a1, vector unsigned int a2)
7402 {
7403   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7404 }
7405
7406 inline int
7407 vec_all_ne (vector bool int a1, vector signed int a2)
7408 {
7409   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7410 }
7411
7412 inline int
7413 vec_all_ne (vector float a1, vector float a2)
7414 {
7415   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a2);
7416 }
7417
7418 /* vec_all_nge */
7419
7420 inline int
7421 vec_all_nge (vector float a1, vector float a2)
7422 {
7423   return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2);
7424 }
7425
7426 /* vec_all_ngt */
7427
7428 inline int
7429 vec_all_ngt (vector float a1, vector float a2)
7430 {
7431   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2);
7432 }
7433
7434 /* vec_all_nle */
7435
7436 inline int
7437 vec_all_nle (vector float a1, vector float a2)
7438 {
7439   return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1);
7440 }
7441
7442 /* vec_all_nlt */
7443
7444 inline int
7445 vec_all_nlt (vector float a1, vector float a2)
7446 {
7447   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1);
7448 }
7449
7450 /* vec_all_numeric */
7451
7452 inline int
7453 vec_all_numeric (vector float a1)
7454 {
7455   return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1);
7456 }
7457
7458 /* vec_any_eq */
7459
7460 inline int
7461 vec_any_eq (vector signed char a1, vector bool char a2)
7462 {
7463   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7464 }
7465
7466 inline int
7467 vec_any_eq (vector signed char a1, vector signed char a2)
7468 {
7469   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7470 }
7471
7472 inline int
7473 vec_any_eq (vector unsigned char a1, vector bool char a2)
7474 {
7475   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7476 }
7477
7478 inline int
7479 vec_any_eq (vector unsigned char a1, vector unsigned char a2)
7480 {
7481   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7482 }
7483
7484 inline int
7485 vec_any_eq (vector bool char a1, vector bool char a2)
7486 {
7487   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7488 }
7489
7490 inline int
7491 vec_any_eq (vector bool char a1, vector unsigned char a2)
7492 {
7493   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7494 }
7495
7496 inline int
7497 vec_any_eq (vector bool char a1, vector signed char a2)
7498 {
7499   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7500 }
7501
7502 inline int
7503 vec_any_eq (vector signed short a1, vector bool short a2)
7504 {
7505   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7506 }
7507
7508 inline int
7509 vec_any_eq (vector signed short a1, vector signed short a2)
7510 {
7511   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7512 }
7513
7514 inline int
7515 vec_any_eq (vector unsigned short a1, vector bool short a2)
7516 {
7517   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7518 }
7519
7520 inline int
7521 vec_any_eq (vector unsigned short a1, vector unsigned short a2)
7522 {
7523   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7524 }
7525
7526 inline int
7527 vec_any_eq (vector bool short a1, vector bool short a2)
7528 {
7529   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7530 }
7531
7532 inline int
7533 vec_any_eq (vector bool short a1, vector unsigned short a2)
7534 {
7535   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7536 }
7537
7538 inline int
7539 vec_any_eq (vector bool short a1, vector signed short a2)
7540 {
7541   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7542 }
7543
7544 inline int
7545 vec_any_eq (vector pixel a1, vector pixel a2)
7546 {
7547   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7548 }
7549
7550 inline int
7551 vec_any_eq (vector signed int a1, vector bool int a2)
7552 {
7553   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7554 }
7555
7556 inline int
7557 vec_any_eq (vector signed int a1, vector signed int a2)
7558 {
7559   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7560 }
7561
7562 inline int
7563 vec_any_eq (vector unsigned int a1, vector bool int a2)
7564 {
7565   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7566 }
7567
7568 inline int
7569 vec_any_eq (vector unsigned int a1, vector unsigned int a2)
7570 {
7571   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7572 }
7573
7574 inline int
7575 vec_any_eq (vector bool int a1, vector bool int a2)
7576 {
7577   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7578 }
7579
7580 inline int
7581 vec_any_eq (vector bool int a1, vector unsigned int a2)
7582 {
7583   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7584 }
7585
7586 inline int
7587 vec_any_eq (vector bool int a1, vector signed int a2)
7588 {
7589   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7590 }
7591
7592 inline int
7593 vec_any_eq (vector float a1, vector float a2)
7594 {
7595   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a2);
7596 }
7597
7598 /* vec_any_ge */
7599
7600 inline int
7601 vec_any_ge (vector signed char a1, vector bool char a2)
7602 {
7603   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7604 }
7605
7606 inline int
7607 vec_any_ge (vector unsigned char a1, vector bool char a2)
7608 {
7609   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7610 }
7611
7612 inline int
7613 vec_any_ge (vector unsigned char a1, vector unsigned char a2)
7614 {
7615   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7616 }
7617
7618 inline int
7619 vec_any_ge (vector signed char a1, vector signed char a2)
7620 {
7621   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7622 }
7623
7624 inline int
7625 vec_any_ge (vector bool char a1, vector unsigned char a2)
7626 {
7627   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7628 }
7629
7630 inline int
7631 vec_any_ge (vector bool char a1, vector signed char a2)
7632 {
7633   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7634 }
7635
7636 inline int
7637 vec_any_ge (vector unsigned short a1, vector bool short a2)
7638 {
7639   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7640 }
7641
7642 inline int
7643 vec_any_ge (vector unsigned short a1, vector unsigned short a2)
7644 {
7645   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7646 }
7647
7648 inline int
7649 vec_any_ge (vector signed short a1, vector signed short a2)
7650 {
7651   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7652 }
7653
7654 inline int
7655 vec_any_ge (vector signed short a1, vector bool short a2)
7656 {
7657   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7658 }
7659
7660 inline int
7661 vec_any_ge (vector bool short a1, vector unsigned short a2)
7662 {
7663   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7664 }
7665
7666 inline int
7667 vec_any_ge (vector bool short a1, vector signed short a2)
7668 {
7669   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7670 }
7671
7672 inline int
7673 vec_any_ge (vector signed int a1, vector bool int a2)
7674 {
7675   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7676 }
7677
7678 inline int
7679 vec_any_ge (vector unsigned int a1, vector bool int a2)
7680 {
7681   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7682 }
7683
7684 inline int
7685 vec_any_ge (vector unsigned int a1, vector unsigned int a2)
7686 {
7687   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7688 }
7689
7690 inline int
7691 vec_any_ge (vector signed int a1, vector signed int a2)
7692 {
7693   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7694 }
7695
7696 inline int
7697 vec_any_ge (vector bool int a1, vector unsigned int a2)
7698 {
7699   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7700 }
7701
7702 inline int
7703 vec_any_ge (vector bool int a1, vector signed int a2)
7704 {
7705   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7706 }
7707
7708 inline int
7709 vec_any_ge (vector float a1, vector float a2)
7710 {
7711   return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a1, a2);
7712 }
7713
7714 /* vec_any_gt */
7715
7716 inline int
7717 vec_any_gt (vector bool char a1, vector unsigned char a2)
7718 {
7719   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7720 }
7721
7722 inline int
7723 vec_any_gt (vector unsigned char a1, vector bool char a2)
7724 {
7725   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7726 }
7727
7728 inline int
7729 vec_any_gt (vector unsigned char a1, vector unsigned char a2)
7730 {
7731   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7732 }
7733
7734 inline int
7735 vec_any_gt (vector bool char a1, vector signed char a2)
7736 {
7737   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7738 }
7739
7740 inline int
7741 vec_any_gt (vector signed char a1, vector bool char a2)
7742 {
7743   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7744 }
7745
7746 inline int
7747 vec_any_gt (vector signed char a1, vector signed char a2)
7748 {
7749   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7750 }
7751
7752 inline int
7753 vec_any_gt (vector bool short a1, vector unsigned short a2)
7754 {
7755   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7756 }
7757
7758 inline int
7759 vec_any_gt (vector unsigned short a1, vector bool short a2)
7760 {
7761   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7762 }
7763
7764 inline int
7765 vec_any_gt (vector unsigned short a1, vector unsigned short a2)
7766 {
7767   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7768 }
7769
7770 inline int
7771 vec_any_gt (vector bool short a1, vector signed short a2)
7772 {
7773   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7774 }
7775
7776 inline int
7777 vec_any_gt (vector signed short a1, vector bool short a2)
7778 {
7779   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7780 }
7781
7782 inline int
7783 vec_any_gt (vector signed short a1, vector signed short a2)
7784 {
7785   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7786 }
7787
7788 inline int
7789 vec_any_gt (vector bool int a1, vector unsigned int a2)
7790 {
7791   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7792 }
7793
7794 inline int
7795 vec_any_gt (vector unsigned int a1, vector bool int a2)
7796 {
7797   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7798 }
7799
7800 inline int
7801 vec_any_gt (vector unsigned int a1, vector unsigned int a2)
7802 {
7803   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7804 }
7805
7806 inline int
7807 vec_any_gt (vector bool int a1, vector signed int a2)
7808 {
7809   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7810 }
7811
7812 inline int
7813 vec_any_gt (vector signed int a1, vector bool int a2)
7814 {
7815   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7816 }
7817
7818 inline int
7819 vec_any_gt (vector signed int a1, vector signed int a2)
7820 {
7821   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7822 }
7823
7824 inline int
7825 vec_any_gt (vector float a1, vector float a2)
7826 {
7827   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a1, a2);
7828 }
7829
7830 /* vec_any_le */
7831
7832 inline int
7833 vec_any_le (vector bool char a1, vector unsigned char a2)
7834 {
7835   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7836 }
7837
7838 inline int
7839 vec_any_le (vector unsigned char a1, vector bool char a2)
7840 {
7841   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7842 }
7843
7844 inline int
7845 vec_any_le (vector unsigned char a1, vector unsigned char a2)
7846 {
7847   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7848 }
7849
7850 inline int
7851 vec_any_le (vector bool char a1, vector signed char a2)
7852 {
7853   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7854 }
7855
7856 inline int
7857 vec_any_le (vector signed char a1, vector bool char a2)
7858 {
7859   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7860 }
7861
7862 inline int
7863 vec_any_le (vector signed char a1, vector signed char a2)
7864 {
7865   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7866 }
7867
7868 inline int
7869 vec_any_le (vector bool short a1, vector unsigned short a2)
7870 {
7871   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7872 }
7873
7874 inline int
7875 vec_any_le (vector unsigned short a1, vector bool short a2)
7876 {
7877   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7878 }
7879
7880 inline int
7881 vec_any_le (vector unsigned short a1, vector unsigned short a2)
7882 {
7883   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7884 }
7885
7886 inline int
7887 vec_any_le (vector bool short a1, vector signed short a2)
7888 {
7889   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7890 }
7891
7892 inline int
7893 vec_any_le (vector signed short a1, vector bool short a2)
7894 {
7895   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7896 }
7897
7898 inline int
7899 vec_any_le (vector signed short a1, vector signed short a2)
7900 {
7901   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7902 }
7903
7904 inline int
7905 vec_any_le (vector bool int a1, vector unsigned int a2)
7906 {
7907   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7908 }
7909
7910 inline int
7911 vec_any_le (vector unsigned int a1, vector bool int a2)
7912 {
7913   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7914 }
7915
7916 inline int
7917 vec_any_le (vector unsigned int a1, vector unsigned int a2)
7918 {
7919   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7920 }
7921
7922 inline int
7923 vec_any_le (vector bool int a1, vector signed int a2)
7924 {
7925   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7926 }
7927
7928 inline int
7929 vec_any_le (vector signed int a1, vector bool int a2)
7930 {
7931   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7932 }
7933
7934 inline int
7935 vec_any_le (vector signed int a1, vector signed int a2)
7936 {
7937   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7938 }
7939
7940 inline int
7941 vec_any_le (vector float a1, vector float a2)
7942 {
7943   return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a2, a1);
7944 }
7945
7946 /* vec_any_lt */
7947
7948 inline int
7949 vec_any_lt (vector bool char a1, vector unsigned char a2)
7950 {
7951   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7952 }
7953
7954 inline int
7955 vec_any_lt (vector unsigned char a1, vector bool char a2)
7956 {
7957   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7958 }
7959
7960 inline int
7961 vec_any_lt (vector unsigned char a1, vector unsigned char a2)
7962 {
7963   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7964 }
7965
7966 inline int
7967 vec_any_lt (vector bool char a1, vector signed char a2)
7968 {
7969   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7970 }
7971
7972 inline int
7973 vec_any_lt (vector signed char a1, vector bool char a2)
7974 {
7975   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7976 }
7977
7978 inline int
7979 vec_any_lt (vector signed char a1, vector signed char a2)
7980 {
7981   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7982 }
7983
7984 inline int
7985 vec_any_lt (vector bool short a1, vector unsigned short a2)
7986 {
7987   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7988 }
7989
7990 inline int
7991 vec_any_lt (vector unsigned short a1, vector bool short a2)
7992 {
7993   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7994 }
7995
7996 inline int
7997 vec_any_lt (vector unsigned short a1, vector unsigned short a2)
7998 {
7999   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
8000 }
8001
8002 inline int
8003 vec_any_lt (vector bool short a1, vector signed short a2)
8004 {
8005   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
8006 }
8007
8008 inline int
8009 vec_any_lt (vector signed short a1, vector bool short a2)
8010 {
8011   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
8012 }
8013
8014 inline int
8015 vec_any_lt (vector signed short a1, vector signed short a2)
8016 {
8017   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
8018 }
8019
8020 inline int
8021 vec_any_lt (vector bool int a1, vector unsigned int a2)
8022 {
8023   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8024 }
8025
8026 inline int
8027 vec_any_lt (vector unsigned int a1, vector bool int a2)
8028 {
8029   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8030 }
8031
8032 inline int
8033 vec_any_lt (vector unsigned int a1, vector unsigned int a2)
8034 {
8035   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8036 }
8037
8038 inline int
8039 vec_any_lt (vector bool int a1, vector signed int a2)
8040 {
8041   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8042 }
8043
8044 inline int
8045 vec_any_lt (vector signed int a1, vector bool int a2)
8046 {
8047   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8048 }
8049
8050 inline int
8051 vec_any_lt (vector signed int a1, vector signed int a2)
8052 {
8053   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
8054 }
8055
8056 inline int
8057 vec_any_lt (vector float a1, vector float a2)
8058 {
8059   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a2, a1);
8060 }
8061
8062 /* vec_any_nan */
8063
8064 inline int
8065 vec_any_nan (vector float a1)
8066 {
8067   return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1);
8068 }
8069
8070 /* vec_any_ne */
8071
8072 inline int
8073 vec_any_ne (vector signed char a1, vector bool char a2)
8074 {
8075   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8076 }
8077
8078 inline int
8079 vec_any_ne (vector signed char a1, vector signed char a2)
8080 {
8081   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8082 }
8083
8084 inline int
8085 vec_any_ne (vector unsigned char a1, vector bool char a2)
8086 {
8087   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8088 }
8089
8090 inline int
8091 vec_any_ne (vector unsigned char a1, vector unsigned char a2)
8092 {
8093   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8094 }
8095
8096 inline int
8097 vec_any_ne (vector bool char a1, vector bool char a2)
8098 {
8099   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8100 }
8101
8102 inline int
8103 vec_any_ne (vector bool char a1, vector unsigned char a2)
8104 {
8105   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8106 }
8107
8108 inline int
8109 vec_any_ne (vector bool char a1, vector signed char a2)
8110 {
8111   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
8112 }
8113
8114 inline int
8115 vec_any_ne (vector signed short a1, vector bool short a2)
8116 {
8117   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8118 }
8119
8120 inline int
8121 vec_any_ne (vector signed short a1, vector signed short a2)
8122 {
8123   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8124 }
8125
8126 inline int
8127 vec_any_ne (vector unsigned short a1, vector bool short a2)
8128 {
8129   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8130 }
8131
8132 inline int
8133 vec_any_ne (vector unsigned short a1, vector unsigned short a2)
8134 {
8135   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8136 }
8137
8138 inline int
8139 vec_any_ne (vector bool short a1, vector bool short a2)
8140 {
8141   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8142 }
8143
8144 inline int
8145 vec_any_ne (vector bool short a1, vector unsigned short a2)
8146 {
8147   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8148 }
8149
8150 inline int
8151 vec_any_ne (vector bool short a1, vector signed short a2)
8152 {
8153   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8154 }
8155
8156 inline int
8157 vec_any_ne (vector pixel a1, vector pixel a2)
8158 {
8159   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
8160 }
8161
8162 inline int
8163 vec_any_ne (vector signed int a1, vector bool int a2)
8164 {
8165   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8166 }
8167
8168 inline int
8169 vec_any_ne (vector signed int a1, vector signed int a2)
8170 {
8171   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8172 }
8173
8174 inline int
8175 vec_any_ne (vector unsigned int a1, vector bool int a2)
8176 {
8177   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8178 }
8179
8180 inline int
8181 vec_any_ne (vector unsigned int a1, vector unsigned int a2)
8182 {
8183   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8184 }
8185
8186 inline int
8187 vec_any_ne (vector bool int a1, vector bool int a2)
8188 {
8189   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8190 }
8191
8192 inline int
8193 vec_any_ne (vector bool int a1, vector unsigned int a2)
8194 {
8195   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8196 }
8197
8198 inline int
8199 vec_any_ne (vector bool int a1, vector signed int a2)
8200 {
8201   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
8202 }
8203
8204 inline int
8205 vec_any_ne (vector float a1, vector float a2)
8206 {
8207   return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a2);
8208 }
8209
8210 /* vec_any_nge */
8211
8212 inline int
8213 vec_any_nge (vector float a1, vector float a2)
8214 {
8215   return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2);
8216 }
8217
8218 /* vec_any_ngt */
8219
8220 inline int
8221 vec_any_ngt (vector float a1, vector float a2)
8222 {
8223   return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2);
8224 }
8225
8226 /* vec_any_nle */
8227
8228 inline int
8229 vec_any_nle (vector float a1, vector float a2)
8230 {
8231   return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1);
8232 }
8233
8234 /* vec_any_nlt */
8235
8236 inline int
8237 vec_any_nlt (vector float a1, vector float a2)
8238 {
8239   return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1);
8240 }
8241
8242 /* vec_any_numeric */
8243
8244 inline int
8245 vec_any_numeric (vector float a1)
8246 {
8247   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1);
8248 }
8249
8250 /* vec_any_out */
8251
8252 inline int
8253 vec_any_out (vector float a1, vector float a2)
8254 {
8255   return __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2);
8256 }
8257
8258 } /* extern "C++" */
8259
8260 #else /* not C++ */
8261
8262 /* "... and so I think no man in a century will suffer as greatly as
8263    you will."  */
8264
8265 /* Helper macros.  */
8266
8267 #define __un_args_eq(xtype, x)                                          \
8268         __builtin_types_compatible_p (xtype, typeof (x))
8269
8270 #define __bin_args_eq(xtype, x, ytype, y)                               \
8271         (__builtin_types_compatible_p (xtype, typeof (x))               \
8272          && __builtin_types_compatible_p (ytype, typeof (y)))
8273
8274 #define __tern_args_eq(xtype, x, ytype, y, ztype, z)                    \
8275         (__builtin_types_compatible_p (xtype, typeof (x))               \
8276          && __builtin_types_compatible_p (ytype, typeof (y))            \
8277          && __builtin_types_compatible_p (ztype, typeof (z)))
8278
8279 #define __ch(x, y, z)   __builtin_choose_expr (x, y, z)
8280
8281 #define vec_step(t) \
8282   __ch (__builtin_types_compatible_p (typeof (t), vector signed int), 4,      \
8283   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned int), 4,    \
8284   __ch (__builtin_types_compatible_p (typeof (t), vector bool int), 4,        \
8285   __ch (__builtin_types_compatible_p (typeof (t), vector signed short), 8,    \
8286   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned short), 8,  \
8287   __ch (__builtin_types_compatible_p (typeof (t), vector bool short), 8,      \
8288   __ch (__builtin_types_compatible_p (typeof (t), vector pixel), 8,           \
8289   __ch (__builtin_types_compatible_p (typeof (t), vector signed char), 16,    \
8290   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned char), 16,  \
8291   __ch (__builtin_types_compatible_p (typeof (t), vector bool char), 16,      \
8292   __ch (__builtin_types_compatible_p (typeof (t), vector float), 4,           \
8293   __builtin_altivec_compiletime_error ("vec_step"))))))))))))
8294
8295 #define vec_abs(a) \
8296   __ch (__un_args_eq (vector signed char, (a)), \
8297         ((vector signed char) __builtin_altivec_abs_v16qi ((vector signed char) (a))), \
8298   __ch (__un_args_eq (vector signed short, (a)), \
8299         ((vector signed short) __builtin_altivec_abs_v8hi ((vector signed short) (a))), \
8300   __ch (__un_args_eq (vector signed int, (a)), \
8301         ((vector signed int) __builtin_altivec_abs_v4si ((vector signed int) (a))), \
8302   __ch (__un_args_eq (vector float, (a)), \
8303         ((vector float) __builtin_altivec_abs_v4sf ((vector float) (a))), \
8304   __builtin_altivec_compiletime_error ("vec_abs")))))
8305
8306 #define vec_abss(a) \
8307   __ch (__un_args_eq (vector signed char, (a)), \
8308         ((vector signed char) __builtin_altivec_abss_v16qi ((vector signed char) (a))), \
8309   __ch (__un_args_eq (vector signed short, (a)), \
8310         ((vector signed short) __builtin_altivec_abss_v8hi ((vector signed short) (a))), \
8311   __ch (__un_args_eq (vector signed int, (a)), \
8312         ((vector signed int) __builtin_altivec_abss_v4si ((vector signed int) (a))), \
8313   __builtin_altivec_compiletime_error ("vec_abss"))))
8314
8315 #define vec_vaddubm(a1, a2) \
8316 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8317       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8318 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8319       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8320 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8321       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8322 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8323       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8324 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8325       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8326 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8327       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8328   __builtin_altivec_compiletime_error ("vec_vaddubm")))))))
8329
8330 #define vec_vadduhm(a1, a2) \
8331 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8332       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8333 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8334       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8335 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8336       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8337 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8338       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8339 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8340       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8341 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8342       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8343   __builtin_altivec_compiletime_error ("vec_vadduhm")))))))
8344
8345 #define vec_vadduwm(a1, a2) \
8346 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8347       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8348 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8349       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8350 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8351       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8352 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8353       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8354 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8355       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8356 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8357       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8358   __builtin_altivec_compiletime_error ("vec_vadduwm")))))))
8359
8360 #define vec_vaddfp(a1, a2) \
8361 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8362       ((vector float) __builtin_altivec_vaddfp ((vector float) (a1), (vector float) (a2))), \
8363   __builtin_altivec_compiletime_error ("vec_vaddfp"))
8364
8365 #define vec_add(a1, a2) \
8366 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8367       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8368 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8369       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8370 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8371       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8372 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8373       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8374 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8375       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8376 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8377       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8378 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8379       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8380 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8381       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8382 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8383       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8384 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8385       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8386 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8387       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8388 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8389       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8390 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8391       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8392 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8393       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8394 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8395       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8396 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8397       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8398 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8399       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8400 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8401       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8402 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8403       ((vector float) __builtin_altivec_vaddfp ((vector float) (a1), (vector float) (a2))), \
8404     __builtin_altivec_compiletime_error ("vec_add"))))))))))))))))))))
8405
8406 #define vec_addc(a1, a2) \
8407 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8408       ((vector unsigned int) __builtin_altivec_vaddcuw ((vector signed int) (a1), (vector signed int) (a2))), \
8409     __builtin_altivec_compiletime_error ("vec_addc"))
8410
8411 #define vec_adds(a1, a2) \
8412 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8413       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8414 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8415       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8416 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8417       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8418 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8419       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8420 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8421       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8422 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8423       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8424 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8425       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8426 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8427       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8428 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8429       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8430 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8431       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8432 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8433       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8434 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8435       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8436 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8437       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8438 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8439       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8440 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8441       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8442 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8443       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8444 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8445       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8446 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8447       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8448     __builtin_altivec_compiletime_error ("vec_adds")))))))))))))))))))
8449
8450 #define vec_vaddsws(a1, a2) \
8451 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8452       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8453 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8454       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8455 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8456       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8457   __builtin_altivec_compiletime_error ("vec_vaddsws"))))
8458
8459 #define vec_vadduws(a1, a2) \
8460 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8461       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8462 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8463       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8464 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8465       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8466   __builtin_altivec_compiletime_error ("vec_vadduws"))))
8467
8468 #define vec_vaddshs(a1, a2) \
8469 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8470       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8471 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8472       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8473 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8474       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8475   __builtin_altivec_compiletime_error ("vec_vaddshs"))))
8476
8477 #define vec_vadduhs(a1, a2) \
8478 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8479       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8480 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8481       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8482 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8483       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8484   __builtin_altivec_compiletime_error ("vec_vadduhs"))))
8485
8486 #define vec_vaddsbs(a1, a2) \
8487 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8488       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8489 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8490       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8491 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8492       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8493   __builtin_altivec_compiletime_error ("vec_vaddsbs"))))
8494
8495 #define vec_vaddubs(a1, a2) \
8496 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8497       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8498 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8499       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8500 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8501       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8502   __builtin_altivec_compiletime_error ("vec_vaddubs"))))
8503
8504 #define vec_and(a1, a2) \
8505 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8506       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8507 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
8508       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8509 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
8510       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8511 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8512       ((vector bool int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8513 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8514       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8515 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8516       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8517 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8518       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8519 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8520       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8521 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8522       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8523 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8524       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8525 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8526       ((vector bool short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8527 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8528       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8529 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8530       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8531 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8532       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8533 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8534       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8535 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8536       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8537 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8538       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8539 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8540       ((vector bool char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8541 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8542       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8543 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8544       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8545 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8546       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8547 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8548       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8549 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8550       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8551 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8552       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8553     __builtin_altivec_compiletime_error ("vec_and")))))))))))))))))))))))))
8554
8555 #define vec_andc(a1, a2) \
8556 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8557       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8558 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
8559       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8560 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
8561       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8562 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8563       ((vector bool int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8564 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8565       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8566 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8567       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8568 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8569       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8570 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8571       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8572 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8573       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8574 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8575       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8576 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8577       ((vector bool short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8578 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8579       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8580 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8581       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8582 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8583       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8584 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8585       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8586 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8587       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8588 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8589       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8590 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8591       ((vector bool char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8592 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8593       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8594 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8595       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8596 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8597       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8598 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8599       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8600 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8601       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8602 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8603       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8604     __builtin_altivec_compiletime_error ("vec_andc")))))))))))))))))))))))))
8605
8606 #define vec_avg(a1, a2) \
8607 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8608       ((vector unsigned char) __builtin_altivec_vavgub ((vector signed char) (a1), (vector signed char) (a2))), \
8609 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8610       ((vector signed char) __builtin_altivec_vavgsb ((vector signed char) (a1), (vector signed char) (a2))), \
8611 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8612       ((vector unsigned short) __builtin_altivec_vavguh ((vector signed short) (a1), (vector signed short) (a2))), \
8613 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8614       ((vector signed short) __builtin_altivec_vavgsh ((vector signed short) (a1), (vector signed short) (a2))), \
8615 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8616       ((vector unsigned int) __builtin_altivec_vavguw ((vector signed int) (a1), (vector signed int) (a2))), \
8617 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8618       ((vector signed int) __builtin_altivec_vavgsw ((vector signed int) (a1), (vector signed int) (a2))), \
8619     __builtin_altivec_compiletime_error ("vec_avg")))))))
8620
8621 #define vec_vavgsw(a1, a2) \
8622 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8623       ((vector signed int) __builtin_altivec_vavgsw ((vector signed int) (a1), (vector signed int) (a2))), \
8624   __builtin_altivec_compiletime_error ("vec_vavgsw"))
8625
8626 #define vec_vavguw(a1, a2) \
8627 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8628       ((vector unsigned int) __builtin_altivec_vavguw ((vector signed int) (a1), (vector signed int) (a2))), \
8629   __builtin_altivec_compiletime_error ("vec_vavguw"))
8630
8631 #define vec_vavgsh(a1, a2) \
8632 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8633       ((vector signed short) __builtin_altivec_vavgsh ((vector signed short) (a1), (vector signed short) (a2))), \
8634   __builtin_altivec_compiletime_error ("vec_vavgsh"))
8635
8636 #define vec_vavguh(a1, a2) \
8637 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8638       ((vector unsigned short) __builtin_altivec_vavguh ((vector signed short) (a1), (vector signed short) (a2))), \
8639   __builtin_altivec_compiletime_error ("vec_vavguh"))
8640
8641 #define vec_vavgsb(a1, a2) \
8642 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8643       ((vector signed char) __builtin_altivec_vavgsb ((vector signed char) (a1), (vector signed char) (a2))), \
8644   __builtin_altivec_compiletime_error ("vec_vavgsb"))
8645
8646 #define vec_vavgub(a1, a2) \
8647 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8648       ((vector unsigned char) __builtin_altivec_vavgub ((vector signed char) (a1), (vector signed char) (a2))), \
8649   __builtin_altivec_compiletime_error ("vec_vavgub"))
8650
8651 #define vec_ceil(a1) \
8652 __ch (__un_args_eq (vector float, (a1)), \
8653       ((vector float) __builtin_altivec_vrfip ((vector float) (a1))), \
8654   __builtin_altivec_compiletime_error ("vec_ceil"))
8655
8656 #define vec_cmpb(a1, a2) \
8657 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8658       ((vector signed int) __builtin_altivec_vcmpbfp ((vector float) (a1), (vector float) (a2))), \
8659   __builtin_altivec_compiletime_error ("vec_cmpb"))
8660
8661 #define vec_cmpeq(a1, a2) \
8662 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8663       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8664 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8665       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8666 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8667       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8668 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8669       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8670 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8671       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8672 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8673       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8674 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8675       ((vector bool int) __builtin_altivec_vcmpeqfp ((vector float) (a1), (vector float) (a2))), \
8676     __builtin_altivec_compiletime_error ("vec_cmpeq"))))))))
8677
8678 #define vec_vcmpeqfp(a1, a2) \
8679 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8680       ((vector bool int) __builtin_altivec_vcmpeqfp ((vector float) (a1), (vector float) (a2))), \
8681   __builtin_altivec_compiletime_error ("vec_vcmpeqfp"))
8682
8683 #define vec_vcmpequw(a1, a2) \
8684 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8685       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8686 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8687       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8688   __builtin_altivec_compiletime_error ("vec_vcmpequw")))
8689
8690 #define vec_vcmpequh(a1, a2) \
8691 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8692       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8693 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8694       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8695   __builtin_altivec_compiletime_error ("vec_vcmpequh")))
8696
8697 #define vec_vcmpequb(a1, a2) \
8698 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8699       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8700 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8701       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8702   __builtin_altivec_compiletime_error ("vec_vcmpequb")))
8703
8704 #define vec_cmpge(a1, a2) \
8705 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8706       ((vector bool int) __builtin_altivec_vcmpgefp ((vector float) (a1), (vector float) (a2))), \
8707   __builtin_altivec_compiletime_error ("vec_cmpge"))
8708
8709 #define vec_cmpgt(a1, a2) \
8710 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8711       ((vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8712 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8713       ((vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8714 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8715       ((vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8716 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8717       ((vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8718 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8719       ((vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8720 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8721       ((vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8722 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8723       ((vector bool int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8724     __builtin_altivec_compiletime_error ("vec_cmpgt"))))))))
8725
8726 #define vec_vcmpgtfp(a1, a2) \
8727 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8728       ((vector bool int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8729   __builtin_altivec_compiletime_error ("vec_vcmpgtfp"))
8730
8731 #define vec_vcmpgtsw(a1, a2) \
8732 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8733       ((vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8734   __builtin_altivec_compiletime_error ("vec_vcmpgtsw"))
8735
8736 #define vec_vcmpgtuw(a1, a2) \
8737 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8738       ((vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8739   __builtin_altivec_compiletime_error ("vec_vcmpgtuw"))
8740
8741 #define vec_vcmpgtsh(a1, a2) \
8742 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8743       ((vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8744   __builtin_altivec_compiletime_error ("vec_vcmpgtsh"))
8745
8746 #define vec_vcmpgtuh(a1, a2) \
8747 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8748       ((vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8749   __builtin_altivec_compiletime_error ("vec_vcmpgtuh"))
8750
8751 #define vec_vcmpgtsb(a1, a2) \
8752 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8753       ((vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8754   __builtin_altivec_compiletime_error ("vec_vcmpgtsb"))
8755
8756 #define vec_vcmpgtub(a1, a2) \
8757 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8758       ((vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8759   __builtin_altivec_compiletime_error ("vec_vcmpgtub"))
8760
8761 #define vec_cmple(a1, a2) \
8762 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8763       ((vector bool int) __builtin_altivec_vcmpgefp ((vector float) (a2), (vector float) (a1))), \
8764   __builtin_altivec_compiletime_error ("vec_cmple"))
8765
8766 #define vec_cmplt(a2, a1) \
8767 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8768       ((vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8769 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8770       ((vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8771 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8772       ((vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8773 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8774       ((vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8775 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8776       ((vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8777 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8778       ((vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8779 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8780       ((vector bool int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8781     __builtin_altivec_compiletime_error ("vec_cmplt"))))))))
8782
8783 #define vec_ctf(a1, a2) \
8784 __ch (__un_args_eq (vector unsigned int, (a1)), \
8785       ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const int) (a2))), \
8786 __ch (__un_args_eq (vector signed int, (a1)), \
8787       ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const int) (a2))), \
8788     __builtin_altivec_compiletime_error ("vec_ctf")))
8789
8790 #define vec_vcfsx(a1, a2) \
8791 __ch (__un_args_eq (vector signed int, (a1)), \
8792       ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const int) (a2))), \
8793   __builtin_altivec_compiletime_error ("vec_vcfsx"))
8794
8795 #define vec_vcfux(a1, a2) \
8796 __ch (__un_args_eq (vector unsigned int, (a1)), \
8797       ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const int) (a2))), \
8798   __builtin_altivec_compiletime_error ("vec_vcfux"))
8799
8800 #define vec_cts(a1, a2) \
8801 __ch (__un_args_eq (vector float, (a1)), \
8802       ((vector signed int) __builtin_altivec_vctsxs ((vector float) (a1), (const int) (a2))), \
8803     __builtin_altivec_compiletime_error ("vec_cts"))
8804
8805 #define vec_ctu(a1, a2) \
8806 __ch (__un_args_eq (vector float, (a1)), \
8807       ((vector unsigned int) __builtin_altivec_vctuxs ((vector float) (a1), (const int) (a2))), \
8808     __builtin_altivec_compiletime_error ("vec_ctu"))
8809
8810 #define vec_dss(a1) __builtin_altivec_dss ((const int) (a1));
8811
8812 #define vec_dssall() __builtin_altivec_dssall ()
8813
8814 #define vec_dst(a1, a2, a3) \
8815 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8816       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8817 __ch (__un_args_eq (const vector signed char, *(a1)), \
8818       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8819 __ch (__un_args_eq (const vector bool char, *(a1)), \
8820       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8821 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8822       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8823 __ch (__un_args_eq (const vector signed short, *(a1)), \
8824       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8825 __ch (__un_args_eq (const vector bool short, *(a1)), \
8826       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8827 __ch (__un_args_eq (const vector pixel, *(a1)), \
8828       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8829 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8830       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8831 __ch (__un_args_eq (const vector signed int, *(a1)), \
8832       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8833 __ch (__un_args_eq (const vector bool int, *(a1)), \
8834       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8835 __ch (__un_args_eq (const vector float, *(a1)), \
8836       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8837 __ch (__un_args_eq (const unsigned char, *(a1)), \
8838       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8839 __ch (__un_args_eq (const signed char, *(a1)), \
8840       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8841 __ch (__un_args_eq (const unsigned short, *(a1)), \
8842       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8843 __ch (__un_args_eq (const short, *(a1)), \
8844       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8845 __ch (__un_args_eq (const unsigned int, *(a1)), \
8846       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8847 __ch (__un_args_eq (const int, *(a1)), \
8848       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8849 __ch (__un_args_eq (const unsigned long, *(a1)), \
8850       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8851 __ch (__un_args_eq (const long, *(a1)), \
8852       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8853 __ch (__un_args_eq (const float, *(a1)), \
8854       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8855   __builtin_altivec_compiletime_error ("vec_dst")))))))))))))))))))))
8856
8857 #define vec_dstst(a1, a2, a3) \
8858 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8859       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8860 __ch (__un_args_eq (const vector signed char, *(a1)), \
8861       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8862 __ch (__un_args_eq (const vector bool char, *(a1)), \
8863       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8864 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8865       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8866 __ch (__un_args_eq (const vector signed short, *(a1)), \
8867       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8868 __ch (__un_args_eq (const vector bool short, *(a1)), \
8869       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8870 __ch (__un_args_eq (const vector pixel, *(a1)), \
8871       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8872 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8873       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8874 __ch (__un_args_eq (const vector signed int, *(a1)), \
8875       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8876 __ch (__un_args_eq (const vector bool int, *(a1)), \
8877       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8878 __ch (__un_args_eq (const vector float, *(a1)), \
8879       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8880 __ch (__un_args_eq (const unsigned char, *(a1)), \
8881       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8882 __ch (__un_args_eq (const signed char, *(a1)), \
8883       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8884 __ch (__un_args_eq (const unsigned short, *(a1)), \
8885       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8886 __ch (__un_args_eq (const short, *(a1)), \
8887       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8888 __ch (__un_args_eq (const unsigned int, *(a1)), \
8889       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8890 __ch (__un_args_eq (const int, *(a1)), \
8891       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8892 __ch (__un_args_eq (const unsigned long, *(a1)), \
8893       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8894 __ch (__un_args_eq (const long, *(a1)), \
8895       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8896 __ch (__un_args_eq (const float, *(a1)), \
8897       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8898   __builtin_altivec_compiletime_error ("vec_dstst")))))))))))))))))))))
8899
8900 #define vec_dststt(a1, a2, a3) \
8901 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8902       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8903 __ch (__un_args_eq (const vector signed char, *(a1)), \
8904       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8905 __ch (__un_args_eq (const vector bool char, *(a1)), \
8906       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8907 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8908       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8909 __ch (__un_args_eq (const vector signed short, *(a1)), \
8910       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8911 __ch (__un_args_eq (const vector bool short, *(a1)), \
8912       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8913 __ch (__un_args_eq (const vector pixel, *(a1)), \
8914       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8915 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8916       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8917 __ch (__un_args_eq (const vector signed int, *(a1)), \
8918       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8919 __ch (__un_args_eq (const vector bool int, *(a1)), \
8920       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8921 __ch (__un_args_eq (const vector float, *(a1)), \
8922       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8923 __ch (__un_args_eq (const unsigned char, *(a1)), \
8924       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8925 __ch (__un_args_eq (const signed char, *(a1)), \
8926       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8927 __ch (__un_args_eq (const unsigned short, *(a1)), \
8928       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8929 __ch (__un_args_eq (const short, *(a1)), \
8930       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8931 __ch (__un_args_eq (const unsigned int, *(a1)), \
8932       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8933 __ch (__un_args_eq (const int, *(a1)), \
8934       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8935 __ch (__un_args_eq (const unsigned long, *(a1)), \
8936       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8937 __ch (__un_args_eq (const long, *(a1)), \
8938       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8939 __ch (__un_args_eq (const float, *(a1)), \
8940       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8941   __builtin_altivec_compiletime_error ("vec_dststt")))))))))))))))))))))
8942
8943 #define vec_dstt(a1, a2, a3) \
8944 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8945       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8946 __ch (__un_args_eq (const vector signed char, *(a1)), \
8947       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8948 __ch (__un_args_eq (const vector bool char, *(a1)), \
8949       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8950 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8951       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8952 __ch (__un_args_eq (const vector signed short, *(a1)), \
8953       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8954 __ch (__un_args_eq (const vector bool short, *(a1)), \
8955       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8956 __ch (__un_args_eq (const vector pixel, *(a1)), \
8957       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8958 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8959       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8960 __ch (__un_args_eq (const vector signed int, *(a1)), \
8961       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8962 __ch (__un_args_eq (const vector bool int, *(a1)), \
8963       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8964 __ch (__un_args_eq (const vector float, *(a1)), \
8965       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8966 __ch (__un_args_eq (const unsigned char, *(a1)), \
8967       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8968 __ch (__un_args_eq (const signed char, *(a1)), \
8969       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8970 __ch (__un_args_eq (const unsigned short, *(a1)), \
8971       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8972 __ch (__un_args_eq (const short, *(a1)), \
8973       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8974 __ch (__un_args_eq (const unsigned int, *(a1)), \
8975       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8976 __ch (__un_args_eq (const int, *(a1)), \
8977       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8978 __ch (__un_args_eq (const unsigned long, *(a1)), \
8979       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8980 __ch (__un_args_eq (const long, *(a1)), \
8981       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8982 __ch (__un_args_eq (const float, *(a1)), \
8983       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8984   __builtin_altivec_compiletime_error ("vec_dstt")))))))))))))))))))))
8985
8986 #define vec_expte(a1) \
8987 __ch (__un_args_eq (vector float, (a1)), \
8988       ((vector float) __builtin_altivec_vexptefp ((vector float) (a1))), \
8989   __builtin_altivec_compiletime_error ("vec_expte"))
8990
8991 #define vec_floor(a1) \
8992 __ch (__un_args_eq (vector float, (a1)), \
8993       ((vector float) __builtin_altivec_vrfim ((vector float) (a1))), \
8994   __builtin_altivec_compiletime_error ("vec_floor"))
8995
8996 #define vec_ld(a, b) \
8997 __ch (__un_args_eq (const vector unsigned char, *(b)), \
8998       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
8999 __ch (__un_args_eq (const unsigned char, *(b)), \
9000       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
9001 __ch (__un_args_eq (const vector signed char, *(b)), \
9002       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
9003 __ch (__un_args_eq (const signed char, *(b)), \
9004       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
9005 __ch (__un_args_eq (const vector bool char, *(b)), \
9006       ((vector bool char) __builtin_altivec_lvx ((a), (b))), \
9007 __ch (__un_args_eq (const vector unsigned short, *(b)), \
9008       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
9009 __ch (__un_args_eq (const unsigned short, *(b)), \
9010       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
9011 __ch (__un_args_eq (const vector signed short, *(b)), \
9012       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
9013 __ch (__un_args_eq (const short, *(b)), \
9014       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
9015 __ch (__un_args_eq (const vector bool short, *(b)), \
9016       ((vector bool short) __builtin_altivec_lvx ((a), (b))), \
9017 __ch (__un_args_eq (const vector pixel, *(b)), \
9018       ((vector pixel) __builtin_altivec_lvx ((a), (b))), \
9019 __ch (__un_args_eq (const vector unsigned int, *(b)), \
9020       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
9021 __ch (__un_args_eq (const unsigned int, *(b)), \
9022       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
9023 __ch (__un_args_eq (const unsigned long, *(b)), \
9024       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
9025 __ch (__un_args_eq (const vector signed int, *(b)), \
9026       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
9027 __ch (__un_args_eq (const int, *(b)), \
9028       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
9029 __ch (__un_args_eq (const long, *(b)), \
9030       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
9031 __ch (__un_args_eq (const vector bool int, *(b)), \
9032       ((vector bool int) __builtin_altivec_lvx ((a), (b))), \
9033 __ch (__un_args_eq (const vector float, *(b)), \
9034       ((vector float) __builtin_altivec_lvx ((a), (b))), \
9035 __ch (__un_args_eq (const float, *(b)), \
9036       ((vector float) __builtin_altivec_lvx ((a), (b))), \
9037 __builtin_altivec_compiletime_error ("vec_ld")))))))))))))))))))))
9038
9039 #define vec_lde(a, b) \
9040 __ch (__un_args_eq (const unsigned char, *(b)), \
9041       ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
9042 __ch (__un_args_eq (const signed char, *(b)), \
9043       ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
9044 __ch (__un_args_eq (const unsigned short, *(b)), \
9045       ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
9046 __ch (__un_args_eq (const short, *(b)), \
9047       ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
9048 __ch (__un_args_eq (const unsigned long, *(b)), \
9049       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
9050 __ch (__un_args_eq (const long, *(b)), \
9051       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
9052 __ch (__un_args_eq (const unsigned int, *(b)), \
9053       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
9054 __ch (__un_args_eq (const int, *(b)), \
9055       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
9056 __ch (__un_args_eq (const float, *(b)), \
9057       ((vector float) __builtin_altivec_lvewx ((a), (b))), \
9058 __builtin_altivec_compiletime_error ("vec_lde"))))))))))
9059
9060 #define vec_lvewx(a, b) \
9061 __ch (__un_args_eq (unsigned int, *(b)), \
9062       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
9063 __ch (__un_args_eq (signed int, *(b)), \
9064       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
9065 __ch (__un_args_eq (unsigned long, *(b)), \
9066       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
9067 __ch (__un_args_eq (signed long, *(b)), \
9068       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
9069 __ch (__un_args_eq (float, *(b)), \
9070       ((vector float) __builtin_altivec_lvewx ((a), (b))), \
9071 __builtin_altivec_compiletime_error ("vec_lvewx"))))))
9072
9073 #define vec_lvehx(a, b) \
9074 __ch (__un_args_eq (unsigned short, *(b)), \
9075       ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
9076 __ch (__un_args_eq (signed short, *(b)), \
9077       ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
9078 __builtin_altivec_compiletime_error ("vec_lvehx")))
9079
9080 #define vec_lvebx(a, b) \
9081 __ch (__un_args_eq (unsigned char, *(b)), \
9082       ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
9083 __ch (__un_args_eq (signed char, *(b)), \
9084       ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
9085 __builtin_altivec_compiletime_error ("vec_lvebx")))
9086
9087 #define vec_ldl(a, b) \
9088 __ch (__un_args_eq (const vector unsigned char, *(b)), \
9089       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
9090 __ch (__un_args_eq (const unsigned char, *(b)), \
9091       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
9092 __ch (__un_args_eq (const vector signed char, *(b)), \
9093       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
9094 __ch (__un_args_eq (const signed char, *(b)), \
9095       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
9096 __ch (__un_args_eq (const vector bool char, *(b)), \
9097       ((vector bool char) __builtin_altivec_lvxl ((a), (b))), \
9098 __ch (__un_args_eq (const vector unsigned short, *(b)), \
9099       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
9100 __ch (__un_args_eq (const unsigned short, *(b)), \
9101       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
9102 __ch (__un_args_eq (const vector signed short, *(b)), \
9103       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
9104 __ch (__un_args_eq (const short, *(b)), \
9105       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
9106 __ch (__un_args_eq (const vector bool short, *(b)), \
9107       ((vector bool short) __builtin_altivec_lvxl ((a), (b))), \
9108 __ch (__un_args_eq (const vector pixel, *(b)), \
9109       ((vector pixel) __builtin_altivec_lvxl ((a), (b))), \
9110 __ch (__un_args_eq (const vector unsigned int, *(b)), \
9111       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
9112 __ch (__un_args_eq (const unsigned int, *(b)), \
9113       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
9114 __ch (__un_args_eq (const unsigned long, *(b)), \
9115       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
9116 __ch (__un_args_eq (const vector signed int, *(b)), \
9117       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
9118 __ch (__un_args_eq (const int, *(b)), \
9119       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
9120 __ch (__un_args_eq (const long, *(b)), \
9121       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
9122 __ch (__un_args_eq (const vector bool int, *(b)), \
9123       ((vector bool int) __builtin_altivec_lvxl ((a), (b))), \
9124 __ch (__un_args_eq (const vector float, *(b)), \
9125       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
9126 __ch (__un_args_eq (const float, *(b)), \
9127       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
9128 __builtin_altivec_compiletime_error ("vec_ldl")))))))))))))))))))))
9129
9130 #define vec_loge(a1) \
9131 __ch (__un_args_eq (vector float, (a1)), \
9132       ((vector float) __builtin_altivec_vlogefp ((vector float) (a1))), \
9133   __builtin_altivec_compiletime_error ("vec_loge"))
9134
9135 #define vec_lvsl(a1, a2) \
9136 __ch (__un_args_eq (const volatile unsigned char, *(a2)), \
9137       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9138 __ch (__un_args_eq (const volatile signed char, *(a2)), \
9139       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9140 __ch (__un_args_eq (const volatile unsigned short, *(a2)), \
9141       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9142 __ch (__un_args_eq (const volatile signed short, *(a2)), \
9143       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9144 __ch (__un_args_eq (const volatile unsigned int, *(a2)), \
9145       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9146 __ch (__un_args_eq (const volatile signed int, *(a2)), \
9147       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9148 __ch (__un_args_eq (const volatile unsigned long, *(a2)), \
9149       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9150 __ch (__un_args_eq (const volatile signed long, *(a2)), \
9151       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9152 __ch (__un_args_eq (const volatile float, *(a2)), \
9153       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
9154 __builtin_altivec_compiletime_error ("vec_lvsl"))))))))))
9155
9156 #define vec_lvsr(a1, a2) \
9157 __ch (__un_args_eq (const volatile unsigned char, *(a2)), \
9158       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9159 __ch (__un_args_eq (const volatile signed char, *(a2)), \
9160       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9161 __ch (__un_args_eq (const volatile unsigned short, *(a2)), \
9162       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9163 __ch (__un_args_eq (const volatile signed short, *(a2)), \
9164       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9165 __ch (__un_args_eq (const volatile unsigned int, *(a2)), \
9166       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9167 __ch (__un_args_eq (const volatile signed int, *(a2)), \
9168       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9169 __ch (__un_args_eq (const volatile unsigned long, *(a2)), \
9170       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9171 __ch (__un_args_eq (const volatile signed long, *(a2)), \
9172       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9173 __ch (__un_args_eq (const volatile float, *(a2)), \
9174       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
9175 __builtin_altivec_compiletime_error ("vec_lvsr"))))))))))
9176
9177 #define vec_madd(a1, a2, a3) \
9178 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector float, (a3)), \
9179       ((vector float) __builtin_altivec_vmaddfp ((a1), (a2), (a3))), \
9180 __builtin_altivec_compiletime_error ("vec_madd"))
9181
9182 #define vec_madds(a1, a2, a3) \
9183 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9184       ((vector signed short) __builtin_altivec_vmhaddshs ((a1), (a2), (a3))), \
9185 __builtin_altivec_compiletime_error ("vec_madds"))
9186
9187 #define vec_max(a1, a2) \
9188 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9189       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9190 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9191       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9192 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9193       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9194 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9195       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9196 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9197       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9198 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9199       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9200 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9201       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9202 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9203       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9204 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9205       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9206 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9207       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9208 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9209       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9210 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9211       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9212 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9213       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9214 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9215       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9216 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9217       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9218 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9219       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9220 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9221       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9222 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9223       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9224 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9225       ((vector float) __builtin_altivec_vmaxfp ((vector float) (a1), (vector float) (a2))), \
9226     __builtin_altivec_compiletime_error ("vec_max"))))))))))))))))))))
9227
9228 #define vec_vmaxfp(a1, a2) \
9229 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9230       ((vector float) __builtin_altivec_vmaxfp ((vector float) (a1), (vector float) (a2))), \
9231 __builtin_altivec_compiletime_error ("vec_vmaxfp"))
9232
9233 #define vec_vmaxsw(a1, a2) \
9234 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9235       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9236 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9237       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9238 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9239       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
9240 __builtin_altivec_compiletime_error ("vec_vmaxsw"))))
9241
9242 #define vec_vmaxuw(a1, a2) \
9243 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9244       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9245 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9246       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9247 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9248       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
9249 __builtin_altivec_compiletime_error ("vec_vmaxuw"))))
9250
9251 #define vec_vmaxsh(a1, a2) \
9252 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9253       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9254 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9255       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9256 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9257       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
9258 __builtin_altivec_compiletime_error ("vec_vmaxsh"))))
9259
9260 #define vec_vmaxuh(a1, a2) \
9261 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9262       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9263 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9264       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9265 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9266       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
9267 __builtin_altivec_compiletime_error ("vec_vmaxuh"))))
9268
9269 #define vec_vmaxsb(a1, a2) \
9270 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9271       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9272 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9273       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9274 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9275       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
9276 __builtin_altivec_compiletime_error ("vec_vmaxsb"))))
9277
9278 #define vec_vmaxub(a1, a2) \
9279 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9280       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9281 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9282       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9283 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9284       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
9285 __builtin_altivec_compiletime_error ("vec_vmaxub"))))
9286
9287 #define vec_mergeh(a1, a2) \
9288 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9289       ((vector signed char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9290 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9291       ((vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9292 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9293       ((vector bool char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9294 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9295       ((vector signed short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9296 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9297       ((vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9298 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9299       ((vector bool short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9300 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9301       ((vector pixel) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9302 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9303       ((vector float) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9304 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9305       ((vector signed int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9306 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9307       ((vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9308 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9309       ((vector bool int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9310     __builtin_altivec_compiletime_error ("vec_mergeh"))))))))))))
9311
9312 #define vec_vmrghw(a1, a2) \
9313 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9314       ((vector float) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9315 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9316       ((vector bool int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9317 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9318       ((vector signed int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9319 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9320       ((vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
9321 __builtin_altivec_compiletime_error ("vec_vmrghw")))))
9322
9323 #define vec_vmrghh(a1, a2) \
9324 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9325       ((vector bool short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9326 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9327       ((vector signed short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9328 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9329       ((vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9330 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9331       ((vector pixel) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
9332 __builtin_altivec_compiletime_error ("vec_vmrghh")))))
9333
9334 #define vec_vmrghb(a1, a2) \
9335 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9336       ((vector bool char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9337 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9338       ((vector signed char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9339 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9340       ((vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
9341 __builtin_altivec_compiletime_error ("vec_vmrghb"))))
9342
9343 #define vec_mergel(a1, a2) \
9344 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9345       ((vector signed char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9346 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9347       ((vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9348 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9349       ((vector bool char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9350 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9351       ((vector signed short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9352 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9353       ((vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9354 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9355       ((vector bool short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9356 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9357       ((vector pixel) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9358 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9359       ((vector float) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9360 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9361       ((vector signed int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9362 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9363       ((vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9364 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9365       ((vector bool int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9366     __builtin_altivec_compiletime_error ("vec_mergel"))))))))))))
9367
9368 #define vec_vmrglw(a1, a2) \
9369 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9370       ((vector float) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9371 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9372       ((vector signed int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9373 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9374       ((vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9375 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9376       ((vector bool int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
9377 __builtin_altivec_compiletime_error ("vec_vmrglw")))))
9378
9379 #define vec_vmrglh(a1, a2) \
9380 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9381       ((vector bool short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9382 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9383       ((vector signed short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9384 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9385       ((vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9386 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9387       ((vector pixel) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
9388 __builtin_altivec_compiletime_error ("vec_vmrglh")))))
9389
9390 #define vec_vmrglb(a1, a2) \
9391 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9392       ((vector bool char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9393 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9394       ((vector signed char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9395 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9396       ((vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
9397 __builtin_altivec_compiletime_error ("vec_vmrglb"))))
9398
9399 #define vec_mfvscr()  (((vector unsigned short) __builtin_altivec_mfvscr ()))
9400
9401 #define vec_min(a1, a2) \
9402 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9403       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9404 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9405       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9406 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9407       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9408 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9409       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9410 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9411       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9412 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9413       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9414 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9415       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9416 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9417       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9418 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9419       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9420 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9421       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9422 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9423       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9424 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9425       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9426 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9427       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9428 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9429       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9430 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9431       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9432 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9433       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9434 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9435       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9436 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9437       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9438 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9439       ((vector float) __builtin_altivec_vminfp ((vector float) (a1), (vector float) (a2))), \
9440     __builtin_altivec_compiletime_error ("vec_min"))))))))))))))))))))
9441
9442 #define vec_vminfp(a1, a2) \
9443 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9444       ((vector float) __builtin_altivec_vminfp ((vector float) (a1), (vector float) (a2))), \
9445 __builtin_altivec_compiletime_error ("vec_vminfp"))
9446
9447 #define vec_vminsw(a1, a2) \
9448 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9449       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9450 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9451       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9452 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9453       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9454 __builtin_altivec_compiletime_error ("vec_vminsw"))))
9455
9456 #define vec_vminuw(a1, a2) \
9457 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9458       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9459 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9460       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9461 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9462       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9463 __builtin_altivec_compiletime_error ("vec_vminuw"))))
9464
9465 #define vec_vminsh(a1, a2) \
9466 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9467       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9468 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9469       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9470 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9471       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9472 __builtin_altivec_compiletime_error ("vec_vminsh"))))
9473
9474 #define vec_vminuh(a1, a2) \
9475 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9476       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9477 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9478       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9479 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9480       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9481 __builtin_altivec_compiletime_error ("vec_vminuh"))))
9482
9483 #define vec_vminsb(a1, a2) \
9484 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9485       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9486 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9487       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9488 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9489       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9490 __builtin_altivec_compiletime_error ("vec_minsb"))))
9491
9492 #define vec_vminub(a1, a2) \
9493 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9494       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9495 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9496       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9497 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9498       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9499 __builtin_altivec_compiletime_error ("vec_vminub"))))
9500
9501 #define vec_mladd(a1, a2, a3) \
9502 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9503       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9504 __ch (__tern_args_eq (vector signed short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9505       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9506 __ch (__tern_args_eq (vector unsigned short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9507       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9508 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9509       ((vector unsigned short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9510     __builtin_altivec_compiletime_error ("vec_mladd")))))
9511
9512 #define vec_mradds(a1, a2, a3) \
9513 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9514       ((vector signed short) __builtin_altivec_vmhraddshs ((a1), (a2), (a3))), \
9515 __builtin_altivec_compiletime_error ("vec_mradds"))
9516
9517 #define vec_msum(a1, a2, a3) \
9518 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned int, (a3)), \
9519       ((vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9520 __ch (__tern_args_eq (vector signed char, (a1), vector unsigned char, (a2), vector signed int, (a3)), \
9521       ((vector signed int) __builtin_altivec_vmsummbm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9522 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9523       ((vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9524 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9525       ((vector signed int) __builtin_altivec_vmsumshm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9526     __builtin_altivec_compiletime_error ("vec_msum")))))
9527
9528 #define vec_vmsumshm(a1, a2, a3) \
9529 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9530       ((vector signed int) __builtin_altivec_vmsumshm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9531 __builtin_altivec_compiletime_error ("vec_vmsumshm"))
9532
9533 #define vec_vmsumuhm(a1, a2, a3) \
9534 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9535       ((vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9536 __builtin_altivec_compiletime_error ("vec_vmsumuhm"))
9537
9538 #define vec_vmsummbm(a1, a2, a3) \
9539 __ch (__tern_args_eq (vector signed char, (a1), vector unsigned char, (a2), vector signed int, (a3)), \
9540       ((vector signed int) __builtin_altivec_vmsummbm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9541 __builtin_altivec_compiletime_error ("vec_vmsummbm"))
9542
9543 #define vec_vmsumubm(a1, a2, a3) \
9544 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned int, (a3)), \
9545       ((vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9546 __builtin_altivec_compiletime_error ("vec_vmsummbm"))
9547
9548 #define vec_msums(a1, a2, a3) \
9549 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9550       ((vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9551 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9552       ((vector signed int) __builtin_altivec_vmsumshs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9553     __builtin_altivec_compiletime_error ("vec_msums")))
9554
9555 #define vec_vmsumshs(a1, a2, a3) \
9556 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9557       ((vector signed int) __builtin_altivec_vmsumshs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9558 __builtin_altivec_compiletime_error ("vec_vmsumshs"))
9559
9560 #define vec_vmsumuhs(a1, a2, a3) \
9561 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9562       ((vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9563 __builtin_altivec_compiletime_error ("vec_vmsumuhs"))
9564
9565 #define vec_mtvscr(a1) \
9566 __ch (__un_args_eq (vector signed int, (a1)), \
9567       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9568 __ch (__un_args_eq (vector unsigned int, (a1)), \
9569       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9570 __ch (__un_args_eq (vector bool int, (a1)), \
9571       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9572 __ch (__un_args_eq (vector signed short, (a1)), \
9573       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9574 __ch (__un_args_eq (vector unsigned short, (a1)), \
9575       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9576 __ch (__un_args_eq (vector bool short, (a1)), \
9577       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9578 __ch (__un_args_eq (vector pixel, (a1)), \
9579       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9580 __ch (__un_args_eq (vector signed char, (a1)), \
9581       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9582 __ch (__un_args_eq (vector unsigned char, (a1)), \
9583       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9584 __ch (__un_args_eq (vector bool char, (a1)), \
9585       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9586     __builtin_altivec_compiletime_error ("vec_mtvscr")))))))))))
9587
9588 #define vec_mule(a1, a2) \
9589 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9590       ((vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) (a1), (vector signed char) (a2))), \
9591 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9592       ((vector signed short) __builtin_altivec_vmulesb ((vector signed char) (a1), (vector signed char) (a2))), \
9593 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9594       ((vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) (a1), (vector signed short) (a2))), \
9595 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9596       ((vector signed int) __builtin_altivec_vmulesh ((vector signed short) (a1), (vector signed short) (a2))), \
9597     __builtin_altivec_compiletime_error ("vec_mule")))))
9598
9599 #define vec_vmulesh(a1, a2) \
9600 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9601       ((vector signed int) __builtin_altivec_vmulesh ((vector signed short) (a1), (vector signed short) (a2))), \
9602 __builtin_altivec_compiletime_error ("vec_vmulesh"))
9603
9604 #define vec_vmuleuh(a1, a2) \
9605 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9606       ((vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) (a1), (vector signed short) (a2))), \
9607 __builtin_altivec_compiletime_error ("vec_vmuleuh"))
9608
9609 #define vec_vmulesb(a1, a2) \
9610 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9611       ((vector signed short) __builtin_altivec_vmulesb ((vector signed char) (a1), (vector signed char) (a2))), \
9612 __builtin_altivec_compiletime_error ("vec_vmulesb"))
9613
9614 #define vec_vmuleub(a1, a2) \
9615 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9616       ((vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) (a1), (vector signed char) (a2))), \
9617 __builtin_altivec_compiletime_error ("vec_vmuleub"))
9618
9619 #define vec_mulo(a1, a2) \
9620 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9621       ((vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) (a1), (vector signed char) (a2))), \
9622 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9623       ((vector signed short) __builtin_altivec_vmulosb ((vector signed char) (a1), (vector signed char) (a2))), \
9624 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9625       ((vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) (a1), (vector signed short) (a2))), \
9626 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9627       ((vector signed int) __builtin_altivec_vmulosh ((vector signed short) (a1), (vector signed short) (a2))), \
9628     __builtin_altivec_compiletime_error ("vec_mulo")))))
9629
9630 #define vec_vmulosh(a1, a2) \
9631 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9632       ((vector signed int) __builtin_altivec_vmulosh ((vector signed short) (a1), (vector signed short) (a2))), \
9633 __builtin_altivec_compiletime_error ("vec_vmulosh"))
9634
9635 #define vec_vmulouh(a1, a2) \
9636 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9637       ((vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) (a1), (vector signed short) (a2))), \
9638 __builtin_altivec_compiletime_error ("vec_vmulouh"))
9639
9640 #define vec_vmulosb(a1, a2) \
9641 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9642       ((vector signed short) __builtin_altivec_vmulosb ((vector signed char) (a1), (vector signed char) (a2))), \
9643 __builtin_altivec_compiletime_error ("vec_vmulosb"))
9644
9645 #define vec_vmuloub(a1, a2) \
9646 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9647       ((vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) (a1), (vector signed char) (a2))), \
9648 __builtin_altivec_compiletime_error ("vec_vmuloub"))
9649
9650 #define vec_nmsub(a1, a2, a3) \
9651 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector float, (a3)), \
9652       ((vector float) __builtin_altivec_vnmsubfp ((vector float) (a1), (vector float) (a2), (vector float) (a3))), \
9653     __builtin_altivec_compiletime_error ("vec_nmsub"))
9654
9655 #define vec_nor(a1, a2) \
9656 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9657       ((vector float) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9658 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9659       ((vector signed int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9660 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9661       ((vector unsigned int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9662 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9663       ((vector bool int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9664 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9665       ((vector signed short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9666 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9667       ((vector unsigned short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9668 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9669       ((vector bool short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9670 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9671       ((vector signed char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9672 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9673       ((vector unsigned char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9674 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9675       ((vector bool char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9676     __builtin_altivec_compiletime_error ("vec_nor")))))))))))
9677
9678 #define vec_or(a1, a2) \
9679 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9680       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9681 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
9682       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9683 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
9684       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9685 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9686       ((vector bool int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9687 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9688       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9689 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9690       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9691 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9692       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9693 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9694       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9695 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9696       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9697 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9698       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9699 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9700       ((vector bool short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9701 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9702       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9703 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9704       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9705 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9706       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9707 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9708       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9709 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9710       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9711 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9712       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9713 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9714       ((vector bool char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9715 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9716       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9717 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9718       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9719 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9720       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9721 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9722       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9723 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9724       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9725 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9726       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9727     __builtin_altivec_compiletime_error ("vec_or")))))))))))))))))))))))))
9728
9729 #define vec_pack(a1, a2) \
9730 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9731       ((vector signed char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9732 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9733       ((vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9734 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9735       ((vector bool char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9736 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9737       ((vector signed short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9738 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9739       ((vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9740 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9741       ((vector bool short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9742     __builtin_altivec_compiletime_error ("vec_pack")))))))
9743
9744 #define vec_vpkuwum(a1, a2) \
9745 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9746       ((vector bool short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9747 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9748       ((vector signed short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9749 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9750       ((vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9751 __builtin_altivec_compiletime_error ("vec_vpkuwum"))))
9752
9753 #define vec_vpkuhum(a1, a2) \
9754 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9755       ((vector bool char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9756 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9757       ((vector signed char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9758 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9759       ((vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9760 __builtin_altivec_compiletime_error ("vec_vpkuhum"))))
9761
9762 #define vec_packpx(a1, a2) \
9763 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9764   ((vector pixel) __builtin_altivec_vpkpx ((vector signed int) (a1), (vector signed int) (a2))), \
9765 __builtin_altivec_compiletime_error ("vec_packpx"))
9766
9767 #define vec_packs(a1, a2) \
9768 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9769       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9770 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9771       ((vector signed char) __builtin_altivec_vpkshss ((vector signed short) (a1), (vector signed short) (a2))), \
9772 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9773       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9774 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9775       ((vector signed short) __builtin_altivec_vpkswss ((vector signed int) (a1), (vector signed int) (a2))), \
9776     __builtin_altivec_compiletime_error ("vec_packs")))))
9777
9778 #define vec_vpkswss(a1, a2) \
9779 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9780       ((vector signed short) __builtin_altivec_vpkswss ((vector signed int) (a1), (vector signed int) (a2))), \
9781 __builtin_altivec_compiletime_error ("vec_vpkswss"))
9782
9783 #define vec_vpkuwus(a1, a2) \
9784 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9785       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9786 __builtin_altivec_compiletime_error ("vec_vpkuwus"))
9787
9788 #define vec_vpkshss(a1, a2) \
9789 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9790       ((vector signed char) __builtin_altivec_vpkshss ((vector signed short) (a1), (vector signed short) (a2))), \
9791 __builtin_altivec_compiletime_error ("vec_vpkshss"))
9792
9793 #define vec_vpkuhus(a1, a2) \
9794 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9795       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9796 __builtin_altivec_compiletime_error ("vec_vpkuhus"))
9797
9798 #define vec_packsu(a1, a2) \
9799 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9800       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9801 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9802       ((vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) (a1), (vector signed short) (a2))), \
9803 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9804       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9805 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9806       ((vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) (a1), (vector signed int) (a2))), \
9807     __builtin_altivec_compiletime_error ("vec_packsu")))))
9808
9809 #define vec_vpkswus(a1, a2) \
9810 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9811       ((vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) (a1), (vector signed int) (a2))), \
9812 __builtin_altivec_compiletime_error ("vec_vpkswus"))
9813
9814 #define vec_vpkshus(a1, a2) \
9815 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9816       ((vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) (a1), (vector signed short) (a2))), \
9817 __builtin_altivec_compiletime_error ("vec_vpkshus"))
9818
9819 #define vec_perm(a1, a2, a3) \
9820 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector unsigned char, (a3)), \
9821       ((vector float) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9822 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector unsigned char, (a3)), \
9823       ((vector signed int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9824 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector unsigned char, (a3)), \
9825       ((vector unsigned int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9826 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector unsigned char, (a3)), \
9827       ((vector bool int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9828 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector unsigned char, (a3)), \
9829       ((vector signed short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9830 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned char, (a3)), \
9831       ((vector unsigned short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9832 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector unsigned char, (a3)), \
9833       ((vector bool short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9834 __ch (__tern_args_eq (vector pixel, (a1), vector pixel, (a2), vector unsigned char, (a3)), \
9835       ((vector pixel) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9836 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector unsigned char, (a3)), \
9837       ((vector signed char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9838 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned char, (a3)), \
9839       ((vector unsigned char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9840 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector unsigned char, (a3)), \
9841       ((vector bool char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9842     __builtin_altivec_compiletime_error ("vec_perm"))))))))))))
9843
9844 #define vec_re(a1) \
9845 __ch (__un_args_eq (vector float, (a1)), \
9846       ((vector float) __builtin_altivec_vrefp ((vector float) (a1))), \
9847 __builtin_altivec_compiletime_error ("vec_re"))
9848
9849 #define vec_rl(a1, a2) \
9850 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9851       ((vector signed char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9852 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9853       ((vector unsigned char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9854 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9855       ((vector signed short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9856 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9857       ((vector unsigned short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9858 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9859       ((vector signed int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9860 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9861       ((vector unsigned int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9862     __builtin_altivec_compiletime_error ("vec_rl")))))))
9863
9864 #define vec_vrlw(a1, a2) \
9865 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9866       ((vector signed int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9867 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9868       ((vector unsigned int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9869 __builtin_altivec_compiletime_error ("vec_vrlw")))
9870
9871 #define vec_vrlh(a1, a2) \
9872 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9873       ((vector signed short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9874 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9875       ((vector unsigned short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9876 __builtin_altivec_compiletime_error ("vec_vrlh")))
9877
9878 #define vec_vrlb(a1, a2) \
9879 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9880       ((vector signed char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9881 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9882       ((vector unsigned char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9883 __builtin_altivec_compiletime_error ("vec_vrlb")))
9884
9885 #define vec_round(a1) \
9886 __ch (__un_args_eq (vector float, (a1)), \
9887       ((vector float) __builtin_altivec_vrfin ((vector float) (a1))), \
9888 __builtin_altivec_compiletime_error ("vec_round"))
9889
9890 #define vec_rsqrte(a1) \
9891 __ch (__un_args_eq (vector float, (a1)), \
9892       ((vector float) __builtin_altivec_vrsqrtefp ((vector float) (a1))), \
9893 __builtin_altivec_compiletime_error ("vec_rsqrte"))
9894
9895 #define vec_sel(a1, a2, a3) \
9896 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector bool int, (a3)), \
9897       ((vector float) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9898 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector unsigned int, (a3)), \
9899       ((vector float) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9900 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector bool int, (a3)), \
9901       ((vector bool int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9902 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector unsigned int, (a3)), \
9903       ((vector bool int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9904 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector bool int, (a3)), \
9905       ((vector signed int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9906 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector unsigned int, (a3)), \
9907       ((vector signed int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9908 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector bool int, (a3)), \
9909       ((vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9910 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector unsigned int, (a3)), \
9911       ((vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9912 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector bool short, (a3)), \
9913       ((vector bool short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9914 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector unsigned short, (a3)), \
9915       ((vector bool short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9916 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector bool short, (a3)), \
9917       ((vector signed short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9918 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector unsigned short, (a3)), \
9919       ((vector signed short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9920 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector bool short, (a3)), \
9921       ((vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9922 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9923       ((vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9924 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector bool char, (a3)), \
9925       ((vector bool char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9926 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector unsigned char, (a3)), \
9927       ((vector bool char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9928 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector bool char, (a3)), \
9929       ((vector signed char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9930 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector unsigned char, (a3)), \
9931       ((vector signed char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9932 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector bool char, (a3)), \
9933       ((vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9934 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned char, (a3)), \
9935       ((vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9936     __builtin_altivec_compiletime_error ("vec_sel")))))))))))))))))))))
9937
9938 #define vec_sl(a1, a2) \
9939 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9940       ((vector signed char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9941 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9942       ((vector unsigned char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9943 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9944       ((vector signed short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9945 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9946       ((vector unsigned short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9947 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9948       ((vector signed int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9949 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9950       ((vector unsigned int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9951     __builtin_altivec_compiletime_error ("vec_sl")))))))
9952
9953 #define vec_vslw(a1, a2) \
9954 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9955       ((vector signed int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9956 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9957       ((vector unsigned int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9958 __builtin_altivec_compiletime_error ("vec_vslw")))
9959
9960 #define vec_vslh(a1, a2) \
9961 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9962       ((vector signed short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9963 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9964       ((vector unsigned short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9965 __builtin_altivec_compiletime_error ("vec_vslh")))
9966
9967 #define vec_vslb(a1, a2) \
9968 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9969       ((vector signed char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9970 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9971       ((vector unsigned char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9972 __builtin_altivec_compiletime_error ("vec_vslb")))
9973
9974 #define vec_sld(a1, a2, a3) \
9975 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9976       ((vector float) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9977 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9978       ((vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9979 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9980       ((vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9981 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9982       ((vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9983 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9984       ((vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9985 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9986       ((vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9987 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9988       ((vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9989 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9990       ((vector pixel) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9991 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9992       ((vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9993 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9994       ((vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9995 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9996       ((vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9997     __builtin_altivec_compiletime_error ("vec_sld"))))))))))))
9998
9999 #define vec_sll(a1, a2) \
10000 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10001       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10002 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned short, (a2)), \
10003       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10004 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
10005       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10006 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10007       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10008 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned short, (a2)), \
10009       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10010 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
10011       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10012 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10013       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10014 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned short, (a2)), \
10015       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10016 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned char, (a2)), \
10017       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10018 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned int, (a2)), \
10019       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10020 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10021       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10022 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
10023       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10024 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned int, (a2)), \
10025       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10026 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10027       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10028 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
10029       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10030 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned int, (a2)), \
10031       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10032 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10033       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10034 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned char, (a2)), \
10035       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10036 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned int, (a2)), \
10037       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10038 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned short, (a2)), \
10039       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10040 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
10041       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10042 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned int, (a2)), \
10043       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10044 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned short, (a2)), \
10045       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10046 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10047       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10048 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10049       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10050 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned short, (a2)), \
10051       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10052 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10053       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10054 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned int, (a2)), \
10055       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10056 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned short, (a2)), \
10057       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10058 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10059       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
10060     __builtin_altivec_compiletime_error ("vec_sll")))))))))))))))))))))))))))))))
10061
10062 #define vec_slo(a1, a2) \
10063 __ch (__bin_args_eq (vector float, (a1), vector signed char, (a2)), \
10064       ((vector float) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10065 __ch (__bin_args_eq (vector float, (a1), vector unsigned char, (a2)), \
10066       ((vector float) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10067 __ch (__bin_args_eq (vector signed int, (a1), vector signed char, (a2)), \
10068       ((vector signed int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10069 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
10070       ((vector signed int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10071 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed char, (a2)), \
10072       ((vector unsigned int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10073 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
10074       ((vector unsigned int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10075 __ch (__bin_args_eq (vector signed short, (a1), vector signed char, (a2)), \
10076       ((vector signed short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10077 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
10078       ((vector signed short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10079 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed char, (a2)), \
10080       ((vector unsigned short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10081 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
10082       ((vector unsigned short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10083 __ch (__bin_args_eq (vector pixel, (a1), vector signed char, (a2)), \
10084       ((vector pixel) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10085 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
10086       ((vector pixel) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10087 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10088       ((vector signed char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10089 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10090       ((vector signed char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10091 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
10092       ((vector unsigned char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10093 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10094       ((vector unsigned char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
10095     __builtin_altivec_compiletime_error ("vec_slo")))))))))))))))))
10096
10097 #define vec_splat(a1, a2) \
10098 __ch (__un_args_eq (vector signed char, (a1)), \
10099       ((vector signed char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10100 __ch (__un_args_eq (vector unsigned char, (a1)), \
10101       ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10102 __ch (__un_args_eq (vector bool char, (a1)), \
10103       ((vector bool char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10104 __ch (__un_args_eq (vector signed short, (a1)), \
10105       ((vector signed short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10106 __ch (__un_args_eq (vector unsigned short, (a1)), \
10107       ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10108 __ch (__un_args_eq (vector bool short, (a1)), \
10109       ((vector bool short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10110 __ch (__un_args_eq (vector pixel, (a1)), \
10111       ((vector pixel) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10112 __ch (__un_args_eq (vector float, (a1)), \
10113       ((vector float) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10114 __ch (__un_args_eq (vector signed int, (a1)), \
10115       ((vector signed int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10116 __ch (__un_args_eq (vector unsigned int, (a1)), \
10117       ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10118 __ch (__un_args_eq (vector bool int, (a1)), \
10119       ((vector bool int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10120     __builtin_altivec_compiletime_error ("vec_splat"))))))))))))
10121
10122 #define vec_vspltw(a1, a2) \
10123 __ch (__un_args_eq (vector float, (a1)), \
10124       ((vector float) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10125 __ch (__un_args_eq (vector bool int, (a1)), \
10126       ((vector bool int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10127 __ch (__un_args_eq (vector signed int, (a1)), \
10128       ((vector signed int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10129 __ch (__un_args_eq (vector unsigned int, (a1)), \
10130       ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
10131 __builtin_altivec_compiletime_error ("vec_vspltw")))))
10132
10133 #define vec_vsplth(a1, a2) \
10134 __ch (__un_args_eq (vector bool short, (a1)), \
10135       ((vector bool short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10136 __ch (__un_args_eq (vector signed short, (a1)), \
10137       ((vector signed short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10138 __ch (__un_args_eq (vector unsigned short, (a1)), \
10139       ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10140 __ch (__un_args_eq (vector pixel, (a1)), \
10141       ((vector pixel) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
10142 __builtin_altivec_compiletime_error ("vec_vsplth")))))
10143
10144 #define vec_vspltb(a1, a2) \
10145 __ch (__un_args_eq (vector bool char, (a1)), \
10146       ((vector bool char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10147 __ch (__un_args_eq (vector signed char, (a1)), \
10148       ((vector signed char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10149 __ch (__un_args_eq (vector unsigned char, (a1)), \
10150       ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
10151 __builtin_altivec_compiletime_error ("vec_vspltb"))))
10152
10153 #define vec_splat_s8(a1) ((vector signed char) __builtin_altivec_vspltisb (a1))
10154
10155 #define vec_splat_s16(a1) ((vector signed short) __builtin_altivec_vspltish (a1))
10156
10157 #define vec_splat_s32(a1) ((vector signed int) __builtin_altivec_vspltisw (a1))
10158
10159 #define vec_splat_u8(a1) ((vector unsigned char) __builtin_altivec_vspltisb (a1))
10160
10161 #define vec_splat_u16(a1) ((vector unsigned short) __builtin_altivec_vspltish (a1))
10162
10163 #define vec_splat_u32(a1) ((vector unsigned int) __builtin_altivec_vspltisw (a1))
10164
10165 #define vec_sr(a1, a2) \
10166 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10167       ((vector signed char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
10168 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10169       ((vector unsigned char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
10170 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10171       ((vector signed short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
10172 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10173       ((vector unsigned short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
10174 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10175       ((vector signed int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
10176 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10177       ((vector unsigned int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
10178     __builtin_altivec_compiletime_error ("vec_sr")))))))
10179
10180 #define vec_vsrw(a1, a2) \
10181 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10182       ((vector signed int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
10183 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10184       ((vector unsigned int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
10185 __builtin_altivec_compiletime_error ("vec_vsrw")))
10186
10187 #define vec_vsrh(a1, a2) \
10188 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10189       ((vector signed short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
10190 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10191       ((vector unsigned short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
10192 __builtin_altivec_compiletime_error ("vec_vsrh")))
10193
10194 #define vec_vsrb(a1, a2) \
10195 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10196       ((vector signed char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
10197 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10198       ((vector unsigned char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
10199 __builtin_altivec_compiletime_error ("vec_vsrb")))
10200
10201 #define vec_sra(a1, a2) \
10202 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10203       ((vector signed char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
10204 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10205       ((vector unsigned char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
10206 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10207       ((vector signed short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
10208 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10209       ((vector unsigned short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
10210 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10211       ((vector signed int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
10212 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10213       ((vector unsigned int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
10214     __builtin_altivec_compiletime_error ("vec_sra")))))))
10215
10216 #define vec_vsraw(a1, a2) \
10217 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10218       ((vector signed int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
10219 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10220       ((vector unsigned int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
10221 __builtin_altivec_compiletime_error ("vec_vsraw")))
10222
10223 #define vec_vsrah(a1, a2) \
10224 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10225       ((vector signed short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
10226 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10227       ((vector unsigned short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
10228 __builtin_altivec_compiletime_error ("vec_vsrah")))
10229
10230 #define vec_vsrab(a1, a2) \
10231 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10232       ((vector signed char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
10233 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10234       ((vector unsigned char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
10235 __builtin_altivec_compiletime_error ("vec_vsrab")))
10236
10237 #define vec_srl(a1, a2) \
10238 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10239       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10240 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned short, (a2)), \
10241       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10242 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
10243       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10244 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10245       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10246 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned short, (a2)), \
10247       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10248 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
10249       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10250 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10251       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10252 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned short, (a2)), \
10253       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10254 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned char, (a2)), \
10255       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10256 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned int, (a2)), \
10257       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10258 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10259       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10260 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
10261       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10262 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned int, (a2)), \
10263       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10264 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10265       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10266 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
10267       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10268 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned int, (a2)), \
10269       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10270 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10271       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10272 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned char, (a2)), \
10273       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10274 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned int, (a2)), \
10275       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10276 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned short, (a2)), \
10277       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10278 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
10279       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10280 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned int, (a2)), \
10281       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10282 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned short, (a2)), \
10283       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10284 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10285       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10286 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10287       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10288 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned short, (a2)), \
10289       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10290 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10291       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10292 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned int, (a2)), \
10293       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10294 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned short, (a2)), \
10295       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10296 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10297       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
10298     __builtin_altivec_compiletime_error ("vec_srl")))))))))))))))))))))))))))))))
10299
10300 #define vec_sro(a1, a2) \
10301 __ch (__bin_args_eq (vector float, (a1), vector signed char, (a2)), \
10302       ((vector float) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10303 __ch (__bin_args_eq (vector float, (a1), vector unsigned char, (a2)), \
10304       ((vector float) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10305 __ch (__bin_args_eq (vector signed int, (a1), vector signed char, (a2)), \
10306       ((vector signed int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10307 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
10308       ((vector signed int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10309 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed char, (a2)), \
10310       ((vector unsigned int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10311 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
10312       ((vector unsigned int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10313 __ch (__bin_args_eq (vector signed short, (a1), vector signed char, (a2)), \
10314       ((vector signed short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10315 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
10316       ((vector signed short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10317 __ch (__bin_args_eq (vector pixel, (a1), vector signed char, (a2)), \
10318       ((vector pixel) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10319 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
10320       ((vector pixel) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10321 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed char, (a2)), \
10322       ((vector unsigned short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10323 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
10324       ((vector unsigned short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10325 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10326       ((vector signed char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10327 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10328       ((vector signed char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10329 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
10330       ((vector unsigned char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10331 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10332       ((vector unsigned char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
10333     __builtin_altivec_compiletime_error ("vec_sro")))))))))))))))))
10334
10335 #define vec_st(a1, a2, a3) \
10336 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, *(a3)), \
10337   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10338 __ch (__bin_args_eq (vector unsigned char, (a1), unsigned char, *(a3)), \
10339   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10340 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, *(a3)), \
10341   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10342 __ch (__bin_args_eq (vector signed char, (a1), signed char, *(a3)), \
10343   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10344 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, *(a3)), \
10345   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10346 __ch (__bin_args_eq (vector bool char, (a1), unsigned char, *(a3)), \
10347   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10348 __ch (__bin_args_eq (vector bool char, (a1), signed char, *(a3)), \
10349   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10350 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, *(a3)), \
10351   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10352 __ch (__bin_args_eq (vector unsigned short, (a1), unsigned short, *(a3)), \
10353   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10354 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, *(a3)), \
10355   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10356 __ch (__bin_args_eq (vector signed short, (a1), short, *(a3)), \
10357   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10358 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, *(a3)), \
10359   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10360 __ch (__bin_args_eq (vector bool short, (a1), unsigned short, *(a3)), \
10361   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10362 __ch (__bin_args_eq (vector bool short, (a1), short, *(a3)), \
10363   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10364 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, *(a3)), \
10365   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10366 __ch (__bin_args_eq (vector pixel, (a1), unsigned short, *(a3)), \
10367   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10368 __ch (__bin_args_eq (vector pixel, (a1), short, *(a3)), \
10369   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10370 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, *(a3)), \
10371   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10372 __ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, *(a3)), \
10373   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10374 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, *(a3)), \
10375   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10376 __ch (__bin_args_eq (vector signed int, (a1), int, *(a3)), \
10377   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10378 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, *(a3)), \
10379   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10380 __ch (__bin_args_eq (vector bool int, (a1), unsigned int, *(a3)), \
10381   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10382 __ch (__bin_args_eq (vector bool int, (a1), int, *(a3)), \
10383   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10384 __ch (__bin_args_eq (vector float, (a1), vector float, *(a3)), \
10385   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10386 __ch (__bin_args_eq (vector float, (a1), float, *(a3)), \
10387   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
10388 __builtin_altivec_compiletime_error ("vec_st")))))))))))))))))))))))))))
10389
10390 #define vec_stl(a1, a2, a3) \
10391 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, *(a3)), \
10392   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10393 __ch (__bin_args_eq (vector unsigned char, (a1), unsigned char, *(a3)), \
10394   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10395 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, *(a3)), \
10396   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10397 __ch (__bin_args_eq (vector signed char, (a1), signed char, *(a3)), \
10398   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10399 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, *(a3)), \
10400   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10401 __ch (__bin_args_eq (vector bool char, (a1), unsigned char, *(a3)), \
10402   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10403 __ch (__bin_args_eq (vector bool char, (a1), signed char, *(a3)), \
10404   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10405 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, *(a3)), \
10406   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10407 __ch (__bin_args_eq (vector unsigned short, (a1), unsigned short, *(a3)), \
10408   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10409 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, *(a3)), \
10410   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10411 __ch (__bin_args_eq (vector signed short, (a1), short, *(a3)), \
10412   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10413 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, *(a3)), \
10414   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10415 __ch (__bin_args_eq (vector bool short, (a1), unsigned short, *(a3)), \
10416   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10417 __ch (__bin_args_eq (vector bool short, (a1), short, *(a3)), \
10418   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10419 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, *(a3)), \
10420   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10421 __ch (__bin_args_eq (vector pixel, (a1), unsigned short, *(a3)), \
10422   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10423 __ch (__bin_args_eq (vector pixel, (a1), short, *(a3)), \
10424   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10425 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, *(a3)), \
10426   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10427 __ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, *(a3)), \
10428   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10429 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, *(a3)), \
10430   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10431 __ch (__bin_args_eq (vector signed int, (a1), int, *(a3)), \
10432   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10433 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, *(a3)), \
10434   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10435 __ch (__bin_args_eq (vector bool int, (a1), unsigned int, *(a3)), \
10436   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10437 __ch (__bin_args_eq (vector bool int, (a1), int, *(a3)), \
10438   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10439 __ch (__bin_args_eq (vector float, (a1), vector float, *(a3)), \
10440   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10441 __ch (__bin_args_eq (vector float, (a1), float, *(a3)), \
10442   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10443 __builtin_altivec_compiletime_error ("vec_stl")))))))))))))))))))))))))))
10444
10445 #define vec_ste(a, b, c) \
10446 __ch (__bin_args_eq (vector unsigned char, (a), unsigned char, *(c)), \
10447       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10448 __ch (__bin_args_eq (vector signed char, (a), signed char, *(c)), \
10449       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10450 __ch (__bin_args_eq (vector bool char, (a), unsigned char, *(c)), \
10451       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10452 __ch (__bin_args_eq (vector bool char, (a), signed char, *(c)), \
10453       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10454 __ch (__bin_args_eq (vector unsigned short, (a), unsigned short, *(c)), \
10455      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10456 __ch (__bin_args_eq (vector signed short, (a), short, *(c)), \
10457      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10458 __ch (__bin_args_eq (vector bool short, (a), unsigned short, *(c)), \
10459      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10460 __ch (__bin_args_eq (vector bool short, (a), short, *(c)), \
10461      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10462 __ch (__bin_args_eq (vector pixel, (a), unsigned short, *(c)), \
10463      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10464 __ch (__bin_args_eq (vector pixel, (a), short, *(c)), \
10465      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10466 __ch (__bin_args_eq (vector unsigned int, (a), unsigned int, *(c)), \
10467      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10468 __ch (__bin_args_eq (vector signed int, (a), int, *(c)), \
10469      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10470 __ch (__bin_args_eq (vector bool int, (a), unsigned int, *(c)), \
10471      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10472 __ch (__bin_args_eq (vector bool int, (a), int, *(c)), \
10473      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10474 __ch (__bin_args_eq (vector float, (a), float, *(c)), \
10475      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10476      __builtin_altivec_compiletime_error ("vec_ste"))))))))))))))))
10477
10478 #define vec_stvewx(a, b, c) \
10479 __ch (__un_args_eq (vector unsigned int, (a)), \
10480      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10481 __ch (__un_args_eq (vector signed int, (a)), \
10482      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10483 __ch (__un_args_eq (vector float, (a)), \
10484      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10485 __builtin_altivec_compiletime_error ("vec_stvewx"))))
10486
10487 #define vec_stvehx(a, b, c) \
10488 __ch (__un_args_eq (vector unsigned short, (a)), \
10489      __builtin_altivec_stvehx ((vector signed short) (a), (b), (c)), \
10490 __ch (__un_args_eq (vector signed short, (a)), \
10491      __builtin_altivec_stvehx ((vector signed short) (a), (b), (c)), \
10492 __builtin_altivec_compiletime_error ("vec_stvehx")))
10493
10494 #define vec_stvebx(a, b, c) \
10495 __ch (__un_args_eq (vector unsigned char, (a)), \
10496       __builtin_altivec_stvebx ((vector signed char) (a), (b), (c)), \
10497 __ch (__un_args_eq (vector signed char, (a)), \
10498       __builtin_altivec_stvebx ((vector signed char) (a), (b), (c)), \
10499 __builtin_altivec_compiletime_error ("vec_stvebx")))
10500
10501 #define vec_sub(a1, a2) \
10502 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10503       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10504 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10505       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10506 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10507       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10508 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10509       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10510 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10511       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10512 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10513       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10514 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10515       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10516 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10517       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10518 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10519       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10520 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10521       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10522 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10523       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10524 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10525       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10526 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10527       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10528 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10529       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10530 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10531       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10532 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10533       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10534 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10535       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10536 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10537       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10538 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10539       ((vector float) __builtin_altivec_vsubfp ((vector float) (a1), (vector float) (a2))), \
10540     __builtin_altivec_compiletime_error ("vec_sub"))))))))))))))))))))
10541
10542 #define vec_vsubfp(a1, a2) \
10543 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10544       ((vector float) __builtin_altivec_vsubfp ((vector float) (a1), (vector float) (a2))), \
10545 __builtin_altivec_compiletime_error ("vec_vsubfp"))
10546
10547 #define vec_vsubuwm(a1, a2) \
10548 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10549       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10550 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10551       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10552 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10553       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10554 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10555       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10556 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10557       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10558 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10559       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10560 __builtin_altivec_compiletime_error ("vec_vsubuwm")))))))
10561
10562 #define vec_vsubuhm(a1, a2) \
10563 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10564       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10565 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10566       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10567 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10568       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10569 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10570       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10571 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10572       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10573 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10574       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10575 __builtin_altivec_compiletime_error ("vec_vsubuhm")))))))
10576
10577 #define vec_vsububm(a1, a2) \
10578 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10579       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10580 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10581       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10582 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10583       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10584 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10585       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10586 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10587       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10588 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10589       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10590 __builtin_altivec_compiletime_error ("vec_vsububm")))))))
10591
10592 #define vec_subc(a1, a2) \
10593 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10594   ((vector unsigned int) __builtin_altivec_vsubcuw ((vector signed int) (a1), (vector signed int) (a2))), \
10595 __builtin_altivec_compiletime_error ("vec_subc"))
10596
10597 #define vec_subs(a1, a2) \
10598 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10599       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10600 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10601       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10602 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10603       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10604 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10605       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10606 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10607       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10608 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10609       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10610 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10611       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10612 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10613       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10614 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10615       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10616 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10617       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10618 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10619       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10620 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10621       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10622 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10623       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10624 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10625       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10626 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10627       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10628 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10629       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10630 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10631       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10632 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10633       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10634     __builtin_altivec_compiletime_error ("vec_subs")))))))))))))))))))
10635
10636 #define vec_vsubsws(a1, a2) \
10637 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10638       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10639 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10640       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10641 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10642       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10643 __builtin_altivec_compiletime_error ("vec_vsubsws"))))
10644
10645 #define vec_vsubuws(a1, a2) \
10646 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10647       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10648 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10649       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10650 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10651       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10652 __builtin_altivec_compiletime_error ("vec_vsubuws"))))
10653
10654 #define vec_vsubshs(a1, a2) \
10655 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10656       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10657 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10658       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10659 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10660       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10661 __builtin_altivec_compiletime_error ("vec_vsubshs"))))
10662
10663 #define vec_vsubuhs(a1, a2) \
10664 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10665       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10666 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10667       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10668 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10669       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10670 __builtin_altivec_compiletime_error ("vec_vsubuhs"))))
10671
10672 #define vec_vsubsbs(a1, a2) \
10673 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10674       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10675 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10676       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10677 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10678       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10679 __builtin_altivec_compiletime_error ("vec_vsubsbs"))))
10680
10681 #define vec_vsububs(a1, a2) \
10682 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10683       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10684 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10685       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10686 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10687       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10688 __builtin_altivec_compiletime_error ("vec_vsububs"))))
10689
10690 #define vec_sum4s(a1, a2) \
10691 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10692       ((vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) (a1), (vector signed int) (a2))), \
10693 __ch (__bin_args_eq (vector signed char, (a1), vector signed int, (a2)), \
10694       ((vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) (a1), (vector signed int) (a2))), \
10695 __ch (__bin_args_eq (vector signed short, (a1), vector signed int, (a2)), \
10696       ((vector signed int) __builtin_altivec_vsum4shs ((vector signed short) (a1), (vector signed int) (a2))), \
10697     __builtin_altivec_compiletime_error ("vec_sum4s"))))
10698
10699 #define vec_vsum4shs(a1, a2) \
10700 __ch (__bin_args_eq (vector signed short, (a1), vector signed int, (a2)), \
10701       ((vector signed int) __builtin_altivec_vsum4shs ((vector signed short) (a1), (vector signed int) (a2))), \
10702 __builtin_altivec_compiletime_error ("vec_vsum4shs"))
10703
10704 #define vec_vsum4sbs(a1, a2) \
10705 __ch (__bin_args_eq (vector signed char, (a1), vector signed int, (a2)), \
10706       ((vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) (a1), (vector signed int) (a2))), \
10707 __builtin_altivec_compiletime_error ("vec_vsum4sbs"))
10708
10709 #define vec_vsum4ubs(a1, a2) \
10710 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10711       ((vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) (a1), (vector signed int) (a2))), \
10712 __builtin_altivec_compiletime_error ("vec_vsum4ubs"))
10713
10714 #define vec_sum2s(a1, a2) \
10715 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10716       ((vector signed int) __builtin_altivec_vsum2sws ((vector signed int) (a1), (vector signed int) (a2))), \
10717 __builtin_altivec_compiletime_error ("vec_sum2s"))
10718
10719 #define vec_sums(a1, a2) \
10720 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10721       ((vector signed int) __builtin_altivec_vsumsws ((vector signed int) (a1), (vector signed int) (a2))), \
10722 __builtin_altivec_compiletime_error ("vec_sums"))
10723
10724 #define vec_trunc(a1) \
10725 __ch (__un_args_eq (vector float, (a1)), \
10726       ((vector float) __builtin_altivec_vrfiz ((vector float) (a1))), \
10727 __builtin_altivec_compiletime_error ("vec_trunc"))
10728
10729 #define vec_unpackh(a1) \
10730 __ch (__un_args_eq (vector signed char, (a1)), \
10731       ((vector signed short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10732 __ch (__un_args_eq (vector bool char, (a1)), \
10733       ((vector bool short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10734 __ch (__un_args_eq (vector pixel, (a1)), \
10735       ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \
10736 __ch (__un_args_eq (vector signed short, (a1)), \
10737       ((vector signed int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10738 __ch (__un_args_eq (vector bool short, (a1)), \
10739       ((vector bool int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10740     __builtin_altivec_compiletime_error ("vec_unpackh"))))))
10741
10742 #define vec_vupkhsh(a1) \
10743 __ch (__un_args_eq (vector bool short, (a1)), \
10744       ((vector bool int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10745 __ch (__un_args_eq (vector signed short, (a1)), \
10746       ((vector signed int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10747 __builtin_altivec_compiletime_error ("vec_vupkhsh")))
10748
10749 #define vec_vupkhpx(a1) \
10750 __ch (__un_args_eq (vector pixel, (a1)), \
10751       ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \
10752 __builtin_altivec_compiletime_error ("vec_vupkhpx"))
10753
10754 #define vec_vupkhsb(a1) \
10755 __ch (__un_args_eq (vector bool char, (a1)), \
10756       ((vector bool short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10757 __ch (__un_args_eq (vector signed char, (a1)), \
10758       ((vector signed short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10759 __builtin_altivec_compiletime_error ("vec_vupkhsb")))
10760
10761 #define vec_unpackl(a1) \
10762 __ch (__un_args_eq (vector signed char, (a1)), \
10763       ((vector signed short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10764 __ch (__un_args_eq (vector bool char, (a1)), \
10765       ((vector bool short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10766 __ch (__un_args_eq (vector pixel, (a1)), \
10767       ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \
10768 __ch (__un_args_eq (vector signed short, (a1)), \
10769       ((vector signed int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10770 __ch (__un_args_eq (vector bool short, (a1)), \
10771       ((vector bool int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10772     __builtin_altivec_compiletime_error ("vec_unpackl"))))))
10773
10774 #define vec_vupklsh(a1) \
10775 __ch (__un_args_eq (vector bool short, (a1)), \
10776       ((vector bool int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10777 __ch (__un_args_eq (vector signed short, (a1)), \
10778       ((vector signed int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10779 __builtin_altivec_compiletime_error ("vec_vupklsh")))
10780
10781 #define vec_vupklpx(a1) \
10782 __ch (__un_args_eq (vector pixel, (a1)), \
10783       ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \
10784 __builtin_altivec_compiletime_error ("vec_vupklpx"))
10785
10786 #define vec_vupklsb(a1) \
10787 __ch (__un_args_eq (vector bool char, (a1)), \
10788       ((vector bool short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10789 __ch (__un_args_eq (vector signed char, (a1)), \
10790       ((vector signed short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10791 __builtin_altivec_compiletime_error ("vec_vupklsb")))
10792
10793 #define vec_xor(a1, a2) \
10794 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10795       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10796 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
10797       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10798 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
10799       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10800 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10801       ((vector bool int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10802 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10803       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10804 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10805       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10806 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10807       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10808 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10809       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10810 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10811       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10812 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10813       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10814 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10815       ((vector bool short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10816 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10817       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10818 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10819       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10820 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10821       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10822 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10823       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10824 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10825       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10826 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10827       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10828 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10829       ((vector bool char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10830 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10831       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10832 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10833       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10834 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10835       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10836 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10837       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10838 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10839       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10840 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10841       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10842     __builtin_altivec_compiletime_error ("vec_xor")))))))))))))))))))))))))
10843
10844 /* Predicates.  */
10845
10846 #define vec_all_eq(a1, a2) \
10847 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10848       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10849 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10850       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10851 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10852       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10853 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10854       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10855 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10856       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10857 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10858       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10859 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10860       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10861 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10862       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10863 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10864       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10865 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10866       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10867 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10868       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10869 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10870       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10871 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10872       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10873 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10874       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10875 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
10876       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10877 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10878       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10879 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10880       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10881 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10882       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10883 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10884       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10885 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10886       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10887 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10888       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10889 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10890       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10891 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10892       __builtin_altivec_vcmpeqfp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10893     __builtin_altivec_compiletime_error ("vec_all_eq"))))))))))))))))))))))))
10894
10895 #define vec_all_ge(a1, a2) \
10896 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10897       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10898 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10899       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10900 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10901       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10902 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10903       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10904 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10905       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10906 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10907       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10908 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10909       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10910 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10911       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10912 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10913       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10914 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10915       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10916 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10917       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10918 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10919       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10920 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10921       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10922 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10923       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10924 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10925       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10926 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10927       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10928 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10929       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10930 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10931       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10932 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10933       __builtin_altivec_vcmpgefp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10934     __builtin_altivec_compiletime_error ("vec_all_ge"))))))))))))))))))))
10935
10936 #define vec_all_gt(a1, a2) \
10937 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10938       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10939 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10940       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10941 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10942       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10943 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10944       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10945 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10946       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10947 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10948       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10949 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10950       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10951 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10952       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10953 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10954       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10955 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10956       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10957 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10958       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10959 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10960       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10961 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10962       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10963 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10964       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10965 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10966       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10967 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10968       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10969 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10970       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10971 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10972       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10973 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10974       __builtin_altivec_vcmpgtfp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10975     __builtin_altivec_compiletime_error ("vec_all_gt"))))))))))))))))))))
10976
10977 #define vec_all_in(a1, a2) \
10978 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10979       __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)), \
10980     __builtin_altivec_compiletime_error ("vec_all_in"))
10981
10982 #define vec_all_le(a1, a2) \
10983 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10984       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10985 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10986       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10987 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10988       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10989 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10990       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10991 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10992       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10993 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10994       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10995 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10996       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10997 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10998       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10999 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11000       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11001 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11002       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11003 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11004       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11005 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11006       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11007 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11008       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11009 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11010       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11011 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11012       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11013 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11014       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11015 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11016       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11017 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11018       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11019 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11020       __builtin_altivec_vcmpgefp_p (__CR6_LT, (vector float) (a2), (vector float) (a1)), \
11021     __builtin_altivec_compiletime_error ("vec_all_le"))))))))))))))))))))
11022
11023 #define vec_all_lt(a1, a2) \
11024 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11025       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11026 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11027       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11028 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11029       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11030 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11031       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11032 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11033       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11034 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11035       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
11036 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11037       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11038 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11039       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11040 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11041       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11042 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11043       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11044 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11045       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11046 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11047       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
11048 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11049       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11050 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11051       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11052 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11053       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11054 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11055       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11056 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11057       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11058 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11059       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
11060 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11061       __builtin_altivec_vcmpgtfp_p (__CR6_LT, (vector float) (a2), (vector float) (a1)), \
11062     __builtin_altivec_compiletime_error ("vec_all_lt"))))))))))))))))))))
11063
11064 #define vec_all_nan(a1) \
11065 __ch (__un_args_eq (vector float, (a1)), \
11066       __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)), \
11067     __builtin_altivec_compiletime_error ("vec_all_nan"))
11068
11069 #define vec_all_ne(a1, a2) \
11070 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11071       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11072 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11073       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11074 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11075       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11076 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11077       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11078 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11079       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11080 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11081       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11082 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
11083       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
11084 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11085       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11086 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11087       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11088 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11089       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11090 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11091       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11092 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11093       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11094 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11095       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11096 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
11097       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11098 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
11099       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
11100 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11101       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11102 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11103       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11104 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11105       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11106 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11107       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11108 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11109       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11110 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11111       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11112 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
11113       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
11114 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11115       __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (vector float) (a1), (vector float) (a2)), \
11116     __builtin_altivec_compiletime_error ("vec_all_ne"))))))))))))))))))))))))
11117
11118 #define vec_all_nge(a1, a2) \
11119 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11120       __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)), \
11121     __builtin_altivec_compiletime_error ("vec_all_nge"))
11122
11123 #define vec_all_ngt(a1, a2) \
11124 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11125       __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)), \
11126     __builtin_altivec_compiletime_error ("vec_all_ngt"))
11127
11128 #define vec_all_nle(a1, a2) \
11129 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11130       __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)), \
11131     __builtin_altivec_compiletime_error ("vec_all_nle"))
11132
11133 #define vec_all_nlt(a1, a2) \
11134 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11135       __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)), \
11136     __builtin_altivec_compiletime_error ("vec_all_nlt"))
11137
11138 #define vec_all_numeric(a1) \
11139 __ch (__un_args_eq (vector float, (a1)), \
11140       __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)), \
11141     __builtin_altivec_compiletime_error ("vec_all_numeric"))
11142
11143 #define vec_any_eq(a1, a2) \
11144 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11145       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11146 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11147       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11148 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11149       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11150 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11151       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11152 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11153       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11154 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11155       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11156 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
11157       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11158 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11159       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11160 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11161       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11162 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11163       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11164 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11165       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11166 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11167       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11168 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11169       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11170 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
11171       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11172 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
11173       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11174 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11175       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11176 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11177       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11178 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11179       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11180 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11181       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11182 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11183       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11184 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11185       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11186 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
11187       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11188 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11189       __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
11190     __builtin_altivec_compiletime_error ("vec_any_eq"))))))))))))))))))))))))
11191
11192 #define vec_any_ge(a1, a2) \
11193 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11194       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11195 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11196       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11197 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11198       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11199 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11200       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11201 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11202       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11203 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11204       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11205 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11206       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11207 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11208       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11209 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11210       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11211 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11212       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11213 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11214       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11215 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11216       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11217 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11218       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11219 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11220       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11221 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11222       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11223 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11224       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11225 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11226       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11227 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11228       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11229 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11230       __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
11231     __builtin_altivec_compiletime_error ("vec_any_ge"))))))))))))))))))))
11232
11233 #define vec_any_gt(a1, a2) \
11234 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11235       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11236 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11237       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11238 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11239       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11240 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11241       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11242 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11243       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11244 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11245       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11246 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11247       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11248 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11249       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11250 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11251       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11252 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11253       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11254 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11255       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11256 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11257       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11258 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11259       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11260 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11261       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11262 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11263       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11264 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11265       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11266 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11267       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11268 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11269       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11270 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11271       __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
11272     __builtin_altivec_compiletime_error ("vec_any_gt"))))))))))))))))))))
11273
11274 #define vec_any_le(a1, a2) \
11275 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11276       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11277 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11278       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11279 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11280       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11281 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11282       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11283 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11284       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11285 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11286       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11287 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11288       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11289 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11290       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11291 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11292       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11293 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11294       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11295 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11296       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11297 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11298       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11299 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11300       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11301 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11302       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11303 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11304       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11305 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11306       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11307 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11308       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11309 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11310       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11311 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11312       __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (vector float) (a2), (vector float) (a1)), \
11313     __builtin_altivec_compiletime_error ("vec_any_le"))))))))))))))))))))
11314
11315 #define vec_any_lt(a1, a2) \
11316 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11317       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11318 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11319       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11320 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11321       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11322 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11323       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11324 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11325       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11326 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11327       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
11328 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11329       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11330 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11331       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11332 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11333       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11334 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11335       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11336 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11337       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11338 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11339       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
11340 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11341       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11342 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11343       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11344 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11345       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11346 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11347       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11348 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11349       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11350 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11351       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
11352 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11353       __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (vector float) (a2), (vector float) (a1)), \
11354     __builtin_altivec_compiletime_error ("vec_any_lt"))))))))))))))))))))
11355
11356 #define vec_any_nan(a1) \
11357 __ch (__un_args_eq (vector float, (a1)), \
11358       __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)), \
11359     __builtin_altivec_compiletime_error ("vec_any_nan"))
11360
11361 #define vec_any_ne(a1, a2) \
11362 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
11363       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11364 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
11365       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11366 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
11367       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11368 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
11369       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11370 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
11371       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11372 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
11373       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11374 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
11375       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
11376 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
11377       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11378 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
11379       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11380 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
11381       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11382 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
11383       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11384 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
11385       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11386 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
11387       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11388 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
11389       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11390 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
11391       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
11392 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
11393       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11394 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
11395       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11396 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
11397       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11398 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
11399       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11400 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
11401       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11402 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
11403       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11404 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
11405       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
11406 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11407       __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (vector float) (a1), (vector float) (a2)), \
11408     __builtin_altivec_compiletime_error ("vec_any_ne"))))))))))))))))))))))))
11409
11410 #define vec_any_nge(a1, a2) \
11411 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11412       __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)), \
11413     __builtin_altivec_compiletime_error ("vec_any_nge"))
11414
11415 #define vec_any_ngt(a1, a2) \
11416 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11417       __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)), \
11418     __builtin_altivec_compiletime_error ("vec_any_ngt"))
11419
11420 #define vec_any_nle(a1, a2) \
11421 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11422       __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)), \
11423     __builtin_altivec_compiletime_error ("vec_any_nle"))
11424
11425 #define vec_any_nlt(a1, a2) \
11426 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11427       __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)), \
11428     __builtin_altivec_compiletime_error ("vec_any_nlt"))
11429
11430 #define vec_any_numeric(a1) \
11431 __ch (__un_args_eq (vector float, (a1)), \
11432       __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)), \
11433     __builtin_altivec_compiletime_error ("vec_any_numeric"))
11434
11435 #define vec_any_out(a1, a2) \
11436 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
11437       __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)), \
11438     __builtin_altivec_compiletime_error ("vec_any_out"))
11439
11440
11441 #endif /* __cplusplus */
11442
11443 #endif /* _ALTIVEC_H */