OSDN Git Service

2004-07-16 Andreas Krebbel <krebbel1@de.ibm.com>
[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 signed int vec_vspltw (vector signed int a1, const int a2) __attribute__ ((always_inline));
230 inline vector unsigned int vec_vspltw (vector unsigned int a1, const int a2) __attribute__ ((always_inline));
231 inline vector signed short vec_vsplth (vector signed short a1, const int a2) __attribute__ ((always_inline));
232 inline vector unsigned short vec_vsplth (vector unsigned short a1, const int a2) __attribute__ ((always_inline));
233 inline vector signed char vec_vspltb (vector signed char a1, const int a2) __attribute__ ((always_inline));
234 inline vector unsigned char vec_vspltb (vector unsigned char a1, const int a2) __attribute__ ((always_inline));
235
236 /* vec_step */
237
238 template<typename _Tp>
239 struct __vec_step_help
240 {
241   // All proper vector types will specialize _S_elem.
242 };
243
244 template<>
245 struct __vec_step_help<vector signed short>
246 {
247   static const int _S_elem = 8;
248 };
249
250 template<>
251 struct __vec_step_help<vector unsigned short>
252 {
253   static const int _S_elem = 8;
254 };
255
256 template<>
257 struct __vec_step_help<vector bool short>
258 {
259   static const int _S_elem = 8;
260 };
261
262 template<>
263 struct __vec_step_help<vector pixel>
264 {
265   static const int _S_elem = 8;
266 };
267
268 template<>
269 struct __vec_step_help<vector signed int>
270 {
271   static const int _S_elem = 4;
272 };
273
274 template<>
275 struct __vec_step_help<vector unsigned int>
276 {
277   static const int _S_elem = 4;
278 };
279
280 template<>
281 struct __vec_step_help<vector bool int>
282 {
283   static const int _S_elem = 4;
284 };
285
286 template<>
287 struct __vec_step_help<vector unsigned char>
288 {
289   static const int _S_elem = 16;
290 };
291
292 template<>
293 struct __vec_step_help<vector signed char>
294 {
295   static const int _S_elem = 16;
296 };
297
298 template<>
299 struct __vec_step_help<vector bool char>
300 {
301   static const int _S_elem = 16;
302 };
303
304 template<>
305 struct __vec_step_help<vector float>
306 {
307   static const int _S_elem = 4;
308 };
309
310 #define vec_step(t)  __vec_step_help<typeof(t)>::_S_elem
311
312 /* vec_abs */
313
314 inline vector signed char
315 vec_abs (vector signed char a1)
316 {
317   return __builtin_altivec_abs_v16qi (a1);
318 }
319
320 inline vector signed short
321 vec_abs (vector signed short a1)
322 {
323   return __builtin_altivec_abs_v8hi (a1);
324 }
325
326 inline vector signed int
327 vec_abs (vector signed int a1)
328 {
329   return __builtin_altivec_abs_v4si (a1);
330 }
331
332 inline vector float
333 vec_abs (vector float a1)
334 {
335   return __builtin_altivec_abs_v4sf (a1);
336 }
337
338 /* vec_abss */
339
340 inline vector signed char
341 vec_abss (vector signed char a1)
342 {
343   return __builtin_altivec_abss_v16qi (a1);
344 }
345
346 inline vector signed short
347 vec_abss (vector signed short a1)
348 {
349   return __builtin_altivec_abss_v8hi (a1);
350 }
351
352 inline vector signed int
353 vec_abss (vector signed int a1)
354 {
355   return __builtin_altivec_abss_v4si (a1);
356 }
357
358 /* vec_add */
359
360 inline vector signed char
361 vec_add (vector bool char a1, vector signed char a2)
362 {
363   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
364 }
365
366 inline vector signed char
367 vec_add (vector signed char a1, vector bool char a2)
368 {
369   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
370 }
371
372 inline vector signed char
373 vec_add (vector signed char a1, vector signed char a2)
374 {
375   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
376 }
377
378 inline vector unsigned char
379 vec_add (vector bool char a1, vector unsigned char a2)
380 {
381   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
382 }
383
384 inline vector unsigned char
385 vec_add (vector unsigned char a1, vector bool char a2)
386 {
387   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
388 }
389
390 inline vector unsigned char
391 vec_add (vector unsigned char a1, vector unsigned char a2)
392 {
393   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
394 }
395
396 inline vector signed short
397 vec_add (vector bool short a1, vector signed short a2)
398 {
399   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
400 }
401
402 inline vector signed short
403 vec_add (vector signed short a1, vector bool short a2)
404 {
405   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
406 }
407
408 inline vector signed short
409 vec_add (vector signed short a1, vector signed short a2)
410 {
411   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
412 }
413
414 inline vector unsigned short
415 vec_add (vector bool short a1, vector unsigned short a2)
416 {
417   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
418 }
419
420 inline vector unsigned short
421 vec_add (vector unsigned short a1, vector bool short a2)
422 {
423   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
424 }
425
426 inline vector unsigned short
427 vec_add (vector unsigned short a1, vector unsigned short a2)
428 {
429   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
430 }
431
432 inline vector signed int
433 vec_add (vector bool int a1, vector signed int a2)
434 {
435   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
436 }
437
438 inline vector signed int
439 vec_add (vector signed int a1, vector bool int a2)
440 {
441   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
442 }
443
444 inline vector signed int
445 vec_add (vector signed int a1, vector signed int a2)
446 {
447   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
448 }
449
450 inline vector unsigned int
451 vec_add (vector bool int a1, vector unsigned int a2)
452 {
453   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
454 }
455
456 inline vector unsigned int
457 vec_add (vector unsigned int a1, vector bool int a2)
458 {
459   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
460 }
461
462 inline vector unsigned int
463 vec_add (vector unsigned int a1, vector unsigned int a2)
464 {
465   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
466 }
467
468 inline vector float
469 vec_add (vector float a1, vector float a2)
470 {
471   return (vector float) __builtin_altivec_vaddfp ((vector float) a1, (vector float) a2);
472 }
473
474 /* vec_vaddfp */
475
476 inline vector float
477 vec_vaddfp (vector float a1, vector float a2)
478 {
479   return (vector float) __builtin_altivec_vaddfp ((vector float) a1, (vector float) a2);
480 }
481
482 /* vec_vadduwm */
483
484 inline vector signed int
485 vec_vadduwm (vector signed int a1, vector signed int a2)
486 {
487   return (vector signed int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
488 }
489
490 inline vector unsigned int
491 vec_vadduwm (vector signed int a1, vector unsigned int a2)
492 {
493   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
494 }
495
496 inline vector unsigned int
497 vec_vadduwm (vector unsigned int a1, vector signed int a2)
498 {
499   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
500 }
501
502 inline vector unsigned int
503 vec_vadduwm (vector unsigned int a1, vector unsigned int a2)
504 {
505   return (vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) a1, (vector signed int) a2);
506 }
507
508 /* vec_vadduhm */
509
510 inline vector signed short
511 vec_vadduhm (vector signed short a1, vector signed short a2)
512 {
513   return (vector signed short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
514 }
515
516 inline vector unsigned short
517 vec_vadduhm (vector signed short a1, vector unsigned short a2)
518 {
519   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
520 }
521
522 inline vector unsigned short
523 vec_vadduhm (vector unsigned short a1, vector signed short a2)
524 {
525   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
526 }
527
528 inline vector unsigned short
529 vec_vadduhm (vector unsigned short a1, vector unsigned short a2)
530 {
531   return (vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) a1, (vector signed short) a2);
532 }
533
534 /* vec_vaddubm */
535
536 inline vector signed char
537 vec_vaddubm (vector signed char a1, vector signed char a2)
538 {
539   return (vector signed char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
540 }
541
542 inline vector unsigned char
543 vec_vaddubm (vector signed char a1, vector unsigned char a2)
544 {
545   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
546 }
547
548 inline vector unsigned char
549 vec_vaddubm (vector unsigned char a1, vector signed char a2)
550 {
551   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
552 }
553
554 inline vector unsigned char
555 vec_vaddubm (vector unsigned char a1, vector unsigned char a2)
556 {
557   return (vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) a1, (vector signed char) a2);
558 }
559
560 /* vec_addc */
561
562 inline vector unsigned int
563 vec_addc (vector unsigned int a1, vector unsigned int a2)
564 {
565   return (vector unsigned int) __builtin_altivec_vaddcuw ((vector signed int) a1, (vector signed int) a2);
566 }
567
568 /* vec_adds */
569
570 inline vector unsigned char
571 vec_adds (vector bool char a1, vector unsigned char a2)
572 {
573   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
574 }
575
576 inline vector unsigned char
577 vec_adds (vector unsigned char a1, vector bool char a2)
578 {
579   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
580 }
581
582 inline vector unsigned char
583 vec_adds (vector unsigned char a1, vector unsigned char a2)
584 {
585   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
586 }
587
588 inline vector signed char
589 vec_adds (vector bool char a1, vector signed char a2)
590 {
591   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
592 }
593
594 inline vector signed char
595 vec_adds (vector signed char a1, vector bool char a2)
596 {
597   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
598 }
599
600 inline vector signed char
601 vec_adds (vector signed char a1, vector signed char a2)
602 {
603   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
604 }
605
606 inline vector unsigned short
607 vec_adds (vector bool short a1, vector unsigned short a2)
608 {
609   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
610 }
611
612 inline vector unsigned short
613 vec_adds (vector unsigned short a1, vector bool short a2)
614 {
615   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
616 }
617
618 inline vector unsigned short
619 vec_adds (vector unsigned short a1, vector unsigned short a2)
620 {
621   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
622 }
623
624 inline vector signed short
625 vec_adds (vector bool short a1, vector signed short a2)
626 {
627   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
628 }
629
630 inline vector signed short
631 vec_adds (vector signed short a1, vector bool short a2)
632 {
633   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
634 }
635
636 inline vector signed short
637 vec_adds (vector signed short a1, vector signed short a2)
638 {
639   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
640 }
641
642 inline vector unsigned int
643 vec_adds (vector bool int a1, vector unsigned int a2)
644 {
645   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
646 }
647
648 inline vector unsigned int
649 vec_adds (vector unsigned int a1, vector bool int a2)
650 {
651   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
652 }
653
654 inline vector unsigned int
655 vec_adds (vector unsigned int a1, vector unsigned int a2)
656 {
657   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
658 }
659
660 inline vector signed int
661 vec_adds (vector bool int a1, vector signed int a2)
662 {
663   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
664 }
665
666 inline vector signed int
667 vec_adds (vector signed int a1, vector bool int a2)
668 {
669   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
670 }
671
672 inline vector signed int
673 vec_adds (vector signed int a1, vector signed int a2)
674 {
675   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
676 }
677
678 /* vec_vaddsws */
679
680 inline vector signed int
681 vec_vaddsws (vector signed int a1, vector signed int a2)
682 {
683   return (vector signed int) __builtin_altivec_vaddsws ((vector signed int) a1, (vector signed int) a2);
684 }
685
686 /* vec_vadduws */
687
688 inline vector unsigned int
689 vec_vadduws (vector signed int a1, vector unsigned 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_vadduws (vector unsigned int a1, vector signed int a2)
696 {
697   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
698 }
699
700 inline vector unsigned int
701 vec_vadduws (vector unsigned int a1, vector unsigned int a2)
702 {
703   return (vector unsigned int) __builtin_altivec_vadduws ((vector signed int) a1, (vector signed int) a2);
704 }
705
706 /* vec_vaddshs */
707 inline vector signed short
708 vec_vaddshs (vector signed short a1, vector signed short a2)
709 {
710   return (vector signed short) __builtin_altivec_vaddshs ((vector signed short) a1, (vector signed short) a2);
711 }
712
713 /* vec_vadduhs */
714
715 inline vector unsigned short
716 vec_vadduhs (vector signed short a1, vector unsigned short a2)
717 {
718   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
719 }
720
721 inline vector unsigned short
722 vec_vadduhs (vector unsigned short a1, vector signed short a2)
723 {
724   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
725 }
726
727 inline vector unsigned short
728 vec_vadduhs (vector unsigned short a1, vector unsigned short a2)
729 {
730   return (vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) a1, (vector signed short) a2);
731 }
732
733 /* vec_vaddsbs */
734
735 inline vector signed char
736 vec_vaddsbs (vector signed char a1, vector signed char a2)
737 {
738   return (vector signed char) __builtin_altivec_vaddsbs ((vector signed char) a1, (vector signed char) a2);
739 }
740
741 /* vec_vaddubs */
742
743 inline vector unsigned char
744 vec_vaddubs (vector signed char a1, vector unsigned char a2)
745 {
746   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
747 }
748
749 inline vector unsigned char
750 vec_vaddubs (vector unsigned char a1, vector signed char a2)
751 {
752   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
753 }
754
755 inline vector unsigned char
756 vec_vaddubs (vector unsigned char a1, vector unsigned char a2)
757 {
758   return (vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) a1, (vector signed char) a2);
759 }
760
761 /* vec_and */
762
763 inline vector float
764 vec_and (vector float a1, vector float a2)
765 {
766   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
767 }
768
769 inline vector float
770 vec_and (vector float a1, vector bool int a2)
771 {
772   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
773 }
774
775 inline vector float
776 vec_and (vector bool int a1, vector float a2)
777 {
778   return (vector float) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
779 }
780
781 inline vector bool int
782 vec_and (vector bool int a1, vector bool int a2)
783 {
784   return (vector bool int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
785 }
786
787 inline vector signed int
788 vec_and (vector bool int a1, vector signed int a2)
789 {
790   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
791 }
792
793 inline vector signed int
794 vec_and (vector signed int a1, vector bool int a2)
795 {
796   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
797 }
798
799 inline vector signed int
800 vec_and (vector signed int a1, vector signed int a2)
801 {
802   return (vector signed int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
803 }
804
805 inline vector unsigned int
806 vec_and (vector bool int a1, vector unsigned int a2)
807 {
808   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
809 }
810
811 inline vector unsigned int
812 vec_and (vector unsigned int a1, vector bool int a2)
813 {
814   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
815 }
816
817 inline vector unsigned int
818 vec_and (vector unsigned int a1, vector unsigned int a2)
819 {
820   return (vector unsigned int) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
821 }
822
823 inline vector bool short
824 vec_and (vector bool short a1, vector bool short a2)
825 {
826   return (vector bool short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
827 }
828
829 inline vector signed short
830 vec_and (vector bool short a1, vector signed short a2)
831 {
832   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
833 }
834
835 inline vector signed short
836 vec_and (vector signed short a1, vector bool short a2)
837 {
838   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
839 }
840
841 inline vector signed short
842 vec_and (vector signed short a1, vector signed short a2)
843 {
844   return (vector signed short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
845 }
846
847 inline vector unsigned short
848 vec_and (vector bool short a1, vector unsigned short a2)
849 {
850   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
851 }
852
853 inline vector unsigned short
854 vec_and (vector unsigned short a1, vector bool short a2)
855 {
856   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
857 }
858
859 inline vector unsigned short
860 vec_and (vector unsigned short a1, vector unsigned short a2)
861 {
862   return (vector unsigned short) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
863 }
864
865 inline vector signed char
866 vec_and (vector bool char a1, vector signed char a2)
867 {
868   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
869 }
870
871 inline vector bool char
872 vec_and (vector bool char a1, vector bool char a2)
873 {
874   return (vector bool char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
875 }
876
877 inline vector signed char
878 vec_and (vector signed char a1, vector bool char a2)
879 {
880   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
881 }
882
883 inline vector signed char
884 vec_and (vector signed char a1, vector signed char a2)
885 {
886   return (vector signed char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
887 }
888
889 inline vector unsigned char
890 vec_and (vector bool char a1, vector unsigned char a2)
891 {
892   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
893 }
894
895 inline vector unsigned char
896 vec_and (vector unsigned char a1, vector bool char a2)
897 {
898   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
899 }
900
901 inline vector unsigned char
902 vec_and (vector unsigned char a1, vector unsigned char a2)
903 {
904   return (vector unsigned char) __builtin_altivec_vand ((vector signed int) a1, (vector signed int) a2);
905 }
906
907 /* vec_andc */
908
909 inline vector float
910 vec_andc (vector float a1, vector float a2)
911 {
912   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
913 }
914
915 inline vector float
916 vec_andc (vector float a1, vector bool int a2)
917 {
918   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
919 }
920
921 inline vector float
922 vec_andc (vector bool int a1, vector float a2)
923 {
924   return (vector float) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
925 }
926
927 inline vector bool int
928 vec_andc (vector bool int a1, vector bool int a2)
929 {
930   return (vector bool int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
931 }
932
933 inline vector signed int
934 vec_andc (vector bool int a1, vector signed int a2)
935 {
936   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
937 }
938
939 inline vector signed int
940 vec_andc (vector signed int a1, vector bool int a2)
941 {
942   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
943 }
944
945 inline vector signed int
946 vec_andc (vector signed int a1, vector signed int a2)
947 {
948   return (vector signed int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
949 }
950
951 inline vector unsigned int
952 vec_andc (vector bool int a1, vector unsigned int a2)
953 {
954   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
955 }
956
957 inline vector unsigned int
958 vec_andc (vector unsigned int a1, vector bool int a2)
959 {
960   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
961 }
962
963 inline vector unsigned int
964 vec_andc (vector unsigned int a1, vector unsigned int a2)
965 {
966   return (vector unsigned int) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
967 }
968
969 inline vector bool short
970 vec_andc (vector bool short a1, vector bool short a2)
971 {
972   return (vector bool short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
973 }
974
975 inline vector signed short
976 vec_andc (vector bool short a1, vector signed short a2)
977 {
978   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
979 }
980
981 inline vector signed short
982 vec_andc (vector signed short a1, vector bool short a2)
983 {
984   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
985 }
986
987 inline vector signed short
988 vec_andc (vector signed short a1, vector signed short a2)
989 {
990   return (vector signed short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
991 }
992
993 inline vector unsigned short
994 vec_andc (vector bool short a1, vector unsigned short a2)
995 {
996   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
997 }
998
999 inline vector unsigned short
1000 vec_andc (vector unsigned short a1, vector bool short a2)
1001 {
1002   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1003 }
1004
1005 inline vector unsigned short
1006 vec_andc (vector unsigned short a1, vector unsigned short a2)
1007 {
1008   return (vector unsigned short) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1009 }
1010
1011 inline vector signed char
1012 vec_andc (vector bool char a1, vector signed char a2)
1013 {
1014   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1015 }
1016
1017 inline vector bool char
1018 vec_andc (vector bool char a1, vector bool char a2)
1019 {
1020   return (vector bool char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1021 }
1022
1023 inline vector signed char
1024 vec_andc (vector signed char a1, vector bool char a2)
1025 {
1026   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1027 }
1028
1029 inline vector signed char
1030 vec_andc (vector signed char a1, vector signed char a2)
1031 {
1032   return (vector signed char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1033 }
1034
1035 inline vector unsigned char
1036 vec_andc (vector bool char a1, vector unsigned char a2)
1037 {
1038   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1039 }
1040
1041 inline vector unsigned char
1042 vec_andc (vector unsigned char a1, vector bool char a2)
1043 {
1044   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1045 }
1046
1047 inline vector unsigned char
1048 vec_andc (vector unsigned char a1, vector unsigned char a2)
1049 {
1050   return (vector unsigned char) __builtin_altivec_vandc ((vector signed int) a1, (vector signed int) a2);
1051 }
1052
1053 /* vec_avg */
1054
1055 inline vector unsigned char
1056 vec_avg (vector unsigned char a1, vector unsigned char a2)
1057 {
1058   return (vector unsigned char) __builtin_altivec_vavgub ((vector signed char) a1, (vector signed char) a2);
1059 }
1060
1061 inline vector signed char
1062 vec_avg (vector signed char a1, vector signed char a2)
1063 {
1064   return (vector signed char) __builtin_altivec_vavgsb ((vector signed char) a1, (vector signed char) a2);
1065 }
1066
1067 inline vector unsigned short
1068 vec_avg (vector unsigned short a1, vector unsigned short a2)
1069 {
1070   return (vector unsigned short) __builtin_altivec_vavguh ((vector signed short) a1, (vector signed short) a2);
1071 }
1072
1073 inline vector signed short
1074 vec_avg (vector signed short a1, vector signed short a2)
1075 {
1076   return (vector signed short) __builtin_altivec_vavgsh ((vector signed short) a1, (vector signed short) a2);
1077 }
1078
1079 inline vector unsigned int
1080 vec_avg (vector unsigned int a1, vector unsigned int a2)
1081 {
1082   return (vector unsigned int) __builtin_altivec_vavguw ((vector signed int) a1, (vector signed int) a2);
1083 }
1084
1085 inline vector signed int
1086 vec_avg (vector signed int a1, vector signed int a2)
1087 {
1088   return (vector signed int) __builtin_altivec_vavgsw ((vector signed int) a1, (vector signed int) a2);
1089 }
1090
1091 /* vec_vavgsw */
1092
1093 inline vector signed int
1094 vec_vavgsw (vector signed int a1, vector signed int a2)
1095 {
1096   return (vector signed int) __builtin_altivec_vavgsw ((vector signed int) a1, (vector signed int) a2);
1097 }
1098
1099 /* vec_vavguw */
1100
1101 inline vector unsigned int
1102 vec_vavguw (vector unsigned int a1, vector unsigned int a2)
1103 {
1104   return (vector unsigned int) __builtin_altivec_vavguw ((vector signed int) a1, (vector signed int) a2);
1105 }
1106
1107 /* vec_vavgsh */
1108
1109 inline vector signed short
1110 vec_vavgsh (vector signed short a1, vector signed short a2)
1111 {
1112   return (vector signed short) __builtin_altivec_vavgsh ((vector signed short) a1, (vector signed short) a2);
1113 }
1114
1115 /* vec_vavguh */
1116
1117 inline vector unsigned short
1118 vec_vavguh (vector unsigned short a1, vector unsigned short a2)
1119 {
1120   return (vector unsigned short) __builtin_altivec_vavguh ((vector signed short) a1, (vector signed short) a2);
1121 }
1122
1123 /* vec_vavgsb */
1124
1125 inline vector signed char
1126 vec_vavgsb (vector signed char a1, vector signed char a2)
1127 {
1128   return (vector signed char) __builtin_altivec_vavgsb ((vector signed char) a1, (vector signed char) a2);
1129 }
1130
1131 /* vec_vavgub */
1132
1133 inline vector unsigned char
1134 vec_vavgub (vector unsigned char a1, vector unsigned char a2)
1135 {
1136   return (vector unsigned char) __builtin_altivec_vavgub ((vector signed char) a1, (vector signed char) a2);
1137 }
1138
1139 /* vec_ceil */
1140
1141 inline vector float
1142 vec_ceil (vector float a1)
1143 {
1144   return (vector float) __builtin_altivec_vrfip ((vector float) a1);
1145 }
1146
1147 /* vec_cmpb */
1148
1149 inline vector signed int
1150 vec_cmpb (vector float a1, vector float a2)
1151 {
1152   return (vector signed int) __builtin_altivec_vcmpbfp ((vector float) a1, (vector float) a2);
1153 }
1154
1155 /* vec_cmpeq */
1156
1157 inline vector bool char
1158 vec_cmpeq (vector signed char a1, vector signed char a2)
1159 {
1160   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1161 }
1162
1163 inline vector bool char
1164 vec_cmpeq (vector unsigned char a1, vector unsigned char a2)
1165 {
1166   return (vector bool char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1167 }
1168
1169 inline vector bool short
1170 vec_cmpeq (vector signed short a1, vector signed short a2)
1171 {
1172   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1173 }
1174
1175 inline vector bool short
1176 vec_cmpeq (vector unsigned short a1, vector unsigned short a2)
1177 {
1178   return (vector bool short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1179 }
1180
1181 inline vector bool int
1182 vec_cmpeq (vector signed int a1, vector signed int a2)
1183 {
1184   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1185 }
1186
1187 inline vector bool int
1188 vec_cmpeq (vector unsigned int a1, vector unsigned int a2)
1189 {
1190   return (vector bool int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1191 }
1192
1193 inline vector bool int
1194 vec_cmpeq (vector float a1, vector float a2)
1195 {
1196   return (vector bool int) __builtin_altivec_vcmpeqfp ((vector float) a1, (vector float) a2);
1197 }
1198
1199 /* vec_vcmpeqfp */
1200
1201 inline vector signed int
1202 vec_vcmpeqfp (vector float a1, vector float a2)
1203 {
1204   return (vector signed int) __builtin_altivec_vcmpeqfp ((vector float) a1, (vector float) a2);
1205 }
1206
1207 /* vec_vcmpequw */
1208
1209 inline vector signed int
1210 vec_vcmpequw (vector signed int a1, vector signed int a2)
1211 {
1212   return (vector signed int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1213 }
1214
1215 inline vector signed int
1216 vec_vcmpequw (vector unsigned int a1, vector unsigned int a2)
1217 {
1218   return (vector signed int) __builtin_altivec_vcmpequw ((vector signed int) a1, (vector signed int) a2);
1219 }
1220
1221 /* vec_vcmpequh */
1222
1223 inline vector signed short
1224 vec_vcmpequh (vector signed short a1, vector signed short a2)
1225 {
1226   return (vector signed short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1227 }
1228
1229 inline vector signed short
1230 vec_vcmpequh (vector unsigned short a1, vector unsigned short a2)
1231 {
1232   return (vector signed short) __builtin_altivec_vcmpequh ((vector signed short) a1, (vector signed short) a2);
1233 }
1234
1235 /* vec_vcmpequb */
1236
1237 inline vector signed char
1238 vec_vcmpequb (vector signed char a1, vector signed char a2)
1239 {
1240   return (vector signed char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1241 }
1242
1243 inline vector signed char
1244 vec_vcmpequb (vector unsigned char a1, vector unsigned char a2)
1245 {
1246   return (vector signed char) __builtin_altivec_vcmpequb ((vector signed char) a1, (vector signed char) a2);
1247 }
1248
1249 /* vec_cmpge */
1250
1251 inline vector bool int
1252 vec_cmpge (vector float a1, vector float a2)
1253 {
1254   return (vector bool int) __builtin_altivec_vcmpgefp ((vector float) a1, (vector float) a2);
1255 }
1256
1257 /* vec_cmpgt */
1258
1259 inline vector bool char
1260 vec_cmpgt (vector unsigned char a1, vector unsigned char a2)
1261 {
1262   return (vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) a1, (vector signed char) a2);
1263 }
1264
1265 inline vector bool char
1266 vec_cmpgt (vector signed char a1, vector signed char a2)
1267 {
1268   return (vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) a1, (vector signed char) a2);
1269 }
1270
1271 inline vector bool short
1272 vec_cmpgt (vector unsigned short a1, vector unsigned short a2)
1273 {
1274   return (vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) a1, (vector signed short) a2);
1275 }
1276
1277 inline vector bool short
1278 vec_cmpgt (vector signed short a1, vector signed short a2)
1279 {
1280   return (vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) a1, (vector signed short) a2);
1281 }
1282
1283 inline vector bool int
1284 vec_cmpgt (vector unsigned int a1, vector unsigned int a2)
1285 {
1286   return (vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) a1, (vector signed int) a2);
1287 }
1288
1289 inline vector bool int
1290 vec_cmpgt (vector signed int a1, vector signed int a2)
1291 {
1292   return (vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) a1, (vector signed int) a2);
1293 }
1294
1295 inline vector bool int
1296 vec_cmpgt (vector float a1, vector float a2)
1297 {
1298   return (vector bool int) __builtin_altivec_vcmpgtfp ((vector float) a1, (vector float) a2);
1299 }
1300
1301 /* vec_vcmpgtfp */
1302
1303 inline vector signed int
1304 vec_vcmpgtfp (vector float a1, vector float a2)
1305 {
1306   return (vector signed int) __builtin_altivec_vcmpgtfp ((vector float) a1, (vector float) a2);
1307 }
1308
1309 /* vec_vcmpgtsw */
1310
1311 inline vector signed int
1312 vec_vcmpgtsw (vector signed int a1, vector signed int a2)
1313 {
1314   return (vector signed int) __builtin_altivec_vcmpgtsw ((vector signed int) a1, (vector signed int) a2);
1315 }
1316
1317 /* vec_vcmpgtuw */
1318
1319 inline vector signed int
1320 vec_vcmpgtuw (vector unsigned int a1, vector unsigned int a2)
1321 {
1322   return (vector signed int) __builtin_altivec_vcmpgtuw ((vector signed int) a1, (vector signed int) a2);
1323 }
1324
1325 /* vec_vcmpgtsh */
1326
1327 inline vector signed short
1328 vec_cmpgtsh (vector signed short a1, vector signed short a2)
1329 {
1330   return (vector signed short) __builtin_altivec_vcmpgtsh ((vector signed short) a1, (vector signed short) a2);
1331 }
1332
1333 /* vec_vcmpgtuh */
1334
1335 inline vector signed short
1336 vec_vcmpgtuh (vector unsigned short a1, vector unsigned short a2)
1337 {
1338   return (vector signed short) __builtin_altivec_vcmpgtuh ((vector signed short) a1, (vector signed short) a2);
1339 }
1340
1341 /* vec_vcmpgtsb */
1342
1343 inline vector signed char
1344 vec_vcmpgtsb (vector signed char a1, vector signed char a2)
1345 {
1346   return (vector signed char) __builtin_altivec_vcmpgtsb ((vector signed char) a1, (vector signed char) a2);
1347 }
1348
1349 /* vec_vcmpgtub */
1350
1351 inline vector signed char
1352 vec_vcmpgtub (vector unsigned char a1, vector unsigned char a2)
1353 {
1354   return (vector signed char) __builtin_altivec_vcmpgtub ((vector signed char) a1, (vector signed char) a2);
1355 }
1356
1357 /* vec_cmple */
1358
1359 inline vector bool int
1360 vec_cmple (vector float a1, vector float a2)
1361 {
1362   return (vector bool int) __builtin_altivec_vcmpgefp ((vector float) a2, (vector float) a1);
1363 }
1364
1365 /* vec_cmplt */
1366
1367 inline vector bool char
1368 vec_cmplt (vector unsigned char a1, vector unsigned char a2)
1369 {
1370   return (vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) a2, (vector signed char) a1);
1371 }
1372
1373 inline vector bool char
1374 vec_cmplt (vector signed char a1, vector signed char a2)
1375 {
1376   return (vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) a2, (vector signed char) a1);
1377 }
1378
1379 inline vector bool short
1380 vec_cmplt (vector unsigned short a1, vector unsigned short a2)
1381 {
1382   return (vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) a2, (vector signed short) a1);
1383 }
1384
1385 inline vector bool short
1386 vec_cmplt (vector signed short a1, vector signed short a2)
1387 {
1388   return (vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) a2, (vector signed short) a1);
1389 }
1390
1391 inline vector bool int
1392 vec_cmplt (vector unsigned int a1, vector unsigned int a2)
1393 {
1394   return (vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) a2, (vector signed int) a1);
1395 }
1396
1397 inline vector bool int
1398 vec_cmplt (vector signed int a1, vector signed int a2)
1399 {
1400   return (vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) a2, (vector signed int) a1);
1401 }
1402
1403 inline vector bool int
1404 vec_cmplt (vector float a1, vector float a2)
1405 {
1406   return (vector bool int) __builtin_altivec_vcmpgtfp ((vector float) a2, (vector float) a1);
1407 }
1408
1409 /* vec_ctf */
1410
1411 inline vector float
1412 vec_ctf (vector unsigned int a1, const int a2)
1413 {
1414   return (vector float) __builtin_altivec_vcfux ((vector signed int) a1, a2);
1415 }
1416
1417 inline vector float
1418 vec_ctf (vector signed int a1, const int a2)
1419 {
1420   return (vector float) __builtin_altivec_vcfsx ((vector signed int) a1, a2);
1421 }
1422
1423 /* vec_vcfsx */
1424
1425 inline vector float
1426 vec_vcfsx (vector signed int a1, const int a2)
1427 {
1428   return (vector float) __builtin_altivec_vcfsx ((vector signed int) a1, a2);
1429 }
1430
1431 /* vec_vcfux */
1432
1433 inline vector float
1434 vec_vcfux (vector unsigned int a1, const int a2)
1435 {
1436   return (vector float) __builtin_altivec_vcfux ((vector signed int) a1, a2);
1437 }
1438
1439 /* vec_cts */
1440
1441 inline vector signed int
1442 vec_cts (vector float a1, const int a2)
1443 {
1444   return (vector signed int) __builtin_altivec_vctsxs ((vector float) a1, a2);
1445 }
1446
1447 /* vec_ctu */
1448
1449 inline vector unsigned int
1450 vec_ctu (vector float a1, const int a2)
1451 {
1452   return (vector unsigned int) __builtin_altivec_vctuxs ((vector float) a1, a2);
1453 }
1454
1455 /* vec_dss */
1456
1457 inline void
1458 vec_dss (const int a1)
1459 {
1460   __builtin_altivec_dss (a1);
1461 }
1462
1463 /* vec_dssall */
1464
1465 inline void
1466 vec_dssall (void)
1467 {
1468   __builtin_altivec_dssall ();
1469 }
1470
1471 /* vec_dst */
1472
1473 inline void
1474 vec_dst (const vector unsigned char *a1, int a2, const int a3)
1475 {
1476   __builtin_altivec_dst ((void *) a1, a2, a3);
1477 }
1478
1479 inline void
1480 vec_dst (const vector signed char *a1, int a2, const int a3)
1481 {
1482   __builtin_altivec_dst ((void *) a1, a2, a3);
1483 }
1484
1485 inline void
1486 vec_dst (const vector bool char *a1, int a2, const int a3)
1487 {
1488   __builtin_altivec_dst ((void *) a1, a2, a3);
1489 }
1490
1491 inline void
1492 vec_dst (const vector unsigned short *a1, int a2, const int a3)
1493 {
1494   __builtin_altivec_dst ((void *) a1, a2, a3);
1495 }
1496
1497 inline void
1498 vec_dst (const vector signed short *a1, int a2, const int a3)
1499 {
1500   __builtin_altivec_dst ((void *) a1, a2, a3);
1501 }
1502
1503 inline void
1504 vec_dst (const vector bool short *a1, int a2, const int a3)
1505 {
1506   __builtin_altivec_dst ((void *) a1, a2, a3);
1507 }
1508
1509 inline void
1510 vec_dst (const vector pixel *a1, int a2, const int a3)
1511 {
1512   __builtin_altivec_dst ((void *) a1, a2, a3);
1513 }
1514
1515 inline void
1516 vec_dst (const vector unsigned int *a1, int a2, const int a3)
1517 {
1518   __builtin_altivec_dst ((void *) a1, a2, a3);
1519 }
1520
1521 inline void
1522 vec_dst (const vector signed int *a1, int a2, const int a3)
1523 {
1524   __builtin_altivec_dst ((void *) a1, a2, a3);
1525 }
1526
1527 inline void
1528 vec_dst (const vector bool int *a1, int a2, const int a3)
1529 {
1530   __builtin_altivec_dst ((void *) a1, a2, a3);
1531 }
1532
1533 inline void
1534 vec_dst (const vector float *a1, int a2, const int a3)
1535 {
1536   __builtin_altivec_dst ((void *) a1, a2, a3);
1537 }
1538
1539 inline void
1540 vec_dst (const unsigned char *a1, int a2, const int a3)
1541 {
1542   __builtin_altivec_dst ((void *) a1, a2, a3);
1543 }
1544
1545 inline void
1546 vec_dst (const signed char *a1, int a2, const int a3)
1547 {
1548   __builtin_altivec_dst ((void *) a1, a2, a3);
1549 }
1550
1551 inline void
1552 vec_dst (const unsigned short *a1, int a2, const int a3)
1553 {
1554   __builtin_altivec_dst ((void *) a1, a2, a3);
1555 }
1556
1557 inline void
1558 vec_dst (const short *a1, int a2, const int a3)
1559 {
1560   __builtin_altivec_dst ((void *) a1, a2, a3);
1561 }
1562
1563 inline void
1564 vec_dst (const unsigned int *a1, int a2, const int a3)
1565 {
1566   __builtin_altivec_dst ((void *) a1, a2, a3);
1567 }
1568
1569 inline void
1570 vec_dst (const int *a1, int a2, const int a3)
1571 {
1572   __builtin_altivec_dst ((void *) a1, a2, a3);
1573 }
1574
1575 inline void
1576 vec_dst (const unsigned long *a1, int a2, const int a3)
1577 {
1578   __builtin_altivec_dst ((void *) a1, a2, a3);
1579 }
1580
1581 inline void
1582 vec_dst (const long *a1, int a2, const int a3)
1583 {
1584   __builtin_altivec_dst ((void *) a1, a2, a3);
1585 }
1586
1587 inline void
1588 vec_dst (float *a1, int a2, const int a3)
1589 {
1590   __builtin_altivec_dst ((void *) a1, a2, a3);
1591 }
1592
1593 /* vec_dstst */
1594
1595 inline void
1596 vec_dstst (const vector unsigned char *a1, int a2, const int a3)
1597 {
1598   __builtin_altivec_dstst ((void *) a1, a2, a3);
1599 }
1600
1601 inline void
1602 vec_dstst (const vector signed char *a1, int a2, const int a3)
1603 {
1604   __builtin_altivec_dstst ((void *) a1, a2, a3);
1605 }
1606
1607 inline void
1608 vec_dstst (const vector bool char *a1, int a2, const int a3)
1609 {
1610   __builtin_altivec_dstst ((void *) a1, a2, a3);
1611 }
1612
1613 inline void
1614 vec_dstst (const vector unsigned short *a1, int a2, const int a3)
1615 {
1616   __builtin_altivec_dstst ((void *) a1, a2, a3);
1617 }
1618
1619 inline void
1620 vec_dstst (const vector signed short *a1, int a2, const int a3)
1621 {
1622   __builtin_altivec_dstst ((void *) a1, a2, a3);
1623 }
1624
1625 inline void
1626 vec_dstst (const vector bool short *a1, int a2, const int a3)
1627 {
1628   __builtin_altivec_dstst ((void *) a1, a2, a3);
1629 }
1630
1631 inline void
1632 vec_dstst (const vector pixel *a1, int a2, const int a3)
1633 {
1634   __builtin_altivec_dstst ((void *) a1, a2, a3);
1635 }
1636
1637 inline void
1638 vec_dstst (const vector unsigned int *a1, int a2, const int a3)
1639 {
1640   __builtin_altivec_dstst ((void *) a1, a2, a3);
1641 }
1642
1643 inline void
1644 vec_dstst (const vector signed int *a1, int a2, const int a3)
1645 {
1646   __builtin_altivec_dstst ((void *) a1, a2, a3);
1647 }
1648
1649 inline void
1650 vec_dstst (const vector bool int *a1, int a2, const int a3)
1651 {
1652   __builtin_altivec_dstst ((void *) a1, a2, a3);
1653 }
1654
1655 inline void
1656 vec_dstst (const vector float *a1, int a2, const int a3)
1657 {
1658   __builtin_altivec_dstst ((void *) a1, a2, a3);
1659 }
1660
1661 inline void
1662 vec_dstst (const unsigned char *a1, int a2, const int a3)
1663 {
1664   __builtin_altivec_dstst ((void *) a1, a2, a3);
1665 }
1666
1667 inline void
1668 vec_dstst (const signed char *a1, int a2, const int a3)
1669 {
1670   __builtin_altivec_dstst ((void *) a1, a2, a3);
1671 }
1672
1673 inline void
1674 vec_dstst (const unsigned short *a1, int a2, const int a3)
1675 {
1676   __builtin_altivec_dstst ((void *) a1, a2, a3);
1677 }
1678
1679 inline void
1680 vec_dstst (const short *a1, int a2, const int a3)
1681 {
1682   __builtin_altivec_dstst ((void *) a1, a2, a3);
1683 }
1684
1685 inline void
1686 vec_dstst (const unsigned int *a1, int a2, const int a3)
1687 {
1688   __builtin_altivec_dstst ((void *) a1, a2, a3);
1689 }
1690
1691 inline void
1692 vec_dstst (const int *a1, int a2, const int a3)
1693 {
1694   __builtin_altivec_dstst ((void *) a1, a2, a3);
1695 }
1696
1697 inline void
1698 vec_dstst (const unsigned long *a1, int a2, const int a3)
1699 {
1700   __builtin_altivec_dstst ((void *) a1, a2, a3);
1701 }
1702
1703 inline void
1704 vec_dstst (const long *a1, int a2, const int a3)
1705 {
1706   __builtin_altivec_dstst ((void *) a1, a2, a3);
1707 }
1708
1709 inline void
1710 vec_dstst (float *a1, int a2, const int a3)
1711 {
1712   __builtin_altivec_dstst ((void *) a1, a2, a3);
1713 }
1714
1715 /* vec_dststt */
1716
1717 inline void
1718 vec_dststt (const vector unsigned char *a1, int a2, const int a3)
1719 {
1720   __builtin_altivec_dststt ((void *) a1, a2, a3);
1721 }
1722
1723 inline void
1724 vec_dststt (const vector signed char *a1, int a2, const int a3)
1725 {
1726   __builtin_altivec_dststt ((void *) a1, a2, a3);
1727 }
1728
1729 inline void
1730 vec_dststt (const vector bool char *a1, int a2, const int a3)
1731 {
1732   __builtin_altivec_dststt ((void *) a1, a2, a3);
1733 }
1734
1735 inline void
1736 vec_dststt (const vector unsigned short *a1, int a2, const int a3)
1737 {
1738   __builtin_altivec_dststt ((void *) a1, a2, a3);
1739 }
1740
1741 inline void
1742 vec_dststt (const vector signed short *a1, int a2, const int a3)
1743 {
1744   __builtin_altivec_dststt ((void *) a1, a2, a3);
1745 }
1746
1747 inline void
1748 vec_dststt (const vector bool short *a1, int a2, const int a3)
1749 {
1750   __builtin_altivec_dststt ((void *) a1, a2, a3);
1751 }
1752
1753 inline void
1754 vec_dststt (const vector pixel *a1, int a2, const int a3)
1755 {
1756   __builtin_altivec_dststt ((void *) a1, a2, a3);
1757 }
1758
1759 inline void
1760 vec_dststt (const vector unsigned int *a1, int a2, const int a3)
1761 {
1762   __builtin_altivec_dststt ((void *) a1, a2, a3);
1763 }
1764
1765 inline void
1766 vec_dststt (const vector signed int *a1, int a2, const int a3)
1767 {
1768   __builtin_altivec_dststt ((void *) a1, a2, a3);
1769 }
1770
1771 inline void
1772 vec_dststt (const vector bool int *a1, int a2, const int a3)
1773 {
1774   __builtin_altivec_dststt ((void *) a1, a2, a3);
1775 }
1776
1777 inline void
1778 vec_dststt (const vector float *a1, int a2, const int a3)
1779 {
1780   __builtin_altivec_dststt ((void *) a1, a2, a3);
1781 }
1782
1783 inline void
1784 vec_dststt (const unsigned char *a1, int a2, const int a3)
1785 {
1786   __builtin_altivec_dststt ((void *) a1, a2, a3);
1787 }
1788
1789 inline void
1790 vec_dststt (const signed char *a1, int a2, const int a3)
1791 {
1792   __builtin_altivec_dststt ((void *) a1, a2, a3);
1793 }
1794
1795 inline void
1796 vec_dststt (const unsigned short *a1, int a2, const int a3)
1797 {
1798   __builtin_altivec_dststt ((void *) a1, a2, a3);
1799 }
1800
1801 inline void
1802 vec_dststt (const short *a1, int a2, const int a3)
1803 {
1804   __builtin_altivec_dststt ((void *) a1, a2, a3);
1805 }
1806
1807 inline void
1808 vec_dststt (const unsigned int *a1, int a2, const int a3)
1809 {
1810   __builtin_altivec_dststt ((void *) a1, a2, a3);
1811 }
1812
1813 inline void
1814 vec_dststt (const int *a1, int a2, const int a3)
1815 {
1816   __builtin_altivec_dststt ((void *) a1, a2, a3);
1817 }
1818
1819 inline void
1820 vec_dststt (const unsigned long *a1, int a2, const int a3)
1821 {
1822   __builtin_altivec_dststt ((void *) a1, a2, a3);
1823 }
1824
1825 inline void
1826 vec_dststt (const long *a1, int a2, const int a3)
1827 {
1828   __builtin_altivec_dststt ((void *) a1, a2, a3);
1829 }
1830
1831 inline void
1832 vec_dststt (float *a1, int a2, const int a3)
1833 {
1834   __builtin_altivec_dststt ((void *) a1, a2, a3);
1835 }
1836
1837 /* vec_dstt */
1838
1839 inline void
1840 vec_dstt (const vector unsigned char *a1, int a2, const int a3)
1841 {
1842   __builtin_altivec_dstt ((void *) a1, a2, a3);
1843 }
1844
1845 inline void
1846 vec_dstt (const vector signed char *a1, int a2, const int a3)
1847 {
1848   __builtin_altivec_dstt ((void *) a1, a2, a3);
1849 }
1850
1851 inline void
1852 vec_dstt (const vector bool char *a1, int a2, const int a3)
1853 {
1854   __builtin_altivec_dstt ((void *) a1, a2, a3);
1855 }
1856
1857 inline void
1858 vec_dstt (const vector unsigned short *a1, int a2, const int a3)
1859 {
1860   __builtin_altivec_dstt ((void *) a1, a2, a3);
1861 }
1862
1863 inline void
1864 vec_dstt (const vector signed short *a1, int a2, const int a3)
1865 {
1866   __builtin_altivec_dstt ((void *) a1, a2, a3);
1867 }
1868
1869 inline void
1870 vec_dstt (const vector bool short *a1, int a2, const int a3)
1871 {
1872   __builtin_altivec_dstt ((void *) a1, a2, a3);
1873 }
1874
1875 inline void
1876 vec_dstt (const vector pixel *a1, int a2, const int a3)
1877 {
1878   __builtin_altivec_dstt ((void *) a1, a2, a3);
1879 }
1880
1881 inline void
1882 vec_dstt (const vector unsigned int *a1, int a2, const int a3)
1883 {
1884   __builtin_altivec_dstt ((void *) a1, a2, a3);
1885 }
1886
1887 inline void
1888 vec_dstt (const vector signed int *a1, int a2, const int a3)
1889 {
1890   __builtin_altivec_dstt ((void *) a1, a2, a3);
1891 }
1892
1893 inline void
1894 vec_dstt (const vector bool int *a1, int a2, const int a3)
1895 {
1896   __builtin_altivec_dstt ((void *) a1, a2, a3);
1897 }
1898
1899 inline void
1900 vec_dstt (const vector float *a1, int a2, const int a3)
1901 {
1902   __builtin_altivec_dstt ((void *) a1, a2, a3);
1903 }
1904
1905 inline void
1906 vec_dstt (const unsigned char *a1, int a2, const int a3)
1907 {
1908   __builtin_altivec_dstt ((void *) a1, a2, a3);
1909 }
1910
1911 inline void
1912 vec_dstt (const signed char *a1, int a2, const int a3)
1913 {
1914   __builtin_altivec_dstt ((void *) a1, a2, a3);
1915 }
1916
1917 inline void
1918 vec_dstt (const unsigned short *a1, int a2, const int a3)
1919 {
1920   __builtin_altivec_dstt ((void *) a1, a2, a3);
1921 }
1922
1923 inline void
1924 vec_dstt (const short *a1, int a2, const int a3)
1925 {
1926   __builtin_altivec_dstt ((void *) a1, a2, a3);
1927 }
1928
1929 inline void
1930 vec_dstt (const unsigned int *a1, int a2, const int a3)
1931 {
1932   __builtin_altivec_dstt ((void *) a1, a2, a3);
1933 }
1934
1935 inline void
1936 vec_dstt (const int *a1, int a2, const int a3)
1937 {
1938   __builtin_altivec_dstt ((void *) a1, a2, a3);
1939 }
1940
1941 inline void
1942 vec_dstt (const unsigned long *a1, int a2, const int a3)
1943 {
1944   __builtin_altivec_dstt ((void *) a1, a2, a3);
1945 }
1946
1947 inline void
1948 vec_dstt (const long *a1, int a2, const int a3)
1949 {
1950   __builtin_altivec_dstt ((void *) a1, a2, a3);
1951 }
1952
1953 inline void
1954 vec_dstt (float *a1, int a2, const int a3)
1955 {
1956   __builtin_altivec_dstt ((void *) a1, a2, a3);
1957 }
1958
1959 /* vec_expte */
1960
1961 inline vector float
1962 vec_expte (vector float a1)
1963 {
1964   return (vector float) __builtin_altivec_vexptefp ((vector float) a1);
1965 }
1966
1967 /* vec_floor */
1968
1969 inline vector float
1970 vec_floor (vector float a1)
1971 {
1972   return (vector float) __builtin_altivec_vrfim ((vector float) a1);
1973 }
1974
1975 /* vec_ld */
1976
1977 inline vector float
1978 vec_ld (int a1, const vector float *a2)
1979 {
1980   return (vector float) __builtin_altivec_lvx (a1, (void *) a2);
1981 }
1982
1983 inline vector float
1984 vec_ld (int a1, const float *a2)
1985 {
1986   return (vector float) __builtin_altivec_lvx (a1, (void *) a2);
1987 }
1988
1989 inline vector bool int
1990 vec_ld (int a1, const vector bool int *a2)
1991 {
1992   return (vector bool int) __builtin_altivec_lvx (a1, (void *) a2);
1993 }
1994
1995 inline vector signed int
1996 vec_ld (int a1, const vector signed int *a2)
1997 {
1998   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
1999 }
2000
2001 inline vector signed int
2002 vec_ld (int a1, const int *a2)
2003 {
2004   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
2005 }
2006
2007 inline vector signed int
2008 vec_ld (int a1, const long *a2)
2009 {
2010   return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2);
2011 }
2012
2013 inline vector unsigned int
2014 vec_ld (int a1, const vector unsigned int *a2)
2015 {
2016   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2017 }
2018
2019 inline vector unsigned int
2020 vec_ld (int a1, const unsigned int *a2)
2021 {
2022   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2023 }
2024
2025 inline vector unsigned int
2026 vec_ld (int a1, const unsigned long *a2)
2027 {
2028   return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2);
2029 }
2030
2031 inline vector bool short
2032 vec_ld (int a1, const vector bool short *a2)
2033 {
2034   return (vector bool short) __builtin_altivec_lvx (a1, (void *) a2);
2035 }
2036
2037 inline vector pixel
2038 vec_ld (int a1, const vector pixel *a2)
2039 {
2040   return (vector pixel) __builtin_altivec_lvx (a1, (void *) a2);
2041 }
2042
2043 inline vector signed short
2044 vec_ld (int a1, const vector signed short *a2)
2045 {
2046   return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2);
2047 }
2048
2049 inline vector signed short
2050 vec_ld (int a1, const short *a2)
2051 {
2052   return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2);
2053 }
2054
2055 inline vector unsigned short
2056 vec_ld (int a1, const vector unsigned short *a2)
2057 {
2058   return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2);
2059 }
2060
2061 inline vector unsigned short
2062 vec_ld (int a1, const unsigned short *a2)
2063 {
2064   return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2);
2065 }
2066
2067 inline vector bool char
2068 vec_ld (int a1, const vector bool char *a2)
2069 {
2070   return (vector bool char) __builtin_altivec_lvx (a1, (void *) a2);
2071 }
2072
2073 inline vector signed char
2074 vec_ld (int a1, const vector signed char *a2)
2075 {
2076   return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2);
2077 }
2078
2079 inline vector signed char
2080 vec_ld (int a1, const signed char *a2)
2081 {
2082   return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2);
2083 }
2084
2085 inline vector unsigned char
2086 vec_ld (int a1, const vector unsigned char *a2)
2087 {
2088   return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2);
2089 }
2090
2091 inline vector unsigned char
2092 vec_ld (int a1, const unsigned char *a2)
2093 {
2094   return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2);
2095 }
2096
2097 /* vec_lde */
2098
2099 inline vector signed char
2100 vec_lde (int a1, const signed char *a2)
2101 {
2102   return (vector signed char) __builtin_altivec_lvebx (a1, (void *) a2);
2103 }
2104
2105 inline vector unsigned char
2106 vec_lde (int a1, const unsigned char *a2)
2107 {
2108   return (vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2);
2109 }
2110
2111 inline vector signed short
2112 vec_lde (int a1, const short *a2)
2113 {
2114   return (vector signed short) __builtin_altivec_lvehx (a1, (void *) a2);
2115 }
2116
2117 inline vector unsigned short
2118 vec_lde (int a1, const unsigned short *a2)
2119 {
2120   return (vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2);
2121 }
2122
2123 inline vector float
2124 vec_lde (int a1, const float *a2)
2125 {
2126   return (vector float) __builtin_altivec_lvewx (a1, (void *) a2);
2127 }
2128
2129 inline vector signed int
2130 vec_lde (int a1, const int *a2)
2131 {
2132   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2133 }
2134
2135 inline vector unsigned int
2136 vec_lde (int a1, const unsigned int *a2)
2137 {
2138   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2139 }
2140
2141 inline vector signed int
2142 vec_lde (int a1, const long *a2)
2143 {
2144   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2145 }
2146
2147 inline vector unsigned int
2148 vec_lde (int a1, const unsigned long *a2)
2149 {
2150   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2151 }
2152
2153 /* vec_lvewx */
2154
2155 inline vector float
2156 vec_lvewx (int a1, const float *a2)
2157 {
2158   return (vector float) __builtin_altivec_lvewx (a1, (void *) a2);
2159 }
2160
2161 inline vector signed int
2162 vec_lvewx (int a1, const int *a2)
2163 {
2164   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2165 }
2166
2167 inline vector unsigned int
2168 vec_lvewx (int a1, const unsigned int *a2)
2169 {
2170   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2171 }
2172
2173 inline vector signed int
2174 vec_lvewx (int a1, const long *a2)
2175 {
2176   return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2);
2177 }
2178
2179 inline vector unsigned int
2180 vec_lvewx (int a1, const unsigned long *a2)
2181 {
2182   return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2);
2183 }
2184
2185 /* vec_lvehx */
2186
2187 inline vector signed short
2188 vec_lvehx (int a1, const short *a2)
2189 {
2190   return (vector signed short) __builtin_altivec_lvehx (a1, (void *) a2);
2191 }
2192
2193 inline vector unsigned short
2194 vec_lvehx (int a1, const unsigned short *a2)
2195 {
2196   return (vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2);
2197 }
2198
2199 /* vec_lvebx */
2200
2201 inline vector signed char
2202 vec_lvebx (int a1, const signed char *a2)
2203 {
2204   return (vector signed char) __builtin_altivec_lvebx (a1, (void *) a2);
2205 }
2206
2207 inline vector unsigned char
2208 vec_lvebx (int a1, const int *a2)
2209 {
2210   return (vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2);
2211 }
2212
2213 /* vec_ldl */
2214
2215 inline vector float
2216 vec_ldl (int a1, const vector float *a2)
2217 {
2218   return (vector float) __builtin_altivec_lvxl (a1, (void *) a2);
2219 }
2220
2221 inline vector float
2222 vec_ldl (int a1, const float *a2)
2223 {
2224   return (vector float) __builtin_altivec_lvxl (a1, (void *) a2);
2225 }
2226
2227 inline vector bool int
2228 vec_ldl (int a1, const vector bool int *a2)
2229 {
2230   return (vector bool int) __builtin_altivec_lvxl (a1, (void *) a2);
2231 }
2232
2233 inline vector signed int
2234 vec_ldl (int a1, const vector signed int *a2)
2235 {
2236   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2237 }
2238
2239 inline vector signed int
2240 vec_ldl (int a1, const int *a2)
2241 {
2242   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2243 }
2244
2245 inline vector signed int
2246 vec_ldl (int a1, const long *a2)
2247 {
2248   return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2);
2249 }
2250
2251 inline vector unsigned int
2252 vec_ldl (int a1, const vector unsigned int *a2)
2253 {
2254   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2255 }
2256
2257 inline vector unsigned int
2258 vec_ldl (int a1, const unsigned int *a2)
2259 {
2260   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2261 }
2262
2263 inline vector unsigned int
2264 vec_ldl (int a1, const unsigned long *a2)
2265 {
2266   return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2);
2267 }
2268
2269 inline vector bool short
2270 vec_ldl (int a1, const vector bool short *a2)
2271 {
2272   return (vector bool short) __builtin_altivec_lvxl (a1, (void *) a2);
2273 }
2274
2275 inline vector pixel
2276 vec_ldl (int a1, const vector pixel *a2)
2277 {
2278   return (vector pixel) __builtin_altivec_lvxl (a1, (void *) a2);
2279 }
2280
2281 inline vector signed short
2282 vec_ldl (int a1, const vector signed short *a2)
2283 {
2284   return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2);
2285 }
2286
2287 inline vector signed short
2288 vec_ldl (int a1, const short *a2)
2289 {
2290   return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2);
2291 }
2292
2293 inline vector unsigned short
2294 vec_ldl (int a1, const vector unsigned short *a2)
2295 {
2296   return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2);
2297 }
2298
2299 inline vector unsigned short
2300 vec_ldl (int a1, const unsigned short *a2)
2301 {
2302   return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2);
2303 }
2304
2305 inline vector bool char
2306 vec_ldl (int a1, const vector bool char *a2)
2307 {
2308   return (vector bool char) __builtin_altivec_lvxl (a1, (void *) a2);
2309 }
2310
2311 inline vector signed char
2312 vec_ldl (int a1, const vector signed char *a2)
2313 {
2314   return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2);
2315 }
2316
2317 inline vector signed char
2318 vec_ldl (int a1, const signed char *a2)
2319 {
2320   return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2);
2321 }
2322
2323 inline vector unsigned char
2324 vec_ldl (int a1, const vector unsigned char *a2)
2325 {
2326   return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2);
2327 }
2328
2329 inline vector unsigned char
2330 vec_ldl (int a1, const unsigned char *a2)
2331 {
2332   return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2);
2333 }
2334
2335 /* vec_loge */
2336
2337 inline vector float
2338 vec_loge (vector float a1)
2339 {
2340   return (vector float) __builtin_altivec_vlogefp ((vector float) a1);
2341 }
2342
2343 /* vec_lvsl */
2344
2345 inline vector unsigned char
2346 vec_lvsl (int a1, const volatile unsigned char *a2)
2347 {
2348   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2349 }
2350
2351 inline vector unsigned char
2352 vec_lvsl (int a1, const volatile signed char *a2)
2353 {
2354   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2355 }
2356
2357 inline vector unsigned char
2358 vec_lvsl (int a1, const volatile unsigned short *a2)
2359 {
2360   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2361 }
2362
2363 inline vector unsigned char
2364 vec_lvsl (int a1, const volatile short *a2)
2365 {
2366   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2367 }
2368
2369 inline vector unsigned char
2370 vec_lvsl (int a1, const volatile unsigned int *a2)
2371 {
2372   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2373 }
2374
2375 inline vector unsigned char
2376 vec_lvsl (int a1, const volatile int *a2)
2377 {
2378   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2379 }
2380
2381 inline vector unsigned char
2382 vec_lvsl (int a1, const volatile unsigned long *a2)
2383 {
2384   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2385 }
2386
2387 inline vector unsigned char
2388 vec_lvsl (int a1, const volatile long *a2)
2389 {
2390   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2391 }
2392
2393 inline vector unsigned char
2394 vec_lvsl (int a1, const volatile float *a2)
2395 {
2396   return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2);
2397 }
2398
2399 /* vec_lvsr */
2400
2401 inline vector unsigned char
2402 vec_lvsr (int a1, const volatile unsigned char *a2)
2403 {
2404   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2405 }
2406
2407 inline vector unsigned char
2408 vec_lvsr (int a1, const volatile signed char *a2)
2409 {
2410   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2411 }
2412
2413 inline vector unsigned char
2414 vec_lvsr (int a1, const volatile unsigned short *a2)
2415 {
2416   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2417 }
2418
2419 inline vector unsigned char
2420 vec_lvsr (int a1, const volatile short *a2)
2421 {
2422   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2423 }
2424
2425 inline vector unsigned char
2426 vec_lvsr (int a1, const volatile unsigned int *a2)
2427 {
2428   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2429 }
2430
2431 inline vector unsigned char
2432 vec_lvsr (int a1, const volatile int *a2)
2433 {
2434   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2435 }
2436
2437 inline vector unsigned char
2438 vec_lvsr (int a1, const volatile unsigned long *a2)
2439 {
2440   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2441 }
2442
2443 inline vector unsigned char
2444 vec_lvsr (int a1, const volatile long *a2)
2445 {
2446   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2447 }
2448
2449 inline vector unsigned char
2450 vec_lvsr (int a1, const volatile float *a2)
2451 {
2452   return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2);
2453 }
2454
2455 /* vec_madd */
2456
2457 inline vector float
2458 vec_madd (vector float a1, vector float a2, vector float a3)
2459 {
2460   return (vector float) __builtin_altivec_vmaddfp ((vector float) a1, (vector float) a2, (vector float) a3);
2461 }
2462
2463 /* vec_madds */
2464
2465 inline vector signed short
2466 vec_madds (vector signed short a1, vector signed short a2, vector signed short a3)
2467 {
2468   return (vector signed short) __builtin_altivec_vmhaddshs ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
2469 }
2470
2471 /* vec_max */
2472
2473 inline vector unsigned char
2474 vec_max (vector bool char a1, vector unsigned char a2)
2475 {
2476   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2477 }
2478
2479 inline vector unsigned char
2480 vec_max (vector unsigned char a1, vector bool char a2)
2481 {
2482   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2483 }
2484
2485 inline vector unsigned char
2486 vec_max (vector unsigned char a1, vector unsigned char a2)
2487 {
2488   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2489 }
2490
2491 inline vector signed char
2492 vec_max (vector bool char a1, vector signed char a2)
2493 {
2494   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2495 }
2496
2497 inline vector signed char
2498 vec_max (vector signed char a1, vector bool char a2)
2499 {
2500   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2501 }
2502
2503 inline vector signed char
2504 vec_max (vector signed char a1, vector signed char a2)
2505 {
2506   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2507 }
2508
2509 inline vector unsigned short
2510 vec_max (vector bool short a1, vector unsigned short a2)
2511 {
2512   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2513 }
2514
2515 inline vector unsigned short
2516 vec_max (vector unsigned short a1, vector bool short a2)
2517 {
2518   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2519 }
2520
2521 inline vector unsigned short
2522 vec_max (vector unsigned short a1, vector unsigned short a2)
2523 {
2524   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2525 }
2526
2527 inline vector signed short
2528 vec_max (vector bool short a1, vector signed short a2)
2529 {
2530   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2531 }
2532
2533 inline vector signed short
2534 vec_max (vector signed short a1, vector bool short a2)
2535 {
2536   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2537 }
2538
2539 inline vector signed short
2540 vec_max (vector signed short a1, vector signed short a2)
2541 {
2542   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2543 }
2544
2545 inline vector unsigned int
2546 vec_max (vector bool int a1, vector unsigned int a2)
2547 {
2548   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2549 }
2550
2551 inline vector unsigned int
2552 vec_max (vector unsigned int a1, vector bool int a2)
2553 {
2554   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2555 }
2556
2557 inline vector unsigned int
2558 vec_max (vector unsigned int a1, vector unsigned int a2)
2559 {
2560   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2561 }
2562
2563 inline vector signed int
2564 vec_max (vector bool int a1, vector signed int a2)
2565 {
2566   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2567 }
2568
2569 inline vector signed int
2570 vec_max (vector signed int a1, vector bool int a2)
2571 {
2572   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2573 }
2574
2575 inline vector signed int
2576 vec_max (vector signed int a1, vector signed int a2)
2577 {
2578   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2579 }
2580
2581 inline vector float
2582 vec_max (vector float a1, vector float a2)
2583 {
2584   return (vector float) __builtin_altivec_vmaxfp ((vector float) a1, (vector float) a2);
2585 }
2586
2587 /* vec_vmaxfp */
2588
2589 inline vector float
2590 vec_vmaxfp (vector float a1, vector float a2)
2591 {
2592   return (vector float) __builtin_altivec_vmaxfp ((vector float) a1, (vector float) a2);
2593 }
2594
2595 /* vec_vmaxsw */
2596
2597 inline vector signed int
2598 vec_vmaxsw (vector signed int a1, vector signed int a2)
2599 {
2600   return (vector signed int) __builtin_altivec_vmaxsw ((vector signed int) a1, (vector signed int) a2);
2601 }
2602
2603 /* vec_vmaxuw */
2604
2605 inline vector unsigned int
2606 vec_vmaxuw (vector signed int a1, vector unsigned int a2)
2607 {
2608   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2609 }
2610
2611 inline vector unsigned int
2612 vec_vmaxuw (vector unsigned int a1, vector signed int a2)
2613 {
2614   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2615 }
2616
2617 inline vector unsigned int
2618 vec_vmaxuw (vector unsigned int a1, vector unsigned int a2)
2619 {
2620   return (vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) a1, (vector signed int) a2);
2621 }
2622
2623 /* vec_vmaxsh */
2624
2625 inline vector signed short
2626 vec_vmaxsh (vector signed short a1, vector signed short a2)
2627 {
2628   return (vector signed short) __builtin_altivec_vmaxsh ((vector signed short) a1, (vector signed short) a2);
2629 }
2630
2631 /* vec_vmaxuh */
2632
2633 inline vector unsigned short
2634 vec_vmaxuh (vector signed short a1, vector unsigned short a2)
2635 {
2636   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2637 }
2638
2639 inline vector unsigned short
2640 vec_vmaxuh (vector unsigned short a1, vector signed short a2)
2641 {
2642   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2643 }
2644
2645 inline vector unsigned short
2646 vec_vmaxuh (vector unsigned short a1, vector unsigned short a2)
2647 {
2648   return (vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) a1, (vector signed short) a2);
2649 }
2650
2651 /* vec_vmaxsb */
2652
2653 inline vector signed char
2654 vec_vmaxsb (vector signed char a1, vector signed char a2)
2655 {
2656   return (vector signed char) __builtin_altivec_vmaxsb ((vector signed char) a1, (vector signed char) a2);
2657 }
2658
2659 /* vec_vmaxub */
2660
2661 inline vector unsigned char
2662 vec_vmaxub (vector signed char a1, vector unsigned char a2)
2663 {
2664   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2665 }
2666
2667 inline vector unsigned char
2668 vec_vmaxub (vector unsigned char a1, vector signed char a2)
2669 {
2670   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2671 }
2672
2673 inline vector unsigned char
2674 vec_vmaxub (vector unsigned char a1, vector unsigned char a2)
2675 {
2676   return (vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) a1, (vector signed char) a2);
2677 }
2678
2679 /* vec_mergeh */
2680
2681 inline vector bool char
2682 vec_mergeh (vector bool char a1, vector bool char a2)
2683 {
2684   return (vector bool char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2685 }
2686
2687 inline vector signed char
2688 vec_mergeh (vector signed char a1, vector signed char a2)
2689 {
2690   return (vector signed char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2691 }
2692
2693 inline vector unsigned char
2694 vec_mergeh (vector unsigned char a1, vector unsigned char a2)
2695 {
2696   return (vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2697 }
2698
2699 inline vector bool short
2700 vec_mergeh (vector bool short a1, vector bool short a2)
2701 {
2702   return (vector bool short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2703 }
2704
2705 inline vector pixel
2706 vec_mergeh (vector pixel a1, vector pixel a2)
2707 {
2708   return (vector pixel) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2709 }
2710
2711 inline vector signed short
2712 vec_mergeh (vector signed short a1, vector signed short a2)
2713 {
2714   return (vector signed short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2715 }
2716
2717 inline vector unsigned short
2718 vec_mergeh (vector unsigned short a1, vector unsigned short a2)
2719 {
2720   return (vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2721 }
2722
2723 inline vector float
2724 vec_mergeh (vector float a1, vector float a2)
2725 {
2726   return (vector float) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2727 }
2728
2729 inline vector bool int
2730 vec_mergeh (vector bool int a1, vector bool int a2)
2731 {
2732   return (vector bool int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2733 }
2734
2735 inline vector signed int
2736 vec_mergeh (vector signed int a1, vector signed int a2)
2737 {
2738   return (vector signed int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2739 }
2740
2741 inline vector unsigned int
2742 vec_mergeh (vector unsigned int a1, vector unsigned int a2)
2743 {
2744   return (vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2745 }
2746
2747 /* vec_vmrghw */
2748
2749 inline vector float
2750 vec_vmrghw (vector float a1, vector float a2)
2751 {
2752   return (vector float) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2753 }
2754
2755 inline vector signed int
2756 vec_vmrghw (vector signed int a1, vector signed int a2)
2757 {
2758   return (vector signed int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2759 }
2760
2761 inline vector unsigned int
2762 vec_vmrghw (vector unsigned int a1, vector unsigned int a2)
2763 {
2764   return (vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) a1, (vector signed int) a2);
2765 }
2766
2767 /* vec_vmrghh */
2768
2769 inline vector signed short
2770 vec_vmrghh (vector signed short a1, vector signed short a2)
2771 {
2772   return (vector signed short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2773 }
2774
2775 inline vector unsigned short
2776 vec_vmrghh (vector unsigned short a1, vector unsigned short a2)
2777 {
2778   return (vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) a1, (vector signed short) a2);
2779 }
2780
2781 /* vec_vmrghb */
2782
2783 inline vector signed char
2784 vec_vmrghb (vector signed char a1, vector signed char a2)
2785 {
2786   return (vector signed char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2787 }
2788
2789 inline vector unsigned char
2790 vec_vmrghb (vector unsigned char a1, vector unsigned char a2)
2791 {
2792   return (vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) a1, (vector signed char) a2);
2793 }
2794
2795 /* vec_mergel */
2796
2797 inline vector bool char
2798 vec_mergel (vector bool char a1, vector bool char a2)
2799 {
2800   return (vector bool char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2801 }
2802
2803 inline vector signed char
2804 vec_mergel (vector signed char a1, vector signed char a2)
2805 {
2806   return (vector signed char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2807 }
2808
2809 inline vector unsigned char
2810 vec_mergel (vector unsigned char a1, vector unsigned char a2)
2811 {
2812   return (vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2813 }
2814
2815 inline vector bool short
2816 vec_mergel (vector bool short a1, vector bool short a2)
2817 {
2818   return (vector bool short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2819 }
2820
2821 inline vector pixel
2822 vec_mergel (vector pixel a1, vector pixel a2)
2823 {
2824   return (vector pixel) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2825 }
2826
2827 inline vector signed short
2828 vec_mergel (vector signed short a1, vector signed short a2)
2829 {
2830   return (vector signed short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2831 }
2832
2833 inline vector unsigned short
2834 vec_mergel (vector unsigned short a1, vector unsigned short a2)
2835 {
2836   return (vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2837 }
2838
2839 inline vector float
2840 vec_mergel (vector float a1, vector float a2)
2841 {
2842   return (vector float) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2843 }
2844
2845 inline vector bool int
2846 vec_mergel (vector bool int a1, vector bool int a2)
2847 {
2848   return (vector bool int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2849 }
2850
2851 inline vector signed int
2852 vec_mergel (vector signed int a1, vector signed int a2)
2853 {
2854   return (vector signed int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2855 }
2856
2857 inline vector unsigned int
2858 vec_mergel (vector unsigned int a1, vector unsigned int a2)
2859 {
2860   return (vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2861 }
2862
2863 /* vec_vmrglw */
2864
2865 inline vector float
2866 vec_vmrglw (vector float a1, vector float a2)
2867 {
2868   return (vector float) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2869 }
2870
2871 inline vector signed int
2872 vec_vmrglw (vector signed int a1, vector signed int a2)
2873 {
2874   return (vector signed int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2875 }
2876
2877 inline vector unsigned int
2878 vec_vmrglw (vector unsigned int a1, vector unsigned int a2)
2879 {
2880   return (vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) a1, (vector signed int) a2);
2881 }
2882
2883 /* vec_vmrglh */
2884
2885 inline vector signed short
2886 vec_vmrglh (vector signed short a1, vector signed short a2)
2887 {
2888   return (vector signed short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2889 }
2890
2891 inline vector unsigned short
2892 vec_vmrglh (vector unsigned short a1, vector unsigned short a2)
2893 {
2894   return (vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) a1, (vector signed short) a2);
2895 }
2896
2897 /* vec_vmrglb */
2898
2899 inline vector signed char
2900 vec_vmrglb (vector signed char a1, vector signed char a2)
2901 {
2902   return (vector signed char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2903 }
2904
2905 inline vector unsigned char
2906 vec_vmrglb (vector unsigned char a1, vector unsigned char a2)
2907 {
2908   return (vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) a1, (vector signed char) a2);
2909 }
2910
2911 /* vec_mfvscr */
2912
2913 inline vector unsigned short
2914 vec_mfvscr (void)
2915 {
2916   return (vector unsigned short) __builtin_altivec_mfvscr ();
2917 }
2918
2919 /* vec_min */
2920
2921 inline vector unsigned char
2922 vec_min (vector bool char a1, vector unsigned char a2)
2923 {
2924   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
2925 }
2926
2927 inline vector unsigned char
2928 vec_min (vector unsigned char a1, vector bool char a2)
2929 {
2930   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
2931 }
2932
2933 inline vector unsigned char
2934 vec_min (vector unsigned char a1, vector unsigned char a2)
2935 {
2936   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
2937 }
2938
2939 inline vector signed char
2940 vec_min (vector bool char a1, vector signed char a2)
2941 {
2942   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
2943 }
2944
2945 inline vector signed char
2946 vec_min (vector signed char a1, vector bool char a2)
2947 {
2948   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
2949 }
2950
2951 inline vector signed char
2952 vec_min (vector signed char a1, vector signed char a2)
2953 {
2954   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
2955 }
2956
2957 inline vector unsigned short
2958 vec_min (vector bool short a1, vector unsigned short a2)
2959 {
2960   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
2961 }
2962
2963 inline vector unsigned short
2964 vec_min (vector unsigned short a1, vector bool short a2)
2965 {
2966   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
2967 }
2968
2969 inline vector unsigned short
2970 vec_min (vector unsigned short a1, vector unsigned short a2)
2971 {
2972   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
2973 }
2974
2975 inline vector signed short
2976 vec_min (vector bool short a1, vector signed short a2)
2977 {
2978   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
2979 }
2980
2981 inline vector signed short
2982 vec_min (vector signed short a1, vector bool short a2)
2983 {
2984   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
2985 }
2986
2987 inline vector signed short
2988 vec_min (vector signed short a1, vector signed short a2)
2989 {
2990   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
2991 }
2992
2993 inline vector unsigned int
2994 vec_min (vector bool int a1, vector unsigned int a2)
2995 {
2996   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
2997 }
2998
2999 inline vector unsigned int
3000 vec_min (vector unsigned int a1, vector bool int a2)
3001 {
3002   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3003 }
3004
3005 inline vector unsigned int
3006 vec_min (vector unsigned int a1, vector unsigned int a2)
3007 {
3008   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3009 }
3010
3011 inline vector signed int
3012 vec_min (vector bool int a1, vector signed int a2)
3013 {
3014   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3015 }
3016
3017 inline vector signed int
3018 vec_min (vector signed int a1, vector bool int a2)
3019 {
3020   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3021 }
3022
3023 inline vector signed int
3024 vec_min (vector signed int a1, vector signed int a2)
3025 {
3026   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3027 }
3028
3029 inline vector float
3030 vec_min (vector float a1, vector float a2)
3031 {
3032   return (vector float) __builtin_altivec_vminfp ((vector float) a1, (vector float) a2);
3033 }
3034
3035 /* vec_vminfp */
3036
3037 inline vector float
3038 vec_vminfp (vector float a1, vector float a2)
3039 {
3040   return (vector float) __builtin_altivec_vminfp ((vector float) a1, (vector float) a2);
3041 }
3042
3043 /* vec_vminsw */
3044
3045 inline vector signed int
3046 vec_vminsw (vector signed int a1, vector signed int a2)
3047 {
3048   return (vector signed int) __builtin_altivec_vminsw ((vector signed int) a1, (vector signed int) a2);
3049 }
3050
3051 /* vec_vminuw */
3052
3053 inline vector unsigned int
3054 vec_vminuw (vector signed int a1, vector unsigned int a2)
3055 {
3056   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3057 }
3058
3059 inline vector unsigned int
3060 vec_vminuw (vector unsigned int a1, vector signed int a2)
3061 {
3062   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3063 }
3064
3065 inline vector unsigned int
3066 vec_vminuw (vector unsigned int a1, vector unsigned int a2)
3067 {
3068   return (vector unsigned int) __builtin_altivec_vminuw ((vector signed int) a1, (vector signed int) a2);
3069 }
3070
3071 /* vec_vminsh */
3072
3073 inline vector signed short
3074 vec_vminsh (vector signed short a1, vector signed short a2)
3075 {
3076   return (vector signed short) __builtin_altivec_vminsh ((vector signed short) a1, (vector signed short) a2);
3077 }
3078
3079 /* vec_vminuh */
3080
3081 inline vector unsigned short
3082 vec_vminuh (vector signed short a1, vector unsigned short a2)
3083 {
3084   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3085 }
3086
3087 inline vector unsigned short
3088 vec_vminuh (vector unsigned short a1, vector signed short a2)
3089 {
3090   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3091 }
3092
3093 inline vector unsigned short
3094 vec_vminuh (vector unsigned short a1, vector unsigned short a2)
3095 {
3096   return (vector unsigned short) __builtin_altivec_vminuh ((vector signed short) a1, (vector signed short) a2);
3097 }
3098
3099 /* vec_vminsb */
3100
3101 inline vector signed char
3102 vec_vminsb (vector signed char a1, vector signed char a2)
3103 {
3104   return (vector signed char) __builtin_altivec_vminsb ((vector signed char) a1, (vector signed char) a2);
3105 }
3106
3107 /* vec_vminub */
3108
3109 inline vector unsigned char
3110 vec_vminub (vector signed char a1, vector unsigned char a2)
3111 {
3112   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3113 }
3114
3115 inline vector unsigned char
3116 vec_vminub (vector unsigned char a1, vector signed char a2)
3117 {
3118   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3119 }
3120
3121 inline vector unsigned char
3122 vec_vminub (vector unsigned char a1, vector unsigned char a2)
3123 {
3124   return (vector unsigned char) __builtin_altivec_vminub ((vector signed char) a1, (vector signed char) a2);
3125 }
3126
3127 /* vec_mladd */
3128
3129 inline vector signed short
3130 vec_mladd (vector signed short a1, vector signed short a2, vector signed short a3)
3131 {
3132   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3133 }
3134
3135 inline vector signed short
3136 vec_mladd (vector signed short a1, vector unsigned short a2, vector unsigned short a3)
3137 {
3138   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3139 }
3140
3141 inline vector signed short
3142 vec_mladd (vector unsigned short a1, vector signed short a2, vector signed short a3)
3143 {
3144   return (vector signed short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3145 }
3146
3147 inline vector unsigned short
3148 vec_mladd (vector unsigned short a1, vector unsigned short a2, vector unsigned short a3)
3149 {
3150   return (vector unsigned short) __builtin_altivec_vmladduhm ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3151 }
3152
3153 /* vec_mradds */
3154
3155 inline vector signed short
3156 vec_mradds (vector signed short a1, vector signed short a2, vector signed short a3)
3157 {
3158   return (vector signed short) __builtin_altivec_vmhraddshs ((vector signed short) a1, (vector signed short) a2, (vector signed short) a3);
3159 }
3160
3161 /* vec_msum */
3162
3163 inline vector unsigned int
3164 vec_msum (vector unsigned char a1, vector unsigned char a2, vector unsigned int a3)
3165 {
3166   return (vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3167 }
3168
3169 inline vector signed int
3170 vec_msum (vector signed char a1, vector unsigned char a2, vector signed int a3)
3171 {
3172   return (vector signed int) __builtin_altivec_vmsummbm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3173 }
3174
3175 inline vector unsigned int
3176 vec_msum (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3177 {
3178   return (vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3179 }
3180
3181 inline vector signed int
3182 vec_msum (vector signed short a1, vector signed short a2, vector signed int a3)
3183 {
3184   return (vector signed int) __builtin_altivec_vmsumshm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3185 }
3186
3187 /* vec_vmsumshm */
3188
3189 inline vector signed int
3190 vec_vmsumshm (vector signed short a1, vector signed short a2, vector signed int a3)
3191 {
3192   return (vector signed int) __builtin_altivec_vmsumshm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3193 }
3194
3195 /* vec_vmsumuhm */
3196
3197 inline vector unsigned int
3198 vec_vmsumuhm (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3199 {
3200   return (vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3201 }
3202
3203 /* vec_vmsummbm */
3204
3205 inline vector signed int
3206 vec_vmsummbm (vector signed char a1, vector unsigned char a2, vector signed int a3)
3207 {
3208   return (vector signed int) __builtin_altivec_vmsummbm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3209 }
3210
3211 /* vec_vmsumubm */
3212
3213 inline vector unsigned int
3214 vec_vmsumubm (vector unsigned char a1, vector unsigned char a2, vector unsigned int a3)
3215 {
3216   return (vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) a1, (vector signed char) a2, (vector signed int) a3);
3217 }
3218
3219 /* vec_msums */
3220
3221 inline vector unsigned int
3222 vec_msums (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3223 {
3224   return (vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3225 }
3226
3227 inline vector signed int
3228 vec_msums (vector signed short a1, vector signed short a2, vector signed int a3)
3229 {
3230   return (vector signed int) __builtin_altivec_vmsumshs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3231 }
3232
3233 /* vec_vmsumshs */
3234
3235 inline vector signed int
3236 vec_vmsumshs (vector signed short a1, vector signed short a2, vector signed int a3)
3237 {
3238   return (vector signed int) __builtin_altivec_vmsumshs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3239 }
3240
3241 /* vec_vmsumuhs */
3242
3243 inline vector unsigned int
3244 vec_vmsumuhs (vector unsigned short a1, vector unsigned short a2, vector unsigned int a3)
3245 {
3246   return (vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) a1, (vector signed short) a2, (vector signed int) a3);
3247 }
3248
3249 /* vec_mtvscr */
3250
3251 inline void
3252 vec_mtvscr (vector signed int a1)
3253 {
3254   __builtin_altivec_mtvscr ((vector signed int) a1);
3255 }
3256
3257 inline void
3258 vec_mtvscr (vector unsigned int a1)
3259 {
3260   __builtin_altivec_mtvscr ((vector signed int) a1);
3261 }
3262
3263 inline void
3264 vec_mtvscr (vector bool int a1)
3265 {
3266   __builtin_altivec_mtvscr ((vector signed int) a1);
3267 }
3268
3269 inline void
3270 vec_mtvscr (vector signed short a1)
3271 {
3272   __builtin_altivec_mtvscr ((vector signed int) a1);
3273 }
3274
3275 inline void
3276 vec_mtvscr (vector unsigned short a1)
3277 {
3278   __builtin_altivec_mtvscr ((vector signed int) a1);
3279 }
3280
3281 inline void
3282 vec_mtvscr (vector bool short a1)
3283 {
3284   __builtin_altivec_mtvscr ((vector signed int) a1);
3285 }
3286
3287 inline void
3288 vec_mtvscr (vector pixel a1)
3289 {
3290   __builtin_altivec_mtvscr ((vector signed int) a1);
3291 }
3292
3293 inline void
3294 vec_mtvscr (vector signed char a1)
3295 {
3296   __builtin_altivec_mtvscr ((vector signed int) a1);
3297 }
3298
3299 inline void
3300 vec_mtvscr (vector unsigned char a1)
3301 {
3302   __builtin_altivec_mtvscr ((vector signed int) a1);
3303 }
3304
3305 inline void
3306 vec_mtvscr (vector bool char a1)
3307 {
3308   __builtin_altivec_mtvscr ((vector signed int) a1);
3309 }
3310
3311 /* vec_mule */
3312
3313 inline vector unsigned short
3314 vec_mule (vector unsigned char a1, vector unsigned char a2)
3315 {
3316   return (vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) a1, (vector signed char) a2);
3317 }
3318
3319 inline vector signed short
3320 vec_mule (vector signed char a1, vector signed char a2)
3321 {
3322   return (vector signed short) __builtin_altivec_vmulesb ((vector signed char) a1, (vector signed char) a2);
3323 }
3324
3325 inline vector unsigned int
3326 vec_mule (vector unsigned short a1, vector unsigned short a2)
3327 {
3328   return (vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) a1, (vector signed short) a2);
3329 }
3330
3331 inline vector signed int
3332 vec_mule (vector signed short a1, vector signed short a2)
3333 {
3334   return (vector signed int) __builtin_altivec_vmulesh ((vector signed short) a1, (vector signed short) a2);
3335 }
3336
3337 /* vec_vmulesh */
3338
3339 inline vector signed int
3340 vec_vmulesh (vector signed short a1, vector signed short a2)
3341 {
3342   return (vector signed int) __builtin_altivec_vmulesh ((vector signed short) a1, (vector signed short) a2);
3343 }
3344
3345 /* vec_vmuleuh */
3346
3347 inline vector unsigned int
3348 vec_vmuleuh (vector unsigned short a1, vector unsigned short a2)
3349 {
3350   return (vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) a1, (vector signed short) a2);
3351 }
3352
3353 /* vec_vmuleub */
3354 inline vector unsigned short
3355 vec_vmuleub (vector unsigned char a1, vector unsigned char a2)
3356 {
3357   return (vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) a1, (vector signed char) a2);
3358 }
3359
3360 /* vec_mulo */
3361
3362 inline vector unsigned short
3363 vec_mulo (vector unsigned char a1, vector unsigned char a2)
3364 {
3365   return (vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) a1, (vector signed char) a2);
3366 }
3367
3368 inline vector signed short
3369 vec_mulo (vector signed char a1, vector signed char a2)
3370 {
3371   return (vector signed short) __builtin_altivec_vmulosb ((vector signed char) a1, (vector signed char) a2);
3372 }
3373
3374 inline vector unsigned int
3375 vec_mulo (vector unsigned short a1, vector unsigned short a2)
3376 {
3377   return (vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) a1, (vector signed short) a2);
3378 }
3379
3380 inline vector signed int
3381 vec_mulo (vector signed short a1, vector signed short a2)
3382 {
3383   return (vector signed int) __builtin_altivec_vmulosh ((vector signed short) a1, (vector signed short) a2);
3384 }
3385
3386 /* vec_vmulosh */
3387
3388 inline vector signed int
3389 vec_vmulosh (vector signed short a1, vector signed short a2)
3390 {
3391   return (vector signed int) __builtin_altivec_vmulosh ((vector signed short) a1, (vector signed short) a2);
3392 }
3393
3394 /* vec_vmulouh */
3395
3396 inline vector unsigned int
3397 vec_vmulouh (vector unsigned short a1, vector unsigned short a2)
3398 {
3399   return (vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) a1, (vector signed short) a2);
3400 }
3401
3402 /* vec_vmulosb */
3403
3404 inline vector signed short
3405 vec_vmulosb (vector signed char a1, vector signed char a2)
3406 {
3407   return (vector signed short) __builtin_altivec_vmulosb ((vector signed char) a1, (vector signed char) a2);
3408 }
3409
3410 /* vec_vmuloub */
3411
3412 inline vector unsigned short
3413 vec_vmuloub (vector unsigned char a1, vector unsigned char a2)
3414 {
3415   return (vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) a1, (vector signed char) a2);
3416 }
3417
3418 /* vec_nmsub */
3419
3420 inline vector float
3421 vec_nmsub (vector float a1, vector float a2, vector float a3)
3422 {
3423   return (vector float) __builtin_altivec_vnmsubfp ((vector float) a1, (vector float) a2, (vector float) a3);
3424 }
3425
3426 /* vec_nor */
3427
3428 inline vector float
3429 vec_nor (vector float a1, vector float a2)
3430 {
3431   return (vector float) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3432 }
3433
3434 inline vector signed int
3435 vec_nor (vector signed int a1, vector signed int a2)
3436 {
3437   return (vector signed int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3438 }
3439
3440 inline vector unsigned int
3441 vec_nor (vector unsigned int a1, vector unsigned int a2)
3442 {
3443   return (vector unsigned int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3444 }
3445
3446 inline vector bool int
3447 vec_nor (vector bool int a1, vector bool int a2)
3448 {
3449   return (vector bool int) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3450 }
3451
3452 inline vector signed short
3453 vec_nor (vector signed short a1, vector signed short a2)
3454 {
3455   return (vector signed short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3456 }
3457
3458 inline vector unsigned short
3459 vec_nor (vector unsigned short a1, vector unsigned short a2)
3460 {
3461   return (vector unsigned short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3462 }
3463
3464 inline vector bool short
3465 vec_nor (vector bool short a1, vector bool short a2)
3466 {
3467   return (vector bool short) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3468 }
3469
3470 inline vector signed char
3471 vec_nor (vector signed char a1, vector signed char a2)
3472 {
3473   return (vector signed char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3474 }
3475
3476 inline vector unsigned char
3477 vec_nor (vector unsigned char a1, vector unsigned char a2)
3478 {
3479   return (vector unsigned char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3480 }
3481
3482 inline vector bool char
3483 vec_nor (vector bool char a1, vector bool char a2)
3484 {
3485   return (vector bool char) __builtin_altivec_vnor ((vector signed int) a1, (vector signed int) a2);
3486 }
3487
3488 /* vec_or */
3489
3490 inline vector float
3491 vec_or (vector float a1, vector float a2)
3492 {
3493   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3494 }
3495
3496 inline vector float
3497 vec_or (vector float a1, vector bool int a2)
3498 {
3499   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3500 }
3501
3502 inline vector float
3503 vec_or (vector bool int a1, vector float a2)
3504 {
3505   return (vector float) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3506 }
3507
3508 inline vector bool int
3509 vec_or (vector bool int a1, vector bool int a2)
3510 {
3511   return (vector bool int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3512 }
3513
3514 inline vector signed int
3515 vec_or (vector bool int a1, vector signed int a2)
3516 {
3517   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3518 }
3519
3520 inline vector signed int
3521 vec_or (vector signed int a1, vector bool int a2)
3522 {
3523   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3524 }
3525
3526 inline vector signed int
3527 vec_or (vector signed int a1, vector signed int a2)
3528 {
3529   return (vector signed int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3530 }
3531
3532 inline vector unsigned int
3533 vec_or (vector bool int a1, vector unsigned int a2)
3534 {
3535   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3536 }
3537
3538 inline vector unsigned int
3539 vec_or (vector unsigned int a1, vector bool int a2)
3540 {
3541   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3542 }
3543
3544 inline vector unsigned int
3545 vec_or (vector unsigned int a1, vector unsigned int a2)
3546 {
3547   return (vector unsigned int) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3548 }
3549
3550 inline vector bool short
3551 vec_or (vector bool short a1, vector bool short a2)
3552 {
3553   return (vector bool short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3554 }
3555
3556 inline vector signed short
3557 vec_or (vector bool short a1, vector signed short a2)
3558 {
3559   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3560 }
3561
3562 inline vector signed short
3563 vec_or (vector signed short a1, vector bool short a2)
3564 {
3565   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3566 }
3567
3568 inline vector signed short
3569 vec_or (vector signed short a1, vector signed short a2)
3570 {
3571   return (vector signed short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3572 }
3573
3574 inline vector unsigned short
3575 vec_or (vector bool short a1, vector unsigned short a2)
3576 {
3577   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3578 }
3579
3580 inline vector unsigned short
3581 vec_or (vector unsigned short a1, vector bool short a2)
3582 {
3583   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3584 }
3585
3586 inline vector unsigned short
3587 vec_or (vector unsigned short a1, vector unsigned short a2)
3588 {
3589   return (vector unsigned short) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3590 }
3591
3592 inline vector signed char
3593 vec_or (vector bool char a1, vector signed char a2)
3594 {
3595   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3596 }
3597
3598 inline vector bool char
3599 vec_or (vector bool char a1, vector bool char a2)
3600 {
3601   return (vector bool char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3602 }
3603
3604 inline vector signed char
3605 vec_or (vector signed char a1, vector bool char a2)
3606 {
3607   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3608 }
3609
3610 inline vector signed char
3611 vec_or (vector signed char a1, vector signed char a2)
3612 {
3613   return (vector signed char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3614 }
3615
3616 inline vector unsigned char
3617 vec_or (vector bool char a1, vector unsigned char a2)
3618 {
3619   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3620 }
3621
3622 inline vector unsigned char
3623 vec_or (vector unsigned char a1, vector bool char a2)
3624 {
3625   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3626 }
3627
3628 inline vector unsigned char
3629 vec_or (vector unsigned char a1, vector unsigned char a2)
3630 {
3631   return (vector unsigned char) __builtin_altivec_vor ((vector signed int) a1, (vector signed int) a2);
3632 }
3633
3634 /* vec_pack */
3635
3636 inline vector signed char
3637 vec_pack (vector signed short a1, vector signed short a2)
3638 {
3639   return (vector signed char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3640 }
3641
3642 inline vector unsigned char
3643 vec_pack (vector unsigned short a1, vector unsigned short a2)
3644 {
3645   return (vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3646 }
3647
3648 inline vector bool char
3649 vec_pack (vector bool short a1, vector bool short a2)
3650 {
3651   return (vector bool char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3652 }
3653
3654 inline vector signed short
3655 vec_pack (vector signed int a1, vector signed int a2)
3656 {
3657   return (vector signed short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3658 }
3659
3660 inline vector unsigned short
3661 vec_pack (vector unsigned int a1, vector unsigned int a2)
3662 {
3663   return (vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3664 }
3665
3666 inline vector bool short
3667 vec_pack (vector bool int a1, vector bool int a2)
3668 {
3669   return (vector bool short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3670 }
3671
3672 /* vec_vpkuwum */
3673
3674 inline vector signed short
3675 vec_vpkuwum (vector signed int a1, vector signed int a2)
3676 {
3677   return (vector signed short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3678 }
3679
3680 inline vector unsigned short
3681 vec_vpkuwum (vector unsigned int a1, vector unsigned int a2)
3682 {
3683   return (vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) a1, (vector signed int) a2);
3684 }
3685
3686 /* vec_vpkuhum */
3687
3688 inline vector signed char
3689 vec_vpkuhum (vector signed short a1, vector signed short a2)
3690 {
3691   return (vector signed char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3692 }
3693
3694 inline vector unsigned char
3695 vec_vpkuhum (vector unsigned short a1, vector unsigned short a2)
3696 {
3697   return (vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) a1, (vector signed short) a2);
3698 }
3699
3700 /* vec_packpx */
3701
3702 inline vector pixel
3703 vec_packpx (vector unsigned int a1, vector unsigned int a2)
3704 {
3705   return (vector pixel) __builtin_altivec_vpkpx ((vector signed int) a1, (vector signed int) a2);
3706 }
3707
3708 /* vec_packs */
3709
3710 inline vector unsigned char
3711 vec_packs (vector unsigned short a1, vector unsigned short a2)
3712 {
3713   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3714 }
3715
3716 inline vector signed char
3717 vec_packs (vector signed short a1, vector signed short a2)
3718 {
3719   return (vector signed char) __builtin_altivec_vpkshss ((vector signed short) a1, (vector signed short) a2);
3720 }
3721
3722 inline vector unsigned short
3723 vec_packs (vector unsigned int a1, vector unsigned int a2)
3724 {
3725   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
3726 }
3727
3728 inline vector signed short
3729 vec_packs (vector signed int a1, vector signed int a2)
3730 {
3731   return (vector signed short) __builtin_altivec_vpkswss ((vector signed int) a1, (vector signed int) a2);
3732 }
3733
3734 /* vec_vpkswss */
3735
3736 inline vector signed short
3737 vec_vpkswss (vector signed int a1, vector signed int a2)
3738 {
3739   return (vector signed short) __builtin_altivec_vpkswss ((vector signed int) a1, (vector signed int) a2);
3740 }
3741
3742 /* vec_vpkuwus */
3743
3744 inline vector unsigned short
3745 vec_vpkuwus (vector unsigned int a1, vector unsigned int a2)
3746 {
3747   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
3748 }
3749
3750 /* vec_vpkshss */
3751
3752 inline vector signed char
3753 vec_vpkshss (vector signed short a1, vector signed short a2)
3754 {
3755   return (vector signed char) __builtin_altivec_vpkshss ((vector signed short) a1, (vector signed short) a2);
3756 }
3757
3758 /* vec_vpkuhus */
3759
3760 inline vector unsigned char
3761 vec_vpkuhus (vector unsigned short a1, vector unsigned short a2)
3762 {
3763   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3764 }
3765
3766 /* vec_packsu */
3767
3768 inline vector unsigned char
3769 vec_packsu (vector unsigned short a1, vector unsigned short a2)
3770 {
3771   return (vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) a1, (vector signed short) a2);
3772 }
3773
3774 inline vector unsigned char
3775 vec_packsu (vector signed short a1, vector signed short a2)
3776 {
3777   return (vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) a1, (vector signed short) a2);
3778 }
3779
3780 inline vector unsigned short
3781 vec_packsu (vector unsigned int a1, vector unsigned int a2)
3782 {
3783   return (vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) a1, (vector signed int) a2);
3784 }
3785
3786 inline vector unsigned short
3787 vec_packsu (vector signed int a1, vector signed int a2)
3788 {
3789   return (vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) a1, (vector signed int) a2);
3790 }
3791
3792 /* vec_vpkswus */
3793
3794 inline vector unsigned short
3795 vec_vpkswus (vector signed int a1, vector signed int a2)
3796 {
3797   return (vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) a1, (vector signed int) a2);
3798 }
3799
3800 /* vec_vpkshus */
3801
3802 inline vector unsigned char
3803 vec_vpkshus (vector signed short a1, vector signed short a2)
3804 {
3805   return (vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) a1, (vector signed short) a2);
3806 }
3807
3808 /* vec_perm */
3809
3810 inline vector float
3811 vec_perm (vector float a1, vector float a2, vector unsigned char a3)
3812 {
3813   return (vector float) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3814 }
3815
3816 inline vector signed int
3817 vec_perm (vector signed int a1, vector signed int a2, vector unsigned char a3)
3818 {
3819   return (vector signed int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3820 }
3821
3822 inline vector unsigned int
3823 vec_perm (vector unsigned int a1, vector unsigned int a2, vector unsigned char a3)
3824 {
3825   return (vector unsigned int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3826 }
3827
3828 inline vector bool int
3829 vec_perm (vector bool int a1, vector bool int a2, vector unsigned char a3)
3830 {
3831   return (vector bool int) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3832 }
3833
3834 inline vector signed short
3835 vec_perm (vector signed short a1, vector signed short a2, vector unsigned char a3)
3836 {
3837   return (vector signed short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3838 }
3839
3840 inline vector unsigned short
3841 vec_perm (vector unsigned short a1, vector unsigned short a2, vector unsigned char a3)
3842 {
3843   return (vector unsigned short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3844 }
3845
3846 inline vector bool short
3847 vec_perm (vector bool short a1, vector bool short a2, vector unsigned char a3)
3848 {
3849   return (vector bool short) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3850 }
3851
3852 inline vector pixel
3853 vec_perm (vector pixel a1, vector pixel a2, vector unsigned char a3)
3854 {
3855   return (vector pixel) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3856 }
3857
3858 inline vector signed char
3859 vec_perm (vector signed char a1, vector signed char a2, vector unsigned char a3)
3860 {
3861   return (vector signed char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3862 }
3863
3864 inline vector unsigned char
3865 vec_perm (vector unsigned char a1, vector unsigned char a2, vector unsigned char a3)
3866 {
3867   return (vector unsigned char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3868 }
3869
3870 inline vector bool char
3871 vec_perm (vector bool char a1, vector bool char a2, vector bool char a3)
3872 {
3873   return (vector bool char) __builtin_altivec_vperm_4si ((vector signed int) a1, (vector signed int) a2, (vector signed char) a3);
3874 }
3875
3876 /* vec_re */
3877
3878 inline vector float
3879 vec_re (vector float a1)
3880 {
3881   return (vector float) __builtin_altivec_vrefp ((vector float) a1);
3882 }
3883
3884 /* vec_rl */
3885
3886 inline vector signed char
3887 vec_rl (vector signed char a1, vector unsigned char a2)
3888 {
3889   return (vector signed char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
3890 }
3891
3892 inline vector unsigned char
3893 vec_rl (vector unsigned char a1, vector unsigned char a2)
3894 {
3895   return (vector unsigned char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
3896 }
3897
3898 inline vector signed short
3899 vec_rl (vector signed short a1, vector unsigned short a2)
3900 {
3901   return (vector signed short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
3902 }
3903
3904 inline vector unsigned short
3905 vec_rl (vector unsigned short a1, vector unsigned short a2)
3906 {
3907   return (vector unsigned short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
3908 }
3909
3910 inline vector signed int
3911 vec_rl (vector signed int a1, vector unsigned int a2)
3912 {
3913   return (vector signed int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
3914 }
3915
3916 inline vector unsigned int
3917 vec_rl (vector unsigned int a1, vector unsigned int a2)
3918 {
3919   return (vector unsigned int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
3920 }
3921
3922 /* vec_vrlw */
3923
3924 inline vector signed int
3925 vec_vrlw (vector signed int a1, vector unsigned int a2)
3926 {
3927   return (vector signed int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
3928 }
3929
3930 inline vector unsigned int
3931 vec_vrlw (vector unsigned int a1, vector unsigned int a2)
3932 {
3933   return (vector unsigned int) __builtin_altivec_vrlw ((vector signed int) a1, (vector signed int) a2);
3934 }
3935
3936 /* vec_vrlh */
3937
3938 inline vector signed short
3939 vec_vrlh (vector signed short a1, vector unsigned short a2)
3940 {
3941   return (vector signed short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
3942 }
3943
3944 inline vector unsigned short
3945 vec_vrlh (vector unsigned short a1, vector unsigned short a2)
3946 {
3947   return (vector unsigned short) __builtin_altivec_vrlh ((vector signed short) a1, (vector signed short) a2);
3948 }
3949
3950 /* vec_vrlb */
3951
3952 inline vector signed char
3953 vec_vrlb (vector signed char a1, vector unsigned char a2)
3954 {
3955   return (vector signed char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
3956 }
3957
3958 inline vector unsigned char
3959 vec_vrlb (vector unsigned char a1, vector unsigned char a2)
3960 {
3961   return (vector unsigned char) __builtin_altivec_vrlb ((vector signed char) a1, (vector signed char) a2);
3962 }
3963
3964 /* vec_round */
3965
3966 inline vector float
3967 vec_round (vector float a1)
3968 {
3969   return (vector float) __builtin_altivec_vrfin ((vector float) a1);
3970 }
3971
3972 /* vec_rsqrte */
3973
3974 inline vector float
3975 vec_rsqrte (vector float a1)
3976 {
3977   return (vector float) __builtin_altivec_vrsqrtefp ((vector float) a1);
3978 }
3979
3980 /* vec_sel */
3981
3982 inline vector float
3983 vec_sel (vector float a1, vector float a2, vector bool int a3)
3984 {
3985   return (vector float) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
3986 }
3987
3988 inline vector float
3989 vec_sel (vector float a1, vector float a2, vector unsigned int a3)
3990 {
3991   return (vector float) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
3992 }
3993
3994 inline vector signed int
3995 vec_sel (vector signed int a1, vector signed int a2, vector bool int a3)
3996 {
3997   return (vector signed int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
3998 }
3999
4000 inline vector signed int
4001 vec_sel (vector signed int a1, vector signed int a2, vector unsigned int a3)
4002 {
4003   return (vector signed int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4004 }
4005
4006 inline vector unsigned int
4007 vec_sel (vector unsigned int a1, vector unsigned int a2, vector bool int a3)
4008 {
4009   return (vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4010 }
4011
4012 inline vector unsigned int
4013 vec_sel (vector unsigned int a1, vector unsigned int a2, vector unsigned int a3)
4014 {
4015   return (vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4016 }
4017
4018 inline vector bool int
4019 vec_sel (vector bool int a1, vector bool int a2, vector bool int a3)
4020 {
4021   return (vector bool int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4022 }
4023
4024 inline vector bool int
4025 vec_sel (vector bool int a1, vector bool int a2, vector unsigned int a3)
4026 {
4027   return (vector bool int) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4028 }
4029
4030 inline vector signed short
4031 vec_sel (vector signed short a1, vector signed short a2, vector bool short a3)
4032 {
4033   return (vector signed short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4034 }
4035
4036 inline vector signed short
4037 vec_sel (vector signed short a1, vector signed short a2, vector unsigned short a3)
4038 {
4039   return (vector signed short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4040 }
4041
4042 inline vector unsigned short
4043 vec_sel (vector unsigned short a1, vector unsigned short a2, vector bool short a3)
4044 {
4045   return (vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4046 }
4047
4048 inline vector unsigned short
4049 vec_sel (vector unsigned short a1, vector unsigned short a2, vector unsigned short a3)
4050 {
4051   return (vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4052 }
4053
4054 inline vector bool short
4055 vec_sel (vector bool short a1, vector bool short a2, vector bool short a3)
4056 {
4057   return (vector bool short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4058 }
4059
4060 inline vector bool short
4061 vec_sel (vector bool short a1, vector bool short a2, vector unsigned short a3)
4062 {
4063   return (vector bool short) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4064 }
4065
4066 inline vector signed char
4067 vec_sel (vector signed char a1, vector signed char a2, vector bool char a3)
4068 {
4069   return (vector signed char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4070 }
4071
4072 inline vector signed char
4073 vec_sel (vector signed char a1, vector signed char a2, vector unsigned char a3)
4074 {
4075   return (vector signed char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4076 }
4077
4078 inline vector unsigned char
4079 vec_sel (vector unsigned char a1, vector unsigned char a2, vector bool char a3)
4080 {
4081   return (vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4082 }
4083
4084 inline vector unsigned char
4085 vec_sel (vector unsigned char a1, vector unsigned char a2, vector unsigned char a3)
4086 {
4087   return (vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4088 }
4089
4090 inline vector bool char
4091 vec_sel (vector bool char a1, vector bool char a2, vector bool char a3)
4092 {
4093   return (vector bool char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4094 }
4095
4096 inline vector bool char
4097 vec_sel (vector bool char a1, vector bool char a2, vector unsigned char a3)
4098 {
4099   return (vector bool char) __builtin_altivec_vsel_4si ((vector signed int) a1, (vector signed int) a2, (vector signed int) a3);
4100 }
4101
4102 /* vec_sl */
4103
4104 inline vector signed char
4105 vec_sl (vector signed char a1, vector unsigned char a2)
4106 {
4107   return (vector signed char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4108 }
4109
4110 inline vector unsigned char
4111 vec_sl (vector unsigned char a1, vector unsigned char a2)
4112 {
4113   return (vector unsigned char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4114 }
4115
4116 inline vector signed short
4117 vec_sl (vector signed short a1, vector unsigned short a2)
4118 {
4119   return (vector signed short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4120 }
4121
4122 inline vector unsigned short
4123 vec_sl (vector unsigned short a1, vector unsigned short a2)
4124 {
4125   return (vector unsigned short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4126 }
4127
4128 inline vector signed int
4129 vec_sl (vector signed int a1, vector unsigned int a2)
4130 {
4131   return (vector signed int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4132 }
4133
4134 inline vector unsigned int
4135 vec_sl (vector unsigned int a1, vector unsigned int a2)
4136 {
4137   return (vector unsigned int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4138 }
4139
4140 /* vec_vslw */
4141
4142 inline vector signed int
4143 vec_vslw (vector signed int a1, vector unsigned int a2)
4144 {
4145   return (vector signed int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4146 }
4147
4148 inline vector unsigned int
4149 vec_vslw (vector unsigned int a1, vector unsigned int a2)
4150 {
4151   return (vector unsigned int) __builtin_altivec_vslw ((vector signed int) a1, (vector signed int) a2);
4152 }
4153
4154 /* vec_vslh */
4155
4156 inline vector signed short
4157 vec_vslh (vector signed short a1, vector unsigned short a2)
4158 {
4159   return (vector signed short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4160 }
4161
4162 inline vector unsigned short
4163 vec_vslh (vector unsigned short a1, vector unsigned short a2)
4164 {
4165   return (vector unsigned short) __builtin_altivec_vslh ((vector signed short) a1, (vector signed short) a2);
4166 }
4167
4168 /* vec_vslb */
4169
4170 inline vector signed char
4171 vec_vslb (vector signed char a1, vector unsigned char a2)
4172 {
4173   return (vector signed char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4174 }
4175
4176 inline vector unsigned char
4177 vec_vslb (vector unsigned char a1, vector unsigned char a2)
4178 {
4179   return (vector unsigned char) __builtin_altivec_vslb ((vector signed char) a1, (vector signed char) a2);
4180 }
4181
4182 /* vec_sld */
4183
4184 inline vector float
4185 vec_sld (vector float a1, vector float a2, const int a3)
4186 {
4187   return (vector float) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4188 }
4189
4190 inline vector signed int
4191 vec_sld (vector signed int a1, vector signed int a2, const int a3)
4192 {
4193   return (vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4194 }
4195
4196 inline vector unsigned int
4197 vec_sld (vector unsigned int a1, vector unsigned int a2, const int a3)
4198 {
4199   return (vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4200 }
4201
4202 inline vector bool int
4203 vec_sld (vector bool int a1, vector bool int a2, const int a3)
4204 {
4205   return (vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4206 }
4207
4208 inline vector signed short
4209 vec_sld (vector signed short a1, vector signed short a2, const int a3)
4210 {
4211   return (vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4212 }
4213
4214 inline vector unsigned short
4215 vec_sld (vector unsigned short a1, vector unsigned short a2, const int a3)
4216 {
4217   return (vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4218 }
4219
4220 inline vector bool short
4221 vec_sld (vector bool short a1, vector bool short a2, const int a3)
4222 {
4223   return (vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4224 }
4225
4226 inline vector pixel
4227 vec_sld (vector pixel a1, vector pixel a2, const int a3)
4228 {
4229   return (vector pixel) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4230 }
4231
4232 inline vector signed char
4233 vec_sld (vector signed char a1, vector signed char a2, const int a3)
4234 {
4235   return (vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4236 }
4237
4238 inline vector unsigned char
4239 vec_sld (vector unsigned char a1, vector unsigned char a2, const int a3)
4240 {
4241   return (vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4242 }
4243
4244 inline vector bool char
4245 vec_sld (vector bool char a1, vector bool char a2, const int a3)
4246 {
4247   return (vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
4248 }
4249
4250 /* vec_sll */
4251
4252 inline vector signed int
4253 vec_sll (vector signed int a1, vector unsigned int a2)
4254 {
4255   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4256 }
4257
4258 inline vector signed int
4259 vec_sll (vector signed int a1, vector unsigned short a2)
4260 {
4261   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4262 }
4263
4264 inline vector signed int
4265 vec_sll (vector signed int a1, vector unsigned char a2)
4266 {
4267   return (vector signed int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4268 }
4269
4270 inline vector unsigned int
4271 vec_sll (vector unsigned int a1, vector unsigned int a2)
4272 {
4273   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4274 }
4275
4276 inline vector unsigned int
4277 vec_sll (vector unsigned int a1, vector unsigned short a2)
4278 {
4279   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4280 }
4281
4282 inline vector unsigned int
4283 vec_sll (vector unsigned int a1, vector unsigned char a2)
4284 {
4285   return (vector unsigned int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4286 }
4287
4288 inline vector bool int
4289 vec_sll (vector bool int a1, vector unsigned int a2)
4290 {
4291   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4292 }
4293
4294 inline vector bool int
4295 vec_sll (vector bool int a1, vector unsigned short a2)
4296 {
4297   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4298 }
4299
4300 inline vector bool int
4301 vec_sll (vector bool int a1, vector unsigned char a2)
4302 {
4303   return (vector bool int) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4304 }
4305
4306 inline vector signed short
4307 vec_sll (vector signed short a1, vector unsigned int a2)
4308 {
4309   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4310 }
4311
4312 inline vector signed short
4313 vec_sll (vector signed short a1, vector unsigned short a2)
4314 {
4315   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4316 }
4317
4318 inline vector signed short
4319 vec_sll (vector signed short a1, vector unsigned char a2)
4320 {
4321   return (vector signed short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4322 }
4323
4324 inline vector unsigned short
4325 vec_sll (vector unsigned short a1, vector unsigned int a2)
4326 {
4327   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4328 }
4329
4330 inline vector unsigned short
4331 vec_sll (vector unsigned short a1, vector unsigned short a2)
4332 {
4333   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4334 }
4335
4336 inline vector unsigned short
4337 vec_sll (vector unsigned short a1, vector unsigned char a2)
4338 {
4339   return (vector unsigned short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4340 }
4341
4342 inline vector bool short
4343 vec_sll (vector bool short a1, vector unsigned int a2)
4344 {
4345   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4346 }
4347
4348 inline vector bool short
4349 vec_sll (vector bool short a1, vector unsigned short a2)
4350 {
4351   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4352 }
4353
4354 inline vector bool short
4355 vec_sll (vector bool short a1, vector unsigned char a2)
4356 {
4357   return (vector bool short) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4358 }
4359
4360 inline vector pixel
4361 vec_sll (vector pixel a1, vector unsigned int a2)
4362 {
4363   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4364 }
4365
4366 inline vector pixel
4367 vec_sll (vector pixel a1, vector unsigned short a2)
4368 {
4369   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4370 }
4371
4372 inline vector pixel
4373 vec_sll (vector pixel a1, vector unsigned char a2)
4374 {
4375   return (vector pixel) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4376 }
4377
4378 inline vector signed char
4379 vec_sll (vector signed char a1, vector unsigned int a2)
4380 {
4381   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4382 }
4383
4384 inline vector signed char
4385 vec_sll (vector signed char a1, vector unsigned short a2)
4386 {
4387   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4388 }
4389
4390 inline vector signed char
4391 vec_sll (vector signed char a1, vector unsigned char a2)
4392 {
4393   return (vector signed char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4394 }
4395
4396 inline vector unsigned char
4397 vec_sll (vector unsigned char a1, vector unsigned int a2)
4398 {
4399   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4400 }
4401
4402 inline vector unsigned char
4403 vec_sll (vector unsigned char a1, vector unsigned short a2)
4404 {
4405   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4406 }
4407
4408 inline vector unsigned char
4409 vec_sll (vector unsigned char a1, vector unsigned char a2)
4410 {
4411   return (vector unsigned char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4412 }
4413
4414 inline vector bool char
4415 vec_sll (vector bool char a1, vector unsigned int a2)
4416 {
4417   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4418 }
4419
4420 inline vector bool char
4421 vec_sll (vector bool char a1, vector unsigned short a2)
4422 {
4423   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4424 }
4425
4426 inline vector bool char
4427 vec_sll (vector bool char a1, vector unsigned char a2)
4428 {
4429   return (vector bool char) __builtin_altivec_vsl ((vector signed int) a1, (vector signed int) a2);
4430 }
4431
4432 /* vec_slo */
4433
4434 inline vector float
4435 vec_slo (vector float a1, vector signed char a2)
4436 {
4437   return (vector float) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4438 }
4439
4440 inline vector float
4441 vec_slo (vector float a1, vector unsigned char a2)
4442 {
4443   return (vector float) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4444 }
4445
4446 inline vector signed int
4447 vec_slo (vector signed int a1, vector signed char a2)
4448 {
4449   return (vector signed int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4450 }
4451
4452 inline vector signed int
4453 vec_slo (vector signed int a1, vector unsigned char a2)
4454 {
4455   return (vector signed int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4456 }
4457
4458 inline vector unsigned int
4459 vec_slo (vector unsigned int a1, vector signed char a2)
4460 {
4461   return (vector unsigned int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4462 }
4463
4464 inline vector unsigned int
4465 vec_slo (vector unsigned int a1, vector unsigned char a2)
4466 {
4467   return (vector unsigned int) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4468 }
4469
4470 inline vector signed short
4471 vec_slo (vector signed short a1, vector signed char a2)
4472 {
4473   return (vector signed short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4474 }
4475
4476 inline vector signed short
4477 vec_slo (vector signed short a1, vector unsigned char a2)
4478 {
4479   return (vector signed short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4480 }
4481
4482 inline vector unsigned short
4483 vec_slo (vector unsigned short a1, vector signed char a2)
4484 {
4485   return (vector unsigned short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4486 }
4487
4488 inline vector unsigned short
4489 vec_slo (vector unsigned short a1, vector unsigned char a2)
4490 {
4491   return (vector unsigned short) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4492 }
4493
4494 inline vector pixel
4495 vec_slo (vector pixel a1, vector signed char a2)
4496 {
4497   return (vector pixel) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4498 }
4499
4500 inline vector pixel
4501 vec_slo (vector pixel a1, vector unsigned char a2)
4502 {
4503   return (vector pixel) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4504 }
4505
4506 inline vector signed char
4507 vec_slo (vector signed char a1, vector signed char a2)
4508 {
4509   return (vector signed char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4510 }
4511
4512 inline vector signed char
4513 vec_slo (vector signed char a1, vector unsigned char a2)
4514 {
4515   return (vector signed char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4516 }
4517
4518 inline vector unsigned char
4519 vec_slo (vector unsigned char a1, vector signed char a2)
4520 {
4521   return (vector unsigned char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4522 }
4523
4524 inline vector unsigned char
4525 vec_slo (vector unsigned char a1, vector unsigned char a2)
4526 {
4527   return (vector unsigned char) __builtin_altivec_vslo ((vector signed int) a1, (vector signed int) a2);
4528 }
4529
4530 /* vec_splat */
4531
4532 inline vector signed char
4533 vec_splat (vector signed char a1, const int a2)
4534 {
4535   return (vector signed char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4536 }
4537
4538 inline vector unsigned char
4539 vec_splat (vector unsigned char a1, const int a2)
4540 {
4541   return (vector unsigned char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4542 }
4543
4544 inline vector bool char
4545 vec_splat (vector bool char a1, const int a2)
4546 {
4547   return (vector bool char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4548 }
4549
4550 inline vector signed short
4551 vec_splat (vector signed short a1, const int a2)
4552 {
4553   return (vector signed short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4554 }
4555
4556 inline vector unsigned short
4557 vec_splat (vector unsigned short a1, const int a2)
4558 {
4559   return (vector unsigned short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4560 }
4561
4562 inline vector bool short
4563 vec_splat (vector bool short a1, const int a2)
4564 {
4565   return (vector bool short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4566 }
4567
4568 inline vector pixel
4569 vec_splat (vector pixel a1, const int a2)
4570 {
4571   return (vector pixel) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4572 }
4573
4574 inline vector float
4575 vec_splat (vector float a1, const int a2)
4576 {
4577   return (vector float) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4578 }
4579
4580 inline vector signed int
4581 vec_splat (vector signed int a1, const int a2)
4582 {
4583   return (vector signed int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4584 }
4585
4586 inline vector unsigned int
4587 vec_splat (vector unsigned int a1, const int a2)
4588 {
4589   return (vector unsigned int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4590 }
4591
4592 inline vector bool int
4593 vec_splat (vector bool int a1, const int a2)
4594 {
4595   return (vector bool int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4596 }
4597
4598 /* vec_vspltw */
4599
4600 inline vector float
4601 vec_vspltw (vector float a1, const int a2)
4602 {
4603   return (vector float) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4604 }
4605
4606 inline vector signed int
4607 vec_vspltw (vector signed int a1, const int a2)
4608 {
4609   return (vector signed int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4610 }
4611
4612 inline vector unsigned int
4613 vec_vspltw (vector unsigned int a1, const int a2)
4614 {
4615   return (vector unsigned int) __builtin_altivec_vspltw ((vector signed int) a1,  a2);
4616 }
4617
4618 /* vec_vsplth */
4619
4620 inline vector signed short
4621 vec_vsplth (vector signed short a1, const int a2)
4622 {
4623   return (vector signed short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4624 }
4625
4626 inline vector unsigned short
4627 vec_vsplth (vector unsigned short a1, const int a2)
4628 {
4629   return (vector unsigned short) __builtin_altivec_vsplth ((vector signed short) a1,  a2);
4630 }
4631
4632 /* vec_vspltb */
4633
4634 inline vector signed char
4635 vec_vspltb (vector signed char a1, const int a2)
4636 {
4637   return (vector signed char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4638 }
4639
4640 inline vector unsigned char
4641 vec_vspltb (vector unsigned char a1, const int a2)
4642 {
4643   return (vector unsigned char) __builtin_altivec_vspltb ((vector signed char) a1,  a2);
4644 }
4645
4646 /* vec_splat_s8 */
4647
4648 inline vector signed char
4649 vec_splat_s8 (const int a1)
4650 {
4651   return (vector signed char) __builtin_altivec_vspltisb (a1);
4652 }
4653
4654 /* vec_splat_s16 */
4655
4656 inline vector signed short
4657 vec_splat_s16 (const int a1)
4658 {
4659   return (vector signed short) __builtin_altivec_vspltish (a1);
4660 }
4661
4662 /* vec_splat_s32 */
4663
4664 inline vector signed int
4665 vec_splat_s32 (const int a1)
4666 {
4667   return (vector signed int) __builtin_altivec_vspltisw (a1);
4668 }
4669
4670 /* vec_splat_u8 */
4671
4672 inline vector unsigned char
4673 vec_splat_u8 (const int a1)
4674 {
4675   return (vector unsigned char) __builtin_altivec_vspltisb (a1);
4676 }
4677
4678 /* vec_splat_u16 */
4679
4680 inline vector unsigned short
4681 vec_splat_u16 (const int a1)
4682 {
4683   return (vector unsigned short) __builtin_altivec_vspltish (a1);
4684 }
4685
4686 /* vec_splat_u32 */
4687
4688 inline vector unsigned int
4689 vec_splat_u32 (const int a1)
4690 {
4691   return (vector unsigned int) __builtin_altivec_vspltisw (a1);
4692 }
4693
4694 /* vec_sr */
4695
4696 inline vector signed char
4697 vec_sr (vector signed char a1, vector unsigned char a2)
4698 {
4699   return (vector signed char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4700 }
4701
4702 inline vector unsigned char
4703 vec_sr (vector unsigned char a1, vector unsigned char a2)
4704 {
4705   return (vector unsigned char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4706 }
4707
4708 inline vector signed short
4709 vec_sr (vector signed short a1, vector unsigned short a2)
4710 {
4711   return (vector signed short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4712 }
4713
4714 inline vector unsigned short
4715 vec_sr (vector unsigned short a1, vector unsigned short a2)
4716 {
4717   return (vector unsigned short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4718 }
4719
4720 inline vector signed int
4721 vec_sr (vector signed int a1, vector unsigned int a2)
4722 {
4723   return (vector signed int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4724 }
4725
4726 inline vector unsigned int
4727 vec_sr (vector unsigned int a1, vector unsigned int a2)
4728 {
4729   return (vector unsigned int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4730 }
4731
4732 /* vec_vsrw */
4733
4734 inline vector signed int
4735 vec_vsrw (vector signed int a1, vector unsigned int a2)
4736 {
4737   return (vector signed int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4738 }
4739
4740 inline vector unsigned int
4741 vec_vsrw (vector unsigned int a1, vector unsigned int a2)
4742 {
4743   return (vector unsigned int) __builtin_altivec_vsrw ((vector signed int) a1, (vector signed int) a2);
4744 }
4745
4746 /* vec_vsrh */
4747
4748 inline vector signed short
4749 vec_vsrh (vector signed short a1, vector unsigned short a2)
4750 {
4751   return (vector signed short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4752 }
4753
4754 inline vector unsigned short
4755 vec_vsrh (vector unsigned short a1, vector unsigned short a2)
4756 {
4757   return (vector unsigned short) __builtin_altivec_vsrh ((vector signed short) a1, (vector signed short) a2);
4758 }
4759
4760 /* vec_vsrb */
4761
4762 inline vector signed char
4763 vec_vsrb (vector signed char a1, vector unsigned char a2)
4764 {
4765   return (vector signed char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4766 }
4767
4768 inline vector unsigned char
4769 vec_vsrb (vector unsigned char a1, vector unsigned char a2)
4770 {
4771   return (vector unsigned char) __builtin_altivec_vsrb ((vector signed char) a1, (vector signed char) a2);
4772 }
4773
4774 /* vec_sra */
4775
4776 inline vector signed char
4777 vec_sra (vector signed char a1, vector unsigned char a2)
4778 {
4779   return (vector signed char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
4780 }
4781
4782 inline vector unsigned char
4783 vec_sra (vector unsigned char a1, vector unsigned char a2)
4784 {
4785   return (vector unsigned char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
4786 }
4787
4788 inline vector signed short
4789 vec_sra (vector signed short a1, vector unsigned short a2)
4790 {
4791   return (vector signed short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
4792 }
4793
4794 inline vector unsigned short
4795 vec_sra (vector unsigned short a1, vector unsigned short a2)
4796 {
4797   return (vector unsigned short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
4798 }
4799
4800 inline vector signed int
4801 vec_sra (vector signed int a1, vector unsigned int a2)
4802 {
4803   return (vector signed int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
4804 }
4805
4806 inline vector unsigned int
4807 vec_sra (vector unsigned int a1, vector unsigned int a2)
4808 {
4809   return (vector unsigned int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
4810 }
4811
4812 /* vec_vsraw */
4813
4814 inline vector signed int
4815 vec_vsraw (vector signed int a1, vector unsigned int a2)
4816 {
4817   return (vector signed int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
4818 }
4819
4820 inline vector unsigned int
4821 vec_vsraw (vector unsigned int a1, vector unsigned int a2)
4822 {
4823   return (vector unsigned int) __builtin_altivec_vsraw ((vector signed int) a1, (vector signed int) a2);
4824 }
4825
4826 /* vec_vsrah */
4827
4828 inline vector signed short
4829 vec_vsrah (vector signed short a1, vector unsigned short a2)
4830 {
4831   return (vector signed short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
4832 }
4833
4834 inline vector unsigned short
4835 vec_vsrah (vector unsigned short a1, vector unsigned short a2)
4836 {
4837   return (vector unsigned short) __builtin_altivec_vsrah ((vector signed short) a1, (vector signed short) a2);
4838 }
4839
4840 /* vec_vsrab */
4841
4842 inline vector signed char
4843 vec_vsrab (vector signed char a1, vector unsigned char a2)
4844 {
4845   return (vector signed char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
4846 }
4847
4848 inline vector unsigned char
4849 vec_vsrab (vector unsigned char a1, vector unsigned char a2)
4850 {
4851   return (vector unsigned char) __builtin_altivec_vsrab ((vector signed char) a1, (vector signed char) a2);
4852 }
4853
4854 /* vec_srl */
4855
4856 inline vector signed int
4857 vec_srl (vector signed int a1, vector unsigned int a2)
4858 {
4859   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4860 }
4861
4862 inline vector signed int
4863 vec_srl (vector signed int a1, vector unsigned short a2)
4864 {
4865   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4866 }
4867
4868 inline vector signed int
4869 vec_srl (vector signed int a1, vector unsigned char a2)
4870 {
4871   return (vector signed int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4872 }
4873
4874 inline vector unsigned int
4875 vec_srl (vector unsigned int a1, vector unsigned int a2)
4876 {
4877   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4878 }
4879
4880 inline vector unsigned int
4881 vec_srl (vector unsigned int a1, vector unsigned short a2)
4882 {
4883   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4884 }
4885
4886 inline vector unsigned int
4887 vec_srl (vector unsigned int a1, vector unsigned char a2)
4888 {
4889   return (vector unsigned int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4890 }
4891
4892 inline vector bool int
4893 vec_srl (vector bool int a1, vector unsigned int a2)
4894 {
4895   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4896 }
4897
4898 inline vector bool int
4899 vec_srl (vector bool int a1, vector unsigned short a2)
4900 {
4901   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4902 }
4903
4904 inline vector bool int
4905 vec_srl (vector bool int a1, vector unsigned char a2)
4906 {
4907   return (vector bool int) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4908 }
4909
4910 inline vector signed short
4911 vec_srl (vector signed short a1, vector unsigned int a2)
4912 {
4913   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4914 }
4915
4916 inline vector signed short
4917 vec_srl (vector signed short a1, vector unsigned short a2)
4918 {
4919   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4920 }
4921
4922 inline vector signed short
4923 vec_srl (vector signed short a1, vector unsigned char a2)
4924 {
4925   return (vector signed short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4926 }
4927
4928 inline vector unsigned short
4929 vec_srl (vector unsigned short a1, vector unsigned int a2)
4930 {
4931   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4932 }
4933
4934 inline vector unsigned short
4935 vec_srl (vector unsigned short a1, vector unsigned short a2)
4936 {
4937   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4938 }
4939
4940 inline vector unsigned short
4941 vec_srl (vector unsigned short a1, vector unsigned char a2)
4942 {
4943   return (vector unsigned short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4944 }
4945
4946 inline vector bool short
4947 vec_srl (vector bool short a1, vector unsigned int a2)
4948 {
4949   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4950 }
4951
4952 inline vector bool short
4953 vec_srl (vector bool short a1, vector unsigned short a2)
4954 {
4955   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4956 }
4957
4958 inline vector bool short
4959 vec_srl (vector bool short a1, vector unsigned char a2)
4960 {
4961   return (vector bool short) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4962 }
4963
4964 inline vector pixel
4965 vec_srl (vector pixel a1, vector unsigned int a2)
4966 {
4967   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4968 }
4969
4970 inline vector pixel
4971 vec_srl (vector pixel a1, vector unsigned short a2)
4972 {
4973   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4974 }
4975
4976 inline vector pixel
4977 vec_srl (vector pixel a1, vector unsigned char a2)
4978 {
4979   return (vector pixel) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4980 }
4981
4982 inline vector signed char
4983 vec_srl (vector signed char a1, vector unsigned int a2)
4984 {
4985   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4986 }
4987
4988 inline vector signed char
4989 vec_srl (vector signed char a1, vector unsigned short a2)
4990 {
4991   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4992 }
4993
4994 inline vector signed char
4995 vec_srl (vector signed char a1, vector unsigned char a2)
4996 {
4997   return (vector signed char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
4998 }
4999
5000 inline vector unsigned char
5001 vec_srl (vector unsigned char a1, vector unsigned int a2)
5002 {
5003   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5004 }
5005
5006 inline vector unsigned char
5007 vec_srl (vector unsigned char a1, vector unsigned short a2)
5008 {
5009   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5010 }
5011
5012 inline vector unsigned char
5013 vec_srl (vector unsigned char a1, vector unsigned char a2)
5014 {
5015   return (vector unsigned char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5016 }
5017
5018 inline vector bool char
5019 vec_srl (vector bool char a1, vector unsigned int a2)
5020 {
5021   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5022 }
5023
5024 inline vector bool char
5025 vec_srl (vector bool char a1, vector unsigned short a2)
5026 {
5027   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5028 }
5029
5030 inline vector bool char
5031 vec_srl (vector bool char a1, vector unsigned char a2)
5032 {
5033   return (vector bool char) __builtin_altivec_vsr ((vector signed int) a1, (vector signed int) a2);
5034 }
5035
5036 /* vec_sro */
5037
5038 inline vector float
5039 vec_sro (vector float a1, vector signed char a2)
5040 {
5041   return (vector float) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5042 }
5043
5044 inline vector float
5045 vec_sro (vector float a1, vector unsigned char a2)
5046 {
5047   return (vector float) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5048 }
5049
5050 inline vector signed int
5051 vec_sro (vector signed int a1, vector signed char a2)
5052 {
5053   return (vector signed int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5054 }
5055
5056 inline vector signed int
5057 vec_sro (vector signed int a1, vector unsigned char a2)
5058 {
5059   return (vector signed int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5060 }
5061
5062 inline vector unsigned int
5063 vec_sro (vector unsigned int a1, vector signed char a2)
5064 {
5065   return (vector unsigned int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5066 }
5067
5068 inline vector unsigned int
5069 vec_sro (vector unsigned int a1, vector unsigned char a2)
5070 {
5071   return (vector unsigned int) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5072 }
5073
5074 inline vector signed short
5075 vec_sro (vector signed short a1, vector signed char a2)
5076 {
5077   return (vector signed short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5078 }
5079
5080 inline vector signed short
5081 vec_sro (vector signed short a1, vector unsigned char a2)
5082 {
5083   return (vector signed short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5084 }
5085
5086 inline vector unsigned short
5087 vec_sro (vector unsigned short a1, vector signed char a2)
5088 {
5089   return (vector unsigned short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5090 }
5091
5092 inline vector unsigned short
5093 vec_sro (vector unsigned short a1, vector unsigned char a2)
5094 {
5095   return (vector unsigned short) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5096 }
5097
5098 inline vector pixel
5099 vec_sro (vector pixel a1, vector signed char a2)
5100 {
5101   return (vector pixel) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5102 }
5103
5104 inline vector pixel
5105 vec_sro (vector pixel a1, vector unsigned char a2)
5106 {
5107   return (vector pixel) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5108 }
5109
5110 inline vector signed char
5111 vec_sro (vector signed char a1, vector signed char a2)
5112 {
5113   return (vector signed char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5114 }
5115
5116 inline vector signed char
5117 vec_sro (vector signed char a1, vector unsigned char a2)
5118 {
5119   return (vector signed char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5120 }
5121
5122 inline vector unsigned char
5123 vec_sro (vector unsigned char a1, vector signed char a2)
5124 {
5125   return (vector unsigned char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5126 }
5127
5128 inline vector unsigned char
5129 vec_sro (vector unsigned char a1, vector unsigned char a2)
5130 {
5131   return (vector unsigned char) __builtin_altivec_vsro ((vector signed int) a1, (vector signed int) a2);
5132 }
5133
5134 /* vec_st */
5135
5136 inline void
5137 vec_st (vector float a1, int a2, vector float *a3)
5138 {
5139   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5140 }
5141
5142 inline void
5143 vec_st (vector float a1, int a2, float *a3)
5144 {
5145   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5146 }
5147
5148 inline void
5149 vec_st (vector signed int a1, int a2, vector signed int *a3)
5150 {
5151   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5152 }
5153
5154 inline void
5155 vec_st (vector signed int a1, int a2, int *a3)
5156 {
5157   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5158 }
5159
5160 inline void
5161 vec_st (vector unsigned int a1, int a2, vector unsigned int *a3)
5162 {
5163   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5164 }
5165
5166 inline void
5167 vec_st (vector unsigned int a1, int a2, unsigned int *a3)
5168 {
5169   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5170 }
5171
5172 inline void
5173 vec_st (vector bool int a1, int a2, vector bool int *a3)
5174 {
5175   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5176 }
5177
5178 inline void
5179 vec_st (vector bool int a1, int a2, unsigned int *a3)
5180 {
5181   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5182 }
5183
5184 inline void
5185 vec_st (vector bool int a1, int a2, int *a3)
5186 {
5187   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5188 }
5189
5190 inline void
5191 vec_st (vector signed short a1, int a2, vector signed short *a3)
5192 {
5193   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5194 }
5195
5196 inline void
5197 vec_st (vector signed short a1, int a2, short *a3)
5198 {
5199   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5200 }
5201
5202 inline void
5203 vec_st (vector unsigned short a1, int a2, vector unsigned short *a3)
5204 {
5205   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5206 }
5207
5208 inline void
5209 vec_st (vector unsigned short a1, int a2, unsigned short *a3)
5210 {
5211   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5212 }
5213
5214 inline void
5215 vec_st (vector bool short a1, int a2, vector bool short *a3)
5216 {
5217   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5218 }
5219
5220 inline void
5221 vec_st (vector bool short a1, int a2, unsigned short *a3)
5222 {
5223   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5224 }
5225
5226 inline void
5227 vec_st (vector bool short a1, int a2, short *a3)
5228 {
5229   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5230 }
5231
5232 inline void
5233 vec_st (vector signed char a1, int a2, vector signed char *a3)
5234 {
5235   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5236 }
5237
5238 inline void
5239 vec_st (vector signed char a1, int a2, signed char *a3)
5240 {
5241   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5242 }
5243
5244 inline void
5245 vec_st (vector unsigned char a1, int a2, vector unsigned char *a3)
5246 {
5247   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5248 }
5249
5250 inline void
5251 vec_st (vector unsigned char a1, int a2, unsigned char *a3)
5252 {
5253   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5254 }
5255
5256 inline void
5257 vec_st (vector bool char a1, int a2, vector bool char *a3)
5258 {
5259   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5260 }
5261
5262 inline void
5263 vec_st (vector bool char a1, int a2, unsigned char *a3)
5264 {
5265   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5266 }
5267
5268 inline void
5269 vec_st (vector bool char a1, int a2, signed char *a3)
5270 {
5271   __builtin_altivec_stvx ((vector signed int) a1, a2, (void *) a3);
5272 }
5273
5274 /* vec_ste */
5275
5276 inline void
5277 vec_ste (vector signed char a1, int a2, signed char *a3)
5278 {
5279   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5280 }
5281
5282 inline void
5283 vec_ste (vector unsigned char a1, int a2, unsigned char *a3)
5284 {
5285   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5286 }
5287
5288 inline void
5289 vec_ste (vector bool char a1, int a2, signed char *a3)
5290 {
5291   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5292 }
5293
5294 inline void
5295 vec_ste (vector bool char a1, int a2, unsigned char *a3)
5296 {
5297   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5298 }
5299
5300 inline void
5301 vec_ste (vector signed short a1, int a2, short *a3)
5302 {
5303   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5304 }
5305
5306 inline void
5307 vec_ste (vector unsigned short a1, int a2, unsigned short *a3)
5308 {
5309   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5310 }
5311
5312 inline void
5313 vec_ste (vector bool short a1, int a2, short *a3)
5314 {
5315   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5316 }
5317
5318 inline void
5319 vec_ste (vector bool short a1, int a2, unsigned short *a3)
5320 {
5321   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5322 }
5323
5324 inline void
5325 vec_ste (vector pixel a1, int a2, short *a3)
5326 {
5327   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5328 }
5329
5330 inline void
5331 vec_ste (vector pixel a1, int a2, unsigned short *a3)
5332 {
5333   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5334 }
5335
5336 inline void
5337 vec_ste (vector float a1, int a2, float *a3)
5338 {
5339   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5340 }
5341
5342 inline void
5343 vec_ste (vector signed int a1, int a2, int *a3)
5344 {
5345   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5346 }
5347
5348 inline void
5349 vec_ste (vector unsigned int a1, int a2, unsigned int *a3)
5350 {
5351   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5352 }
5353
5354 inline void
5355 vec_ste (vector bool int a1, int a2, int *a3)
5356 {
5357   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5358 }
5359
5360 inline void
5361 vec_ste (vector bool int a1, int a2, unsigned int *a3)
5362 {
5363   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5364 }
5365
5366 /* vec_stvewx */
5367
5368 inline void
5369 vec_stvewx (vector float a1, int a2, void *a3)
5370 {
5371   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5372 }
5373
5374 inline void
5375 vec_stvewx (vector signed int a1, int a2, void *a3)
5376 {
5377   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5378 }
5379
5380 inline void
5381 vec_stvewx (vector unsigned int a1, int a2, void *a3)
5382 {
5383   __builtin_altivec_stvewx ((vector signed int) a1, a2, (void *) a3);
5384 }
5385
5386 /* vec_stvehx */
5387
5388 inline void
5389 vec_stvehx (vector signed short a1, int a2, void *a3)
5390 {
5391   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5392 }
5393
5394 inline void
5395 vec_stvehx (vector unsigned short a1, int a2, void *a3)
5396 {
5397   __builtin_altivec_stvehx ((vector signed short) a1, a2, (void *) a3);
5398 }
5399
5400 /* vec_stvebx */
5401
5402 inline void
5403 vec_stvebx (vector signed char a1, int a2, void *a3)
5404 {
5405   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5406 }
5407
5408 inline void
5409 vec_stvebx (vector unsigned char a1, int a2, void *a3)
5410 {
5411   __builtin_altivec_stvebx ((vector signed char) a1, a2, (void *) a3);
5412 }
5413
5414 /* vec_stl */
5415
5416 inline void
5417 vec_stl (vector float a1, int a2, vector float *a3)
5418 {
5419   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5420 }
5421
5422 inline void
5423 vec_stl (vector float a1, int a2, float *a3)
5424 {
5425   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5426 }
5427
5428 inline void
5429 vec_stl (vector signed int a1, int a2, vector signed int *a3)
5430 {
5431   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5432 }
5433
5434 inline void
5435 vec_stl (vector signed int a1, int a2, int *a3)
5436 {
5437   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5438 }
5439
5440 inline void
5441 vec_stl (vector unsigned int a1, int a2, vector unsigned int *a3)
5442 {
5443   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5444 }
5445
5446 inline void
5447 vec_stl (vector unsigned int a1, int a2, unsigned int *a3)
5448 {
5449   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5450 }
5451
5452 inline void
5453 vec_stl (vector bool int a1, int a2, vector bool int *a3)
5454 {
5455   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5456 }
5457
5458 inline void
5459 vec_stl (vector bool int a1, int a2, unsigned int *a3)
5460 {
5461   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5462 }
5463
5464 inline void
5465 vec_stl (vector bool int a1, int a2, int *a3)
5466 {
5467   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5468 }
5469
5470 inline void
5471 vec_stl (vector signed short a1, int a2, vector signed short *a3)
5472 {
5473   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5474 }
5475
5476 inline void
5477 vec_stl (vector signed short a1, int a2, short *a3)
5478 {
5479   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5480 }
5481
5482 inline void
5483 vec_stl (vector unsigned short a1, int a2, vector unsigned short *a3)
5484 {
5485   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5486 }
5487
5488 inline void
5489 vec_stl (vector unsigned short a1, int a2, unsigned short *a3)
5490 {
5491   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5492 }
5493
5494 inline void
5495 vec_stl (vector bool short a1, int a2, vector bool short *a3)
5496 {
5497   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5498 }
5499
5500 inline void
5501 vec_stl (vector bool short a1, int a2, unsigned short *a3)
5502 {
5503   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5504 }
5505
5506 inline void
5507 vec_stl (vector bool short a1, int a2, short *a3)
5508 {
5509   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5510 }
5511
5512 inline void
5513 vec_stl (vector signed char a1, int a2, vector signed char *a3)
5514 {
5515   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5516 }
5517
5518 inline void
5519 vec_stl (vector signed char a1, int a2, signed char *a3)
5520 {
5521   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5522 }
5523
5524 inline void
5525 vec_stl (vector unsigned char a1, int a2, vector unsigned char *a3)
5526 {
5527   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5528 }
5529
5530 inline void
5531 vec_stl (vector unsigned char a1, int a2, unsigned char *a3)
5532 {
5533   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5534 }
5535
5536 inline void
5537 vec_stl (vector bool char a1, int a2, vector bool char *a3)
5538 {
5539   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5540 }
5541
5542 inline void
5543 vec_stl (vector bool char a1, int a2, unsigned char *a3)
5544 {
5545   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5546 }
5547
5548 inline void
5549 vec_stl (vector bool char a1, int a2, signed char *a3)
5550 {
5551   __builtin_altivec_stvxl ((vector signed int) a1, a2, (void *) a3);
5552 }
5553
5554 /* vec_sub */
5555
5556 inline vector signed char
5557 vec_sub (vector bool char a1, vector signed char a2)
5558 {
5559   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5560 }
5561
5562 inline vector signed char
5563 vec_sub (vector signed char a1, vector bool char a2)
5564 {
5565   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5566 }
5567
5568 inline vector signed char
5569 vec_sub (vector signed char a1, vector signed char a2)
5570 {
5571   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5572 }
5573
5574 inline vector unsigned char
5575 vec_sub (vector bool char a1, vector unsigned char a2)
5576 {
5577   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5578 }
5579
5580 inline vector unsigned char
5581 vec_sub (vector unsigned char a1, vector bool char a2)
5582 {
5583   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5584 }
5585
5586 inline vector unsigned char
5587 vec_sub (vector unsigned char a1, vector unsigned char a2)
5588 {
5589   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5590 }
5591
5592 inline vector signed short
5593 vec_sub (vector bool short a1, vector signed short a2)
5594 {
5595   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5596 }
5597
5598 inline vector signed short
5599 vec_sub (vector signed short a1, vector bool short a2)
5600 {
5601   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5602 }
5603
5604 inline vector signed short
5605 vec_sub (vector signed short a1, vector signed short a2)
5606 {
5607   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5608 }
5609
5610 inline vector unsigned short
5611 vec_sub (vector bool short a1, vector unsigned short a2)
5612 {
5613   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5614 }
5615
5616 inline vector unsigned short
5617 vec_sub (vector unsigned short a1, vector bool short a2)
5618 {
5619   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5620 }
5621
5622 inline vector unsigned short
5623 vec_sub (vector unsigned short a1, vector unsigned short a2)
5624 {
5625   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5626 }
5627
5628 inline vector signed int
5629 vec_sub (vector bool int a1, vector signed int a2)
5630 {
5631   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5632 }
5633
5634 inline vector signed int
5635 vec_sub (vector signed int a1, vector bool int a2)
5636 {
5637   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5638 }
5639
5640 inline vector signed int
5641 vec_sub (vector signed int a1, vector signed int a2)
5642 {
5643   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5644 }
5645
5646 inline vector unsigned int
5647 vec_sub (vector bool int a1, vector unsigned int a2)
5648 {
5649   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5650 }
5651
5652 inline vector unsigned int
5653 vec_sub (vector unsigned int a1, vector bool int a2)
5654 {
5655   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5656 }
5657
5658 inline vector unsigned int
5659 vec_sub (vector unsigned int a1, vector unsigned int a2)
5660 {
5661   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5662 }
5663
5664 inline vector float
5665 vec_sub (vector float a1, vector float a2)
5666 {
5667   return (vector float) __builtin_altivec_vsubfp ((vector float) a1, (vector float) a2);
5668 }
5669
5670 /* vec_vsubfp */
5671
5672 inline vector float
5673 vec_vsubfp (vector float a1, vector float a2)
5674 {
5675   return (vector float) __builtin_altivec_vsubfp ((vector float) a1, (vector float) a2);
5676 }
5677
5678 /* vec_vsubuwm */
5679
5680 inline vector signed int
5681 vec_vsubuwm (vector signed int a1, vector signed int a2)
5682 {
5683   return (vector signed int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5684 }
5685
5686 inline vector unsigned int
5687 vec_vsubuwm (vector signed int a1, vector unsigned int a2)
5688 {
5689   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5690 }
5691
5692 inline vector unsigned int
5693 vec_vsubuwm (vector unsigned int a1, vector signed int a2)
5694 {
5695   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5696 }
5697
5698 inline vector unsigned int
5699 vec_vsubuwm (vector unsigned int a1, vector unsigned int a2)
5700 {
5701   return (vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) a1, (vector signed int) a2);
5702 }
5703
5704 /* vec_vsubuhm */
5705
5706 inline vector signed short
5707 vec_vsubuhm (vector signed short a1, vector signed short a2)
5708 {
5709   return (vector signed short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5710 }
5711
5712 inline vector unsigned short
5713 vec_vsubuhm (vector signed short a1, vector unsigned short a2)
5714 {
5715   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5716 }
5717
5718 inline vector unsigned short
5719 vec_vsubuhm (vector unsigned short a1, vector signed short a2)
5720 {
5721   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5722 }
5723
5724 inline vector unsigned short
5725 vec_vsubuhm (vector unsigned short a1, vector unsigned short a2)
5726 {
5727   return (vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) a1, (vector signed short) a2);
5728 }
5729
5730 /* vec_vsububm */
5731
5732 inline vector signed char
5733 vec_vsububm (vector signed char a1, vector signed char a2)
5734 {
5735   return (vector signed char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5736 }
5737
5738 inline vector unsigned char
5739 vec_vsububm (vector signed char a1, vector unsigned char a2)
5740 {
5741   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5742 }
5743
5744 inline vector unsigned char
5745 vec_vsububm (vector unsigned char a1, vector signed char a2)
5746 {
5747   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5748 }
5749
5750 inline vector unsigned char
5751 vec_vsububm (vector unsigned char a1, vector unsigned char a2)
5752 {
5753   return (vector unsigned char) __builtin_altivec_vsububm ((vector signed char) a1, (vector signed char) a2);
5754 }
5755
5756 /* vec_subc */
5757
5758 inline vector unsigned int
5759 vec_subc (vector unsigned int a1, vector unsigned int a2)
5760 {
5761   return (vector unsigned int) __builtin_altivec_vsubcuw ((vector signed int) a1, (vector signed int) a2);
5762 }
5763
5764 /* vec_subs */
5765
5766 inline vector unsigned char
5767 vec_subs (vector bool char a1, vector unsigned char a2)
5768 {
5769   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5770 }
5771
5772 inline vector unsigned char
5773 vec_subs (vector unsigned char a1, vector bool char a2)
5774 {
5775   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5776 }
5777
5778 inline vector unsigned char
5779 vec_subs (vector unsigned char a1, vector unsigned char a2)
5780 {
5781   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5782 }
5783
5784 inline vector signed char
5785 vec_subs (vector bool char a1, vector signed char a2)
5786 {
5787   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
5788 }
5789
5790 inline vector signed char
5791 vec_subs (vector signed char a1, vector bool char a2)
5792 {
5793   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
5794 }
5795
5796 inline vector signed char
5797 vec_subs (vector signed char a1, vector signed char a2)
5798 {
5799   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
5800 }
5801
5802 inline vector unsigned short
5803 vec_subs (vector bool short a1, vector unsigned short a2)
5804 {
5805   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5806 }
5807
5808 inline vector unsigned short
5809 vec_subs (vector unsigned short a1, vector bool short a2)
5810 {
5811   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5812 }
5813
5814 inline vector unsigned short
5815 vec_subs (vector unsigned short a1, vector unsigned short a2)
5816 {
5817   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5818 }
5819
5820 inline vector signed short
5821 vec_subs (vector bool short a1, vector signed short a2)
5822 {
5823   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
5824 }
5825
5826 inline vector signed short
5827 vec_subs (vector signed short a1, vector bool short a2)
5828 {
5829   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
5830 }
5831
5832 inline vector signed short
5833 vec_subs (vector signed short a1, vector signed short a2)
5834 {
5835   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
5836 }
5837
5838 inline vector unsigned int
5839 vec_subs (vector bool int a1, vector unsigned int a2)
5840 {
5841   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5842 }
5843
5844 inline vector unsigned int
5845 vec_subs (vector unsigned int a1, vector bool int a2)
5846 {
5847   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5848 }
5849
5850 inline vector unsigned int
5851 vec_subs (vector unsigned int a1, vector unsigned int a2)
5852 {
5853   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5854 }
5855
5856 inline vector signed int
5857 vec_subs (vector bool int a1, vector signed int a2)
5858 {
5859   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
5860 }
5861
5862 inline vector signed int
5863 vec_subs (vector signed int a1, vector bool int a2)
5864 {
5865   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
5866 }
5867
5868 inline vector signed int
5869 vec_subs (vector signed int a1, vector signed int a2)
5870 {
5871   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
5872 }
5873
5874 /* vec_vsubsws */
5875
5876 inline vector signed int
5877 vec_vsubsws (vector signed int a1, vector signed int a2)
5878 {
5879   return (vector signed int) __builtin_altivec_vsubsws ((vector signed int) a1, (vector signed int) a2);
5880 }
5881
5882 /* vec_vsubuws */
5883
5884 inline vector unsigned int
5885 vec_vsubuws (vector signed int a1, vector unsigned int a2)
5886 {
5887   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5888 }
5889
5890 inline vector unsigned int
5891 vec_vsubuws (vector unsigned int a1, vector signed int a2)
5892 {
5893   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5894 }
5895
5896 inline vector unsigned int
5897 vec_vsubuws (vector unsigned int a1, vector unsigned int a2)
5898 {
5899   return (vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) a1, (vector signed int) a2);
5900 }
5901
5902 /* vec_vsubshs */
5903
5904 inline vector signed short
5905 vec_vsubshs (vector signed short a1, vector signed short a2)
5906 {
5907   return (vector signed short) __builtin_altivec_vsubshs ((vector signed short) a1, (vector signed short) a2);
5908 }
5909
5910 /* vec_vsubuhs */
5911
5912 inline vector unsigned short
5913 vec_vsubuhs (vector signed short a1, vector unsigned short a2)
5914 {
5915   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5916 }
5917
5918 inline vector unsigned short
5919 vec_vsubuhs (vector unsigned short a1, vector signed short a2)
5920 {
5921   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5922 }
5923
5924 inline vector unsigned short
5925 vec_vsubuhs (vector unsigned short a1, vector unsigned short a2)
5926 {
5927   return (vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) a1, (vector signed short) a2);
5928 }
5929
5930 /* vec_vsubsbs */
5931
5932 inline vector signed char
5933 vec_vsubsbs (vector signed char a1, vector signed char a2)
5934 {
5935   return (vector signed char) __builtin_altivec_vsubsbs ((vector signed char) a1, (vector signed char) a2);
5936 }
5937
5938 /* vec_vsububs */
5939
5940 inline vector unsigned char
5941 vec_vsububs (vector signed char a1, vector unsigned char a2)
5942 {
5943   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5944 }
5945
5946 inline vector unsigned char
5947 vec_vsububs (vector unsigned char a1, vector signed char a2)
5948 {
5949   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5950 }
5951
5952 inline vector unsigned char
5953 vec_vsububs (vector unsigned char a1, vector unsigned char a2)
5954 {
5955   return (vector unsigned char) __builtin_altivec_vsububs ((vector signed char) a1, (vector signed char) a2);
5956 }
5957
5958 /* vec_sum4s */
5959
5960 inline vector unsigned int
5961 vec_sum4s (vector unsigned char a1, vector unsigned int a2)
5962 {
5963   return (vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) a1, (vector signed int) a2);
5964 }
5965
5966 inline vector signed int
5967 vec_sum4s (vector signed char a1, vector signed int a2)
5968 {
5969   return (vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) a1, (vector signed int) a2);
5970 }
5971
5972 inline vector signed int
5973 vec_sum4s (vector signed short a1, vector signed int a2)
5974 {
5975   return (vector signed int) __builtin_altivec_vsum4shs ((vector signed short) a1, (vector signed int) a2);
5976 }
5977
5978 /* vec_vsum4shs */
5979
5980 inline vector signed int
5981 vec_vsum4shss (vector signed short a1, vector signed int a2)
5982 {
5983   return (vector signed int) __builtin_altivec_vsum4shs ((vector signed short) a1, (vector signed int) a2);
5984 }
5985
5986 /* vec_vsum4sbs */
5987
5988 inline vector signed int
5989 vec_vsum4sbs (vector signed char a1, vector signed int a2)
5990 {
5991   return (vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) a1, (vector signed int) a2);
5992 }
5993
5994 /* vec_vsum4ubs */
5995
5996 inline vector unsigned int
5997 vec_vsum4ubs (vector unsigned char a1, vector unsigned int a2)
5998 {
5999   return (vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) a1, (vector signed int) a2);
6000 }
6001
6002 /* vec_sum2s */
6003
6004 inline vector signed int
6005 vec_sum2s (vector signed int a1, vector signed int a2)
6006 {
6007   return (vector signed int) __builtin_altivec_vsum2sws ((vector signed int) a1, (vector signed int) a2);
6008 }
6009
6010 /* vec_sums */
6011
6012 inline vector signed int
6013 vec_sums (vector signed int a1, vector signed int a2)
6014 {
6015   return (vector signed int) __builtin_altivec_vsumsws ((vector signed int) a1, (vector signed int) a2);
6016 }
6017
6018 /* vec_trunc */
6019
6020 inline vector float
6021 vec_trunc (vector float a1)
6022 {
6023   return (vector float) __builtin_altivec_vrfiz ((vector float) a1);
6024 }
6025
6026 /* vec_unpackh */
6027
6028 inline vector signed short
6029 vec_unpackh (vector signed char a1)
6030 {
6031   return (vector signed short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6032 }
6033
6034 inline vector signed short
6035 vec_unpackh (vector bool char a1)
6036 {
6037   return (vector signed short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6038 }
6039
6040 inline vector signed int
6041 vec_unpackh (vector signed short a1)
6042 {
6043   return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6044 }
6045
6046 inline vector signed int
6047 vec_unpackh (vector bool short a1)
6048 {
6049   return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6050 }
6051
6052 inline vector unsigned int
6053 vec_unpackh (vector pixel a1)
6054 {
6055   return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1);
6056 }
6057
6058 /* vec_vupkhsh */
6059
6060 inline vector signed int
6061 vec_vupkhsh (vector signed short a1)
6062 {
6063   return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1);
6064 }
6065
6066 /* vec_vupkhpx */
6067
6068 inline vector unsigned int
6069 vec_vupkhpx (vector unsigned short a1)
6070 {
6071   return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1);
6072 }
6073
6074 /* vec_vupkhsb */
6075
6076 inline vector signed short
6077 vec_vupkhsb (vector signed char a1)
6078 {
6079   return (vector signed short) __builtin_altivec_vupkhsb ((vector signed char) a1);
6080 }
6081
6082 /* vec_unpackl */
6083
6084 inline vector signed short
6085 vec_unpackl (vector signed char a1)
6086 {
6087   return (vector signed short) __builtin_altivec_vupklsb ((vector signed char) a1);
6088 }
6089
6090 inline vector signed short
6091 vec_unpackl (vector bool char a1)
6092 {
6093   return (vector signed short) __builtin_altivec_vupklsb ((vector signed char) a1);
6094 }
6095
6096 inline vector unsigned int
6097 vec_unpackl (vector pixel a1)
6098 {
6099   return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1);
6100 }
6101
6102 inline vector signed int
6103 vec_unpackl (vector signed short a1)
6104 {
6105   return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1);
6106 }
6107
6108 inline vector signed int
6109 vec_unpackl (vector bool short a1)
6110 {
6111   return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1);
6112 }
6113
6114 /* vec_vupklpx */
6115
6116 inline vector unsigned int
6117 vec_vupklpx (vector unsigned short a1)
6118 {
6119   return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1);
6120 }
6121
6122 /* vec_upklsh */
6123
6124 inline vector signed int
6125 vec_vupklsh (vector signed short a1)
6126 {
6127   return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1);
6128 }
6129
6130 /* vec_vupklsb */
6131
6132 inline vector signed short
6133 vec_vupklsb (vector signed char a1)
6134 {
6135   return (vector signed short) __builtin_altivec_vupklsb ((vector signed char) a1);
6136 }
6137
6138 /* vec_xor */
6139
6140 inline vector float
6141 vec_xor (vector float a1, vector float a2)
6142 {
6143   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6144 }
6145
6146 inline vector float
6147 vec_xor (vector float a1, vector bool int a2)
6148 {
6149   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6150 }
6151
6152 inline vector float
6153 vec_xor (vector bool int a1, vector float a2)
6154 {
6155   return (vector float) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6156 }
6157
6158 inline vector bool int
6159 vec_xor (vector bool int a1, vector bool int a2)
6160 {
6161   return (vector bool int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6162 }
6163
6164 inline vector signed int
6165 vec_xor (vector bool int a1, vector signed int a2)
6166 {
6167   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6168 }
6169
6170 inline vector signed int
6171 vec_xor (vector signed int a1, vector bool int a2)
6172 {
6173   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6174 }
6175
6176 inline vector signed int
6177 vec_xor (vector signed int a1, vector signed int a2)
6178 {
6179   return (vector signed int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6180 }
6181
6182 inline vector unsigned int
6183 vec_xor (vector bool int a1, vector unsigned int a2)
6184 {
6185   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6186 }
6187
6188 inline vector unsigned int
6189 vec_xor (vector unsigned int a1, vector bool int a2)
6190 {
6191   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6192 }
6193
6194 inline vector unsigned int
6195 vec_xor (vector unsigned int a1, vector unsigned int a2)
6196 {
6197   return (vector unsigned int) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6198 }
6199
6200 inline vector bool short
6201 vec_xor (vector bool short a1, vector bool short a2)
6202 {
6203   return (vector bool short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6204 }
6205
6206 inline vector signed short
6207 vec_xor (vector bool short a1, vector signed short a2)
6208 {
6209   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6210 }
6211
6212 inline vector signed short
6213 vec_xor (vector signed short a1, vector bool short a2)
6214 {
6215   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6216 }
6217
6218 inline vector signed short
6219 vec_xor (vector signed short a1, vector signed short a2)
6220 {
6221   return (vector signed short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6222 }
6223
6224 inline vector unsigned short
6225 vec_xor (vector bool short a1, vector unsigned short a2)
6226 {
6227   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6228 }
6229
6230 inline vector unsigned short
6231 vec_xor (vector unsigned short a1, vector bool short a2)
6232 {
6233   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6234 }
6235
6236 inline vector unsigned short
6237 vec_xor (vector unsigned short a1, vector unsigned short a2)
6238 {
6239   return (vector unsigned short) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6240 }
6241
6242 inline vector signed char
6243 vec_xor (vector bool char a1, vector signed char a2)
6244 {
6245   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6246 }
6247
6248 inline vector bool char
6249 vec_xor (vector bool char a1, vector bool char a2)
6250 {
6251   return (vector bool char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6252 }
6253
6254 inline vector signed char
6255 vec_xor (vector signed char a1, vector bool char a2)
6256 {
6257   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6258 }
6259
6260 inline vector signed char
6261 vec_xor (vector signed char a1, vector signed char a2)
6262 {
6263   return (vector signed char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6264 }
6265
6266 inline vector unsigned char
6267 vec_xor (vector bool char a1, vector unsigned char a2)
6268 {
6269   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6270 }
6271
6272 inline vector unsigned char
6273 vec_xor (vector unsigned char a1, vector bool char a2)
6274 {
6275   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6276 }
6277
6278 inline vector unsigned char
6279 vec_xor (vector unsigned char a1, vector unsigned char a2)
6280 {
6281   return (vector unsigned char) __builtin_altivec_vxor ((vector signed int) a1, (vector signed int) a2);
6282 }
6283
6284 /* vec_all_eq */
6285
6286 inline int
6287 vec_all_eq (vector signed char a1, vector bool char a2)
6288 {
6289   return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, (vector signed char) a2);
6290 }
6291
6292 inline int
6293 vec_all_eq (vector signed char a1, vector signed char a2)
6294 {
6295   return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, a2);
6296 }
6297
6298 inline int
6299 vec_all_eq (vector unsigned char a1, vector bool char a2)
6300 {
6301   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6302 }
6303
6304 inline int
6305 vec_all_eq (vector unsigned char a1, vector unsigned char a2)
6306 {
6307   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6308 }
6309
6310 inline int
6311 vec_all_eq (vector bool char a1, vector bool char a2)
6312 {
6313   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6314 }
6315
6316 inline int
6317 vec_all_eq (vector bool char a1, vector unsigned char a2)
6318 {
6319   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6320 }
6321
6322 inline int
6323 vec_all_eq (vector bool char a1, vector signed char a2)
6324 {
6325   return __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6326 }
6327
6328 inline int
6329 vec_all_eq (vector signed short a1, vector bool short a2)
6330 {
6331   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6332 }
6333
6334 inline int
6335 vec_all_eq (vector signed short a1, vector signed short a2)
6336 {
6337   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6338 }
6339
6340 inline int
6341 vec_all_eq (vector unsigned short a1, vector bool short a2)
6342 {
6343   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6344 }
6345
6346 inline int
6347 vec_all_eq (vector unsigned short a1, vector unsigned short a2)
6348 {
6349   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6350 }
6351
6352 inline int
6353 vec_all_eq (vector bool short a1, vector bool short a2)
6354 {
6355   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6356 }
6357
6358 inline int
6359 vec_all_eq (vector bool short a1, vector unsigned short a2)
6360 {
6361   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6362 }
6363
6364 inline int
6365 vec_all_eq (vector bool short a1, vector signed short a2)
6366 {
6367   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6368 }
6369
6370 inline int
6371 vec_all_eq (vector pixel a1, vector pixel a2)
6372 {
6373   return __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6374 }
6375
6376 inline int
6377 vec_all_eq (vector signed int a1, vector bool int a2)
6378 {
6379   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6380 }
6381
6382 inline int
6383 vec_all_eq (vector signed int a1, vector signed int a2)
6384 {
6385   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6386 }
6387
6388 inline int
6389 vec_all_eq (vector unsigned int a1, vector bool int a2)
6390 {
6391   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6392 }
6393
6394 inline int
6395 vec_all_eq (vector unsigned int a1, vector unsigned int a2)
6396 {
6397   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6398 }
6399
6400 inline int
6401 vec_all_eq (vector bool int a1, vector bool int a2)
6402 {
6403   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6404 }
6405
6406 inline int
6407 vec_all_eq (vector bool int a1, vector unsigned int a2)
6408 {
6409   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6410 }
6411
6412 inline int
6413 vec_all_eq (vector bool int a1, vector signed int a2)
6414 {
6415   return __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6416 }
6417
6418 inline int
6419 vec_all_eq (vector float a1, vector float a2)
6420 {
6421   return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a2);
6422 }
6423
6424 /* vec_all_ge */
6425
6426 inline int
6427 vec_all_ge (vector bool char a1, vector unsigned char a2)
6428 {
6429   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6430 }
6431
6432 inline int
6433 vec_all_ge (vector unsigned char a1, vector bool char a2)
6434 {
6435   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6436 }
6437
6438 inline int
6439 vec_all_ge (vector unsigned char a1, vector unsigned char a2)
6440 {
6441   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6442 }
6443
6444 inline int
6445 vec_all_ge (vector bool char a1, vector signed char a2)
6446 {
6447   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6448 }
6449
6450 inline int
6451 vec_all_ge (vector signed char a1, vector bool char a2)
6452 {
6453   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6454 }
6455
6456 inline int
6457 vec_all_ge (vector signed char a1, vector signed char a2)
6458 {
6459   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a2, (vector signed char) a1);
6460 }
6461
6462 inline int
6463 vec_all_ge (vector bool short a1, vector unsigned short a2)
6464 {
6465   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6466 }
6467
6468 inline int
6469 vec_all_ge (vector unsigned short a1, vector bool short a2)
6470 {
6471   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6472 }
6473
6474 inline int
6475 vec_all_ge (vector unsigned short a1, vector unsigned short a2)
6476 {
6477   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6478 }
6479
6480 inline int
6481 vec_all_ge (vector signed short a1, vector signed short a2)
6482 {
6483   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6484 }
6485
6486 inline int
6487 vec_all_ge (vector bool short a1, vector signed short a2)
6488 {
6489   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6490 }
6491
6492 inline int
6493 vec_all_ge (vector signed short a1, vector bool short a2)
6494 {
6495   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a2, (vector signed short) a1);
6496 }
6497
6498 inline int
6499 vec_all_ge (vector bool int a1, vector unsigned int a2)
6500 {
6501   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6502 }
6503
6504 inline int
6505 vec_all_ge (vector unsigned int a1, vector bool int a2)
6506 {
6507   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6508 }
6509
6510 inline int
6511 vec_all_ge (vector unsigned int a1, vector unsigned int a2)
6512 {
6513   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6514 }
6515
6516 inline int
6517 vec_all_ge (vector bool int a1, vector signed int a2)
6518 {
6519   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6520 }
6521
6522 inline int
6523 vec_all_ge (vector signed int a1, vector bool int a2)
6524 {
6525   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6526 }
6527
6528 inline int
6529 vec_all_ge (vector signed int a1, vector signed int a2)
6530 {
6531   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a2, (vector signed int) a1);
6532 }
6533
6534 inline int
6535 vec_all_ge (vector float a1, vector float a2)
6536 {
6537   return __builtin_altivec_vcmpgefp_p (__CR6_LT, a1, a2);
6538 }
6539
6540 /* vec_all_gt */
6541
6542 inline int
6543 vec_all_gt (vector bool char a1, vector unsigned char a2)
6544 {
6545   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6546 }
6547
6548 inline int
6549 vec_all_gt (vector unsigned char a1, vector bool char a2)
6550 {
6551   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6552 }
6553
6554 inline int
6555 vec_all_gt (vector unsigned char a1, vector unsigned char a2)
6556 {
6557   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6558 }
6559
6560 inline int
6561 vec_all_gt (vector bool char a1, vector signed char a2)
6562 {
6563   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6564 }
6565
6566 inline int
6567 vec_all_gt (vector signed char a1, vector bool char a2)
6568 {
6569   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6570 }
6571
6572 inline int
6573 vec_all_gt (vector signed char a1, vector signed char a2)
6574 {
6575   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a1, (vector signed char) a2);
6576 }
6577
6578 inline int
6579 vec_all_gt (vector bool short a1, vector unsigned short a2)
6580 {
6581   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6582 }
6583
6584 inline int
6585 vec_all_gt (vector unsigned short a1, vector bool short a2)
6586 {
6587   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6588 }
6589
6590 inline int
6591 vec_all_gt (vector unsigned short a1, vector unsigned short a2)
6592 {
6593   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6594 }
6595
6596 inline int
6597 vec_all_gt (vector bool short a1, vector signed short a2)
6598 {
6599   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6600 }
6601
6602 inline int
6603 vec_all_gt (vector signed short a1, vector bool short a2)
6604 {
6605   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6606 }
6607
6608 inline int
6609 vec_all_gt (vector signed short a1, vector signed short a2)
6610 {
6611   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a1, (vector signed short) a2);
6612 }
6613
6614 inline int
6615 vec_all_gt (vector bool int a1, vector unsigned int a2)
6616 {
6617   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6618 }
6619
6620 inline int
6621 vec_all_gt (vector unsigned int a1, vector bool int a2)
6622 {
6623   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6624 }
6625
6626 inline int
6627 vec_all_gt (vector unsigned int a1, vector unsigned int a2)
6628 {
6629   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6630 }
6631
6632 inline int
6633 vec_all_gt (vector bool int a1, vector signed int a2)
6634 {
6635   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6636 }
6637
6638 inline int
6639 vec_all_gt (vector signed int a1, vector bool int a2)
6640 {
6641   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6642 }
6643
6644 inline int
6645 vec_all_gt (vector signed int a1, vector signed int a2)
6646 {
6647   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a1, (vector signed int) a2);
6648 }
6649
6650 inline int
6651 vec_all_gt (vector float a1, vector float a2)
6652 {
6653   return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a1, a2);
6654 }
6655
6656 /* vec_all_in */
6657
6658 inline int
6659 vec_all_in (vector float a1, vector float a2)
6660 {
6661   return __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2);
6662 }
6663
6664 /* vec_all_le */
6665
6666 inline int
6667 vec_all_le (vector bool char a1, vector unsigned char a2)
6668 {
6669   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6670 }
6671
6672 inline int
6673 vec_all_le (vector unsigned char a1, vector bool char a2)
6674 {
6675   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6676 }
6677
6678 inline int
6679 vec_all_le (vector unsigned char a1, vector unsigned char a2)
6680 {
6681   return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6682 }
6683
6684 inline int
6685 vec_all_le (vector bool char a1, vector signed char a2)
6686 {
6687   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6688 }
6689
6690 inline int
6691 vec_all_le (vector signed char a1, vector bool char a2)
6692 {
6693   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6694 }
6695
6696 inline int
6697 vec_all_le (vector signed char a1, vector signed char a2)
6698 {
6699   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6700 }
6701
6702 inline int
6703 vec_all_le (vector bool short a1, vector unsigned short a2)
6704 {
6705   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6706 }
6707
6708 inline int
6709 vec_all_le (vector unsigned short a1, vector bool short a2)
6710 {
6711   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6712 }
6713
6714 inline int
6715 vec_all_le (vector unsigned short a1, vector unsigned short a2)
6716 {
6717   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6718 }
6719
6720 inline int
6721 vec_all_le (vector bool short a1, vector signed short a2)
6722 {
6723   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6724 }
6725
6726 inline int
6727 vec_all_le (vector signed short a1, vector bool short a2)
6728 {
6729   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6730 }
6731
6732 inline int
6733 vec_all_le (vector signed short a1, vector signed short a2)
6734 {
6735   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6736 }
6737
6738 inline int
6739 vec_all_le (vector bool int a1, vector unsigned int a2)
6740 {
6741   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6742 }
6743
6744 inline int
6745 vec_all_le (vector unsigned int a1, vector bool int a2)
6746 {
6747   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6748 }
6749
6750 inline int
6751 vec_all_le (vector unsigned int a1, vector unsigned int a2)
6752 {
6753   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6754 }
6755
6756 inline int
6757 vec_all_le (vector bool int a1, vector signed int a2)
6758 {
6759   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6760 }
6761
6762 inline int
6763 vec_all_le (vector signed int a1, vector bool int a2)
6764 {
6765   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6766 }
6767
6768 inline int
6769 vec_all_le (vector signed int a1, vector signed int a2)
6770 {
6771   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6772 }
6773
6774 inline int
6775 vec_all_le (vector float a1, vector float a2)
6776 {
6777   return __builtin_altivec_vcmpgefp_p (__CR6_LT, a2, a1);
6778 }
6779
6780 /* vec_all_lt */
6781
6782 inline int
6783 vec_all_lt (vector bool char a1, vector unsigned char a2)
6784 {
6785   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6786 }
6787
6788 inline int
6789 vec_all_lt (vector unsigned char a1, vector bool char a2)
6790 {
6791   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6792 }
6793
6794 inline int
6795 vec_all_lt (vector unsigned char a1, vector unsigned char a2)
6796 {
6797   return __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6798 }
6799
6800 inline int
6801 vec_all_lt (vector bool char a1, vector signed char a2)
6802 {
6803   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6804 }
6805
6806 inline int
6807 vec_all_lt (vector signed char a1, vector bool char a2)
6808 {
6809   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6810 }
6811
6812 inline int
6813 vec_all_lt (vector signed char a1, vector signed char a2)
6814 {
6815   return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) a2, (vector signed char) a1);
6816 }
6817
6818 inline int
6819 vec_all_lt (vector bool short a1, vector unsigned short a2)
6820 {
6821   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6822 }
6823
6824 inline int
6825 vec_all_lt (vector unsigned short a1, vector bool short a2)
6826 {
6827   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6828 }
6829
6830 inline int
6831 vec_all_lt (vector unsigned short a1, vector unsigned short a2)
6832 {
6833   return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6834 }
6835
6836 inline int
6837 vec_all_lt (vector bool short a1, vector signed short a2)
6838 {
6839   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6840 }
6841
6842 inline int
6843 vec_all_lt (vector signed short a1, vector bool short a2)
6844 {
6845   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6846 }
6847
6848 inline int
6849 vec_all_lt (vector signed short a1, vector signed short a2)
6850 {
6851   return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) a2, (vector signed short) a1);
6852 }
6853
6854 inline int
6855 vec_all_lt (vector bool int a1, vector unsigned int a2)
6856 {
6857   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6858 }
6859
6860 inline int
6861 vec_all_lt (vector unsigned int a1, vector bool int a2)
6862 {
6863   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6864 }
6865
6866 inline int
6867 vec_all_lt (vector unsigned int a1, vector unsigned int a2)
6868 {
6869   return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6870 }
6871
6872 inline int
6873 vec_all_lt (vector bool int a1, vector signed int a2)
6874 {
6875   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6876 }
6877
6878 inline int
6879 vec_all_lt (vector signed int a1, vector bool int a2)
6880 {
6881   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6882 }
6883
6884 inline int
6885 vec_all_lt (vector signed int a1, vector signed int a2)
6886 {
6887   return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) a2, (vector signed int) a1);
6888 }
6889
6890 inline int
6891 vec_all_lt (vector float a1, vector float a2)
6892 {
6893   return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a2, a1);
6894 }
6895
6896 /* vec_all_nan */
6897
6898 inline int
6899 vec_all_nan (vector float a1)
6900 {
6901   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1);
6902 }
6903
6904 /* vec_all_ne */
6905
6906 inline int
6907 vec_all_ne (vector signed char a1, vector bool char a2)
6908 {
6909   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6910 }
6911
6912 inline int
6913 vec_all_ne (vector signed char a1, vector signed char a2)
6914 {
6915   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6916 }
6917
6918 inline int
6919 vec_all_ne (vector unsigned char a1, vector bool char a2)
6920 {
6921   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6922 }
6923
6924 inline int
6925 vec_all_ne (vector unsigned char a1, vector unsigned char a2)
6926 {
6927   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6928 }
6929
6930 inline int
6931 vec_all_ne (vector bool char a1, vector bool char a2)
6932 {
6933   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6934 }
6935
6936 inline int
6937 vec_all_ne (vector bool char a1, vector unsigned char a2)
6938 {
6939   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6940 }
6941
6942 inline int
6943 vec_all_ne (vector bool char a1, vector signed char a2)
6944 {
6945   return __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) a1, (vector signed char) a2);
6946 }
6947
6948 inline int
6949 vec_all_ne (vector signed short a1, vector bool short a2)
6950 {
6951   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6952 }
6953
6954 inline int
6955 vec_all_ne (vector signed short a1, vector signed short a2)
6956 {
6957   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6958 }
6959
6960 inline int
6961 vec_all_ne (vector unsigned short a1, vector bool short a2)
6962 {
6963   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6964 }
6965
6966 inline int
6967 vec_all_ne (vector unsigned short a1, vector unsigned short a2)
6968 {
6969   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6970 }
6971
6972 inline int
6973 vec_all_ne (vector bool short a1, vector bool short a2)
6974 {
6975   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6976 }
6977
6978 inline int
6979 vec_all_ne (vector bool short a1, vector unsigned short a2)
6980 {
6981   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6982 }
6983
6984 inline int
6985 vec_all_ne (vector bool short a1, vector signed short a2)
6986 {
6987   return __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) a1, (vector signed short) a2);
6988 }
6989
6990 inline int
6991 vec_all_ne (vector signed int a1, vector bool int a2)
6992 {
6993   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
6994 }
6995
6996 inline int
6997 vec_all_ne (vector signed int a1, vector signed int a2)
6998 {
6999   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7000 }
7001
7002 inline int
7003 vec_all_ne (vector unsigned int a1, vector bool int a2)
7004 {
7005   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7006 }
7007
7008 inline int
7009 vec_all_ne (vector unsigned int a1, vector unsigned int a2)
7010 {
7011   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7012 }
7013
7014 inline int
7015 vec_all_ne (vector bool int a1, vector bool int a2)
7016 {
7017   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7018 }
7019
7020 inline int
7021 vec_all_ne (vector bool int a1, vector unsigned int a2)
7022 {
7023   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7024 }
7025
7026 inline int
7027 vec_all_ne (vector bool int a1, vector signed int a2)
7028 {
7029   return __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) a1, (vector signed int) a2);
7030 }
7031
7032 inline int
7033 vec_all_ne (vector float a1, vector float a2)
7034 {
7035   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a2);
7036 }
7037
7038 /* vec_all_nge */
7039
7040 inline int
7041 vec_all_nge (vector float a1, vector float a2)
7042 {
7043   return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2);
7044 }
7045
7046 /* vec_all_ngt */
7047
7048 inline int
7049 vec_all_ngt (vector float a1, vector float a2)
7050 {
7051   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2);
7052 }
7053
7054 /* vec_all_nle */
7055
7056 inline int
7057 vec_all_nle (vector float a1, vector float a2)
7058 {
7059   return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1);
7060 }
7061
7062 /* vec_all_nlt */
7063
7064 inline int
7065 vec_all_nlt (vector float a1, vector float a2)
7066 {
7067   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1);
7068 }
7069
7070 /* vec_all_numeric */
7071
7072 inline int
7073 vec_all_numeric (vector float a1)
7074 {
7075   return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1);
7076 }
7077
7078 /* vec_any_eq */
7079
7080 inline int
7081 vec_any_eq (vector signed char a1, vector bool char a2)
7082 {
7083   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7084 }
7085
7086 inline int
7087 vec_any_eq (vector signed char a1, vector signed char a2)
7088 {
7089   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7090 }
7091
7092 inline int
7093 vec_any_eq (vector unsigned char a1, vector bool char a2)
7094 {
7095   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7096 }
7097
7098 inline int
7099 vec_any_eq (vector unsigned char a1, vector unsigned char a2)
7100 {
7101   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7102 }
7103
7104 inline int
7105 vec_any_eq (vector bool char a1, vector bool char a2)
7106 {
7107   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7108 }
7109
7110 inline int
7111 vec_any_eq (vector bool char a1, vector unsigned char a2)
7112 {
7113   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7114 }
7115
7116 inline int
7117 vec_any_eq (vector bool char a1, vector signed char a2)
7118 {
7119   return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7120 }
7121
7122 inline int
7123 vec_any_eq (vector signed short a1, vector bool short a2)
7124 {
7125   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7126 }
7127
7128 inline int
7129 vec_any_eq (vector signed short a1, vector signed short a2)
7130 {
7131   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7132 }
7133
7134 inline int
7135 vec_any_eq (vector unsigned short a1, vector bool short a2)
7136 {
7137   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7138 }
7139
7140 inline int
7141 vec_any_eq (vector unsigned short a1, vector unsigned short a2)
7142 {
7143   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7144 }
7145
7146 inline int
7147 vec_any_eq (vector bool short a1, vector bool short a2)
7148 {
7149   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7150 }
7151
7152 inline int
7153 vec_any_eq (vector bool short a1, vector unsigned short a2)
7154 {
7155   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7156 }
7157
7158 inline int
7159 vec_any_eq (vector bool short a1, vector signed short a2)
7160 {
7161   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7162 }
7163
7164 inline int
7165 vec_any_eq (vector pixel a1, vector pixel a2)
7166 {
7167   return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7168 }
7169
7170 inline int
7171 vec_any_eq (vector signed int a1, vector bool int a2)
7172 {
7173   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7174 }
7175
7176 inline int
7177 vec_any_eq (vector signed int a1, vector signed int a2)
7178 {
7179   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7180 }
7181
7182 inline int
7183 vec_any_eq (vector unsigned int a1, vector bool int a2)
7184 {
7185   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7186 }
7187
7188 inline int
7189 vec_any_eq (vector unsigned int a1, vector unsigned int a2)
7190 {
7191   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7192 }
7193
7194 inline int
7195 vec_any_eq (vector bool int a1, vector bool int a2)
7196 {
7197   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7198 }
7199
7200 inline int
7201 vec_any_eq (vector bool int a1, vector unsigned int a2)
7202 {
7203   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7204 }
7205
7206 inline int
7207 vec_any_eq (vector bool int a1, vector signed int a2)
7208 {
7209   return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7210 }
7211
7212 inline int
7213 vec_any_eq (vector float a1, vector float a2)
7214 {
7215   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a2);
7216 }
7217
7218 /* vec_any_ge */
7219
7220 inline int
7221 vec_any_ge (vector signed char a1, vector bool char a2)
7222 {
7223   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7224 }
7225
7226 inline int
7227 vec_any_ge (vector unsigned char a1, vector bool char a2)
7228 {
7229   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7230 }
7231
7232 inline int
7233 vec_any_ge (vector unsigned char a1, vector unsigned char a2)
7234 {
7235   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7236 }
7237
7238 inline int
7239 vec_any_ge (vector signed char a1, vector signed char a2)
7240 {
7241   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7242 }
7243
7244 inline int
7245 vec_any_ge (vector bool char a1, vector bool char a2)
7246 {
7247   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7248 }
7249
7250 inline int
7251 vec_any_ge (vector bool char a1, vector unsigned char a2)
7252 {
7253   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7254 }
7255
7256 inline int
7257 vec_any_ge (vector bool char a1, vector signed char a2)
7258 {
7259   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a2, (vector signed char) a1);
7260 }
7261
7262 inline int
7263 vec_any_ge (vector signed short a1, vector bool short a2)
7264 {
7265   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7266 }
7267
7268 inline int
7269 vec_any_ge (vector unsigned short a1, vector bool short a2)
7270 {
7271   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7272 }
7273
7274 inline int
7275 vec_any_ge (vector unsigned short a1, vector unsigned short a2)
7276 {
7277   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7278 }
7279
7280 inline int
7281 vec_any_ge (vector signed short a1, vector signed short a2)
7282 {
7283   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7284 }
7285
7286 inline int
7287 vec_any_ge (vector bool short a1, vector bool short a2)
7288 {
7289   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7290 }
7291
7292 inline int
7293 vec_any_ge (vector bool short a1, vector unsigned short a2)
7294 {
7295   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7296 }
7297
7298 inline int
7299 vec_any_ge (vector bool short a1, vector signed short a2)
7300 {
7301   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a2, (vector signed short) a1);
7302 }
7303
7304 inline int
7305 vec_any_ge (vector signed int a1, vector bool int a2)
7306 {
7307   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7308 }
7309
7310 inline int
7311 vec_any_ge (vector unsigned int a1, vector bool int a2)
7312 {
7313   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7314 }
7315
7316 inline int
7317 vec_any_ge (vector unsigned int a1, vector unsigned int a2)
7318 {
7319   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7320 }
7321
7322 inline int
7323 vec_any_ge (vector signed int a1, vector signed int a2)
7324 {
7325   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7326 }
7327
7328 inline int
7329 vec_any_ge (vector bool int a1, vector bool int a2)
7330 {
7331   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7332 }
7333
7334 inline int
7335 vec_any_ge (vector bool int a1, vector unsigned int a2)
7336 {
7337   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7338 }
7339
7340 inline int
7341 vec_any_ge (vector bool int a1, vector signed int a2)
7342 {
7343   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a2, (vector signed int) a1);
7344 }
7345
7346 inline int
7347 vec_any_ge (vector float a1, vector float a2)
7348 {
7349   return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a1, a2);
7350 }
7351
7352 /* vec_any_gt */
7353
7354 inline int
7355 vec_any_gt (vector bool char a1, vector unsigned char a2)
7356 {
7357   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7358 }
7359
7360 inline int
7361 vec_any_gt (vector unsigned char a1, vector bool char a2)
7362 {
7363   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7364 }
7365
7366 inline int
7367 vec_any_gt (vector unsigned char a1, vector unsigned char a2)
7368 {
7369   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7370 }
7371
7372 inline int
7373 vec_any_gt (vector bool char a1, vector signed char a2)
7374 {
7375   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7376 }
7377
7378 inline int
7379 vec_any_gt (vector signed char a1, vector bool char a2)
7380 {
7381   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7382 }
7383
7384 inline int
7385 vec_any_gt (vector signed char a1, vector signed char a2)
7386 {
7387   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a1, (vector signed char) a2);
7388 }
7389
7390 inline int
7391 vec_any_gt (vector bool short a1, vector unsigned short a2)
7392 {
7393   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7394 }
7395
7396 inline int
7397 vec_any_gt (vector unsigned short a1, vector bool short a2)
7398 {
7399   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7400 }
7401
7402 inline int
7403 vec_any_gt (vector unsigned short a1, vector unsigned short a2)
7404 {
7405   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7406 }
7407
7408 inline int
7409 vec_any_gt (vector bool short a1, vector signed short a2)
7410 {
7411   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7412 }
7413
7414 inline int
7415 vec_any_gt (vector signed short a1, vector bool short a2)
7416 {
7417   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7418 }
7419
7420 inline int
7421 vec_any_gt (vector signed short a1, vector signed short a2)
7422 {
7423   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a1, (vector signed short) a2);
7424 }
7425
7426 inline int
7427 vec_any_gt (vector bool int a1, vector unsigned int a2)
7428 {
7429   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7430 }
7431
7432 inline int
7433 vec_any_gt (vector unsigned int a1, vector bool int a2)
7434 {
7435   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7436 }
7437
7438 inline int
7439 vec_any_gt (vector unsigned int a1, vector unsigned int a2)
7440 {
7441   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7442 }
7443
7444 inline int
7445 vec_any_gt (vector bool int a1, vector signed int a2)
7446 {
7447   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7448 }
7449
7450 inline int
7451 vec_any_gt (vector signed int a1, vector bool int a2)
7452 {
7453   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7454 }
7455
7456 inline int
7457 vec_any_gt (vector signed int a1, vector signed int a2)
7458 {
7459   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a1, (vector signed int) a2);
7460 }
7461
7462 inline int
7463 vec_any_gt (vector float a1, vector float a2)
7464 {
7465   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a1, a2);
7466 }
7467
7468 /* vec_any_le */
7469
7470 inline int
7471 vec_any_le (vector bool char a1, vector unsigned char a2)
7472 {
7473   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7474 }
7475
7476 inline int
7477 vec_any_le (vector unsigned char a1, vector bool char a2)
7478 {
7479   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7480 }
7481
7482 inline int
7483 vec_any_le (vector unsigned char a1, vector unsigned char a2)
7484 {
7485   return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7486 }
7487
7488 inline int
7489 vec_any_le (vector bool char a1, vector signed char a2)
7490 {
7491   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7492 }
7493
7494 inline int
7495 vec_any_le (vector signed char a1, vector bool char a2)
7496 {
7497   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7498 }
7499
7500 inline int
7501 vec_any_le (vector signed char a1, vector signed char a2)
7502 {
7503   return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7504 }
7505
7506 inline int
7507 vec_any_le (vector bool short a1, vector unsigned short a2)
7508 {
7509   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7510 }
7511
7512 inline int
7513 vec_any_le (vector unsigned short a1, vector bool short a2)
7514 {
7515   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7516 }
7517
7518 inline int
7519 vec_any_le (vector unsigned short a1, vector unsigned short a2)
7520 {
7521   return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7522 }
7523
7524 inline int
7525 vec_any_le (vector bool short a1, vector signed short a2)
7526 {
7527   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7528 }
7529
7530 inline int
7531 vec_any_le (vector signed short a1, vector bool short a2)
7532 {
7533   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7534 }
7535
7536 inline int
7537 vec_any_le (vector signed short a1, vector signed short a2)
7538 {
7539   return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7540 }
7541
7542 inline int
7543 vec_any_le (vector bool int a1, vector unsigned int a2)
7544 {
7545   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7546 }
7547
7548 inline int
7549 vec_any_le (vector unsigned int a1, vector bool int a2)
7550 {
7551   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7552 }
7553
7554 inline int
7555 vec_any_le (vector unsigned int a1, vector unsigned int a2)
7556 {
7557   return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7558 }
7559
7560 inline int
7561 vec_any_le (vector bool int a1, vector signed int a2)
7562 {
7563   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7564 }
7565
7566 inline int
7567 vec_any_le (vector signed int a1, vector bool int a2)
7568 {
7569   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7570 }
7571
7572 inline int
7573 vec_any_le (vector signed int a1, vector signed int a2)
7574 {
7575   return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7576 }
7577
7578 inline int
7579 vec_any_le (vector float a1, vector float a2)
7580 {
7581   return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a2, a1);
7582 }
7583
7584 /* vec_any_lt */
7585
7586 inline int
7587 vec_any_lt (vector bool char a1, vector unsigned char a2)
7588 {
7589   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7590 }
7591
7592 inline int
7593 vec_any_lt (vector unsigned char a1, vector bool char a2)
7594 {
7595   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7596 }
7597
7598 inline int
7599 vec_any_lt (vector unsigned char a1, vector unsigned char a2)
7600 {
7601   return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7602 }
7603
7604 inline int
7605 vec_any_lt (vector bool char a1, vector signed char a2)
7606 {
7607   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7608 }
7609
7610 inline int
7611 vec_any_lt (vector signed char a1, vector bool char a2)
7612 {
7613   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7614 }
7615
7616 inline int
7617 vec_any_lt (vector signed char a1, vector signed char a2)
7618 {
7619   return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) a2, (vector signed char) a1);
7620 }
7621
7622 inline int
7623 vec_any_lt (vector bool short a1, vector unsigned short a2)
7624 {
7625   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7626 }
7627
7628 inline int
7629 vec_any_lt (vector unsigned short a1, vector bool short a2)
7630 {
7631   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7632 }
7633
7634 inline int
7635 vec_any_lt (vector unsigned short a1, vector unsigned short a2)
7636 {
7637   return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7638 }
7639
7640 inline int
7641 vec_any_lt (vector bool short a1, vector signed short a2)
7642 {
7643   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7644 }
7645
7646 inline int
7647 vec_any_lt (vector signed short a1, vector bool short a2)
7648 {
7649   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7650 }
7651
7652 inline int
7653 vec_any_lt (vector signed short a1, vector signed short a2)
7654 {
7655   return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) a2, (vector signed short) a1);
7656 }
7657
7658 inline int
7659 vec_any_lt (vector bool int a1, vector unsigned int a2)
7660 {
7661   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7662 }
7663
7664 inline int
7665 vec_any_lt (vector unsigned int a1, vector bool int a2)
7666 {
7667   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7668 }
7669
7670 inline int
7671 vec_any_lt (vector unsigned int a1, vector unsigned int a2)
7672 {
7673   return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7674 }
7675
7676 inline int
7677 vec_any_lt (vector bool int a1, vector signed int a2)
7678 {
7679   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7680 }
7681
7682 inline int
7683 vec_any_lt (vector signed int a1, vector bool int a2)
7684 {
7685   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7686 }
7687
7688 inline int
7689 vec_any_lt (vector signed int a1, vector signed int a2)
7690 {
7691   return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) a2, (vector signed int) a1);
7692 }
7693
7694 inline int
7695 vec_any_lt (vector float a1, vector float a2)
7696 {
7697   return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a2, a1);
7698 }
7699
7700 /* vec_any_nan */
7701
7702 inline int
7703 vec_any_nan (vector float a1)
7704 {
7705   return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1);
7706 }
7707
7708 /* vec_any_ne */
7709
7710 inline int
7711 vec_any_ne (vector signed char a1, vector bool char a2)
7712 {
7713   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7714 }
7715
7716 inline int
7717 vec_any_ne (vector signed char a1, vector signed char a2)
7718 {
7719   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7720 }
7721
7722 inline int
7723 vec_any_ne (vector unsigned char a1, vector bool char a2)
7724 {
7725   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7726 }
7727
7728 inline int
7729 vec_any_ne (vector unsigned char a1, vector unsigned char a2)
7730 {
7731   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7732 }
7733
7734 inline int
7735 vec_any_ne (vector bool char a1, vector bool char a2)
7736 {
7737   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7738 }
7739
7740 inline int
7741 vec_any_ne (vector bool char a1, vector unsigned char a2)
7742 {
7743   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7744 }
7745
7746 inline int
7747 vec_any_ne (vector bool char a1, vector signed char a2)
7748 {
7749   return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) a1, (vector signed char) a2);
7750 }
7751
7752 inline int
7753 vec_any_ne (vector signed short a1, vector bool short a2)
7754 {
7755   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7756 }
7757
7758 inline int
7759 vec_any_ne (vector signed short a1, vector signed short a2)
7760 {
7761   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7762 }
7763
7764 inline int
7765 vec_any_ne (vector unsigned short a1, vector bool short a2)
7766 {
7767   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7768 }
7769
7770 inline int
7771 vec_any_ne (vector unsigned short a1, vector unsigned short a2)
7772 {
7773   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7774 }
7775
7776 inline int
7777 vec_any_ne (vector bool short a1, vector bool short a2)
7778 {
7779   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7780 }
7781
7782 inline int
7783 vec_any_ne (vector bool short a1, vector unsigned short a2)
7784 {
7785   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7786 }
7787
7788 inline int
7789 vec_any_ne (vector bool short a1, vector signed short a2)
7790 {
7791   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7792 }
7793
7794 inline int
7795 vec_any_ne (vector pixel a1, vector pixel a2)
7796 {
7797   return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) a1, (vector signed short) a2);
7798 }
7799
7800 inline int
7801 vec_any_ne (vector signed int a1, vector bool int a2)
7802 {
7803   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7804 }
7805
7806 inline int
7807 vec_any_ne (vector signed int a1, vector signed int a2)
7808 {
7809   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7810 }
7811
7812 inline int
7813 vec_any_ne (vector unsigned int a1, vector bool int a2)
7814 {
7815   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7816 }
7817
7818 inline int
7819 vec_any_ne (vector unsigned int a1, vector unsigned int a2)
7820 {
7821   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7822 }
7823
7824 inline int
7825 vec_any_ne (vector bool int a1, vector bool int a2)
7826 {
7827   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7828 }
7829
7830 inline int
7831 vec_any_ne (vector bool int a1, vector unsigned int a2)
7832 {
7833   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7834 }
7835
7836 inline int
7837 vec_any_ne (vector bool int a1, vector signed int a2)
7838 {
7839   return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) a1, (vector signed int) a2);
7840 }
7841
7842 inline int
7843 vec_any_ne (vector float a1, vector float a2)
7844 {
7845   return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a2);
7846 }
7847
7848 /* vec_any_nge */
7849
7850 inline int
7851 vec_any_nge (vector float a1, vector float a2)
7852 {
7853   return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2);
7854 }
7855
7856 /* vec_any_ngt */
7857
7858 inline int
7859 vec_any_ngt (vector float a1, vector float a2)
7860 {
7861   return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2);
7862 }
7863
7864 /* vec_any_nle */
7865
7866 inline int
7867 vec_any_nle (vector float a1, vector float a2)
7868 {
7869   return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1);
7870 }
7871
7872 /* vec_any_nlt */
7873
7874 inline int
7875 vec_any_nlt (vector float a1, vector float a2)
7876 {
7877   return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1);
7878 }
7879
7880 /* vec_any_numeric */
7881
7882 inline int
7883 vec_any_numeric (vector float a1)
7884 {
7885   return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1);
7886 }
7887
7888 /* vec_any_out */
7889
7890 inline int
7891 vec_any_out (vector float a1, vector float a2)
7892 {
7893   return __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2);
7894 }
7895
7896 } /* extern "C++" */
7897
7898 #else /* not C++ */
7899
7900 /* "... and so I think no man in a century will suffer as greatly as
7901    you will."  */
7902
7903 /* Helper macros.  */
7904
7905 #define __un_args_eq(xtype, x)                                          \
7906         __builtin_types_compatible_p (xtype, typeof (x))
7907
7908 #define __bin_args_eq(xtype, x, ytype, y)                               \
7909         (__builtin_types_compatible_p (xtype, typeof (x))               \
7910          && __builtin_types_compatible_p (ytype, typeof (y)))
7911
7912 #define __tern_args_eq(xtype, x, ytype, y, ztype, z)                    \
7913         (__builtin_types_compatible_p (xtype, typeof (x))               \
7914          && __builtin_types_compatible_p (ytype, typeof (y))            \
7915          && __builtin_types_compatible_p (ztype, typeof (z)))
7916
7917 #define __ch(x, y, z)   __builtin_choose_expr (x, y, z)
7918
7919 #define vec_step(t) \
7920   __ch (__builtin_types_compatible_p (typeof (t), vector signed int), 4,      \
7921   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned int), 4,    \
7922   __ch (__builtin_types_compatible_p (typeof (t), vector bool int), 4,        \
7923   __ch (__builtin_types_compatible_p (typeof (t), vector signed short), 8,    \
7924   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned short), 8,  \
7925   __ch (__builtin_types_compatible_p (typeof (t), vector bool short), 8,      \
7926   __ch (__builtin_types_compatible_p (typeof (t), vector pixel), 8,           \
7927   __ch (__builtin_types_compatible_p (typeof (t), vector signed char), 16,    \
7928   __ch (__builtin_types_compatible_p (typeof (t), vector unsigned char), 16,  \
7929   __ch (__builtin_types_compatible_p (typeof (t), vector bool char), 16,      \
7930   __ch (__builtin_types_compatible_p (typeof (t), vector float), 4,           \
7931   __builtin_altivec_compiletime_error ("vec_step"))))))))))))
7932
7933 #define vec_abs(a) \
7934   __ch (__un_args_eq (vector signed char, (a)), \
7935         ((vector signed char) __builtin_altivec_abs_v16qi ((vector signed char) (a))), \
7936   __ch (__un_args_eq (vector signed short, (a)), \
7937         ((vector signed short) __builtin_altivec_abs_v8hi ((vector signed short) (a))), \
7938   __ch (__un_args_eq (vector signed int, (a)), \
7939         ((vector signed int) __builtin_altivec_abs_v4si ((vector signed int) (a))), \
7940   __ch (__un_args_eq (vector float, (a)), \
7941         ((vector float) __builtin_altivec_abs_v4sf ((vector float) (a))), \
7942   __builtin_altivec_compiletime_error ("vec_abs")))))
7943
7944 #define vec_abss(a) \
7945   __ch (__un_args_eq (vector signed char, (a)), \
7946         ((vector signed char) __builtin_altivec_abss_v16qi ((vector signed char) (a))), \
7947   __ch (__un_args_eq (vector signed short, (a)), \
7948         ((vector signed short) __builtin_altivec_abss_v8hi ((vector signed short) (a))), \
7949   __ch (__un_args_eq (vector signed int, (a)), \
7950         ((vector signed int) __builtin_altivec_abss_v4si ((vector signed int) (a))), \
7951   __builtin_altivec_compiletime_error ("vec_abss"))))
7952
7953 #define vec_vaddubm(a1, a2) \
7954 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
7955       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7956 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
7957       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7958 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
7959       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7960 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
7961       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7962   __builtin_altivec_compiletime_error ("vec_vaddubm")))))
7963
7964 #define vec_vadduhm(a1, a2) \
7965 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
7966       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
7967 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
7968       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
7969 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
7970       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
7971 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
7972       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
7973   __builtin_altivec_compiletime_error ("vec_vadduhm")))))
7974
7975 #define vec_vadduwm(a1, a2) \
7976 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
7977       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
7978 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
7979       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
7980 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
7981       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
7982 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
7983       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
7984   __builtin_altivec_compiletime_error ("vec_vadduwm")))))
7985
7986 #define vec_vaddfp(a1, a2) \
7987 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
7988       ((vector float) __builtin_altivec_vaddfp ((vector float) (a1), (vector float) (a2))), \
7989   __builtin_altivec_compiletime_error ("vec_vaddfp"))
7990
7991 #define vec_add(a1, a2) \
7992 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
7993       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7994 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
7995       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7996 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
7997       ((vector signed char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
7998 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
7999       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8000 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8001       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8002 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8003       ((vector unsigned char) __builtin_altivec_vaddubm ((vector signed char) (a1), (vector signed char) (a2))), \
8004 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8005       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8006 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8007       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8008 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8009       ((vector signed short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8010 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8011       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8012 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8013       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8014 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8015       ((vector unsigned short) __builtin_altivec_vadduhm ((vector signed short) (a1), (vector signed short) (a2))), \
8016 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8017       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8018 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8019       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8020 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8021       ((vector signed int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8022 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8023       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8024 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8025       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8026 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8027       ((vector unsigned int) __builtin_altivec_vadduwm ((vector signed int) (a1), (vector signed int) (a2))), \
8028 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8029       ((vector float) __builtin_altivec_vaddfp ((vector float) (a1), (vector float) (a2))), \
8030     __builtin_altivec_compiletime_error ("vec_add"))))))))))))))))))))
8031
8032 #define vec_addc(a1, a2) \
8033 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8034       ((vector unsigned int) __builtin_altivec_vaddcuw ((vector signed int) (a1), (vector signed int) (a2))), \
8035     __builtin_altivec_compiletime_error ("vec_addc"))
8036
8037 #define vec_adds(a1, a2) \
8038 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8039       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8040 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8041       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8042 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8043       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8044 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8045       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8046 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8047       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8048 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8049       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8050 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8051       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8052 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8053       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8054 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8055       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8056 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8057       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8058 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8059       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8060 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8061       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8062 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8063       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8064 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8065       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8066 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8067       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8068 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8069       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8070 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8071       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8072 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8073       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8074     __builtin_altivec_compiletime_error ("vec_adds")))))))))))))))))))
8075
8076 #define vec_vaddsws(a1, a2) \
8077 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8078       ((vector signed int) __builtin_altivec_vaddsws ((vector signed int) (a1), (vector signed int) (a2))), \
8079   __builtin_altivec_compiletime_error ("vec_vaddsws"))
8080
8081 #define vec_vadduws(a1, a2) \
8082 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
8083       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8084 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
8085       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8086 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8087       ((vector unsigned int) __builtin_altivec_vadduws ((vector signed int) (a1), (vector signed int) (a2))), \
8088   __builtin_altivec_compiletime_error ("vec_vadduws"))))
8089
8090 #define vec_vaddshs(a1, a2) \
8091 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8092       ((vector signed short) __builtin_altivec_vaddshs ((vector signed short) (a1), (vector signed short) (a2))), \
8093   __builtin_altivec_compiletime_error ("vec_vaddshs"))
8094
8095 #define vec_vadduhs(a1, a2) \
8096 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
8097       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8098 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
8099       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8100 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8101       ((vector unsigned short) __builtin_altivec_vadduhs ((vector signed short) (a1), (vector signed short) (a2))), \
8102   __builtin_altivec_compiletime_error ("vec_vadduhs"))))
8103
8104 #define vec_vaddsbs(a1, a2) \
8105 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8106       ((vector signed char) __builtin_altivec_vaddsbs ((vector signed char) (a1), (vector signed char) (a2))), \
8107   __builtin_altivec_compiletime_error ("vec_vaddsbs"))
8108
8109 #define vec_vaddubs(a1, a2) \
8110 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
8111       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8112 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
8113       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8114 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8115       ((vector unsigned char) __builtin_altivec_vaddubs ((vector signed char) (a1), (vector signed char) (a2))), \
8116   __builtin_altivec_compiletime_error ("vec_vaddubs"))))
8117
8118 #define vec_and(a1, a2) \
8119 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8120       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8121 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
8122       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8123 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
8124       ((vector float) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8125 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8126       ((vector bool int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8127 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8128       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8129 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8130       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8131 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8132       ((vector signed int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8133 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8134       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8135 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8136       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8137 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8138       ((vector unsigned int) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8139 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8140       ((vector bool short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8141 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8142       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8143 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8144       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8145 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8146       ((vector signed short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8147 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8148       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8149 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8150       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8151 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8152       ((vector unsigned short) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8153 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8154       ((vector bool char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8155 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8156       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8157 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8158       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8159 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8160       ((vector signed char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8161 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8162       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8163 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8164       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8165 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8166       ((vector unsigned char) __builtin_altivec_vand ((vector signed int) (a1), (vector signed int) (a2))), \
8167     __builtin_altivec_compiletime_error ("vec_and")))))))))))))))))))))))))
8168
8169 #define vec_andc(a1, a2) \
8170 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8171       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8172 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
8173       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8174 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
8175       ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8176 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8177       ((vector bool int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8178 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8179       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8180 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8181       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8182 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8183       ((vector signed int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8184 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8185       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8186 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8187       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8188 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8189       ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8190 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8191       ((vector bool short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8192 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8193       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8194 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8195       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8196 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8197       ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8198 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8199       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8200 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8201       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8202 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8203       ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8204 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8205       ((vector bool char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8206 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8207       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8208 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8209       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8210 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8211       ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8212 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8213       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8214 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8215       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8216 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8217       ((vector unsigned char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \
8218     __builtin_altivec_compiletime_error ("vec_andc")))))))))))))))))))))))))
8219
8220 #define vec_avg(a1, a2) \
8221 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8222       ((vector unsigned char) __builtin_altivec_vavgub ((vector signed char) (a1), (vector signed char) (a2))), \
8223 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8224       ((vector signed char) __builtin_altivec_vavgsb ((vector signed char) (a1), (vector signed char) (a2))), \
8225 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8226       ((vector unsigned short) __builtin_altivec_vavguh ((vector signed short) (a1), (vector signed short) (a2))), \
8227 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8228       ((vector signed short) __builtin_altivec_vavgsh ((vector signed short) (a1), (vector signed short) (a2))), \
8229 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8230       ((vector unsigned int) __builtin_altivec_vavguw ((vector signed int) (a1), (vector signed int) (a2))), \
8231 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8232       ((vector signed int) __builtin_altivec_vavgsw ((vector signed int) (a1), (vector signed int) (a2))), \
8233     __builtin_altivec_compiletime_error ("vec_avg")))))))
8234
8235 #define vec_vavgsw(a1, a2) \
8236 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8237       ((vector signed int) __builtin_altivec_vavgsw ((vector signed int) (a1), (vector signed int) (a2))), \
8238   __builtin_altivec_compiletime_error ("vec_vavgsw"))
8239
8240 #define vec_vavguw(a1, a2) \
8241 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8242       ((vector unsigned int) __builtin_altivec_vavguw ((vector signed int) (a1), (vector signed int) (a2))), \
8243   __builtin_altivec_compiletime_error ("vec_vavguw"))
8244
8245 #define vec_vavgsh(a1, a2) \
8246 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8247       ((vector signed short) __builtin_altivec_vavgsh ((vector signed short) (a1), (vector signed short) (a2))), \
8248   __builtin_altivec_compiletime_error ("vec_vavgsh"))
8249
8250 #define vec_vavguh(a1, a2) \
8251 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8252       ((vector unsigned short) __builtin_altivec_vavguh ((vector signed short) (a1), (vector signed short) (a2))), \
8253   __builtin_altivec_compiletime_error ("vec_vavguh"))
8254
8255 #define vec_vavgsb(a1, a2) \
8256 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8257       ((vector signed char) __builtin_altivec_vavgsb ((vector signed char) (a1), (vector signed char) (a2))), \
8258   __builtin_altivec_compiletime_error ("vec_vavgsb"))
8259
8260 #define vec_vavgub(a1, a2) \
8261 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8262       ((vector unsigned char) __builtin_altivec_vavgub ((vector signed char) (a1), (vector signed char) (a2))), \
8263   __builtin_altivec_compiletime_error ("vec_vavgub"))
8264
8265 #define vec_ceil(a1) \
8266 __ch (__un_args_eq (vector float, (a1)), \
8267       ((vector float) __builtin_altivec_vrfip ((vector float) (a1))), \
8268   __builtin_altivec_compiletime_error ("vec_ceil"))
8269
8270 #define vec_cmpb(a1, a2) \
8271 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8272       ((vector signed int) __builtin_altivec_vcmpbfp ((vector float) (a1), (vector float) (a2))), \
8273   __builtin_altivec_compiletime_error ("vec_cmpb"))
8274
8275 #define vec_cmpeq(a1, a2) \
8276 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8277       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8278 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8279       ((vector bool char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8280 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8281       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8282 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8283       ((vector bool short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8284 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8285       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8286 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8287       ((vector bool int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8288 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8289       ((vector bool int) __builtin_altivec_vcmpeqfp ((vector float) (a1), (vector float) (a2))), \
8290     __builtin_altivec_compiletime_error ("vec_cmpeq"))))))))
8291
8292 #define vec_vcmpeqfp(a1, a2) \
8293 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8294       ((vector signed int) __builtin_altivec_vcmpeqfp ((vector float) (a1), (vector float) (a2))), \
8295   __builtin_altivec_compiletime_error ("vec_vcmpeqfp"))
8296
8297 #define vec_vcmpequw(a1, a2) \
8298 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8299       ((vector signed int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8300 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8301       ((vector signed int) __builtin_altivec_vcmpequw ((vector signed int) (a1), (vector signed int) (a2))), \
8302   __builtin_altivec_compiletime_error ("vec_vcmpequw")))
8303
8304 #define vec_vcmpequh(a1, a2) \
8305 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8306       ((vector signed short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8307 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8308       ((vector signed short) __builtin_altivec_vcmpequh ((vector signed short) (a1), (vector signed short) (a2))), \
8309   __builtin_altivec_compiletime_error ("vec_vcmpequh")))
8310
8311 #define vec_vcmpequb(a1, a2) \
8312 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8313       ((vector signed char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8314 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8315       ((vector signed char) __builtin_altivec_vcmpequb ((vector signed char) (a1), (vector signed char) (a2))), \
8316   __builtin_altivec_compiletime_error ("vec_vcmpequb")))
8317
8318 #define vec_cmpge(a1, a2) \
8319 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8320       ((vector bool int) __builtin_altivec_vcmpgefp ((vector float) (a1), (vector float) (a2))), \
8321   __builtin_altivec_compiletime_error ("vec_cmpge"))
8322
8323 #define vec_cmpgt(a1, a2) \
8324 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8325       ((vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8326 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8327       ((vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8328 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8329       ((vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8330 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8331       ((vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8332 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8333       ((vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8334 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8335       ((vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8336 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8337       ((vector bool int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8338     __builtin_altivec_compiletime_error ("vec_cmpgt"))))))))
8339
8340 #define vec_vcmpgtfp(a1, a2) \
8341 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8342       ((vector signed int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8343   __builtin_altivec_compiletime_error ("vec_vcmpgtfp"))
8344
8345 #define vec_vcmpgtsw(a1, a2) \
8346 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8347       ((vector signed int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8348   __builtin_altivec_compiletime_error ("vec_abs"))
8349
8350 #define vec_vcmpgtuw(a1, a2) \
8351 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8352       ((vector signed int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8353   __builtin_altivec_compiletime_error ("vec_abs"))
8354
8355 #define vec_vcmpgtsh(a1, a2) \
8356 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8357       ((vector signed short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8358   __builtin_altivec_compiletime_error ("vec_vcmpgtsh"))
8359
8360 #define vec_vcmpgtuh(a1, a2) \
8361 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8362       ((vector signed short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8363   __builtin_altivec_compiletime_error ("vec_vcmpgtuh"))
8364
8365 #define vec_vcmpgtsb(a1, a2) \
8366 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8367       ((vector signed char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8368   __builtin_altivec_compiletime_error ("vec_vcmpgtsb"))
8369
8370 #define vec_vcmpgtub(a1, a2) \
8371 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8372       ((vector signed char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8373   __builtin_altivec_compiletime_error ("vec_vcmpgtub"))
8374
8375 #define vec_cmple(a1, a2) \
8376 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8377       ((vector bool int) __builtin_altivec_vcmpgefp ((vector float) (a2), (vector float) (a1))), \
8378   __builtin_altivec_compiletime_error ("vec_cmple"))
8379
8380 #define vec_cmplt(a2, a1) \
8381 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8382       ((vector bool char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
8383 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8384       ((vector bool char) __builtin_altivec_vcmpgtsb ((vector signed char) (a1), (vector signed char) (a2))), \
8385 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8386       ((vector bool short) __builtin_altivec_vcmpgtuh ((vector signed short) (a1), (vector signed short) (a2))), \
8387 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8388       ((vector bool short) __builtin_altivec_vcmpgtsh ((vector signed short) (a1), (vector signed short) (a2))), \
8389 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8390       ((vector bool int) __builtin_altivec_vcmpgtuw ((vector signed int) (a1), (vector signed int) (a2))), \
8391 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8392       ((vector bool int) __builtin_altivec_vcmpgtsw ((vector signed int) (a1), (vector signed int) (a2))), \
8393 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8394       ((vector bool int) __builtin_altivec_vcmpgtfp ((vector float) (a1), (vector float) (a2))), \
8395     __builtin_altivec_compiletime_error ("vec_cmplt"))))))))
8396
8397 #define vec_ctf(a1, a2) \
8398 __ch (__un_args_eq (vector unsigned int, (a1)), \
8399       ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const int) (a2))), \
8400 __ch (__un_args_eq (vector signed int, (a1)), \
8401       ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const int) (a2))), \
8402     __builtin_altivec_compiletime_error ("vec_ctf")))
8403
8404 #define vec_vcfsx(a1, a2) \
8405 __ch (__un_args_eq (vector signed int, (a1)), \
8406       ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const int) (a2))), \
8407   __builtin_altivec_compiletime_error ("vec_vcfsx"))
8408
8409 #define vec_vcfux(a1, a2) \
8410 __ch (__un_args_eq (vector unsigned int, (a1)), \
8411       ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const int) (a2))), \
8412   __builtin_altivec_compiletime_error ("vec_vcfux"))
8413
8414 #define vec_cts(a1, a2) \
8415 __ch (__un_args_eq (vector float, (a1)), \
8416       ((vector signed int) __builtin_altivec_vctsxs ((vector float) (a1), (const int) (a2))), \
8417     __builtin_altivec_compiletime_error ("vec_cts"))
8418
8419 #define vec_ctu(a1, a2) \
8420 __ch (__un_args_eq (vector float, (a1)), \
8421       ((vector unsigned int) __builtin_altivec_vctuxs ((vector float) (a1), (const int) (a2))), \
8422     __builtin_altivec_compiletime_error ("vec_ctu"))
8423
8424 #define vec_dss(a1) __builtin_altivec_dss ((const int) (a1));
8425
8426 #define vec_dssall() __builtin_altivec_dssall ()
8427
8428 #define vec_dst(a1, a2, a3) \
8429 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8430       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8431 __ch (__un_args_eq (const vector signed char, *(a1)), \
8432       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8433 __ch (__un_args_eq (const vector bool char, *(a1)), \
8434       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8435 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8436       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8437 __ch (__un_args_eq (const vector signed short, *(a1)), \
8438       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8439 __ch (__un_args_eq (const vector bool short, *(a1)), \
8440       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8441 __ch (__un_args_eq (const vector pixel, *(a1)), \
8442       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8443 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8444       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8445 __ch (__un_args_eq (const vector signed int, *(a1)), \
8446       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8447 __ch (__un_args_eq (const vector bool int, *(a1)), \
8448       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8449 __ch (__un_args_eq (const vector float, *(a1)), \
8450       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8451 __ch (__un_args_eq (const unsigned char, *(a1)), \
8452       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8453 __ch (__un_args_eq (const signed char, *(a1)), \
8454       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8455 __ch (__un_args_eq (const unsigned short, *(a1)), \
8456       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8457 __ch (__un_args_eq (const short, *(a1)), \
8458       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8459 __ch (__un_args_eq (const unsigned int, *(a1)), \
8460       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8461 __ch (__un_args_eq (const int, *(a1)), \
8462       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8463 __ch (__un_args_eq (const unsigned long, *(a1)), \
8464       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8465 __ch (__un_args_eq (const long, *(a1)), \
8466       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8467 __ch (__un_args_eq (const float, *(a1)), \
8468       __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \
8469   __builtin_altivec_compiletime_error ("vec_dst")))))))))))))))))))))
8470
8471 #define vec_dstst(a1, a2, a3) \
8472 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8473       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8474 __ch (__un_args_eq (const vector signed char, *(a1)), \
8475       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8476 __ch (__un_args_eq (const vector bool char, *(a1)), \
8477       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8478 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8479       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8480 __ch (__un_args_eq (const vector signed short, *(a1)), \
8481       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8482 __ch (__un_args_eq (const vector bool short, *(a1)), \
8483       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8484 __ch (__un_args_eq (const vector pixel, *(a1)), \
8485       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8486 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8487       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8488 __ch (__un_args_eq (const vector signed int, *(a1)), \
8489       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8490 __ch (__un_args_eq (const vector bool int, *(a1)), \
8491       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8492 __ch (__un_args_eq (const vector float, *(a1)), \
8493       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8494 __ch (__un_args_eq (const unsigned char, *(a1)), \
8495       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8496 __ch (__un_args_eq (const signed char, *(a1)), \
8497       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8498 __ch (__un_args_eq (const unsigned short, *(a1)), \
8499       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8500 __ch (__un_args_eq (const short, *(a1)), \
8501       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8502 __ch (__un_args_eq (const unsigned int, *(a1)), \
8503       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8504 __ch (__un_args_eq (const int, *(a1)), \
8505       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8506 __ch (__un_args_eq (const unsigned long, *(a1)), \
8507       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8508 __ch (__un_args_eq (const long, *(a1)), \
8509       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8510 __ch (__un_args_eq (const float, *(a1)), \
8511       __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \
8512   __builtin_altivec_compiletime_error ("vec_dstst")))))))))))))))))))))
8513
8514 #define vec_dststt(a1, a2, a3) \
8515 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8516       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8517 __ch (__un_args_eq (const vector signed char, *(a1)), \
8518       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8519 __ch (__un_args_eq (const vector bool char, *(a1)), \
8520       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8521 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8522       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8523 __ch (__un_args_eq (const vector signed short, *(a1)), \
8524       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8525 __ch (__un_args_eq (const vector bool short, *(a1)), \
8526       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8527 __ch (__un_args_eq (const vector pixel, *(a1)), \
8528       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8529 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8530       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8531 __ch (__un_args_eq (const vector signed int, *(a1)), \
8532       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8533 __ch (__un_args_eq (const vector bool int, *(a1)), \
8534       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8535 __ch (__un_args_eq (const vector float, *(a1)), \
8536       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8537 __ch (__un_args_eq (const unsigned char, *(a1)), \
8538       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8539 __ch (__un_args_eq (const signed char, *(a1)), \
8540       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8541 __ch (__un_args_eq (const unsigned short, *(a1)), \
8542       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8543 __ch (__un_args_eq (const short, *(a1)), \
8544       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8545 __ch (__un_args_eq (const unsigned int, *(a1)), \
8546       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8547 __ch (__un_args_eq (const int, *(a1)), \
8548       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8549 __ch (__un_args_eq (const unsigned long, *(a1)), \
8550       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8551 __ch (__un_args_eq (const long, *(a1)), \
8552       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8553 __ch (__un_args_eq (const float, *(a1)), \
8554       __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \
8555   __builtin_altivec_compiletime_error ("vec_dststt")))))))))))))))))))))
8556
8557 #define vec_dstt(a1, a2, a3) \
8558 __ch (__un_args_eq (const vector unsigned char, *(a1)), \
8559       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8560 __ch (__un_args_eq (const vector signed char, *(a1)), \
8561       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8562 __ch (__un_args_eq (const vector bool char, *(a1)), \
8563       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8564 __ch (__un_args_eq (const vector unsigned short, *(a1)), \
8565       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8566 __ch (__un_args_eq (const vector signed short, *(a1)), \
8567       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8568 __ch (__un_args_eq (const vector bool short, *(a1)), \
8569       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8570 __ch (__un_args_eq (const vector pixel, *(a1)), \
8571       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8572 __ch (__un_args_eq (const vector unsigned int, *(a1)), \
8573       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8574 __ch (__un_args_eq (const vector signed int, *(a1)), \
8575       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8576 __ch (__un_args_eq (const vector bool int, *(a1)), \
8577       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8578 __ch (__un_args_eq (const vector float, *(a1)), \
8579       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8580 __ch (__un_args_eq (const unsigned char, *(a1)), \
8581       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8582 __ch (__un_args_eq (const signed char, *(a1)), \
8583       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8584 __ch (__un_args_eq (const unsigned short, *(a1)), \
8585       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8586 __ch (__un_args_eq (const short, *(a1)), \
8587       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8588 __ch (__un_args_eq (const unsigned int, *(a1)), \
8589       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8590 __ch (__un_args_eq (const int, *(a1)), \
8591       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8592 __ch (__un_args_eq (const unsigned long, *(a1)), \
8593       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8594 __ch (__un_args_eq (const long, *(a1)), \
8595       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8596 __ch (__un_args_eq (const float, *(a1)), \
8597       __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \
8598   __builtin_altivec_compiletime_error ("vec_dstt")))))))))))))))))))))
8599
8600 #define vec_expte(a1) \
8601 __ch (__un_args_eq (vector float, (a1)), \
8602       ((vector float) __builtin_altivec_vexptefp ((vector float) (a1))), \
8603   __builtin_altivec_compiletime_error ("vec_expte"))
8604
8605 #define vec_floor(a1) \
8606 __ch (__un_args_eq (vector float, (a1)), \
8607       ((vector float) __builtin_altivec_vrfim ((vector float) (a1))), \
8608   __builtin_altivec_compiletime_error ("vec_floor"))
8609
8610 #define vec_ld(a, b) \
8611 __ch (__un_args_eq (const vector unsigned char, *(b)), \
8612       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
8613 __ch (__un_args_eq (const unsigned char, *(b)), \
8614       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
8615 __ch (__un_args_eq (const vector signed char, *(b)), \
8616       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
8617 __ch (__un_args_eq (const signed char, *(b)), \
8618       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
8619 __ch (__un_args_eq (const vector bool char, *(b)), \
8620       ((vector bool char) __builtin_altivec_lvx ((a), (b))), \
8621 __ch (__un_args_eq (const vector unsigned short, *(b)), \
8622       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
8623 __ch (__un_args_eq (const unsigned short, *(b)), \
8624       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
8625 __ch (__un_args_eq (const vector signed short, *(b)), \
8626       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
8627 __ch (__un_args_eq (const short, *(b)), \
8628       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
8629 __ch (__un_args_eq (const vector bool short, *(b)), \
8630       ((vector bool short) __builtin_altivec_lvx ((a), (b))), \
8631 __ch (__un_args_eq (const vector pixel, *(b)), \
8632       ((vector pixel) __builtin_altivec_lvx ((a), (b))), \
8633 __ch (__un_args_eq (const vector unsigned int, *(b)), \
8634       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
8635 __ch (__un_args_eq (const unsigned int, *(b)), \
8636       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
8637 __ch (__un_args_eq (const unsigned long, *(b)), \
8638       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
8639 __ch (__un_args_eq (const vector signed int, *(b)), \
8640       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
8641 __ch (__un_args_eq (const int, *(b)), \
8642       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
8643 __ch (__un_args_eq (const long, *(b)), \
8644       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
8645 __ch (__un_args_eq (const vector bool int, *(b)), \
8646       ((vector bool int) __builtin_altivec_lvx ((a), (b))), \
8647 __ch (__un_args_eq (const vector float, *(b)), \
8648       ((vector float) __builtin_altivec_lvx ((a), (b))), \
8649 __ch (__un_args_eq (const float, *(b)), \
8650       ((vector float) __builtin_altivec_lvx ((a), (b))), \
8651 __builtin_altivec_compiletime_error ("vec_ld")))))))))))))))))))))
8652
8653 #define vec_lde(a, b) \
8654 __ch (__un_args_eq (const unsigned char, *(b)), \
8655       ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
8656 __ch (__un_args_eq (const signed char, *(b)), \
8657       ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
8658 __ch (__un_args_eq (const unsigned short, *(b)), \
8659       ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
8660 __ch (__un_args_eq (const short, *(b)), \
8661       ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
8662 __ch (__un_args_eq (const unsigned long, *(b)), \
8663       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
8664 __ch (__un_args_eq (const long, *(b)), \
8665       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
8666 __ch (__un_args_eq (const unsigned int, *(b)), \
8667       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
8668 __ch (__un_args_eq (const int, *(b)), \
8669       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
8670 __ch (__un_args_eq (const float, *(b)), \
8671       ((vector float) __builtin_altivec_lvewx ((a), (b))), \
8672 __builtin_altivec_compiletime_error ("vec_lde"))))))))))
8673
8674 #define vec_lvewx(a, b) \
8675 __ch (__un_args_eq (unsigned int, *(b)), \
8676       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
8677 __ch (__un_args_eq (signed int, *(b)), \
8678       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
8679 __ch (__un_args_eq (unsigned long, *(b)), \
8680       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
8681 __ch (__un_args_eq (signed long, *(b)), \
8682       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
8683 __ch (__un_args_eq (float, *(b)), \
8684       ((vector float) __builtin_altivec_lvewx ((a), (b))), \
8685 __builtin_altivec_compiletime_error ("vec_lvewx"))))))
8686
8687 #define vec_lvehx(a, b) \
8688 __ch (__un_args_eq (unsigned short, *(b)), \
8689       ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
8690 __ch (__un_args_eq (signed short, *(b)), \
8691       ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
8692 __builtin_altivec_compiletime_error ("vec_lvehx")))
8693
8694 #define vec_lvebx(a, b) \
8695 __ch (__un_args_eq (unsigned char, *(b)), \
8696       ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
8697 __ch (__un_args_eq (signed char, *(b)), \
8698       ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
8699 __builtin_altivec_compiletime_error ("vec_lvebx")))
8700
8701 #define vec_ldl(a, b) \
8702 __ch (__un_args_eq (const vector unsigned char, *(b)), \
8703       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
8704 __ch (__un_args_eq (const unsigned char, *(b)), \
8705       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
8706 __ch (__un_args_eq (const vector signed char, *(b)), \
8707       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
8708 __ch (__un_args_eq (const signed char, *(b)), \
8709       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
8710 __ch (__un_args_eq (const vector bool char, *(b)), \
8711       ((vector bool char) __builtin_altivec_lvxl ((a), (b))), \
8712 __ch (__un_args_eq (const vector unsigned short, *(b)), \
8713       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
8714 __ch (__un_args_eq (const unsigned short, *(b)), \
8715       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
8716 __ch (__un_args_eq (const vector signed short, *(b)), \
8717       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
8718 __ch (__un_args_eq (const short, *(b)), \
8719       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
8720 __ch (__un_args_eq (const vector bool short, *(b)), \
8721       ((vector bool short) __builtin_altivec_lvxl ((a), (b))), \
8722 __ch (__un_args_eq (const vector pixel, *(b)), \
8723       ((vector pixel) __builtin_altivec_lvxl ((a), (b))), \
8724 __ch (__un_args_eq (const vector unsigned int, *(b)), \
8725       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
8726 __ch (__un_args_eq (const unsigned int, *(b)), \
8727       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
8728 __ch (__un_args_eq (const unsigned long, *(b)), \
8729       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
8730 __ch (__un_args_eq (const vector signed int, *(b)), \
8731       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
8732 __ch (__un_args_eq (const int, *(b)), \
8733       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
8734 __ch (__un_args_eq (const long, *(b)), \
8735       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
8736 __ch (__un_args_eq (const vector bool int, *(b)), \
8737       ((vector bool int) __builtin_altivec_lvxl ((a), (b))), \
8738 __ch (__un_args_eq (const vector float, *(b)), \
8739       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
8740 __ch (__un_args_eq (const float, *(b)), \
8741       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
8742 __builtin_altivec_compiletime_error ("vec_ldl")))))))))))))))))))))
8743
8744 #define vec_loge(a1) \
8745 __ch (__un_args_eq (vector float, (a1)), \
8746       ((vector float) __builtin_altivec_vlogefp ((vector float) (a1))), \
8747   __builtin_altivec_compiletime_error ("vec_loge"))
8748
8749 #define vec_lvsl(a1, a2) \
8750 __ch (__un_args_eq (const volatile unsigned char, *(a2)), \
8751       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8752 __ch (__un_args_eq (const volatile signed char, *(a2)), \
8753       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8754 __ch (__un_args_eq (const volatile unsigned short, *(a2)), \
8755       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8756 __ch (__un_args_eq (const volatile signed short, *(a2)), \
8757       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8758 __ch (__un_args_eq (const volatile unsigned int, *(a2)), \
8759       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8760 __ch (__un_args_eq (const volatile signed int, *(a2)), \
8761       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8762 __ch (__un_args_eq (const volatile unsigned long, *(a2)), \
8763       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8764 __ch (__un_args_eq (const volatile signed long, *(a2)), \
8765       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8766 __ch (__un_args_eq (const volatile float, *(a2)), \
8767       ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \
8768 __builtin_altivec_compiletime_error ("vec_lvsl"))))))))))
8769
8770 #define vec_lvsr(a1, a2) \
8771 __ch (__un_args_eq (const volatile unsigned char, *(a2)), \
8772       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8773 __ch (__un_args_eq (const volatile signed char, *(a2)), \
8774       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8775 __ch (__un_args_eq (const volatile unsigned short, *(a2)), \
8776       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8777 __ch (__un_args_eq (const volatile signed short, *(a2)), \
8778       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8779 __ch (__un_args_eq (const volatile unsigned int, *(a2)), \
8780       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8781 __ch (__un_args_eq (const volatile signed int, *(a2)), \
8782       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8783 __ch (__un_args_eq (const volatile unsigned long, *(a2)), \
8784       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8785 __ch (__un_args_eq (const volatile signed long, *(a2)), \
8786       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8787 __ch (__un_args_eq (const volatile float, *(a2)), \
8788       ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \
8789 __builtin_altivec_compiletime_error ("vec_lvsr"))))))))))
8790
8791 #define vec_madd(a1, a2, a3) \
8792 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector float, (a3)), \
8793       ((vector float) __builtin_altivec_vmaddfp ((a1), (a2), (a3))), \
8794 __builtin_altivec_compiletime_error ("vec_madd"))
8795
8796 #define vec_madds(a1, a2, a3) \
8797 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
8798       ((vector signed short) __builtin_altivec_vmhaddshs ((a1), (a2), (a3))), \
8799 __builtin_altivec_compiletime_error ("vec_madds"))
8800
8801 #define vec_max(a1, a2) \
8802 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8803       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8804 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8805       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8806 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8807       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8808 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8809       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
8810 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8811       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
8812 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8813       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
8814 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
8815       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8816 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
8817       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8818 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8819       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8820 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
8821       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
8822 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
8823       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
8824 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8825       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
8826 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
8827       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8828 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
8829       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8830 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8831       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8832 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
8833       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
8834 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
8835       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
8836 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8837       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
8838 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8839       ((vector float) __builtin_altivec_vmaxfp ((vector float) (a1), (vector float) (a2))), \
8840     __builtin_altivec_compiletime_error ("vec_max"))))))))))))))))))))
8841
8842 #define vec_vmaxfp(a1, a2) \
8843 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8844       ((vector float) __builtin_altivec_vmaxfp ((vector float) (a1), (vector float) (a2))), \
8845 __builtin_altivec_compiletime_error ("vec_vmaxfp"))
8846
8847 #define vec_vmaxsw(a1, a2) \
8848 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8849       ((vector signed int) __builtin_altivec_vmaxsw ((vector signed int) (a1), (vector signed int) (a2))), \
8850 __builtin_altivec_compiletime_error ("vec_vmaxsw"))
8851
8852 #define vec_vmaxuw(a1, a2) \
8853 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
8854       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8855 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
8856       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8857 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8858       ((vector unsigned int) __builtin_altivec_vmaxuw ((vector signed int) (a1), (vector signed int) (a2))), \
8859 __builtin_altivec_compiletime_error ("vec_vmaxuw"))))
8860
8861 #define vec_vmaxsh(a1, a2) \
8862 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8863       ((vector signed short) __builtin_altivec_vmaxsh ((vector signed short) (a1), (vector signed short) (a2))), \
8864 __builtin_altivec_compiletime_error ("vec_vmaxsh"))
8865
8866 #define vec_vmaxuh(a1, a2) \
8867 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
8868       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8869 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
8870       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8871 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8872       ((vector unsigned short) __builtin_altivec_vmaxuh ((vector signed short) (a1), (vector signed short) (a2))), \
8873 __builtin_altivec_compiletime_error ("vec_vmaxuh"))))
8874
8875 #define vec_vmaxsb(a1, a2) \
8876 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8877       ((vector signed char) __builtin_altivec_vmaxsb ((vector signed char) (a1), (vector signed char) (a2))), \
8878 __builtin_altivec_compiletime_error ("vec_vmaxsb"))
8879
8880 #define vec_vmaxub(a1, a2) \
8881 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
8882       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8883 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
8884       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8885 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8886       ((vector unsigned char) __builtin_altivec_vmaxub ((vector signed char) (a1), (vector signed char) (a2))), \
8887 __builtin_altivec_compiletime_error ("vec_vmaxub"))))
8888
8889 #define vec_mergeh(a1, a2) \
8890 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8891       ((vector signed char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
8892 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8893       ((vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
8894 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8895       ((vector bool char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
8896 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8897       ((vector signed short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8898 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8899       ((vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8900 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8901       ((vector bool short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8902 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
8903       ((vector pixel) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8904 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8905       ((vector float) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8906 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8907       ((vector signed int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8908 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8909       ((vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8910 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8911       ((vector bool int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8912     __builtin_altivec_compiletime_error ("vec_mergeh"))))))))))))
8913
8914 #define vec_vmrghw(a1, a2) \
8915 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8916       ((vector float) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8917 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8918       ((vector signed int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8919 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8920       ((vector unsigned int) __builtin_altivec_vmrghw ((vector signed int) (a1), (vector signed int) (a2))), \
8921 __builtin_altivec_compiletime_error ("vec_vmrghw"))))
8922
8923 #define vec_vmrghh(a1, a2) \
8924 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8925       ((vector signed short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8926 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8927       ((vector unsigned short) __builtin_altivec_vmrghh ((vector signed short) (a1), (vector signed short) (a2))), \
8928 __builtin_altivec_compiletime_error ("vec_vmrghh")))
8929
8930 #define vec_vmrghb(a1, a2) \
8931 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8932       ((vector signed char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
8933 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8934       ((vector unsigned char) __builtin_altivec_vmrghb ((vector signed char) (a1), (vector signed char) (a2))), \
8935 __builtin_altivec_compiletime_error ("vec_vmrghb")))
8936
8937 #define vec_mergel(a1, a2) \
8938 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8939       ((vector signed char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
8940 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8941       ((vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
8942 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
8943       ((vector bool char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
8944 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8945       ((vector signed short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8946 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8947       ((vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8948 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
8949       ((vector bool short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8950 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
8951       ((vector pixel) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8952 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8953       ((vector float) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8954 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8955       ((vector signed int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8956 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8957       ((vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8958 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
8959       ((vector bool int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8960     __builtin_altivec_compiletime_error ("vec_mergel"))))))))))))
8961
8962 #define vec_vmrglw(a1, a2) \
8963 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
8964       ((vector float) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8965 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
8966       ((vector signed int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8967 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
8968       ((vector unsigned int) __builtin_altivec_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
8969 __builtin_altivec_compiletime_error ("vec_vmrglw"))))
8970
8971 #define vec_vmrglh(a1, a2) \
8972 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
8973       ((vector signed short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8974 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
8975       ((vector unsigned short) __builtin_altivec_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
8976 __builtin_altivec_compiletime_error ("vec_vmrglh")))
8977
8978 #define vec_vmrglb(a1, a2) \
8979 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8980       ((vector signed char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
8981 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8982       ((vector unsigned char) __builtin_altivec_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
8983 __builtin_altivec_compiletime_error ("vec_vmrglb")))
8984
8985 #define vec_mfvscr()  (((vector unsigned short) __builtin_altivec_mfvscr ()))
8986
8987 #define vec_min(a1, a2) \
8988 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
8989       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
8990 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
8991       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
8992 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
8993       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
8994 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
8995       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
8996 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
8997       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
8998 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
8999       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9000 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9001       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9002 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9003       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9004 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9005       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9006 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9007       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9008 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9009       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9010 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9011       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9012 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9013       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9014 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9015       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9016 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9017       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9018 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9019       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9020 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9021       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9022 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9023       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9024 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9025       ((vector float) __builtin_altivec_vminfp ((vector float) (a1), (vector float) (a2))), \
9026     __builtin_altivec_compiletime_error ("vec_min"))))))))))))))))))))
9027
9028 #define vec_vminfp(a1, a2) \
9029 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9030       ((vector float) __builtin_altivec_vminfp ((vector float) (a1), (vector float) (a2))), \
9031 __builtin_altivec_compiletime_error ("vec_vminfp"))
9032
9033 #define vec_vminsw(a1, a2) \
9034 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9035       ((vector signed int) __builtin_altivec_vminsw ((vector signed int) (a1), (vector signed int) (a2))), \
9036 __builtin_altivec_compiletime_error ("vec_vminsw"))
9037
9038 #define vec_vminuw(a1, a2) \
9039 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9040       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9041 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
9042       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9043 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9044       ((vector unsigned int) __builtin_altivec_vminuw ((vector signed int) (a1), (vector signed int) (a2))), \
9045 __builtin_altivec_compiletime_error ("vec_vminuw"))))
9046
9047 #define vec_vminsh(a1, a2) \
9048 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9049       ((vector signed short) __builtin_altivec_vminsh ((vector signed short) (a1), (vector signed short) (a2))), \
9050 __builtin_altivec_compiletime_error ("vec_vminsh"))
9051
9052 #define vec_vminuh(a1, a2) \
9053 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9054       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9055 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
9056       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9057 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9058       ((vector unsigned short) __builtin_altivec_vminuh ((vector signed short) (a1), (vector signed short) (a2))), \
9059 __builtin_altivec_compiletime_error ("vec_vminuh"))))
9060
9061 #define vec_vminsb(a1, a2) \
9062 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9063       ((vector signed char) __builtin_altivec_vminsb ((vector signed char) (a1), (vector signed char) (a2))), \
9064 __builtin_altivec_compiletime_error ("vec_abs"))
9065
9066 #define vec_vminub(a1, a2) \
9067 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9068       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9069 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
9070       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9071 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9072       ((vector unsigned char) __builtin_altivec_vminub ((vector signed char) (a1), (vector signed char) (a2))), \
9073 __builtin_altivec_compiletime_error ("vec_vminub"))))
9074
9075 #define vec_mladd(a1, a2, a3) \
9076 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9077       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9078 __ch (__tern_args_eq (vector signed short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9079       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9080 __ch (__tern_args_eq (vector unsigned short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9081       ((vector signed short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9082 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9083       ((vector unsigned short) __builtin_altivec_vmladduhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed short) (a3))), \
9084     __builtin_altivec_compiletime_error ("vec_mladd")))))
9085
9086 #define vec_mradds(a1, a2, a3) \
9087 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed short, (a3)), \
9088       ((vector signed short) __builtin_altivec_vmhraddshs ((a1), (a2), (a3))), \
9089 __builtin_altivec_compiletime_error ("vec_mradds"))
9090
9091 #define vec_msum(a1, a2, a3) \
9092 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned int, (a3)), \
9093       ((vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9094 __ch (__tern_args_eq (vector signed char, (a1), vector unsigned char, (a2), vector signed int, (a3)), \
9095       ((vector signed int) __builtin_altivec_vmsummbm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9096 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9097       ((vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9098 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9099       ((vector signed int) __builtin_altivec_vmsumshm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9100     __builtin_altivec_compiletime_error ("vec_msum")))))
9101
9102 #define vec_vmsumshm(a1, a2, a3) \
9103 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9104       ((vector signed int) __builtin_altivec_vmsumshm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9105 __builtin_altivec_compiletime_error ("vec_vmsumshm"))
9106
9107 #define vec_vmsumuhm(a1, a2, a3) \
9108 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9109       ((vector unsigned int) __builtin_altivec_vmsumuhm ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9110 __builtin_altivec_compiletime_error ("vec_vmsumuhm"))
9111
9112 #define vec_vmsummbm(a1, a2, a3) \
9113 __ch (__tern_args_eq (vector signed char, (a1), vector unsigned char, (a2), vector signed int, (a3)), \
9114       ((vector signed int) __builtin_altivec_vmsummbm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9115 __builtin_altivec_compiletime_error ("vec_abs"))
9116
9117 #define vec_vmsumubm(a1, a2, a3) \
9118 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned int, (a3)), \
9119       ((vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \
9120 __builtin_altivec_compiletime_error ("vec_vmsummbm"))
9121
9122 #define vec_msums(a1, a2, a3) \
9123 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9124       ((vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9125 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9126       ((vector signed int) __builtin_altivec_vmsumshs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9127     __builtin_altivec_compiletime_error ("vec_msums")))
9128
9129 #define vec_vmsumshs(a1, a2, a3) \
9130 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector signed int, (a3)), \
9131       ((vector signed int) __builtin_altivec_vmsumshs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9132 __builtin_altivec_compiletime_error ("vec_vmsumshs"))
9133
9134 #define vec_vmsumuhs(a1, a2, a3) \
9135 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned int, (a3)), \
9136       ((vector unsigned int) __builtin_altivec_vmsumuhs ((vector signed short) (a1), (vector signed short) (a2), (vector signed int) (a3))), \
9137 __builtin_altivec_compiletime_error ("vec_vmsumuhs"))
9138
9139 #define vec_mtvscr(a1) \
9140 __ch (__un_args_eq (vector signed int, (a1)), \
9141       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9142 __ch (__un_args_eq (vector unsigned int, (a1)), \
9143       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9144 __ch (__un_args_eq (vector bool int, (a1)), \
9145       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9146 __ch (__un_args_eq (vector signed short, (a1)), \
9147       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9148 __ch (__un_args_eq (vector unsigned short, (a1)), \
9149       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9150 __ch (__un_args_eq (vector bool short, (a1)), \
9151       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9152 __ch (__un_args_eq (vector pixel, (a1)), \
9153       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9154 __ch (__un_args_eq (vector signed char, (a1)), \
9155       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9156 __ch (__un_args_eq (vector unsigned char, (a1)), \
9157       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9158 __ch (__un_args_eq (vector bool char, (a1)), \
9159       __builtin_altivec_mtvscr ((vector signed int) (a1)), \
9160     __builtin_altivec_compiletime_error ("vec_mtvscr")))))))))))
9161
9162 #define vec_mule(a1, a2) \
9163 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9164       ((vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) (a1), (vector signed char) (a2))), \
9165 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9166       ((vector signed short) __builtin_altivec_vmulesb ((vector signed char) (a1), (vector signed char) (a2))), \
9167 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9168       ((vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) (a1), (vector signed short) (a2))), \
9169 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9170       ((vector signed int) __builtin_altivec_vmulesh ((vector signed short) (a1), (vector signed short) (a2))), \
9171     __builtin_altivec_compiletime_error ("vec_mule")))))
9172
9173 #define vec_vmulesh(a1, a2) \
9174 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9175       ((vector signed int) __builtin_altivec_vmulesh ((vector signed short) (a1), (vector signed short) (a2))), \
9176 __builtin_altivec_compiletime_error ("vec_vmulesh"))
9177
9178 #define vec_vmuleuh(a1, a2) \
9179 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9180       ((vector unsigned int) __builtin_altivec_vmuleuh ((vector signed short) (a1), (vector signed short) (a2))), \
9181 __builtin_altivec_compiletime_error ("vec_vmuleuh"))
9182
9183 #define vec_vmulesb(a1, a2) \
9184 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9185       ((vector signed short) __builtin_altivec_vmulesb ((vector signed char) (a1), (vector signed char) (a2))), \
9186 __builtin_altivec_compiletime_error ("vec_vmulesb"))
9187
9188 #define vec_vmuleub(a1, a2) \
9189 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9190       ((vector unsigned short) __builtin_altivec_vmuleub ((vector signed char) (a1), (vector signed char) (a2))), \
9191 __builtin_altivec_compiletime_error ("vec_vmuleub"))
9192
9193 #define vec_mulo(a1, a2) \
9194 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9195       ((vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) (a1), (vector signed char) (a2))), \
9196 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9197       ((vector signed short) __builtin_altivec_vmulosb ((vector signed char) (a1), (vector signed char) (a2))), \
9198 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9199       ((vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) (a1), (vector signed short) (a2))), \
9200 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9201       ((vector signed int) __builtin_altivec_vmulosh ((vector signed short) (a1), (vector signed short) (a2))), \
9202     __builtin_altivec_compiletime_error ("vec_mulo")))))
9203
9204 #define vec_vmulosh(a1, a2) \
9205 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9206       ((vector signed int) __builtin_altivec_vmulosh ((vector signed short) (a1), (vector signed short) (a2))), \
9207 __builtin_altivec_compiletime_error ("vec_vmulosh"))
9208
9209 #define vec_vmulouh(a1, a2) \
9210 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9211       ((vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) (a1), (vector signed short) (a2))), \
9212 __builtin_altivec_compiletime_error ("vec_vmulouh"))
9213
9214 #define vec_vmulosb(a1, a2) \
9215 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9216       ((vector signed short) __builtin_altivec_vmulosb ((vector signed char) (a1), (vector signed char) (a2))), \
9217 __builtin_altivec_compiletime_error ("vec_vmulosb"))
9218
9219 #define vec_vmuloub(a1, a2) \
9220 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9221       ((vector unsigned short) __builtin_altivec_vmuloub ((vector signed char) (a1), (vector signed char) (a2))), \
9222 __builtin_altivec_compiletime_error ("vec_vmuloub"))
9223
9224 #define vec_nmsub(a1, a2, a3) \
9225 __ch (__tern_args_eq (vector float, ((a1)), vector float, ((a2)) , vector float, ((a3))), \
9226       ((vector float) __builtin_altivec_vnmsubfp ((vector float) ((a1)), (vector float) ((a2)), (vector float)((a3)))), \
9227     __builtin_altivec_compiletime_error ("vec_nmsub"))
9228
9229 #define vec_nor(a1, a2) \
9230 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9231       ((vector float) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9232 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9233       ((vector signed int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9234 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9235       ((vector unsigned int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9236 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9237       ((vector bool int) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9238 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9239       ((vector signed short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9240 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9241       ((vector unsigned short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9242 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9243       ((vector bool short) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9244 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9245       ((vector signed char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9246 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9247       ((vector unsigned char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9248 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9249       ((vector bool char) __builtin_altivec_vnor ((vector signed int) (a1), (vector signed int) (a2))), \
9250     __builtin_altivec_compiletime_error ("vec_nor")))))))))))
9251
9252 #define vec_or(a1, a2) \
9253 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9254       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9255 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
9256       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9257 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
9258       ((vector float) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9259 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9260       ((vector bool int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9261 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
9262       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9263 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
9264       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9265 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9266       ((vector signed int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9267 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9268       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9269 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
9270       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9271 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9272       ((vector unsigned int) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9273 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9274       ((vector bool short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9275 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
9276       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9277 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
9278       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9279 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9280       ((vector signed short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9281 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9282       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9283 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
9284       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9285 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9286       ((vector unsigned short) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9287 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9288       ((vector bool char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9289 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
9290       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9291 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
9292       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9293 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9294       ((vector signed char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9295 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9296       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9297 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
9298       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9299 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9300       ((vector unsigned char) __builtin_altivec_vor ((vector signed int) (a1), (vector signed int) (a2))), \
9301     __builtin_altivec_compiletime_error ("vec_or")))))))))))))))))))))))))
9302
9303 #define vec_pack(a1, a2) \
9304 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9305       ((vector signed char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9306 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9307       ((vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9308 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9309       ((vector bool char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9310 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9311       ((vector signed short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9312 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9313       ((vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9314 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9315       ((vector bool short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9316     __builtin_altivec_compiletime_error ("vec_pack")))))))
9317
9318 #define vec_vpkuwum(a1, a2) \
9319 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9320       ((vector signed short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9321 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9322       ((vector unsigned short) __builtin_altivec_vpkuwum ((vector signed int) (a1), (vector signed int) (a2))), \
9323 __builtin_altivec_compiletime_error ("vec_vpkuwum")))
9324
9325 #define vec_vpkuhum(a1, a2) \
9326 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9327       ((vector signed char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9328 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9329       ((vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \
9330 __builtin_altivec_compiletime_error ("vec_vpkuhum")))
9331
9332 #define vec_packpx(a1, a2) \
9333 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9334   (vector pixel) __builtin_altivec_vpkpx ((vector signed int) (a1), (vector signed int) (a2)), \
9335 __builtin_altivec_compiletime_error ("vec_packpx"))
9336
9337 #define vec_packs(a1, a2) \
9338 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9339       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9340 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9341       ((vector signed char) __builtin_altivec_vpkshss ((vector signed short) (a1), (vector signed short) (a2))), \
9342 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9343       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9344 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9345       ((vector signed short) __builtin_altivec_vpkswss ((vector signed int) (a1), (vector signed int) (a2))), \
9346     __builtin_altivec_compiletime_error ("vec_packs")))))
9347
9348 #define vec_vpkswss(a1, a2) \
9349 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9350       ((vector signed short) __builtin_altivec_vpkswss ((vector signed int) (a1), (vector signed int) (a2))), \
9351 __builtin_altivec_compiletime_error ("vec_vpkswss"))
9352
9353 #define vec_vpkuwus(a1, a2) \
9354 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9355       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9356 __builtin_altivec_compiletime_error ("vec_vpkuwus"))
9357
9358 #define vec_vpkshss(a1, a2) \
9359 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9360       ((vector signed char) __builtin_altivec_vpkshss ((vector signed short) (a1), (vector signed short) (a2))), \
9361 __builtin_altivec_compiletime_error ("vec_vpkshss"))
9362
9363 #define vec_vpkuhus(a1, a2) \
9364 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9365       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9366 __builtin_altivec_compiletime_error ("vec_vpkuhus"))
9367
9368 #define vec_packsu(a1, a2) \
9369 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9370       ((vector unsigned char) __builtin_altivec_vpkuhus ((vector signed short) (a1), (vector signed short) (a2))), \
9371 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9372       ((vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) (a1), (vector signed short) (a2))), \
9373 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9374       ((vector unsigned short) __builtin_altivec_vpkuwus ((vector signed int) (a1), (vector signed int) (a2))), \
9375 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9376       ((vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) (a1), (vector signed int) (a2))), \
9377     __builtin_altivec_compiletime_error ("vec_packsu")))))
9378
9379 #define vec_vpkswus(a1, a2) \
9380 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9381       ((vector unsigned short) __builtin_altivec_vpkswus ((vector signed int) (a1), (vector signed int) (a2))), \
9382 __builtin_altivec_compiletime_error ("vec_vpkswus"))
9383
9384 #define vec_vpkshus(a1, a2) \
9385 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9386       ((vector unsigned char) __builtin_altivec_vpkshus ((vector signed short) (a1), (vector signed short) (a2))), \
9387 __builtin_altivec_compiletime_error ("vec_vpkshus"))
9388
9389 #define vec_perm(a1, a2, a3) \
9390 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector unsigned char, (a3)), \
9391       ((vector float) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9392 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector unsigned char, (a3)), \
9393       ((vector signed int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9394 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector unsigned char, (a3)), \
9395       ((vector unsigned int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9396 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector unsigned char, (a3)), \
9397       ((vector bool int) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9398 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector unsigned char, (a3)), \
9399       ((vector signed short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9400 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned char, (a3)), \
9401       ((vector unsigned short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9402 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector unsigned char, (a3)), \
9403       ((vector bool short) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9404 __ch (__tern_args_eq (vector pixel, (a1), vector pixel, (a2), vector unsigned char, (a3)), \
9405       ((vector pixel) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9406 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector unsigned char, (a3)), \
9407       ((vector signed char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9408 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned char, (a3)), \
9409       ((vector unsigned char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9410 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector unsigned char, (a3)), \
9411       ((vector bool char) __builtin_altivec_vperm_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed char) (a3))), \
9412     __builtin_altivec_compiletime_error ("vec_perm"))))))))))))
9413
9414 #define vec_re(a1) \
9415 __ch (__un_args_eq (vector float, (a1)), \
9416       ((vector float) __builtin_altivec_vrefp ((vector float) (a1))), \
9417 __builtin_altivec_compiletime_error ("vec_re"))
9418
9419 #define vec_rl(a1, a2) \
9420 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9421       ((vector signed char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9422 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9423       ((vector unsigned char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9424 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9425       ((vector signed short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9426 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9427       ((vector unsigned short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9428 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9429       ((vector signed int) __builtin_altivec_vrlw ((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_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9432     __builtin_altivec_compiletime_error ("vec_rl")))))))
9433
9434 #define vec_vrlw(a1, a2) \
9435 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9436       ((vector signed int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9437 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9438       ((vector unsigned int) __builtin_altivec_vrlw ((vector signed int) (a1), (vector signed int) (a2))), \
9439 __builtin_altivec_compiletime_error ("vec_vrlw")))
9440
9441 #define vec_vrlh(a1, a2) \
9442 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9443       ((vector signed short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9444 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9445       ((vector unsigned short) __builtin_altivec_vrlh ((vector signed short) (a1), (vector signed short) (a2))), \
9446 __builtin_altivec_compiletime_error ("vec_vrlh")))
9447
9448 #define vec_vrlb(a1, a2) \
9449 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9450       ((vector signed char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9451 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9452       ((vector unsigned char) __builtin_altivec_vrlb ((vector signed char) (a1), (vector signed char) (a2))), \
9453 __builtin_altivec_compiletime_error ("vec_vrlb")))
9454
9455 #define vec_round(a1) \
9456 __ch (__un_args_eq (vector float, (a1)), \
9457       ((vector float) __builtin_altivec_vrfin ((vector float) (a1))), \
9458 __builtin_altivec_compiletime_error ("vec_round"))
9459
9460 #define vec_rsqrte(a1) \
9461 __ch (__un_args_eq (vector float, (a1)), \
9462       ((vector float) __builtin_altivec_vrsqrtefp ((vector float) (a1))), \
9463 __builtin_altivec_compiletime_error ("vec_rsqrte"))
9464
9465 #define vec_sel(a1, a2, a3) \
9466 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector bool int, (a3)), \
9467       ((vector float) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9468 __ch (__tern_args_eq (vector float, (a1), vector float, (a2), vector unsigned int, (a3)), \
9469       ((vector float) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9470 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector bool int, (a3)), \
9471       ((vector bool int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9472 __ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), vector unsigned int, (a3)), \
9473       ((vector bool int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9474 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector bool int, (a3)), \
9475       ((vector signed int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9476 __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), vector unsigned int, (a3)), \
9477       ((vector signed int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9478 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector bool int, (a3)), \
9479       ((vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9480 __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), vector unsigned int, (a3)), \
9481       ((vector unsigned int) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9482 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector bool short, (a3)), \
9483       ((vector bool short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9484 __ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), vector unsigned short, (a3)), \
9485       ((vector bool short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9486 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector bool short, (a3)), \
9487       ((vector signed short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9488 __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), vector unsigned short, (a3)), \
9489       ((vector signed short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9490 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector bool short, (a3)), \
9491       ((vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9492 __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), vector unsigned short, (a3)), \
9493       ((vector unsigned short) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9494 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector bool char, (a3)), \
9495       ((vector bool char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9496 __ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), vector unsigned char, (a3)), \
9497       ((vector bool char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9498 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector bool char, (a3)), \
9499       ((vector signed char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9500 __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), vector unsigned char, (a3)), \
9501       ((vector signed char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9502 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector bool char, (a3)), \
9503       ((vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9504 __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned char, (a3)), \
9505       ((vector unsigned char) __builtin_altivec_vsel_4si ((vector signed int) (a1), (vector signed int) (a2), (vector signed int) (a3))), \
9506     __builtin_altivec_compiletime_error ("vec_sel")))))))))))))))))))))
9507
9508 #define vec_sl(a1, a2) \
9509 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9510       ((vector signed char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9511 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9512       ((vector unsigned char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9513 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9514       ((vector signed short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9515 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9516       ((vector unsigned short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9517 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9518       ((vector signed int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9519 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9520       ((vector unsigned int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9521     __builtin_altivec_compiletime_error ("vec_sl")))))))
9522
9523 #define vec_vslw(a1, a2) \
9524 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9525       ((vector signed int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9526 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9527       ((vector unsigned int) __builtin_altivec_vslw ((vector signed int) (a1), (vector signed int) (a2))), \
9528 __builtin_altivec_compiletime_error ("vec_vslw")))
9529
9530 #define vec_vslh(a1, a2) \
9531 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9532       ((vector signed short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9533 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9534       ((vector unsigned short) __builtin_altivec_vslh ((vector signed short) (a1), (vector signed short) (a2))), \
9535 __builtin_altivec_compiletime_error ("vec_vslh")))
9536
9537 #define vec_vslb(a1, a2) \
9538 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9539       ((vector signed char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9540 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9541       ((vector unsigned char) __builtin_altivec_vslb ((vector signed char) (a1), (vector signed char) (a2))), \
9542 __builtin_altivec_compiletime_error ("vec_vslb")))
9543
9544 #define vec_sld(a1, a2, a3) \
9545 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
9546       ((vector float) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9547 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
9548       ((vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9549 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9550       ((vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9551 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
9552       ((vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9553 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
9554       ((vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9555 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9556       ((vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9557 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
9558       ((vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9559 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
9560       ((vector pixel) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9561 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9562       ((vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9563 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9564       ((vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9565 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
9566       ((vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
9567     __builtin_altivec_compiletime_error ("vec_sld"))))))))))))
9568
9569 #define vec_sll(a1, a2) \
9570 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9571       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9572 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned short, (a2)), \
9573       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9574 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
9575       ((vector signed int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9576 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9577       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9578 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned short, (a2)), \
9579       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9580 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
9581       ((vector unsigned int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9582 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9583       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9584 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned short, (a2)), \
9585       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9586 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned char, (a2)), \
9587       ((vector bool int) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9588 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned int, (a2)), \
9589       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9590 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9591       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9592 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
9593       ((vector signed short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9594 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned int, (a2)), \
9595       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9596 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9597       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9598 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
9599       ((vector unsigned short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9600 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned int, (a2)), \
9601       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9602 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9603       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9604 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned char, (a2)), \
9605       ((vector bool short) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9606 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned int, (a2)), \
9607       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9608 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned short, (a2)), \
9609       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9610 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
9611       ((vector pixel) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9612 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned int, (a2)), \
9613       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9614 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned short, (a2)), \
9615       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9616 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9617       ((vector signed char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9618 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
9619       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9620 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned short, (a2)), \
9621       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9622 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9623       ((vector unsigned char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9624 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned int, (a2)), \
9625       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9626 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned short, (a2)), \
9627       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9628 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9629       ((vector bool char) __builtin_altivec_vsl ((vector signed int) (a1), (vector signed int) (a2))), \
9630     __builtin_altivec_compiletime_error ("vec_sll")))))))))))))))))))))))))))))))
9631
9632 #define vec_slo(a1, a2) \
9633 __ch (__bin_args_eq (vector float, (a1), vector signed char, (a2)), \
9634       ((vector float) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9635 __ch (__bin_args_eq (vector float, (a1), vector unsigned char, (a2)), \
9636       ((vector float) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9637 __ch (__bin_args_eq (vector signed int, (a1), vector signed char, (a2)), \
9638       ((vector signed int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9639 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
9640       ((vector signed int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9641 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed char, (a2)), \
9642       ((vector unsigned int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9643 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
9644       ((vector unsigned int) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9645 __ch (__bin_args_eq (vector signed short, (a1), vector signed char, (a2)), \
9646       ((vector signed short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9647 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
9648       ((vector signed short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9649 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed char, (a2)), \
9650       ((vector unsigned short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9651 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
9652       ((vector unsigned short) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9653 __ch (__bin_args_eq (vector pixel, (a1), vector signed char, (a2)), \
9654       ((vector pixel) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9655 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
9656       ((vector pixel) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9657 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9658       ((vector signed char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9659 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9660       ((vector signed char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9661 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
9662       ((vector unsigned char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9663 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9664       ((vector unsigned char) __builtin_altivec_vslo ((vector signed int) (a1), (vector signed int) (a2))), \
9665     __builtin_altivec_compiletime_error ("vec_slo")))))))))))))))))
9666
9667 #define vec_splat(a1, a2) \
9668 __ch (__un_args_eq (vector signed char, (a1)), \
9669       ((vector signed char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
9670 __ch (__un_args_eq (vector unsigned char, (a1)), \
9671       ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
9672 __ch (__un_args_eq (vector bool char, (a1)), \
9673       ((vector bool char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
9674 __ch (__un_args_eq (vector signed short, (a1)), \
9675       ((vector signed short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9676 __ch (__un_args_eq (vector unsigned short, (a1)), \
9677       ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9678 __ch (__un_args_eq (vector bool short, (a1)), \
9679       ((vector bool short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9680 __ch (__un_args_eq (vector pixel, (a1)), \
9681       ((vector pixel) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9682 __ch (__un_args_eq (vector float, (a1)), \
9683       ((vector float) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9684 __ch (__un_args_eq (vector signed int, (a1)), \
9685       ((vector signed int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9686 __ch (__un_args_eq (vector unsigned int, (a1)), \
9687       ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9688 __ch (__un_args_eq (vector bool int, (a1)), \
9689       ((vector bool int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9690     __builtin_altivec_compiletime_error ("vec_splat"))))))))))))
9691
9692 #define vec_vspltw(a1, a2) \
9693 __ch (__un_args_eq (vector float, (a1)), \
9694       ((vector float) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9695 __ch (__un_args_eq (vector signed int, (a1)), \
9696       ((vector signed int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9697 __ch (__un_args_eq (vector unsigned int, (a1)), \
9698       ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const int) (a2))), \
9699 __builtin_altivec_compiletime_error ("vec_vspltw"))))
9700
9701 #define vec_vsplth(a1, a2) \
9702 __ch (__un_args_eq (vector signed short, (a1)), \
9703       ((vector signed short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9704 __ch (__un_args_eq (vector unsigned short, (a1)), \
9705       ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) (a1), (const int) (a2))), \
9706 __builtin_altivec_compiletime_error ("vec_vsplth")))
9707
9708 #define vec_vspltb(a1, a2) \
9709 __ch (__un_args_eq (vector signed char, (a1)), \
9710       ((vector signed char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
9711 __ch (__un_args_eq (vector unsigned char, (a1)), \
9712       ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) (a1), (const int) (a2))), \
9713 __builtin_altivec_compiletime_error ("vec_vspltb")))
9714
9715 #define vec_splat_s8(a1) ((vector signed char) __builtin_altivec_vspltisb (a1))
9716
9717 #define vec_splat_s16(a1) ((vector signed short) __builtin_altivec_vspltish (a1))
9718
9719 #define vec_splat_s32(a1) ((vector signed int) __builtin_altivec_vspltisw (a1))
9720
9721 #define vec_splat_u8(a1) ((vector unsigned char) __builtin_altivec_vspltisb (a1))
9722
9723 #define vec_splat_u16(a1) ((vector unsigned short) __builtin_altivec_vspltish (a1))
9724
9725 #define vec_splat_u32(a1) ((vector unsigned int) __builtin_altivec_vspltisw (a1))
9726
9727 #define vec_sr(a1, a2) \
9728 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9729       ((vector signed char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
9730 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9731       ((vector unsigned char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
9732 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9733       ((vector signed short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
9734 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9735       ((vector unsigned short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
9736 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9737       ((vector signed int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
9738 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9739       ((vector unsigned int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
9740     __builtin_altivec_compiletime_error ("vec_sr")))))))
9741
9742 #define vec_vsrw(a1, a2) \
9743 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9744       ((vector signed int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
9745 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9746       ((vector unsigned int) __builtin_altivec_vsrw ((vector signed int) (a1), (vector signed int) (a2))), \
9747 __builtin_altivec_compiletime_error ("vec_vsrw")))
9748
9749 #define vec_vsrh(a1, a2) \
9750 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9751       ((vector signed short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
9752 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9753       ((vector unsigned short) __builtin_altivec_vsrh ((vector signed short) (a1), (vector signed short) (a2))), \
9754 __builtin_altivec_compiletime_error ("vec_vsrh")))
9755
9756 #define vec_vsrb(a1, a2) \
9757 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9758       ((vector signed char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
9759 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9760       ((vector unsigned char) __builtin_altivec_vsrb ((vector signed char) (a1), (vector signed char) (a2))), \
9761 __builtin_altivec_compiletime_error ("vec_vsrb")))
9762
9763 #define vec_sra(a1, a2) \
9764 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9765       ((vector signed char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
9766 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9767       ((vector unsigned char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
9768 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9769       ((vector signed short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
9770 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9771       ((vector unsigned short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
9772 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9773       ((vector signed int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
9774 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9775       ((vector unsigned int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
9776     __builtin_altivec_compiletime_error ("vec_sra")))))))
9777
9778 #define vec_vsraw(a1, a2) \
9779 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9780       ((vector signed int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
9781 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9782       ((vector unsigned int) __builtin_altivec_vsraw ((vector signed int) (a1), (vector signed int) (a2))), \
9783 __builtin_altivec_compiletime_error ("vec_vsraw")))
9784
9785 #define vec_vsrah(a1, a2) \
9786 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9787       ((vector signed short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
9788 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9789       ((vector unsigned short) __builtin_altivec_vsrah ((vector signed short) (a1), (vector signed short) (a2))), \
9790 __builtin_altivec_compiletime_error ("vec_vsrah")))
9791
9792 #define vec_vsrab(a1, a2) \
9793 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9794       ((vector signed char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
9795 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9796       ((vector unsigned char) __builtin_altivec_vsrab ((vector signed char) (a1), (vector signed char) (a2))), \
9797 __builtin_altivec_compiletime_error ("vec_vsrab")))
9798
9799 #define vec_srl(a1, a2) \
9800 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
9801       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9802 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned short, (a2)), \
9803       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9804 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
9805       ((vector signed int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9806 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
9807       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9808 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned short, (a2)), \
9809       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9810 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
9811       ((vector unsigned int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9812 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
9813       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9814 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned short, (a2)), \
9815       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9816 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned char, (a2)), \
9817       ((vector bool int) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9818 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned int, (a2)), \
9819       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9820 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
9821       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9822 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
9823       ((vector signed short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9824 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned int, (a2)), \
9825       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9826 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
9827       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9828 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
9829       ((vector unsigned short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9830 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned int, (a2)), \
9831       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9832 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
9833       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9834 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned char, (a2)), \
9835       ((vector bool short) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9836 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned int, (a2)), \
9837       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9838 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned short, (a2)), \
9839       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9840 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
9841       ((vector pixel) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9842 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned int, (a2)), \
9843       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9844 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned short, (a2)), \
9845       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9846 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9847       ((vector signed char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9848 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
9849       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9850 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned short, (a2)), \
9851       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9852 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9853       ((vector unsigned char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9854 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned int, (a2)), \
9855       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9856 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned short, (a2)), \
9857       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9858 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
9859       ((vector bool char) __builtin_altivec_vsr ((vector signed int) (a1), (vector signed int) (a2))), \
9860     __builtin_altivec_compiletime_error ("vec_srl")))))))))))))))))))))))))))))))
9861
9862 #define vec_sro(a1, a2) \
9863 __ch (__bin_args_eq (vector float, (a1), vector signed char, (a2)), \
9864       ((vector float) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9865 __ch (__bin_args_eq (vector float, (a1), vector unsigned char, (a2)), \
9866       ((vector float) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9867 __ch (__bin_args_eq (vector signed int, (a1), vector signed char, (a2)), \
9868       ((vector signed int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9869 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned char, (a2)), \
9870       ((vector signed int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9871 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed char, (a2)), \
9872       ((vector unsigned int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9873 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned char, (a2)), \
9874       ((vector unsigned int) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9875 __ch (__bin_args_eq (vector signed short, (a1), vector signed char, (a2)), \
9876       ((vector signed short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9877 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned char, (a2)), \
9878       ((vector signed short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9879 __ch (__bin_args_eq (vector pixel, (a1), vector signed char, (a2)), \
9880       ((vector pixel) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9881 __ch (__bin_args_eq (vector pixel, (a1), vector unsigned char, (a2)), \
9882       ((vector pixel) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9883 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed char, (a2)), \
9884       ((vector unsigned short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9885 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned char, (a2)), \
9886       ((vector unsigned short) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9887 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
9888       ((vector signed char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9889 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
9890       ((vector signed char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9891 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
9892       ((vector unsigned char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9893 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
9894       ((vector unsigned char) __builtin_altivec_vsro ((vector signed int) (a1), (vector signed int) (a2))), \
9895     __builtin_altivec_compiletime_error ("vec_sro")))))))))))))))))
9896
9897 #define vec_st(a1, a2, a3) \
9898 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, *(a3)), \
9899   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9900 __ch (__bin_args_eq (vector unsigned char, (a1), unsigned char, *(a3)), \
9901   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9902 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, *(a3)), \
9903   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9904 __ch (__bin_args_eq (vector signed char, (a1), signed char, *(a3)), \
9905   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9906 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, *(a3)), \
9907   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9908 __ch (__bin_args_eq (vector bool char, (a1), unsigned char, *(a3)), \
9909   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9910 __ch (__bin_args_eq (vector bool char, (a1), signed char, *(a3)), \
9911   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9912 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, *(a3)), \
9913   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9914 __ch (__bin_args_eq (vector unsigned short, (a1), unsigned short, *(a3)), \
9915   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9916 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, *(a3)), \
9917   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9918 __ch (__bin_args_eq (vector signed short, (a1), short, *(a3)), \
9919   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9920 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, *(a3)), \
9921   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9922 __ch (__bin_args_eq (vector bool short, (a1), unsigned short, *(a3)), \
9923   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9924 __ch (__bin_args_eq (vector bool short, (a1), short, *(a3)), \
9925   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9926 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, *(a3)), \
9927   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9928 __ch (__bin_args_eq (vector pixel, (a1), unsigned short, *(a3)), \
9929   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9930 __ch (__bin_args_eq (vector pixel, (a1), short, *(a3)), \
9931   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9932 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, *(a3)), \
9933   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9934 __ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, *(a3)), \
9935   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9936 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, *(a3)), \
9937   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9938 __ch (__bin_args_eq (vector signed int, (a1), int, *(a3)), \
9939   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9940 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, *(a3)), \
9941   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9942 __ch (__bin_args_eq (vector bool int, (a1), unsigned int, *(a3)), \
9943   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9944 __ch (__bin_args_eq (vector bool int, (a1), int, *(a3)), \
9945   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9946 __ch (__bin_args_eq (vector float, (a1), vector float, *(a3)), \
9947   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9948 __ch (__bin_args_eq (vector float, (a1), float, *(a3)), \
9949   __builtin_altivec_stvx ((vector signed int) (a1), (a2), (void *) (a3)), \
9950 __builtin_altivec_compiletime_error ("vec_st")))))))))))))))))))))))))))
9951
9952 #define vec_stl(a1, a2, a3) \
9953 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, *(a3)), \
9954   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9955 __ch (__bin_args_eq (vector unsigned char, (a1), unsigned char, *(a3)), \
9956   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9957 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, *(a3)), \
9958   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9959 __ch (__bin_args_eq (vector signed char, (a1), signed char, *(a3)), \
9960   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9961 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, *(a3)), \
9962   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9963 __ch (__bin_args_eq (vector bool char, (a1), unsigned char, *(a3)), \
9964   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9965 __ch (__bin_args_eq (vector bool char, (a1), signed char, *(a3)), \
9966   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9967 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, *(a3)), \
9968   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9969 __ch (__bin_args_eq (vector unsigned short, (a1), unsigned short, *(a3)), \
9970   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9971 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, *(a3)), \
9972   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9973 __ch (__bin_args_eq (vector signed short, (a1), short, *(a3)), \
9974   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9975 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, *(a3)), \
9976   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9977 __ch (__bin_args_eq (vector bool short, (a1), unsigned short, *(a3)), \
9978   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9979 __ch (__bin_args_eq (vector bool short, (a1), short, *(a3)), \
9980   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9981 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, *(a3)), \
9982   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9983 __ch (__bin_args_eq (vector pixel, (a1), unsigned short, *(a3)), \
9984   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9985 __ch (__bin_args_eq (vector pixel, (a1), short, *(a3)), \
9986   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9987 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, *(a3)), \
9988   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9989 __ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, *(a3)), \
9990   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9991 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, *(a3)), \
9992   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9993 __ch (__bin_args_eq (vector signed int, (a1), int, *(a3)), \
9994   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9995 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, *(a3)), \
9996   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9997 __ch (__bin_args_eq (vector bool int, (a1), unsigned int, *(a3)), \
9998   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
9999 __ch (__bin_args_eq (vector bool int, (a1), int, *(a3)), \
10000   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10001 __ch (__bin_args_eq (vector float, (a1), vector float, *(a3)), \
10002   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10003 __ch (__bin_args_eq (vector float, (a1), float, *(a3)), \
10004   __builtin_altivec_stvxl ((vector signed int) (a1), (a2), (void *) (a3)), \
10005 __builtin_altivec_compiletime_error ("vec_stl")))))))))))))))))))))))))))
10006
10007 #define vec_ste(a, b, c) \
10008 __ch (__bin_args_eq (vector unsigned char, (a), unsigned char, *(c)), \
10009       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10010 __ch (__bin_args_eq (vector signed char, (a), signed char, *(c)), \
10011       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10012 __ch (__bin_args_eq (vector bool char, (a), unsigned char, *(c)), \
10013       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10014 __ch (__bin_args_eq (vector bool char, (a), signed char, *(c)), \
10015       __builtin_altivec_stvebx ((vector signed char) (a), (b), (void *) (c)), \
10016 __ch (__bin_args_eq (vector unsigned short, (a), unsigned short, *(c)), \
10017      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10018 __ch (__bin_args_eq (vector signed short, (a), short, *(c)), \
10019      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10020 __ch (__bin_args_eq (vector bool short, (a), unsigned short, *(c)), \
10021      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10022 __ch (__bin_args_eq (vector bool short, (a), short, *(c)), \
10023      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10024 __ch (__bin_args_eq (vector pixel, (a), unsigned short, *(c)), \
10025      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10026 __ch (__bin_args_eq (vector pixel, (a), short, *(c)), \
10027      __builtin_altivec_stvehx ((vector signed short) (a), (b), (void *) (c)), \
10028 __ch (__bin_args_eq (vector unsigned int, (a), unsigned int, *(c)), \
10029      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10030 __ch (__bin_args_eq (vector signed int, (a), int, *(c)), \
10031      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10032 __ch (__bin_args_eq (vector bool int, (a), unsigned int, *(c)), \
10033      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10034 __ch (__bin_args_eq (vector bool int, (a), int, *(c)), \
10035      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10036 __ch (__bin_args_eq (vector float, (a), float, *(c)), \
10037      __builtin_altivec_stvewx ((vector signed int) (a), (b), (void *) (c)), \
10038      __builtin_altivec_compiletime_error ("vec_ste"))))))))))))))))
10039
10040 #define vec_stvewx(a, b, c) \
10041 __ch (__un_args_eq (vector unsigned int, (a)), \
10042      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10043 __ch (__un_args_eq (vector signed int, (a)), \
10044      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10045 __ch (__un_args_eq (vector float, (a)), \
10046      __builtin_altivec_stvewx ((vector signed int) (a), (b), (c)), \
10047 __builtin_altivec_compiletime_error ("vec_stvewx"))))
10048
10049 #define vec_stvehx(a, b, c) \
10050 __ch (__un_args_eq (vector unsigned short, (a)), \
10051      __builtin_altivec_stvehx ((vector signed short) (a), (b), (c)), \
10052 __ch (__un_args_eq (vector signed short, (a)), \
10053      __builtin_altivec_stvehx ((vector signed short) (a), (b), (c)), \
10054 __builtin_altivec_compiletime_error ("vec_stvehx")))
10055
10056 #define vec_stvebx(a, b, c) \
10057 __ch (__un_args_eq (vector unsigned char, (a)), \
10058       __builtin_altivec_stvebx ((vector signed char) (a), (b), (c)), \
10059 __ch (__un_args_eq (vector signed char, (a)), \
10060       __builtin_altivec_stvebx ((vector signed char) (a), (b), (c)), \
10061 __builtin_altivec_compiletime_error ("vec_stvebx")))
10062
10063 #define vec_sub(a1, a2) \
10064 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10065       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10066 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10067       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10068 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10069       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10070 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10071       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10072 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10073       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10074 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10075       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10076 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10077       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10078 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10079       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10080 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10081       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10082 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10083       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10084 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10085       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10086 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10087       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10088 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10089       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10090 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10091       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10092 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10093       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10094 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10095       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10096 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10097       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10098 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10099       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10100 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10101       ((vector float) __builtin_altivec_vsubfp ((vector float) (a1), (vector float) (a2))), \
10102     __builtin_altivec_compiletime_error ("vec_sub"))))))))))))))))))))
10103
10104 #define vec_vsubfp(a1, a2) \
10105 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10106       ((vector float) __builtin_altivec_vsubfp ((vector float) (a1), (vector float) (a2))), \
10107 __builtin_altivec_compiletime_error ("vec_vsubfp"))
10108
10109 #define vec_vsubuwm(a1, a2) \
10110 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10111       ((vector signed int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10112 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10113       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10114 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
10115       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10116 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10117       ((vector unsigned int) __builtin_altivec_vsubuwm ((vector signed int) (a1), (vector signed int) (a2))), \
10118 __builtin_altivec_compiletime_error ("vec_vsubuwm")))))
10119
10120 #define vec_vsubuhm(a1, a2) \
10121 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10122       ((vector signed short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10123 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10124       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10125 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
10126       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10127 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10128       ((vector unsigned short) __builtin_altivec_vsubuhm ((vector signed short) (a1), (vector signed short) (a2))), \
10129 __builtin_altivec_compiletime_error ("vec_vsubuhm")))))
10130
10131 #define vec_vsububm(a1, a2) \
10132 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10133       ((vector signed char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10134 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10135       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10136 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
10137       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10138 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10139       ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \
10140 __builtin_altivec_compiletime_error ("vec_vsububm")))))
10141
10142 #define vec_subc(a1, a2) \
10143 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10144   ((vector unsigned int) __builtin_altivec_vsubcuw ((vector signed int) (a1), (vector signed int) (a2))), \
10145 __builtin_altivec_compiletime_error ("vec_subc"))
10146
10147 #define vec_subs(a1, a2) \
10148 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10149       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10150 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10151       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10152 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10153       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10154 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10155       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10156 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10157       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10158 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10159       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10160 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10161       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10162 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10163       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10164 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10165       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10166 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10167       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10168 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10169       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10170 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10171       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10172 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10173       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10174 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10175       ((vector unsigned int) __builtin_altivec_vsubuws ((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_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10178 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10179       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10180 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10181       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10182 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10183       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10184     __builtin_altivec_compiletime_error ("vec_subs")))))))))))))))))))
10185
10186 #define vec_vsubsws(a1, a2) \
10187 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10188       ((vector signed int) __builtin_altivec_vsubsws ((vector signed int) (a1), (vector signed int) (a2))), \
10189 __builtin_altivec_compiletime_error ("vec_vsubsws"))
10190
10191 #define vec_vsubuws(a1, a2) \
10192 __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
10193       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10194 __ch (__bin_args_eq (vector unsigned int, (a1), vector signed int, (a2)), \
10195       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10196 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10197       ((vector unsigned int) __builtin_altivec_vsubuws ((vector signed int) (a1), (vector signed int) (a2))), \
10198 __builtin_altivec_compiletime_error ("vec_vsubuws"))))
10199
10200 #define vec_vsubshs(a1, a2) \
10201 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10202       ((vector signed short) __builtin_altivec_vsubshs ((vector signed short) (a1), (vector signed short) (a2))), \
10203 __builtin_altivec_compiletime_error ("vec_vsubshs"))
10204
10205 #define vec_vsubuhs(a1, a2) \
10206 __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \
10207       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10208 __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \
10209       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10210 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10211       ((vector unsigned short) __builtin_altivec_vsubuhs ((vector signed short) (a1), (vector signed short) (a2))), \
10212 __builtin_altivec_compiletime_error ("vec_vsubuhs"))))
10213
10214 #define vec_vsubsbs(a1, a2) \
10215 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10216       ((vector signed char) __builtin_altivec_vsubsbs ((vector signed char) (a1), (vector signed char) (a2))), \
10217 __builtin_altivec_compiletime_error ("vec_vsubsbs"))
10218
10219 #define vec_vsububs(a1, a2) \
10220 __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
10221       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10222 __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \
10223       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10224 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10225       ((vector unsigned char) __builtin_altivec_vsububs ((vector signed char) (a1), (vector signed char) (a2))), \
10226 __builtin_altivec_compiletime_error ("vec_vsububs"))))
10227
10228 #define vec_sum4s(a1, a2) \
10229 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10230       ((vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) (a1), (vector signed int) (a2))), \
10231 __ch (__bin_args_eq (vector signed char, (a1), vector signed int, (a2)), \
10232       ((vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) (a1), (vector signed int) (a2))), \
10233 __ch (__bin_args_eq (vector signed short, (a1), vector signed int, (a2)), \
10234       ((vector signed int) __builtin_altivec_vsum4shs ((vector signed short) (a1), (vector signed int) (a2))), \
10235     __builtin_altivec_compiletime_error ("vec_sum4s"))))
10236
10237 #define vec_vsum4shs(a1, a2) \
10238 __ch (__bin_args_eq (vector signed short, (a1), vector signed int, (a2)), \
10239       ((vector signed int) __builtin_altivec_vsum4shs ((vector signed short) (a1), (vector signed int) (a2))), \
10240 __builtin_altivec_compiletime_error ("vec_vsum4shs"))
10241
10242 #define vec_vsum4sbs(a1, a2) \
10243 __ch (__bin_args_eq (vector signed char, (a1), vector signed int, (a2)), \
10244       ((vector signed int) __builtin_altivec_vsum4sbs ((vector signed char) (a1), (vector signed int) (a2))), \
10245 __builtin_altivec_compiletime_error ("vec_vsum4sbs"))
10246
10247 #define vec_vsum4ubs(a1, a2) \
10248 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned int, (a2)), \
10249       ((vector unsigned int) __builtin_altivec_vsum4ubs ((vector signed char) (a1), (vector signed int) (a2))), \
10250 __builtin_altivec_compiletime_error ("vec_vsum4ubs"))
10251
10252 #define vec_sum2s(a1, a2) \
10253 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10254       ((vector signed int) __builtin_altivec_vsum2sws ((vector signed int) (a1), (vector signed int) (a2))), \
10255 __builtin_altivec_compiletime_error ("vec_sum2s"))
10256
10257 #define vec_sums(a1, a2) \
10258 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10259       ((vector signed int) __builtin_altivec_vsumsws ((vector signed int) (a1), (vector signed int) (a2))), \
10260 __builtin_altivec_compiletime_error ("vec_sums"))
10261
10262 #define vec_trunc(a1) \
10263 __ch (__un_args_eq (vector float, (a1)), \
10264       ((vector float) __builtin_altivec_vrfiz ((vector float) (a1))), \
10265 __builtin_altivec_compiletime_error ("vec_trunc"))
10266
10267 #define vec_unpackh(a1) \
10268 __ch (__un_args_eq (vector signed char, (a1)), \
10269       ((vector signed short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10270 __ch (__un_args_eq (vector bool char, (a1)), \
10271       ((vector bool short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10272 __ch (__un_args_eq (vector pixel, (a1)), \
10273       ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \
10274 __ch (__un_args_eq (vector signed short, (a1)), \
10275       ((vector signed int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10276 __ch (__un_args_eq (vector bool short, (a1)), \
10277       ((vector bool int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10278     __builtin_altivec_compiletime_error ("vec_unpackh"))))))
10279
10280 #define vec_vupkhsh(a1) \
10281 __ch (__un_args_eq (vector signed short, (a1)), \
10282       ((vector signed int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \
10283 __builtin_altivec_compiletime_error ("vec_vupkhsh"))
10284
10285 #define vec_vupkhpx(a1) \
10286 __ch (__un_args_eq (vector unsigned short, (a1)), \
10287       ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \
10288 __builtin_altivec_compiletime_error ("vec_vupkhpx"))
10289
10290 #define vec_vupkhsb(a1) \
10291 __ch (__un_args_eq (vector signed char, (a1)), \
10292       ((vector signed short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \
10293 __builtin_altivec_compiletime_error ("vec_vupkhsb"))
10294
10295 #define vec_unpackl(a1) \
10296 __ch (__un_args_eq (vector signed char, (a1)), \
10297       ((vector signed short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10298 __ch (__un_args_eq (vector bool char, (a1)), \
10299       ((vector bool short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10300 __ch (__un_args_eq (vector pixel, (a1)), \
10301       ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \
10302 __ch (__un_args_eq (vector signed short, (a1)), \
10303       ((vector signed int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10304 __ch (__un_args_eq (vector bool short, (a1)), \
10305       ((vector bool int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10306     __builtin_altivec_compiletime_error ("vec_unpackl"))))))
10307
10308 #define vec_vupklsh(a1) \
10309 __ch (__un_args_eq (vector signed short, (a1)), \
10310       ((vector signed int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \
10311 __builtin_altivec_compiletime_error ("vec_vupklsh"))
10312
10313 #define vec_vupklpx(a1) \
10314 __ch (__un_args_eq (vector unsigned short, (a1)), \
10315       ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \
10316 __builtin_altivec_compiletime_error ("vec_vupklpx"))
10317
10318 #define vec_vupklsb(a1) \
10319 __ch (__un_args_eq (vector signed char, (a1)), \
10320       ((vector signed short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \
10321 __builtin_altivec_compiletime_error ("vec_vupklsb"))
10322
10323 #define vec_xor(a1, a2) \
10324 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10325       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10326 __ch (__bin_args_eq (vector float, (a1), vector bool int, (a2)), \
10327       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10328 __ch (__bin_args_eq (vector bool int, (a1), vector float, (a2)), \
10329       ((vector float) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10330 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10331       ((vector bool int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10332 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10333       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10334 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10335       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10336 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10337       ((vector signed int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10338 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10339       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10340 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10341       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10342 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10343       ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10344 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10345       ((vector bool short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10346 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10347       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10348 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10349       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10350 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10351       ((vector signed short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10352 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10353       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10354 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10355       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10356 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10357       ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10358 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10359       ((vector bool char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10360 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10361       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10362 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10363       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10364 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10365       ((vector signed char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10366 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10367       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10368 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10369       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10370 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10371       ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) (a1), (vector signed int) (a2))), \
10372     __builtin_altivec_compiletime_error ("vec_xor")))))))))))))))))))))))))
10373
10374 /* Predicates.  */
10375
10376 #define vec_all_eq(a1, a2) \
10377 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10378       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10379 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10380       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10381 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10382       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10383 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10384       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10385 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10386       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10387 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10388       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10389 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10390       __builtin_altivec_vcmpequb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10391 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10392       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10393 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10394       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10395 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10396       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10397 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10398       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10399 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10400       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10401 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10402       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10403 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10404       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10405 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
10406       __builtin_altivec_vcmpequh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10407 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10408       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10409 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10410       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10411 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10412       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10413 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10414       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10415 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10416       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10417 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10418       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10419 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10420       __builtin_altivec_vcmpequw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10421 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10422       __builtin_altivec_vcmpeqfp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10423     __builtin_altivec_compiletime_error ("vec_all_eq"))))))))))))))))))))))))
10424
10425 #define vec_all_ge(a1, a2) \
10426 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10427       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10428 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10429       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10430 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10431       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10432 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10433       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10434 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10435       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10436 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10437       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a2), (vector signed char) (a1)), \
10438 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10439       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10440 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10441       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10442 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10443       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10444 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10445       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10446 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10447       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10448 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10449       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a2), (vector signed short) (a1)), \
10450 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10451       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10452 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10453       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10454 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10455       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10456 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10457       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10458 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10459       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10460 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10461       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \
10462 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10463       __builtin_altivec_vcmpgefp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10464     __builtin_altivec_compiletime_error ("vec_all_ge"))))))))))))))))))))
10465
10466 #define vec_all_gt(a1, a2) \
10467 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10468       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10469 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10470       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10471 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10472       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10473 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10474       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10475 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10476       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10477 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10478       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a1), (vector signed char) (a2)), \
10479 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10480       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10481 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10482       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10483 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10484       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10485 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10486       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10487 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10488       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10489 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10490       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a1), (vector signed short) (a2)), \
10491 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10492       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10493 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10494       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10495 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10496       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10497 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10498       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10499 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10500       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10501 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10502       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a1), (vector signed int) (a2)), \
10503 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10504       __builtin_altivec_vcmpgtfp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \
10505     __builtin_altivec_compiletime_error ("vec_all_gt"))))))))))))))))))))
10506
10507 #define vec_all_in(a1, a2) \
10508 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10509       __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)), \
10510     __builtin_altivec_compiletime_error ("vec_all_in"))
10511
10512 #define vec_all_le(a1, a2) \
10513 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10514       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10515 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10516       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10517 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10518       __builtin_altivec_vcmpgtub_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10519 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10520       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10521 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10522       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10523 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10524       __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10525 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10526       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10527 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10528       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10529 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10530       __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10531 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10532       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10533 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10534       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10535 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10536       __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10537 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10538       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10539 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10540       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10541 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10542       __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10543 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10544       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10545 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10546       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10547 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10548       __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10549 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10550       __builtin_altivec_vcmpgefp_p (__CR6_LT, (vector float) (a2), (vector float) (a1)), \
10551     __builtin_altivec_compiletime_error ("vec_all_le"))))))))))))))))))))
10552
10553 #define vec_all_lt(a1, a2) \
10554 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10555       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10556 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10557       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10558 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10559       __builtin_altivec_vcmpgtub_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10560 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10561       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10562 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10563       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10564 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10565       __builtin_altivec_vcmpgtsb_p (__CR6_LT, (vector signed char) (a2), (vector signed char) (a1)), \
10566 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10567       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10568 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10569       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10570 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10571       __builtin_altivec_vcmpgtuh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10572 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10573       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10574 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10575       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10576 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10577       __builtin_altivec_vcmpgtsh_p (__CR6_LT, (vector signed short) (a2), (vector signed short) (a1)), \
10578 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10579       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10580 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10581       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10582 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10583       __builtin_altivec_vcmpgtuw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10584 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10585       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10586 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10587       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10588 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10589       __builtin_altivec_vcmpgtsw_p (__CR6_LT, (vector signed int) (a2), (vector signed int) (a1)), \
10590 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10591       __builtin_altivec_vcmpgtfp_p (__CR6_LT, (vector float) (a2), (vector float) (a1)), \
10592     __builtin_altivec_compiletime_error ("vec_all_lt"))))))))))))))))))))
10593
10594 #define vec_all_nan(a1) \
10595 __ch (__un_args_eq (vector float, (a1)), \
10596       __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)), \
10597     __builtin_altivec_compiletime_error ("vec_all_nan"))
10598
10599 #define vec_all_ne(a1, a2) \
10600 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10601       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10602 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10603       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10604 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10605       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10606 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10607       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10608 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10609       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10610 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10611       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10612 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10613       __builtin_altivec_vcmpequb_p (__CR6_EQ, (vector signed char) (a1), (vector signed char) (a2)), \
10614 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10615       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10616 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10617       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10618 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10619       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10620 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10621       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10622 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10623       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10624 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10625       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10626 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10627       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10628 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
10629       __builtin_altivec_vcmpequh_p (__CR6_EQ, (vector signed short) (a1), (vector signed short) (a2)), \
10630 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10631       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10632 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10633       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10634 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10635       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10636 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10637       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10638 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10639       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10640 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10641       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10642 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10643       __builtin_altivec_vcmpequw_p (__CR6_EQ, (vector signed int) (a1), (vector signed int) (a2)), \
10644 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10645       __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (vector float) (a1), (vector float) (a2)), \
10646     __builtin_altivec_compiletime_error ("vec_all_ne"))))))))))))))))))))))))
10647
10648 #define vec_all_nge(a1, a2) \
10649 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10650       __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)), \
10651     __builtin_altivec_compiletime_error ("vec_all_nge"))
10652
10653 #define vec_all_ngt(a1, a2) \
10654 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10655       __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)), \
10656     __builtin_altivec_compiletime_error ("vec_all_ngt"))
10657
10658 #define vec_all_nle(a1, a2) \
10659 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10660       __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)), \
10661     __builtin_altivec_compiletime_error ("vec_all_nle"))
10662
10663 #define vec_all_nlt(a1, a2) \
10664 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10665       __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)), \
10666     __builtin_altivec_compiletime_error ("vec_all_nlt"))
10667
10668 #define vec_all_numeric(a1) \
10669 __ch (__un_args_eq (vector float, (a1)), \
10670       __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)), \
10671     __builtin_altivec_compiletime_error ("vec_all_numeric"))
10672
10673 #define vec_any_eq(a1, a2) \
10674 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10675       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10676 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10677       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10678 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10679       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10680 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10681       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10682 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10683       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10684 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10685       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10686 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10687       __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10688 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10689       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10690 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10691       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10692 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10693       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10694 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10695       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10696 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10697       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10698 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10699       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10700 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10701       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10702 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
10703       __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10704 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10705       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10706 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10707       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10708 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10709       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10710 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10711       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10712 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10713       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10714 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10715       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10716 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10717       __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10718 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10719       __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
10720     __builtin_altivec_compiletime_error ("vec_any_eq"))))))))))))))))))))))))
10721
10722 #define vec_any_ge(a1, a2) \
10723 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10724       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10725 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10726       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10727 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10728       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10729 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10730       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10731 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10732       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10733 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10734       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10735 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10736       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10737 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10738       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10739 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10740       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10741 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10742       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10743 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10744       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10745 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10746       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10747 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10748       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10749 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10750       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10751 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10752       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10753 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10754       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10755 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10756       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10757 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10758       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10759 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10760       __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
10761     __builtin_altivec_compiletime_error ("vec_any_ge"))))))))))))))))))))
10762
10763 #define vec_any_gt(a1, a2) \
10764 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10765       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10766 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10767       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10768 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10769       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10770 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10771       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10772 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10773       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10774 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10775       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10776 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10777       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10778 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10779       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10780 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10781       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10782 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10783       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10784 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10785       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10786 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10787       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10788 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10789       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10790 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10791       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10792 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10793       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10794 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10795       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10796 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10797       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10798 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10799       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10800 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10801       __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (vector float) (a1), (vector float) (a2)), \
10802     __builtin_altivec_compiletime_error ("vec_any_gt"))))))))))))))))))))
10803
10804 #define vec_any_le(a1, a2) \
10805 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10806       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10807 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10808       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10809 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10810       __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10811 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10812       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10813 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10814       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10815 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10816       __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10817 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10818       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10819 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10820       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10821 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10822       __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10823 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10824       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10825 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10826       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10827 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10828       __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10829 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10830       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10831 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10832       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10833 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10834       __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10835 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10836       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10837 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10838       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10839 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10840       __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10841 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10842       __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (vector float) (a2), (vector float) (a1)), \
10843     __builtin_altivec_compiletime_error ("vec_any_le"))))))))))))))))))))
10844
10845 #define vec_any_lt(a1, a2) \
10846 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10847       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10848 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10849       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10850 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10851       __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10852 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10853       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10854 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10855       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10856 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10857       __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (vector signed char) (a2), (vector signed char) (a1)), \
10858 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10859       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10860 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10861       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10862 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10863       __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10864 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10865       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10866 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10867       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10868 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10869       __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (vector signed short) (a2), (vector signed short) (a1)), \
10870 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10871       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10872 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10873       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10874 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10875       __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10876 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10877       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10878 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10879       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10880 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10881       __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (vector signed int) (a2), (vector signed int) (a1)), \
10882 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10883       __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (vector float) (a2), (vector float) (a1)), \
10884     __builtin_altivec_compiletime_error ("vec_any_lt"))))))))))))))))))))
10885
10886 #define vec_any_nan(a1) \
10887 __ch (__un_args_eq (vector float, (a1)), \
10888       __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)), \
10889     __builtin_altivec_compiletime_error ("vec_any_nan"))
10890
10891 #define vec_any_ne(a1, a2) \
10892 __ch (__bin_args_eq (vector bool char, (a1), vector unsigned char, (a2)), \
10893       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10894 __ch (__bin_args_eq (vector bool char, (a1), vector signed char, (a2)), \
10895       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10896 __ch (__bin_args_eq (vector signed char, (a1), vector bool char, (a2)), \
10897       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10898 __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
10899       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10900 __ch (__bin_args_eq (vector unsigned char, (a1), vector bool char, (a2)), \
10901       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10902 __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
10903       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10904 __ch (__bin_args_eq (vector bool char, (a1), vector bool char, (a2)), \
10905       __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (vector signed char) (a1), (vector signed char) (a2)), \
10906 __ch (__bin_args_eq (vector bool short, (a1), vector unsigned short, (a2)), \
10907       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10908 __ch (__bin_args_eq (vector bool short, (a1), vector signed short, (a2)), \
10909       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10910 __ch (__bin_args_eq (vector signed short, (a1), vector bool short, (a2)), \
10911       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10912 __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
10913       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10914 __ch (__bin_args_eq (vector unsigned short, (a1), vector bool short, (a2)), \
10915       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10916 __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
10917       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10918 __ch (__bin_args_eq (vector bool short, (a1), vector bool short, (a2)), \
10919       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10920 __ch (__bin_args_eq (vector pixel, (a1), vector pixel, (a2)), \
10921       __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (vector signed short) (a1), (vector signed short) (a2)), \
10922 __ch (__bin_args_eq (vector bool int, (a1), vector unsigned int, (a2)), \
10923       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10924 __ch (__bin_args_eq (vector bool int, (a1), vector signed int, (a2)), \
10925       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10926 __ch (__bin_args_eq (vector signed int, (a1), vector bool int, (a2)), \
10927       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10928 __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
10929       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10930 __ch (__bin_args_eq (vector unsigned int, (a1), vector bool int, (a2)), \
10931       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10932 __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
10933       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10934 __ch (__bin_args_eq (vector bool int, (a1), vector bool int, (a2)), \
10935       __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (vector signed int) (a1), (vector signed int) (a2)), \
10936 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10937       __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (vector float) (a1), (vector float) (a2)), \
10938     __builtin_altivec_compiletime_error ("vec_any_ne"))))))))))))))))))))))))
10939
10940 #define vec_any_nge(a1, a2) \
10941 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10942       __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)), \
10943     __builtin_altivec_compiletime_error ("vec_any_nge"))
10944
10945 #define vec_any_ngt(a1, a2) \
10946 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10947       __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)), \
10948     __builtin_altivec_compiletime_error ("vec_any_ngt"))
10949
10950 #define vec_any_nle(a1, a2) \
10951 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10952       __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)), \
10953     __builtin_altivec_compiletime_error ("vec_any_nle"))
10954
10955 #define vec_any_nlt(a1, a2) \
10956 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10957       __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)), \
10958     __builtin_altivec_compiletime_error ("vec_any_nlt"))
10959
10960 #define vec_any_numeric(a1) \
10961 __ch (__un_args_eq (vector float, (a1)), \
10962       __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)), \
10963     __builtin_altivec_compiletime_error ("vec_any_numeric"))
10964
10965 #define vec_any_out(a1, a2) \
10966 __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
10967       __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)), \
10968     __builtin_altivec_compiletime_error ("vec_any_out"))
10969
10970
10971 #endif /* __cplusplus */
10972
10973 #endif /* _ALTIVEC_H */