]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/lib/Headers/altivec.h
Merge clang trunk r238337 from ^/vendor/clang/dist, resolve conflicts,
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / lib / Headers / altivec.h
1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  *
21 \*===----------------------------------------------------------------------===*/
22
23 #ifndef __ALTIVEC_H
24 #define __ALTIVEC_H
25
26 #ifndef __ALTIVEC__
27 #error "AltiVec support not enabled"
28 #endif
29
30 /* constants for mapping CR6 bits to predicate result. */
31
32 #define __CR6_EQ     0
33 #define __CR6_EQ_REV 1
34 #define __CR6_LT     2
35 #define __CR6_LT_REV 3
36
37 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
38
39 static vector signed char __ATTRS_o_ai
40 vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c);
41
42 static vector unsigned char __ATTRS_o_ai
43 vec_perm(vector unsigned char __a,
44          vector unsigned char __b,
45          vector unsigned char __c);
46
47 static vector bool char __ATTRS_o_ai
48 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
49
50 static vector short __ATTRS_o_ai
51 vec_perm(vector short __a, vector short __b, vector unsigned char __c);
52
53 static vector unsigned short __ATTRS_o_ai
54 vec_perm(vector unsigned short __a,
55          vector unsigned short __b,
56          vector unsigned char __c);
57
58 static vector bool short __ATTRS_o_ai
59 vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c);
60
61 static vector pixel __ATTRS_o_ai
62 vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c);
63
64 static vector int __ATTRS_o_ai
65 vec_perm(vector int __a, vector int __b, vector unsigned char __c);
66
67 static vector unsigned int __ATTRS_o_ai
68 vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
69
70 static vector bool int __ATTRS_o_ai
71 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
72
73 static vector float __ATTRS_o_ai
74 vec_perm(vector float __a, vector float __b, vector unsigned char __c);
75
76 #ifdef __VSX__
77 static vector long long __ATTRS_o_ai
78 vec_perm(vector long long __a, vector long long __b, vector unsigned char __c);
79
80 static vector unsigned long long __ATTRS_o_ai
81 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
82          vector unsigned char __c);
83
84 static vector double __ATTRS_o_ai
85 vec_perm(vector double __a, vector double __b, vector unsigned char __c);
86 #endif
87
88 static vector unsigned char __ATTRS_o_ai
89 vec_xor(vector unsigned char __a, vector unsigned char __b);
90
91 /* vec_abs */
92
93 #define __builtin_altivec_abs_v16qi vec_abs
94 #define __builtin_altivec_abs_v8hi  vec_abs
95 #define __builtin_altivec_abs_v4si  vec_abs
96
97 static vector signed char __ATTRS_o_ai
98 vec_abs(vector signed char __a)
99 {
100   return __builtin_altivec_vmaxsb(__a, -__a);
101 }
102
103 static vector signed short __ATTRS_o_ai
104 vec_abs(vector signed short __a)
105 {
106   return __builtin_altivec_vmaxsh(__a, -__a);
107 }
108
109 static vector signed int __ATTRS_o_ai
110 vec_abs(vector signed int __a)
111 {
112   return __builtin_altivec_vmaxsw(__a, -__a);
113 }
114
115 static vector float __ATTRS_o_ai
116 vec_abs(vector float __a)
117 {
118   vector unsigned int __res = (vector unsigned int)__a
119                             & (vector unsigned int)(0x7FFFFFFF);
120   return (vector float)__res;
121 }
122
123 /* vec_abss */
124
125 #define __builtin_altivec_abss_v16qi vec_abss
126 #define __builtin_altivec_abss_v8hi  vec_abss
127 #define __builtin_altivec_abss_v4si  vec_abss
128
129 static vector signed char __ATTRS_o_ai
130 vec_abss(vector signed char __a)
131 {
132   return __builtin_altivec_vmaxsb
133            (__a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
134 }
135
136 static vector signed short __ATTRS_o_ai
137 vec_abss(vector signed short __a)
138 {
139   return __builtin_altivec_vmaxsh
140            (__a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
141 }
142
143 static vector signed int __ATTRS_o_ai
144 vec_abss(vector signed int __a)
145 {
146   return __builtin_altivec_vmaxsw
147            (__a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
148 }
149
150 /* vec_add */
151
152 static vector signed char __ATTRS_o_ai
153 vec_add(vector signed char __a, vector signed char __b)
154 {
155   return __a + __b;
156 }
157
158 static vector signed char __ATTRS_o_ai
159 vec_add(vector bool char __a, vector signed char __b)
160 {
161   return (vector signed char)__a + __b;
162 }
163
164 static vector signed char __ATTRS_o_ai
165 vec_add(vector signed char __a, vector bool char __b)
166 {
167   return __a + (vector signed char)__b;
168 }
169
170 static vector unsigned char __ATTRS_o_ai
171 vec_add(vector unsigned char __a, vector unsigned char __b)
172 {
173   return __a + __b;
174 }
175
176 static vector unsigned char __ATTRS_o_ai
177 vec_add(vector bool char __a, vector unsigned char __b)
178 {
179   return (vector unsigned char)__a + __b;
180 }
181
182 static vector unsigned char __ATTRS_o_ai
183 vec_add(vector unsigned char __a, vector bool char __b)
184 {
185   return __a + (vector unsigned char)__b;
186 }
187
188 static vector short __ATTRS_o_ai
189 vec_add(vector short __a, vector short __b)
190 {
191   return __a + __b;
192 }
193
194 static vector short __ATTRS_o_ai
195 vec_add(vector bool short __a, vector short __b)
196 {
197   return (vector short)__a + __b;
198 }
199
200 static vector short __ATTRS_o_ai
201 vec_add(vector short __a, vector bool short __b)
202 {
203   return __a + (vector short)__b;
204 }
205
206 static vector unsigned short __ATTRS_o_ai
207 vec_add(vector unsigned short __a, vector unsigned short __b)
208 {
209   return __a + __b;
210 }
211
212 static vector unsigned short __ATTRS_o_ai
213 vec_add(vector bool short __a, vector unsigned short __b)
214 {
215   return (vector unsigned short)__a + __b;
216 }
217
218 static vector unsigned short __ATTRS_o_ai
219 vec_add(vector unsigned short __a, vector bool short __b)
220 {
221   return __a + (vector unsigned short)__b;
222 }
223
224 static vector int __ATTRS_o_ai
225 vec_add(vector int __a, vector int __b)
226 {
227   return __a + __b;
228 }
229
230 static vector int __ATTRS_o_ai
231 vec_add(vector bool int __a, vector int __b)
232 {
233   return (vector int)__a + __b;
234 }
235
236 static vector int __ATTRS_o_ai
237 vec_add(vector int __a, vector bool int __b)
238 {
239   return __a + (vector int)__b;
240 }
241
242 static vector unsigned int __ATTRS_o_ai
243 vec_add(vector unsigned int __a, vector unsigned int __b)
244 {
245   return __a + __b;
246 }
247
248 static vector unsigned int __ATTRS_o_ai
249 vec_add(vector bool int __a, vector unsigned int __b)
250 {
251   return (vector unsigned int)__a + __b;
252 }
253
254 static vector unsigned int __ATTRS_o_ai
255 vec_add(vector unsigned int __a, vector bool int __b)
256 {
257   return __a + (vector unsigned int)__b;
258 }
259
260 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
261 static vector signed __int128 __ATTRS_o_ai
262 vec_add(vector signed __int128 __a, vector signed __int128 __b)
263 {
264   return __a + __b;
265 }
266
267 static vector unsigned __int128 __ATTRS_o_ai
268 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b)
269 {
270   return __a + __b;
271 }
272 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
273
274 static vector float __ATTRS_o_ai
275 vec_add(vector float __a, vector float __b)
276 {
277   return __a + __b;
278 }
279
280 /* vec_vaddubm */
281
282 #define __builtin_altivec_vaddubm vec_vaddubm
283
284 static vector signed char __ATTRS_o_ai
285 vec_vaddubm(vector signed char __a, vector signed char __b)
286 {
287   return __a + __b;
288 }
289
290 static vector signed char __ATTRS_o_ai
291 vec_vaddubm(vector bool char __a, vector signed char __b)
292 {
293   return (vector signed char)__a + __b;
294 }
295
296 static vector signed char __ATTRS_o_ai
297 vec_vaddubm(vector signed char __a, vector bool char __b)
298 {
299   return __a + (vector signed char)__b;
300 }
301
302 static vector unsigned char __ATTRS_o_ai
303 vec_vaddubm(vector unsigned char __a, vector unsigned char __b)
304 {
305   return __a + __b;
306 }
307
308 static vector unsigned char __ATTRS_o_ai
309 vec_vaddubm(vector bool char __a, vector unsigned char __b)
310 {
311   return (vector unsigned char)__a + __b;
312 }
313
314 static vector unsigned char __ATTRS_o_ai
315 vec_vaddubm(vector unsigned char __a, vector bool char __b)
316 {
317   return __a + (vector unsigned char)__b;
318 }
319
320 /* vec_vadduhm */
321
322 #define __builtin_altivec_vadduhm vec_vadduhm
323
324 static vector short __ATTRS_o_ai
325 vec_vadduhm(vector short __a, vector short __b)
326 {
327   return __a + __b;
328 }
329
330 static vector short __ATTRS_o_ai
331 vec_vadduhm(vector bool short __a, vector short __b)
332 {
333   return (vector short)__a + __b;
334 }
335
336 static vector short __ATTRS_o_ai
337 vec_vadduhm(vector short __a, vector bool short __b)
338 {
339   return __a + (vector short)__b;
340 }
341
342 static vector unsigned short __ATTRS_o_ai
343 vec_vadduhm(vector unsigned short __a, vector unsigned short __b)
344 {
345   return __a + __b;
346 }
347
348 static vector unsigned short __ATTRS_o_ai
349 vec_vadduhm(vector bool short __a, vector unsigned short __b)
350 {
351   return (vector unsigned short)__a + __b;
352 }
353
354 static vector unsigned short __ATTRS_o_ai
355 vec_vadduhm(vector unsigned short __a, vector bool short __b)
356 {
357   return __a + (vector unsigned short)__b;
358 }
359
360 /* vec_vadduwm */
361
362 #define __builtin_altivec_vadduwm vec_vadduwm
363
364 static vector int __ATTRS_o_ai
365 vec_vadduwm(vector int __a, vector int __b)
366 {
367   return __a + __b;
368 }
369
370 static vector int __ATTRS_o_ai
371 vec_vadduwm(vector bool int __a, vector int __b)
372 {
373   return (vector int)__a + __b;
374 }
375
376 static vector int __ATTRS_o_ai
377 vec_vadduwm(vector int __a, vector bool int __b)
378 {
379   return __a + (vector int)__b;
380 }
381
382 static vector unsigned int __ATTRS_o_ai
383 vec_vadduwm(vector unsigned int __a, vector unsigned int __b)
384 {
385   return __a + __b;
386 }
387
388 static vector unsigned int __ATTRS_o_ai
389 vec_vadduwm(vector bool int __a, vector unsigned int __b)
390 {
391   return (vector unsigned int)__a + __b;
392 }
393
394 static vector unsigned int __ATTRS_o_ai
395 vec_vadduwm(vector unsigned int __a, vector bool int __b)
396 {
397   return __a + (vector unsigned int)__b;
398 }
399
400 /* vec_vaddfp */
401
402 #define __builtin_altivec_vaddfp  vec_vaddfp
403
404 static vector float __attribute__((__always_inline__))
405 vec_vaddfp(vector float __a, vector float __b)
406 {
407   return __a + __b;
408 }
409
410 /* vec_addc */
411
412 static vector unsigned int __ATTRS_o_ai
413 vec_addc(vector unsigned int __a, vector unsigned int __b)
414 {
415   return __builtin_altivec_vaddcuw(__a, __b);
416 }
417
418 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
419 static vector signed __int128 __ATTRS_o_ai
420 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
421   return __builtin_altivec_vaddcuq(__a, __b);
422 }
423
424 static vector unsigned __int128 __ATTRS_o_ai
425 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
426   return __builtin_altivec_vaddcuq(__a, __b);
427 }
428 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
429
430 /* vec_vaddcuw */
431
432 static vector unsigned int __attribute__((__always_inline__))
433 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b)
434 {
435   return __builtin_altivec_vaddcuw(__a, __b);
436 }
437
438 /* vec_adds */
439
440 static vector signed char __ATTRS_o_ai
441 vec_adds(vector signed char __a, vector signed char __b)
442 {
443   return __builtin_altivec_vaddsbs(__a, __b);
444 }
445
446 static vector signed char __ATTRS_o_ai
447 vec_adds(vector bool char __a, vector signed char __b)
448 {
449   return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
450 }
451
452 static vector signed char __ATTRS_o_ai
453 vec_adds(vector signed char __a, vector bool char __b)
454 {
455   return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
456 }
457
458 static vector unsigned char __ATTRS_o_ai
459 vec_adds(vector unsigned char __a, vector unsigned char __b)
460 {
461   return __builtin_altivec_vaddubs(__a, __b);
462 }
463
464 static vector unsigned char __ATTRS_o_ai
465 vec_adds(vector bool char __a, vector unsigned char __b)
466 {
467   return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
468 }
469
470 static vector unsigned char __ATTRS_o_ai
471 vec_adds(vector unsigned char __a, vector bool char __b)
472 {
473   return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
474 }
475
476 static vector short __ATTRS_o_ai
477 vec_adds(vector short __a, vector short __b)
478 {
479   return __builtin_altivec_vaddshs(__a, __b);
480 }
481
482 static vector short __ATTRS_o_ai
483 vec_adds(vector bool short __a, vector short __b)
484 {
485   return __builtin_altivec_vaddshs((vector short)__a, __b);
486 }
487
488 static vector short __ATTRS_o_ai
489 vec_adds(vector short __a, vector bool short __b)
490 {
491   return __builtin_altivec_vaddshs(__a, (vector short)__b);
492 }
493
494 static vector unsigned short __ATTRS_o_ai
495 vec_adds(vector unsigned short __a, vector unsigned short __b)
496 {
497   return __builtin_altivec_vadduhs(__a, __b);
498 }
499
500 static vector unsigned short __ATTRS_o_ai
501 vec_adds(vector bool short __a, vector unsigned short __b)
502 {
503   return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
504 }
505
506 static vector unsigned short __ATTRS_o_ai
507 vec_adds(vector unsigned short __a, vector bool short __b)
508 {
509   return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
510 }
511
512 static vector int __ATTRS_o_ai
513 vec_adds(vector int __a, vector int __b)
514 {
515   return __builtin_altivec_vaddsws(__a, __b);
516 }
517
518 static vector int __ATTRS_o_ai
519 vec_adds(vector bool int __a, vector int __b)
520 {
521   return __builtin_altivec_vaddsws((vector int)__a, __b);
522 }
523
524 static vector int __ATTRS_o_ai
525 vec_adds(vector int __a, vector bool int __b)
526 {
527   return __builtin_altivec_vaddsws(__a, (vector int)__b);
528 }
529
530 static vector unsigned int __ATTRS_o_ai
531 vec_adds(vector unsigned int __a, vector unsigned int __b)
532 {
533   return __builtin_altivec_vadduws(__a, __b);
534 }
535
536 static vector unsigned int __ATTRS_o_ai
537 vec_adds(vector bool int __a, vector unsigned int __b)
538 {
539   return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
540 }
541
542 static vector unsigned int __ATTRS_o_ai
543 vec_adds(vector unsigned int __a, vector bool int __b)
544 {
545   return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
546 }
547
548 /* vec_vaddsbs */
549
550 static vector signed char __ATTRS_o_ai
551 vec_vaddsbs(vector signed char __a, vector signed char __b)
552 {
553   return __builtin_altivec_vaddsbs(__a, __b);
554 }
555
556 static vector signed char __ATTRS_o_ai
557 vec_vaddsbs(vector bool char __a, vector signed char __b)
558 {
559   return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
560 }
561
562 static vector signed char __ATTRS_o_ai
563 vec_vaddsbs(vector signed char __a, vector bool char __b)
564 {
565   return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
566 }
567
568 /* vec_vaddubs */
569
570 static vector unsigned char __ATTRS_o_ai
571 vec_vaddubs(vector unsigned char __a, vector unsigned char __b)
572 {
573   return __builtin_altivec_vaddubs(__a, __b);
574 }
575
576 static vector unsigned char __ATTRS_o_ai
577 vec_vaddubs(vector bool char __a, vector unsigned char __b)
578 {
579   return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
580 }
581
582 static vector unsigned char __ATTRS_o_ai
583 vec_vaddubs(vector unsigned char __a, vector bool char __b)
584 {
585   return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
586 }
587
588 /* vec_vaddshs */
589
590 static vector short __ATTRS_o_ai
591 vec_vaddshs(vector short __a, vector short __b)
592 {
593   return __builtin_altivec_vaddshs(__a, __b);
594 }
595
596 static vector short __ATTRS_o_ai
597 vec_vaddshs(vector bool short __a, vector short __b)
598 {
599   return __builtin_altivec_vaddshs((vector short)__a, __b);
600 }
601
602 static vector short __ATTRS_o_ai
603 vec_vaddshs(vector short __a, vector bool short __b)
604 {
605   return __builtin_altivec_vaddshs(__a, (vector short)__b);
606 }
607
608 /* vec_vadduhs */
609
610 static vector unsigned short __ATTRS_o_ai
611 vec_vadduhs(vector unsigned short __a, vector unsigned short __b)
612 {
613   return __builtin_altivec_vadduhs(__a, __b);
614 }
615
616 static vector unsigned short __ATTRS_o_ai
617 vec_vadduhs(vector bool short __a, vector unsigned short __b)
618 {
619   return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
620 }
621
622 static vector unsigned short __ATTRS_o_ai
623 vec_vadduhs(vector unsigned short __a, vector bool short __b)
624 {
625   return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
626 }
627
628 /* vec_vaddsws */
629
630 static vector int __ATTRS_o_ai
631 vec_vaddsws(vector int __a, vector int __b)
632 {
633   return __builtin_altivec_vaddsws(__a, __b);
634 }
635
636 static vector int __ATTRS_o_ai
637 vec_vaddsws(vector bool int __a, vector int __b)
638 {
639   return __builtin_altivec_vaddsws((vector int)__a, __b);
640 }
641
642 static vector int __ATTRS_o_ai
643 vec_vaddsws(vector int __a, vector bool int __b)
644 {
645   return __builtin_altivec_vaddsws(__a, (vector int)__b);
646 }
647
648 /* vec_vadduws */
649
650 static vector unsigned int __ATTRS_o_ai
651 vec_vadduws(vector unsigned int __a, vector unsigned int __b)
652 {
653   return __builtin_altivec_vadduws(__a, __b);
654 }
655
656 static vector unsigned int __ATTRS_o_ai
657 vec_vadduws(vector bool int __a, vector unsigned int __b)
658 {
659   return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
660 }
661
662 static vector unsigned int __ATTRS_o_ai
663 vec_vadduws(vector unsigned int __a, vector bool int __b)
664 {
665   return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
666 }
667
668 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
669 /* vec_vadduqm */
670
671 static vector signed __int128 __ATTRS_o_ai
672 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b)
673 {
674   return __a + __b;
675 }
676
677 static vector unsigned __int128 __ATTRS_o_ai
678 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b)
679 {
680   return __a + __b;
681 }
682
683 /* vec_vaddeuqm */
684
685 static vector signed __int128 __ATTRS_o_ai
686 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
687              vector signed __int128 __c) {
688   return __builtin_altivec_vaddeuqm(__a, __b, __c);
689 }
690
691 static vector unsigned __int128 __ATTRS_o_ai
692 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
693              vector unsigned __int128 __c) {
694   return __builtin_altivec_vaddeuqm(__a, __b, __c);
695 }
696
697 /* vec_vaddcuq */
698
699 static vector signed __int128 __ATTRS_o_ai
700 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b)
701 {
702   return __builtin_altivec_vaddcuq(__a, __b);
703 }
704
705 static vector unsigned __int128 __ATTRS_o_ai
706 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b)
707 {
708   return __builtin_altivec_vaddcuq(__a, __b);
709 }
710
711 /* vec_vaddecuq */
712
713 static vector signed __int128 __ATTRS_o_ai
714 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
715              vector signed __int128 __c) {
716   return __builtin_altivec_vaddecuq(__a, __b, __c);
717 }
718
719 static vector unsigned __int128 __ATTRS_o_ai
720 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
721              vector unsigned __int128 __c) {
722   return __builtin_altivec_vaddecuq(__a, __b, __c);
723 }
724 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
725
726 /* vec_and */
727
728 #define __builtin_altivec_vand vec_and
729
730 static vector signed char __ATTRS_o_ai
731 vec_and(vector signed char __a, vector signed char __b)
732 {
733   return __a & __b;
734 }
735
736 static vector signed char __ATTRS_o_ai
737 vec_and(vector bool char __a, vector signed char __b)
738 {
739   return (vector signed char)__a & __b;
740 }
741
742 static vector signed char __ATTRS_o_ai
743 vec_and(vector signed char __a, vector bool char __b)
744 {
745   return __a & (vector signed char)__b;
746 }
747
748 static vector unsigned char __ATTRS_o_ai
749 vec_and(vector unsigned char __a, vector unsigned char __b)
750 {
751   return __a & __b;
752 }
753
754 static vector unsigned char __ATTRS_o_ai
755 vec_and(vector bool char __a, vector unsigned char __b)
756 {
757   return (vector unsigned char)__a & __b;
758 }
759
760 static vector unsigned char __ATTRS_o_ai
761 vec_and(vector unsigned char __a, vector bool char __b)
762 {
763   return __a & (vector unsigned char)__b;
764 }
765
766 static vector bool char __ATTRS_o_ai
767 vec_and(vector bool char __a, vector bool char __b)
768 {
769   return __a & __b;
770 }
771
772 static vector short __ATTRS_o_ai
773 vec_and(vector short __a, vector short __b)
774 {
775   return __a & __b;
776 }
777
778 static vector short __ATTRS_o_ai
779 vec_and(vector bool short __a, vector short __b)
780 {
781   return (vector short)__a & __b;
782 }
783
784 static vector short __ATTRS_o_ai
785 vec_and(vector short __a, vector bool short __b)
786 {
787   return __a & (vector short)__b;
788 }
789
790 static vector unsigned short __ATTRS_o_ai
791 vec_and(vector unsigned short __a, vector unsigned short __b)
792 {
793   return __a & __b;
794 }
795
796 static vector unsigned short __ATTRS_o_ai
797 vec_and(vector bool short __a, vector unsigned short __b)
798 {
799   return (vector unsigned short)__a & __b;
800 }
801
802 static vector unsigned short __ATTRS_o_ai
803 vec_and(vector unsigned short __a, vector bool short __b)
804 {
805   return __a & (vector unsigned short)__b;
806 }
807
808 static vector bool short __ATTRS_o_ai
809 vec_and(vector bool short __a, vector bool short __b)
810 {
811   return __a & __b;
812 }
813
814 static vector int __ATTRS_o_ai
815 vec_and(vector int __a, vector int __b)
816 {
817   return __a & __b;
818 }
819
820 static vector int __ATTRS_o_ai
821 vec_and(vector bool int __a, vector int __b)
822 {
823   return (vector int)__a & __b;
824 }
825
826 static vector int __ATTRS_o_ai
827 vec_and(vector int __a, vector bool int __b)
828 {
829   return __a & (vector int)__b;
830 }
831
832 static vector unsigned int __ATTRS_o_ai
833 vec_and(vector unsigned int __a, vector unsigned int __b)
834 {
835   return __a & __b;
836 }
837
838 static vector unsigned int __ATTRS_o_ai
839 vec_and(vector bool int __a, vector unsigned int __b)
840 {
841   return (vector unsigned int)__a & __b;
842 }
843
844 static vector unsigned int __ATTRS_o_ai
845 vec_and(vector unsigned int __a, vector bool int __b)
846 {
847   return __a & (vector unsigned int)__b;
848 }
849
850 static vector bool int __ATTRS_o_ai
851 vec_and(vector bool int __a, vector bool int __b)
852 {
853   return __a & __b;
854 }
855
856 static vector float __ATTRS_o_ai
857 vec_and(vector float __a, vector float __b)
858 {
859   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
860   return (vector float)__res;
861 }
862
863 static vector float __ATTRS_o_ai
864 vec_and(vector bool int __a, vector float __b)
865 {
866   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
867   return (vector float)__res;
868 }
869
870 static vector float __ATTRS_o_ai
871 vec_and(vector float __a, vector bool int __b)
872 {
873   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
874   return (vector float)__res;
875 }
876
877 /* vec_vand */
878
879 static vector signed char __ATTRS_o_ai
880 vec_vand(vector signed char __a, vector signed char __b)
881 {
882   return __a & __b;
883 }
884
885 static vector signed char __ATTRS_o_ai
886 vec_vand(vector bool char __a, vector signed char __b)
887 {
888   return (vector signed char)__a & __b;
889 }
890
891 static vector signed char __ATTRS_o_ai
892 vec_vand(vector signed char __a, vector bool char __b)
893 {
894   return __a & (vector signed char)__b;
895 }
896
897 static vector unsigned char __ATTRS_o_ai
898 vec_vand(vector unsigned char __a, vector unsigned char __b)
899 {
900   return __a & __b;
901 }
902
903 static vector unsigned char __ATTRS_o_ai
904 vec_vand(vector bool char __a, vector unsigned char __b)
905 {
906   return (vector unsigned char)__a & __b;
907 }
908
909 static vector unsigned char __ATTRS_o_ai
910 vec_vand(vector unsigned char __a, vector bool char __b)
911 {
912   return __a & (vector unsigned char)__b;
913 }
914
915 static vector bool char __ATTRS_o_ai
916 vec_vand(vector bool char __a, vector bool char __b)
917 {
918   return __a & __b;
919 }
920
921 static vector short __ATTRS_o_ai
922 vec_vand(vector short __a, vector short __b)
923 {
924   return __a & __b;
925 }
926
927 static vector short __ATTRS_o_ai
928 vec_vand(vector bool short __a, vector short __b)
929 {
930   return (vector short)__a & __b;
931 }
932
933 static vector short __ATTRS_o_ai
934 vec_vand(vector short __a, vector bool short __b)
935 {
936   return __a & (vector short)__b;
937 }
938
939 static vector unsigned short __ATTRS_o_ai
940 vec_vand(vector unsigned short __a, vector unsigned short __b)
941 {
942   return __a & __b;
943 }
944
945 static vector unsigned short __ATTRS_o_ai
946 vec_vand(vector bool short __a, vector unsigned short __b)
947 {
948   return (vector unsigned short)__a & __b;
949 }
950
951 static vector unsigned short __ATTRS_o_ai
952 vec_vand(vector unsigned short __a, vector bool short __b)
953 {
954   return __a & (vector unsigned short)__b;
955 }
956
957 static vector bool short __ATTRS_o_ai
958 vec_vand(vector bool short __a, vector bool short __b)
959 {
960   return __a & __b;
961 }
962
963 static vector int __ATTRS_o_ai
964 vec_vand(vector int __a, vector int __b)
965 {
966   return __a & __b;
967 }
968
969 static vector int __ATTRS_o_ai
970 vec_vand(vector bool int __a, vector int __b)
971 {
972   return (vector int)__a & __b;
973 }
974
975 static vector int __ATTRS_o_ai
976 vec_vand(vector int __a, vector bool int __b)
977 {
978   return __a & (vector int)__b;
979 }
980
981 static vector unsigned int __ATTRS_o_ai
982 vec_vand(vector unsigned int __a, vector unsigned int __b)
983 {
984   return __a & __b;
985 }
986
987 static vector unsigned int __ATTRS_o_ai
988 vec_vand(vector bool int __a, vector unsigned int __b)
989 {
990   return (vector unsigned int)__a & __b;
991 }
992
993 static vector unsigned int __ATTRS_o_ai
994 vec_vand(vector unsigned int __a, vector bool int __b)
995 {
996   return __a & (vector unsigned int)__b;
997 }
998
999 static vector bool int __ATTRS_o_ai
1000 vec_vand(vector bool int __a, vector bool int __b)
1001 {
1002   return __a & __b;
1003 }
1004
1005 static vector float __ATTRS_o_ai
1006 vec_vand(vector float __a, vector float __b)
1007 {
1008   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
1009   return (vector float)__res;
1010 }
1011
1012 static vector float __ATTRS_o_ai
1013 vec_vand(vector bool int __a, vector float __b)
1014 {
1015   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
1016   return (vector float)__res;
1017 }
1018
1019 static vector float __ATTRS_o_ai
1020 vec_vand(vector float __a, vector bool int __b)
1021 {
1022   vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
1023   return (vector float)__res;
1024 }
1025
1026 /* vec_andc */
1027
1028 #define __builtin_altivec_vandc vec_andc
1029
1030 static vector signed char __ATTRS_o_ai
1031 vec_andc(vector signed char __a, vector signed char __b)
1032 {
1033   return __a & ~__b;
1034 }
1035
1036 static vector signed char __ATTRS_o_ai
1037 vec_andc(vector bool char __a, vector signed char __b)
1038 {
1039   return (vector signed char)__a & ~__b;
1040 }
1041
1042 static vector signed char __ATTRS_o_ai
1043 vec_andc(vector signed char __a, vector bool char __b)
1044 {
1045   return __a & ~(vector signed char)__b;
1046 }
1047
1048 static vector unsigned char __ATTRS_o_ai
1049 vec_andc(vector unsigned char __a, vector unsigned char __b)
1050 {
1051   return __a & ~__b;
1052 }
1053
1054 static vector unsigned char __ATTRS_o_ai
1055 vec_andc(vector bool char __a, vector unsigned char __b)
1056 {
1057   return (vector unsigned char)__a & ~__b;
1058 }
1059
1060 static vector unsigned char __ATTRS_o_ai
1061 vec_andc(vector unsigned char __a, vector bool char __b)
1062 {
1063   return __a & ~(vector unsigned char)__b;
1064 }
1065
1066 static vector bool char __ATTRS_o_ai
1067 vec_andc(vector bool char __a, vector bool char __b)
1068 {
1069   return __a & ~__b;
1070 }
1071
1072 static vector short __ATTRS_o_ai
1073 vec_andc(vector short __a, vector short __b)
1074 {
1075   return __a & ~__b;
1076 }
1077
1078 static vector short __ATTRS_o_ai
1079 vec_andc(vector bool short __a, vector short __b)
1080 {
1081   return (vector short)__a & ~__b;
1082 }
1083
1084 static vector short __ATTRS_o_ai
1085 vec_andc(vector short __a, vector bool short __b)
1086 {
1087   return __a & ~(vector short)__b;
1088 }
1089
1090 static vector unsigned short __ATTRS_o_ai
1091 vec_andc(vector unsigned short __a, vector unsigned short __b)
1092 {
1093   return __a & ~__b;
1094 }
1095
1096 static vector unsigned short __ATTRS_o_ai
1097 vec_andc(vector bool short __a, vector unsigned short __b)
1098 {
1099   return (vector unsigned short)__a & ~__b;
1100 }
1101
1102 static vector unsigned short __ATTRS_o_ai
1103 vec_andc(vector unsigned short __a, vector bool short __b)
1104 {
1105   return __a & ~(vector unsigned short)__b;
1106 }
1107
1108 static vector bool short __ATTRS_o_ai
1109 vec_andc(vector bool short __a, vector bool short __b)
1110 {
1111   return __a & ~__b;
1112 }
1113
1114 static vector int __ATTRS_o_ai
1115 vec_andc(vector int __a, vector int __b)
1116 {
1117   return __a & ~__b;
1118 }
1119
1120 static vector int __ATTRS_o_ai
1121 vec_andc(vector bool int __a, vector int __b)
1122 {
1123   return (vector int)__a & ~__b;
1124 }
1125
1126 static vector int __ATTRS_o_ai
1127 vec_andc(vector int __a, vector bool int __b)
1128 {
1129   return __a & ~(vector int)__b;
1130 }
1131
1132 static vector unsigned int __ATTRS_o_ai
1133 vec_andc(vector unsigned int __a, vector unsigned int __b)
1134 {
1135   return __a & ~__b;
1136 }
1137
1138 static vector unsigned int __ATTRS_o_ai
1139 vec_andc(vector bool int __a, vector unsigned int __b)
1140 {
1141   return (vector unsigned int)__a & ~__b;
1142 }
1143
1144 static vector unsigned int __ATTRS_o_ai
1145 vec_andc(vector unsigned int __a, vector bool int __b)
1146 {
1147   return __a & ~(vector unsigned int)__b;
1148 }
1149
1150 static vector bool int __ATTRS_o_ai
1151 vec_andc(vector bool int __a, vector bool int __b)
1152 {
1153   return __a & ~__b;
1154 }
1155
1156 static vector float __ATTRS_o_ai
1157 vec_andc(vector float __a, vector float __b)
1158 {
1159   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1160   return (vector float)__res;
1161 }
1162
1163 static vector float __ATTRS_o_ai
1164 vec_andc(vector bool int __a, vector float __b)
1165 {
1166   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1167   return (vector float)__res;
1168 }
1169
1170 static vector float __ATTRS_o_ai
1171 vec_andc(vector float __a, vector bool int __b)
1172 {
1173   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1174   return (vector float)__res;
1175 }
1176
1177 /* vec_vandc */
1178
1179 static vector signed char __ATTRS_o_ai
1180 vec_vandc(vector signed char __a, vector signed char __b)
1181 {
1182   return __a & ~__b;
1183 }
1184
1185 static vector signed char __ATTRS_o_ai
1186 vec_vandc(vector bool char __a, vector signed char __b)
1187 {
1188   return (vector signed char)__a & ~__b;
1189 }
1190
1191 static vector signed char __ATTRS_o_ai
1192 vec_vandc(vector signed char __a, vector bool char __b)
1193 {
1194   return __a & ~(vector signed char)__b;
1195 }
1196
1197 static vector unsigned char __ATTRS_o_ai
1198 vec_vandc(vector unsigned char __a, vector unsigned char __b)
1199 {
1200   return __a & ~__b;
1201 }
1202
1203 static vector unsigned char __ATTRS_o_ai
1204 vec_vandc(vector bool char __a, vector unsigned char __b)
1205 {
1206   return (vector unsigned char)__a & ~__b;
1207 }
1208
1209 static vector unsigned char __ATTRS_o_ai
1210 vec_vandc(vector unsigned char __a, vector bool char __b)
1211 {
1212   return __a & ~(vector unsigned char)__b;
1213 }
1214
1215 static vector bool char __ATTRS_o_ai
1216 vec_vandc(vector bool char __a, vector bool char __b)
1217 {
1218   return __a & ~__b;
1219 }
1220
1221 static vector short __ATTRS_o_ai
1222 vec_vandc(vector short __a, vector short __b)
1223 {
1224   return __a & ~__b;
1225 }
1226
1227 static vector short __ATTRS_o_ai
1228 vec_vandc(vector bool short __a, vector short __b)
1229 {
1230   return (vector short)__a & ~__b;
1231 }
1232
1233 static vector short __ATTRS_o_ai
1234 vec_vandc(vector short __a, vector bool short __b)
1235 {
1236   return __a & ~(vector short)__b;
1237 }
1238
1239 static vector unsigned short __ATTRS_o_ai
1240 vec_vandc(vector unsigned short __a, vector unsigned short __b)
1241 {
1242   return __a & ~__b;
1243 }
1244
1245 static vector unsigned short __ATTRS_o_ai
1246 vec_vandc(vector bool short __a, vector unsigned short __b)
1247 {
1248   return (vector unsigned short)__a & ~__b;
1249 }
1250
1251 static vector unsigned short __ATTRS_o_ai
1252 vec_vandc(vector unsigned short __a, vector bool short __b)
1253 {
1254   return __a & ~(vector unsigned short)__b;
1255 }
1256
1257 static vector bool short __ATTRS_o_ai
1258 vec_vandc(vector bool short __a, vector bool short __b)
1259 {
1260   return __a & ~__b;
1261 }
1262
1263 static vector int __ATTRS_o_ai
1264 vec_vandc(vector int __a, vector int __b)
1265 {
1266   return __a & ~__b;
1267 }
1268
1269 static vector int __ATTRS_o_ai
1270 vec_vandc(vector bool int __a, vector int __b)
1271 {
1272   return (vector int)__a & ~__b;
1273 }
1274
1275 static vector int __ATTRS_o_ai
1276 vec_vandc(vector int __a, vector bool int __b)
1277 {
1278   return __a & ~(vector int)__b;
1279 }
1280
1281 static vector unsigned int __ATTRS_o_ai
1282 vec_vandc(vector unsigned int __a, vector unsigned int __b)
1283 {
1284   return __a & ~__b;
1285 }
1286
1287 static vector unsigned int __ATTRS_o_ai
1288 vec_vandc(vector bool int __a, vector unsigned int __b)
1289 {
1290   return (vector unsigned int)__a & ~__b;
1291 }
1292
1293 static vector unsigned int __ATTRS_o_ai
1294 vec_vandc(vector unsigned int __a, vector bool int __b)
1295 {
1296   return __a & ~(vector unsigned int)__b;
1297 }
1298
1299 static vector bool int __ATTRS_o_ai
1300 vec_vandc(vector bool int __a, vector bool int __b)
1301 {
1302   return __a & ~__b;
1303 }
1304
1305 static vector float __ATTRS_o_ai
1306 vec_vandc(vector float __a, vector float __b)
1307 {
1308   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1309   return (vector float)__res;
1310 }
1311
1312 static vector float __ATTRS_o_ai
1313 vec_vandc(vector bool int __a, vector float __b)
1314 {
1315   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1316   return (vector float)__res;
1317 }
1318
1319 static vector float __ATTRS_o_ai
1320 vec_vandc(vector float __a, vector bool int __b)
1321 {
1322   vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1323   return (vector float)__res;
1324 }
1325
1326 /* vec_avg */
1327
1328 static vector signed char __ATTRS_o_ai
1329 vec_avg(vector signed char __a, vector signed char __b)
1330 {
1331   return __builtin_altivec_vavgsb(__a, __b);
1332 }
1333
1334 static vector unsigned char __ATTRS_o_ai
1335 vec_avg(vector unsigned char __a, vector unsigned char __b)
1336 {
1337   return __builtin_altivec_vavgub(__a, __b);
1338 }
1339
1340 static vector short __ATTRS_o_ai
1341 vec_avg(vector short __a, vector short __b)
1342 {
1343   return __builtin_altivec_vavgsh(__a, __b);
1344 }
1345
1346 static vector unsigned short __ATTRS_o_ai
1347 vec_avg(vector unsigned short __a, vector unsigned short __b)
1348 {
1349   return __builtin_altivec_vavguh(__a, __b);
1350 }
1351
1352 static vector int __ATTRS_o_ai
1353 vec_avg(vector int __a, vector int __b)
1354 {
1355   return __builtin_altivec_vavgsw(__a, __b);
1356 }
1357
1358 static vector unsigned int __ATTRS_o_ai
1359 vec_avg(vector unsigned int __a, vector unsigned int __b)
1360 {
1361   return __builtin_altivec_vavguw(__a, __b);
1362 }
1363
1364 /* vec_vavgsb */
1365
1366 static vector signed char __attribute__((__always_inline__))
1367 vec_vavgsb(vector signed char __a, vector signed char __b)
1368 {
1369   return __builtin_altivec_vavgsb(__a, __b);
1370 }
1371
1372 /* vec_vavgub */
1373
1374 static vector unsigned char __attribute__((__always_inline__))
1375 vec_vavgub(vector unsigned char __a, vector unsigned char __b)
1376 {
1377   return __builtin_altivec_vavgub(__a, __b);
1378 }
1379
1380 /* vec_vavgsh */
1381
1382 static vector short __attribute__((__always_inline__))
1383 vec_vavgsh(vector short __a, vector short __b)
1384 {
1385   return __builtin_altivec_vavgsh(__a, __b);
1386 }
1387
1388 /* vec_vavguh */
1389
1390 static vector unsigned short __attribute__((__always_inline__))
1391 vec_vavguh(vector unsigned short __a, vector unsigned short __b)
1392 {
1393   return __builtin_altivec_vavguh(__a, __b);
1394 }
1395
1396 /* vec_vavgsw */
1397
1398 static vector int __attribute__((__always_inline__))
1399 vec_vavgsw(vector int __a, vector int __b)
1400 {
1401   return __builtin_altivec_vavgsw(__a, __b);
1402 }
1403
1404 /* vec_vavguw */
1405
1406 static vector unsigned int __attribute__((__always_inline__))
1407 vec_vavguw(vector unsigned int __a, vector unsigned int __b)
1408 {
1409   return __builtin_altivec_vavguw(__a, __b);
1410 }
1411
1412 /* vec_ceil */
1413
1414 static vector float __attribute__((__always_inline__))
1415 vec_ceil(vector float __a)
1416 {
1417   return __builtin_altivec_vrfip(__a);
1418 }
1419
1420 /* vec_vrfip */
1421
1422 static vector float __attribute__((__always_inline__))
1423 vec_vrfip(vector float __a)
1424 {
1425   return __builtin_altivec_vrfip(__a);
1426 }
1427
1428 /* vec_cmpb */
1429
1430 static vector int __attribute__((__always_inline__))
1431 vec_cmpb(vector float __a, vector float __b)
1432 {
1433   return __builtin_altivec_vcmpbfp(__a, __b);
1434 }
1435
1436 /* vec_vcmpbfp */
1437
1438 static vector int __attribute__((__always_inline__))
1439 vec_vcmpbfp(vector float __a, vector float __b)
1440 {
1441   return __builtin_altivec_vcmpbfp(__a, __b);
1442 }
1443
1444 /* vec_cmpeq */
1445
1446 static vector bool char __ATTRS_o_ai
1447 vec_cmpeq(vector signed char __a, vector signed char __b)
1448 {
1449   return (vector bool char)
1450     __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b);
1451 }
1452
1453 static vector bool char __ATTRS_o_ai
1454 vec_cmpeq(vector unsigned char __a, vector unsigned char __b)
1455 {
1456   return (vector bool char)
1457     __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b);
1458 }
1459
1460 static vector bool short __ATTRS_o_ai
1461 vec_cmpeq(vector short __a, vector short __b)
1462 {
1463   return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1464 }
1465
1466 static vector bool short __ATTRS_o_ai
1467 vec_cmpeq(vector unsigned short __a, vector unsigned short __b)
1468 {
1469   return (vector bool short)
1470     __builtin_altivec_vcmpequh((vector short)__a, (vector short)__b);
1471 }
1472
1473 static vector bool int __ATTRS_o_ai
1474 vec_cmpeq(vector int __a, vector int __b)
1475 {
1476   return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1477 }
1478
1479 static vector bool int __ATTRS_o_ai
1480 vec_cmpeq(vector unsigned int __a, vector unsigned int __b)
1481 {
1482   return (vector bool int)
1483     __builtin_altivec_vcmpequw((vector int)__a, (vector int)__b);
1484 }
1485
1486 #ifdef __POWER8_VECTOR__
1487 static vector bool long long __ATTRS_o_ai
1488 vec_cmpeq(vector signed long long __a, vector signed long long __b) 
1489 {
1490   return (vector bool long long) __builtin_altivec_vcmpequd(__a, __b);
1491 }
1492
1493 static vector bool long long __ATTRS_o_ai
1494 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) 
1495 {
1496   return (vector bool long long) 
1497     __builtin_altivec_vcmpequd((vector long long)__a, (vector long long) __b);
1498 }
1499 #endif
1500
1501 static vector bool int __ATTRS_o_ai
1502 vec_cmpeq(vector float __a, vector float __b)
1503 {
1504   return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1505 }
1506
1507 /* vec_cmpge */
1508
1509 static vector bool int __attribute__((__always_inline__))
1510 vec_cmpge(vector float __a, vector float __b)
1511 {
1512   return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1513 }
1514
1515 /* vec_vcmpgefp */
1516
1517 static vector bool int __attribute__((__always_inline__))
1518 vec_vcmpgefp(vector float __a, vector float __b)
1519 {
1520   return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1521 }
1522
1523 /* vec_cmpgt */
1524
1525 static vector bool char __ATTRS_o_ai
1526 vec_cmpgt(vector signed char __a, vector signed char __b)
1527 {
1528   return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1529 }
1530
1531 static vector bool char __ATTRS_o_ai
1532 vec_cmpgt(vector unsigned char __a, vector unsigned char __b)
1533 {
1534   return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1535 }
1536
1537 static vector bool short __ATTRS_o_ai
1538 vec_cmpgt(vector short __a, vector short __b)
1539 {
1540   return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1541 }
1542
1543 static vector bool short __ATTRS_o_ai
1544 vec_cmpgt(vector unsigned short __a, vector unsigned short __b)
1545 {
1546   return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1547 }
1548
1549 static vector bool int __ATTRS_o_ai
1550 vec_cmpgt(vector int __a, vector int __b)
1551 {
1552   return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1553 }
1554
1555 static vector bool int __ATTRS_o_ai
1556 vec_cmpgt(vector unsigned int __a, vector unsigned int __b)
1557 {
1558   return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1559 }
1560
1561 #ifdef __POWER8_VECTOR__
1562 static vector bool long long __ATTRS_o_ai
1563 vec_cmpgt(vector signed long long __a, vector signed long long __b)
1564 {
1565   return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1566 }
1567
1568 static vector bool long long __ATTRS_o_ai
1569 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b)
1570 {
1571   return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1572 }
1573 #endif
1574
1575 static vector bool int __ATTRS_o_ai
1576 vec_cmpgt(vector float __a, vector float __b)
1577 {
1578   return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1579 }
1580
1581 /* vec_vcmpgtsb */
1582
1583 static vector bool char __attribute__((__always_inline__))
1584 vec_vcmpgtsb(vector signed char __a, vector signed char __b)
1585 {
1586   return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1587 }
1588
1589 /* vec_vcmpgtub */
1590
1591 static vector bool char __attribute__((__always_inline__))
1592 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b)
1593 {
1594   return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1595 }
1596
1597 /* vec_vcmpgtsh */
1598
1599 static vector bool short __attribute__((__always_inline__))
1600 vec_vcmpgtsh(vector short __a, vector short __b)
1601 {
1602   return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1603 }
1604
1605 /* vec_vcmpgtuh */
1606
1607 static vector bool short __attribute__((__always_inline__))
1608 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b)
1609 {
1610   return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1611 }
1612
1613 /* vec_vcmpgtsw */
1614
1615 static vector bool int __attribute__((__always_inline__))
1616 vec_vcmpgtsw(vector int __a, vector int __b)
1617 {
1618   return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1619 }
1620
1621 /* vec_vcmpgtuw */
1622
1623 static vector bool int __attribute__((__always_inline__))
1624 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b)
1625 {
1626   return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1627 }
1628
1629 /* vec_vcmpgtfp */
1630
1631 static vector bool int __attribute__((__always_inline__))
1632 vec_vcmpgtfp(vector float __a, vector float __b)
1633 {
1634   return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1635 }
1636
1637 /* vec_cmple */
1638
1639 static vector bool int __attribute__((__always_inline__))
1640 vec_cmple(vector float __a, vector float __b)
1641 {
1642   return (vector bool int)__builtin_altivec_vcmpgefp(__b, __a);
1643 }
1644
1645 /* vec_cmplt */
1646
1647 static vector bool char __ATTRS_o_ai
1648 vec_cmplt(vector signed char __a, vector signed char __b)
1649 {
1650   return (vector bool char)__builtin_altivec_vcmpgtsb(__b, __a);
1651 }
1652
1653 static vector bool char __ATTRS_o_ai
1654 vec_cmplt(vector unsigned char __a, vector unsigned char __b)
1655 {
1656   return (vector bool char)__builtin_altivec_vcmpgtub(__b, __a);
1657 }
1658
1659 static vector bool short __ATTRS_o_ai
1660 vec_cmplt(vector short __a, vector short __b)
1661 {
1662   return (vector bool short)__builtin_altivec_vcmpgtsh(__b, __a);
1663 }
1664
1665 static vector bool short __ATTRS_o_ai
1666 vec_cmplt(vector unsigned short __a, vector unsigned short __b)
1667 {
1668   return (vector bool short)__builtin_altivec_vcmpgtuh(__b, __a);
1669 }
1670
1671 static vector bool int __ATTRS_o_ai
1672 vec_cmplt(vector int __a, vector int __b)
1673 {
1674   return (vector bool int)__builtin_altivec_vcmpgtsw(__b, __a);
1675 }
1676
1677 static vector bool int __ATTRS_o_ai
1678 vec_cmplt(vector unsigned int __a, vector unsigned int __b)
1679 {
1680   return (vector bool int)__builtin_altivec_vcmpgtuw(__b, __a);
1681 }
1682
1683 static vector bool int __ATTRS_o_ai
1684 vec_cmplt(vector float __a, vector float __b)
1685 {
1686   return (vector bool int)__builtin_altivec_vcmpgtfp(__b, __a);
1687 }
1688
1689 /* vec_ctf */
1690
1691 static vector float __ATTRS_o_ai
1692 vec_ctf(vector int __a, int __b)
1693 {
1694   return __builtin_altivec_vcfsx(__a, __b);
1695 }
1696
1697 static vector float __ATTRS_o_ai
1698 vec_ctf(vector unsigned int __a, int __b)
1699 {
1700   return __builtin_altivec_vcfux((vector int)__a, __b);
1701 }
1702
1703 /* vec_vcfsx */
1704
1705 static vector float __attribute__((__always_inline__))
1706 vec_vcfsx(vector int __a, int __b)
1707 {
1708   return __builtin_altivec_vcfsx(__a, __b);
1709 }
1710
1711 /* vec_vcfux */
1712
1713 static vector float __attribute__((__always_inline__))
1714 vec_vcfux(vector unsigned int __a, int __b)
1715 {
1716   return __builtin_altivec_vcfux((vector int)__a, __b);
1717 }
1718
1719 /* vec_cts */
1720
1721 static vector int __attribute__((__always_inline__))
1722 vec_cts(vector float __a, int __b)
1723 {
1724   return __builtin_altivec_vctsxs(__a, __b);
1725 }
1726
1727 /* vec_vctsxs */
1728
1729 static vector int __attribute__((__always_inline__))
1730 vec_vctsxs(vector float __a, int __b)
1731 {
1732   return __builtin_altivec_vctsxs(__a, __b);
1733 }
1734
1735 /* vec_ctu */
1736
1737 static vector unsigned int __attribute__((__always_inline__))
1738 vec_ctu(vector float __a, int __b)
1739 {
1740   return __builtin_altivec_vctuxs(__a, __b);
1741 }
1742
1743 /* vec_vctuxs */
1744
1745 static vector unsigned int __attribute__((__always_inline__))
1746 vec_vctuxs(vector float __a, int __b)
1747 {
1748   return __builtin_altivec_vctuxs(__a, __b);
1749 }
1750
1751 /* vec_div */
1752 #ifdef __VSX__
1753 static vector float __ATTRS_o_ai
1754 vec_div(vector float __a, vector float __b)
1755 {
1756   return __builtin_vsx_xvdivsp(__a, __b);
1757 }
1758
1759 static vector double __ATTRS_o_ai
1760 vec_div(vector double __a, vector double __b)
1761 {
1762   return __builtin_vsx_xvdivdp(__a, __b);
1763 }
1764 #endif
1765
1766 /* vec_dss */
1767
1768 static void __attribute__((__always_inline__))
1769 vec_dss(int __a)
1770 {
1771   __builtin_altivec_dss(__a);
1772 }
1773
1774 /* vec_dssall */
1775
1776 static void __attribute__((__always_inline__))
1777 vec_dssall(void)
1778 {
1779   __builtin_altivec_dssall();
1780 }
1781
1782 /* vec_dst */
1783
1784 static void __attribute__((__always_inline__))
1785 vec_dst(const void *__a, int __b, int __c)
1786 {
1787   __builtin_altivec_dst(__a, __b, __c);
1788 }
1789
1790 /* vec_dstst */
1791
1792 static void __attribute__((__always_inline__))
1793 vec_dstst(const void *__a, int __b, int __c)
1794 {
1795   __builtin_altivec_dstst(__a, __b, __c);
1796 }
1797
1798 /* vec_dststt */
1799
1800 static void __attribute__((__always_inline__))
1801 vec_dststt(const void *__a, int __b, int __c)
1802 {
1803   __builtin_altivec_dststt(__a, __b, __c);
1804 }
1805
1806 /* vec_dstt */
1807
1808 static void __attribute__((__always_inline__))
1809 vec_dstt(const void *__a, int __b, int __c)
1810 {
1811   __builtin_altivec_dstt(__a, __b, __c);
1812 }
1813
1814 /* vec_expte */
1815
1816 static vector float __attribute__((__always_inline__))
1817 vec_expte(vector float __a)
1818 {
1819   return __builtin_altivec_vexptefp(__a);
1820 }
1821
1822 /* vec_vexptefp */
1823
1824 static vector float __attribute__((__always_inline__))
1825 vec_vexptefp(vector float __a)
1826 {
1827   return __builtin_altivec_vexptefp(__a);
1828 }
1829
1830 /* vec_floor */
1831
1832 static vector float __attribute__((__always_inline__))
1833 vec_floor(vector float __a)
1834 {
1835   return __builtin_altivec_vrfim(__a);
1836 }
1837
1838 /* vec_vrfim */
1839
1840 static vector float __attribute__((__always_inline__))
1841 vec_vrfim(vector float __a)
1842 {
1843   return __builtin_altivec_vrfim(__a);
1844 }
1845
1846 /* vec_ld */
1847
1848 static vector signed char __ATTRS_o_ai
1849 vec_ld(int __a, const vector signed char *__b)
1850 {
1851   return (vector signed char)__builtin_altivec_lvx(__a, __b);
1852 }
1853
1854 static vector signed char __ATTRS_o_ai
1855 vec_ld(int __a, const signed char *__b)
1856 {
1857   return (vector signed char)__builtin_altivec_lvx(__a, __b);
1858 }
1859
1860 static vector unsigned char __ATTRS_o_ai
1861 vec_ld(int __a, const vector unsigned char *__b)
1862 {
1863   return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
1864 }
1865
1866 static vector unsigned char __ATTRS_o_ai
1867 vec_ld(int __a, const unsigned char *__b)
1868 {
1869   return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
1870 }
1871
1872 static vector bool char __ATTRS_o_ai
1873 vec_ld(int __a, const vector bool char *__b)
1874 {
1875   return (vector bool char)__builtin_altivec_lvx(__a, __b);
1876 }
1877
1878 static vector short __ATTRS_o_ai
1879 vec_ld(int __a, const vector short *__b)
1880 {
1881   return (vector short)__builtin_altivec_lvx(__a, __b);
1882 }
1883
1884 static vector short __ATTRS_o_ai
1885 vec_ld(int __a, const short *__b)
1886 {
1887   return (vector short)__builtin_altivec_lvx(__a, __b);
1888 }
1889
1890 static vector unsigned short __ATTRS_o_ai
1891 vec_ld(int __a, const vector unsigned short *__b)
1892 {
1893   return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
1894 }
1895
1896 static vector unsigned short __ATTRS_o_ai
1897 vec_ld(int __a, const unsigned short *__b)
1898 {
1899   return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
1900 }
1901
1902 static vector bool short __ATTRS_o_ai
1903 vec_ld(int __a, const vector bool short *__b)
1904 {
1905   return (vector bool short)__builtin_altivec_lvx(__a, __b);
1906 }
1907
1908 static vector pixel __ATTRS_o_ai
1909 vec_ld(int __a, const vector pixel *__b)
1910 {
1911   return (vector pixel)__builtin_altivec_lvx(__a, __b);
1912 }
1913
1914 static vector int __ATTRS_o_ai
1915 vec_ld(int __a, const vector int *__b)
1916 {
1917   return (vector int)__builtin_altivec_lvx(__a, __b);
1918 }
1919
1920 static vector int __ATTRS_o_ai
1921 vec_ld(int __a, const int *__b)
1922 {
1923   return (vector int)__builtin_altivec_lvx(__a, __b);
1924 }
1925
1926 static vector unsigned int __ATTRS_o_ai
1927 vec_ld(int __a, const vector unsigned int *__b)
1928 {
1929   return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
1930 }
1931
1932 static vector unsigned int __ATTRS_o_ai
1933 vec_ld(int __a, const unsigned int *__b)
1934 {
1935   return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
1936 }
1937
1938 static vector bool int __ATTRS_o_ai
1939 vec_ld(int __a, const vector bool int *__b)
1940 {
1941   return (vector bool int)__builtin_altivec_lvx(__a, __b);
1942 }
1943
1944 static vector float __ATTRS_o_ai
1945 vec_ld(int __a, const vector float *__b)
1946 {
1947   return (vector float)__builtin_altivec_lvx(__a, __b);
1948 }
1949
1950 static vector float __ATTRS_o_ai
1951 vec_ld(int __a, const float *__b)
1952 {
1953   return (vector float)__builtin_altivec_lvx(__a, __b);
1954 }
1955
1956 /* vec_lvx */
1957
1958 static vector signed char __ATTRS_o_ai
1959 vec_lvx(int __a, const vector signed char *__b)
1960 {
1961   return (vector signed char)__builtin_altivec_lvx(__a, __b);
1962 }
1963
1964 static vector signed char __ATTRS_o_ai
1965 vec_lvx(int __a, const signed char *__b)
1966 {
1967   return (vector signed char)__builtin_altivec_lvx(__a, __b);
1968 }
1969
1970 static vector unsigned char __ATTRS_o_ai
1971 vec_lvx(int __a, const vector unsigned char *__b)
1972 {
1973   return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
1974 }
1975
1976 static vector unsigned char __ATTRS_o_ai
1977 vec_lvx(int __a, const unsigned char *__b)
1978 {
1979   return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
1980 }
1981
1982 static vector bool char __ATTRS_o_ai
1983 vec_lvx(int __a, const vector bool char *__b)
1984 {
1985   return (vector bool char)__builtin_altivec_lvx(__a, __b);
1986 }
1987
1988 static vector short __ATTRS_o_ai
1989 vec_lvx(int __a, const vector short *__b)
1990 {
1991   return (vector short)__builtin_altivec_lvx(__a, __b);
1992 }
1993
1994 static vector short __ATTRS_o_ai
1995 vec_lvx(int __a, const short *__b)
1996 {
1997   return (vector short)__builtin_altivec_lvx(__a, __b);
1998 }
1999
2000 static vector unsigned short __ATTRS_o_ai
2001 vec_lvx(int __a, const vector unsigned short *__b)
2002 {
2003   return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2004 }
2005
2006 static vector unsigned short __ATTRS_o_ai
2007 vec_lvx(int __a, const unsigned short *__b)
2008 {
2009   return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2010 }
2011
2012 static vector bool short __ATTRS_o_ai
2013 vec_lvx(int __a, const vector bool short *__b)
2014 {
2015   return (vector bool short)__builtin_altivec_lvx(__a, __b);
2016 }
2017
2018 static vector pixel __ATTRS_o_ai
2019 vec_lvx(int __a, const vector pixel *__b)
2020 {
2021   return (vector pixel)__builtin_altivec_lvx(__a, __b);
2022 }
2023
2024 static vector int __ATTRS_o_ai
2025 vec_lvx(int __a, const vector int *__b)
2026 {
2027   return (vector int)__builtin_altivec_lvx(__a, __b);
2028 }
2029
2030 static vector int __ATTRS_o_ai
2031 vec_lvx(int __a, const int *__b)
2032 {
2033   return (vector int)__builtin_altivec_lvx(__a, __b);
2034 }
2035
2036 static vector unsigned int __ATTRS_o_ai
2037 vec_lvx(int __a, const vector unsigned int *__b)
2038 {
2039   return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2040 }
2041
2042 static vector unsigned int __ATTRS_o_ai
2043 vec_lvx(int __a, const unsigned int *__b)
2044 {
2045   return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2046 }
2047
2048 static vector bool int __ATTRS_o_ai
2049 vec_lvx(int __a, const vector bool int *__b)
2050 {
2051   return (vector bool int)__builtin_altivec_lvx(__a, __b);
2052 }
2053
2054 static vector float __ATTRS_o_ai
2055 vec_lvx(int __a, const vector float *__b)
2056 {
2057   return (vector float)__builtin_altivec_lvx(__a, __b);
2058 }
2059
2060 static vector float __ATTRS_o_ai
2061 vec_lvx(int __a, const float *__b)
2062 {
2063   return (vector float)__builtin_altivec_lvx(__a, __b);
2064 }
2065
2066 /* vec_lde */
2067
2068 static vector signed char __ATTRS_o_ai
2069 vec_lde(int __a, const signed char *__b)
2070 {
2071   return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2072 }
2073
2074 static vector unsigned char __ATTRS_o_ai
2075 vec_lde(int __a, const unsigned char *__b)
2076 {
2077   return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2078 }
2079
2080 static vector short __ATTRS_o_ai
2081 vec_lde(int __a, const short *__b)
2082 {
2083   return (vector short)__builtin_altivec_lvehx(__a, __b);
2084 }
2085
2086 static vector unsigned short __ATTRS_o_ai
2087 vec_lde(int __a, const unsigned short *__b)
2088 {
2089   return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2090 }
2091
2092 static vector int __ATTRS_o_ai
2093 vec_lde(int __a, const int *__b)
2094 {
2095   return (vector int)__builtin_altivec_lvewx(__a, __b);
2096 }
2097
2098 static vector unsigned int __ATTRS_o_ai
2099 vec_lde(int __a, const unsigned int *__b)
2100 {
2101   return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2102 }
2103
2104 static vector float __ATTRS_o_ai
2105 vec_lde(int __a, const float *__b)
2106 {
2107   return (vector float)__builtin_altivec_lvewx(__a, __b);
2108 }
2109
2110 /* vec_lvebx */
2111
2112 static vector signed char __ATTRS_o_ai
2113 vec_lvebx(int __a, const signed char *__b)
2114 {
2115   return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2116 }
2117
2118 static vector unsigned char __ATTRS_o_ai
2119 vec_lvebx(int __a, const unsigned char *__b)
2120 {
2121   return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2122 }
2123
2124 /* vec_lvehx */
2125
2126 static vector short __ATTRS_o_ai
2127 vec_lvehx(int __a, const short *__b)
2128 {
2129   return (vector short)__builtin_altivec_lvehx(__a, __b);
2130 }
2131
2132 static vector unsigned short __ATTRS_o_ai
2133 vec_lvehx(int __a, const unsigned short *__b)
2134 {
2135   return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2136 }
2137
2138 /* vec_lvewx */
2139
2140 static vector int __ATTRS_o_ai
2141 vec_lvewx(int __a, const int *__b)
2142 {
2143   return (vector int)__builtin_altivec_lvewx(__a, __b);
2144 }
2145
2146 static vector unsigned int __ATTRS_o_ai
2147 vec_lvewx(int __a, const unsigned int *__b)
2148 {
2149   return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2150 }
2151
2152 static vector float __ATTRS_o_ai
2153 vec_lvewx(int __a, const float *__b)
2154 {
2155   return (vector float)__builtin_altivec_lvewx(__a, __b);
2156 }
2157
2158 /* vec_ldl */
2159
2160 static vector signed char __ATTRS_o_ai
2161 vec_ldl(int __a, const vector signed char *__b)
2162 {
2163   return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2164 }
2165
2166 static vector signed char __ATTRS_o_ai
2167 vec_ldl(int __a, const signed char *__b)
2168 {
2169   return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2170 }
2171
2172 static vector unsigned char __ATTRS_o_ai
2173 vec_ldl(int __a, const vector unsigned char *__b)
2174 {
2175   return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2176 }
2177
2178 static vector unsigned char __ATTRS_o_ai
2179 vec_ldl(int __a, const unsigned char *__b)
2180 {
2181   return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2182 }
2183
2184 static vector bool char __ATTRS_o_ai
2185 vec_ldl(int __a, const vector bool char *__b)
2186 {
2187   return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2188 }
2189
2190 static vector short __ATTRS_o_ai
2191 vec_ldl(int __a, const vector short *__b)
2192 {
2193   return (vector short)__builtin_altivec_lvxl(__a, __b);
2194 }
2195
2196 static vector short __ATTRS_o_ai
2197 vec_ldl(int __a, const short *__b)
2198 {
2199   return (vector short)__builtin_altivec_lvxl(__a, __b);
2200 }
2201
2202 static vector unsigned short __ATTRS_o_ai
2203 vec_ldl(int __a, const vector unsigned short *__b)
2204 {
2205   return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2206 }
2207
2208 static vector unsigned short __ATTRS_o_ai
2209 vec_ldl(int __a, const unsigned short *__b)
2210 {
2211   return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2212 }
2213
2214 static vector bool short __ATTRS_o_ai
2215 vec_ldl(int __a, const vector bool short *__b)
2216 {
2217   return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2218 }
2219
2220 static vector pixel __ATTRS_o_ai
2221 vec_ldl(int __a, const vector pixel *__b)
2222 {
2223   return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
2224 }
2225
2226 static vector int __ATTRS_o_ai
2227 vec_ldl(int __a, const vector int *__b)
2228 {
2229   return (vector int)__builtin_altivec_lvxl(__a, __b);
2230 }
2231
2232 static vector int __ATTRS_o_ai
2233 vec_ldl(int __a, const int *__b)
2234 {
2235   return (vector int)__builtin_altivec_lvxl(__a, __b);
2236 }
2237
2238 static vector unsigned int __ATTRS_o_ai
2239 vec_ldl(int __a, const vector unsigned int *__b)
2240 {
2241   return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2242 }
2243
2244 static vector unsigned int __ATTRS_o_ai
2245 vec_ldl(int __a, const unsigned int *__b)
2246 {
2247   return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2248 }
2249
2250 static vector bool int __ATTRS_o_ai
2251 vec_ldl(int __a, const vector bool int *__b)
2252 {
2253   return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2254 }
2255
2256 static vector float __ATTRS_o_ai
2257 vec_ldl(int __a, const vector float *__b)
2258 {
2259   return (vector float)__builtin_altivec_lvxl(__a, __b);
2260 }
2261
2262 static vector float __ATTRS_o_ai
2263 vec_ldl(int __a, const float *__b)
2264 {
2265   return (vector float)__builtin_altivec_lvxl(__a, __b);
2266 }
2267
2268 /* vec_lvxl */
2269
2270 static vector signed char __ATTRS_o_ai
2271 vec_lvxl(int __a, const vector signed char *__b)
2272 {
2273   return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2274 }
2275
2276 static vector signed char __ATTRS_o_ai
2277 vec_lvxl(int __a, const signed char *__b)
2278 {
2279   return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2280 }
2281
2282 static vector unsigned char __ATTRS_o_ai
2283 vec_lvxl(int __a, const vector unsigned char *__b)
2284 {
2285   return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2286 }
2287
2288 static vector unsigned char __ATTRS_o_ai
2289 vec_lvxl(int __a, const unsigned char *__b)
2290 {
2291   return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2292 }
2293
2294 static vector bool char __ATTRS_o_ai
2295 vec_lvxl(int __a, const vector bool char *__b)
2296 {
2297   return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2298 }
2299
2300 static vector short __ATTRS_o_ai
2301 vec_lvxl(int __a, const vector short *__b)
2302 {
2303   return (vector short)__builtin_altivec_lvxl(__a, __b);
2304 }
2305
2306 static vector short __ATTRS_o_ai
2307 vec_lvxl(int __a, const short *__b)
2308 {
2309   return (vector short)__builtin_altivec_lvxl(__a, __b);
2310 }
2311
2312 static vector unsigned short __ATTRS_o_ai
2313 vec_lvxl(int __a, const vector unsigned short *__b)
2314 {
2315   return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2316 }
2317
2318 static vector unsigned short __ATTRS_o_ai
2319 vec_lvxl(int __a, const unsigned short *__b)
2320 {
2321   return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2322 }
2323
2324 static vector bool short __ATTRS_o_ai
2325 vec_lvxl(int __a, const vector bool short *__b)
2326 {
2327   return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2328 }
2329
2330 static vector pixel __ATTRS_o_ai
2331 vec_lvxl(int __a, const vector pixel *__b)
2332 {
2333   return (vector pixel)__builtin_altivec_lvxl(__a, __b);
2334 }
2335
2336 static vector int __ATTRS_o_ai
2337 vec_lvxl(int __a, const vector int *__b)
2338 {
2339   return (vector int)__builtin_altivec_lvxl(__a, __b);
2340 }
2341
2342 static vector int __ATTRS_o_ai
2343 vec_lvxl(int __a, const int *__b)
2344 {
2345   return (vector int)__builtin_altivec_lvxl(__a, __b);
2346 }
2347
2348 static vector unsigned int __ATTRS_o_ai
2349 vec_lvxl(int __a, const vector unsigned int *__b)
2350 {
2351   return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2352 }
2353
2354 static vector unsigned int __ATTRS_o_ai
2355 vec_lvxl(int __a, const unsigned int *__b)
2356 {
2357   return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2358 }
2359
2360 static vector bool int __ATTRS_o_ai
2361 vec_lvxl(int __a, const vector bool int *__b)
2362 {
2363   return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2364 }
2365
2366 static vector float __ATTRS_o_ai
2367 vec_lvxl(int __a, const vector float *__b)
2368 {
2369   return (vector float)__builtin_altivec_lvxl(__a, __b);
2370 }
2371
2372 static vector float __ATTRS_o_ai
2373 vec_lvxl(int __a, const float *__b)
2374 {
2375   return (vector float)__builtin_altivec_lvxl(__a, __b);
2376 }
2377
2378 /* vec_loge */
2379
2380 static vector float __attribute__((__always_inline__))
2381 vec_loge(vector float __a)
2382 {
2383   return __builtin_altivec_vlogefp(__a);
2384 }
2385
2386 /* vec_vlogefp */
2387
2388 static vector float __attribute__((__always_inline__))
2389 vec_vlogefp(vector float __a)
2390 {
2391   return __builtin_altivec_vlogefp(__a);
2392 }
2393
2394 /* vec_lvsl */
2395
2396 #ifdef __LITTLE_ENDIAN__
2397 static vector unsigned char __ATTRS_o_ai
2398 __attribute__((__deprecated__("use assignment for unaligned little endian \
2399 loads/stores")))
2400 vec_lvsl(int __a, const signed char *__b)
2401 {
2402   vector unsigned char mask = 
2403     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2404   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2405   return vec_perm(mask, mask, reverse);
2406 }
2407 #else
2408 static vector unsigned char __ATTRS_o_ai
2409 vec_lvsl(int __a, const signed char *__b)
2410 {
2411   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2412 }
2413 #endif
2414
2415 #ifdef __LITTLE_ENDIAN__
2416 static vector unsigned char __ATTRS_o_ai
2417 __attribute__((__deprecated__("use assignment for unaligned little endian \
2418 loads/stores")))
2419 vec_lvsl(int __a, const unsigned char *__b)
2420 {
2421   vector unsigned char mask =
2422     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2423   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2424   return vec_perm(mask, mask, reverse);
2425 }
2426 #else
2427 static vector unsigned char __ATTRS_o_ai
2428 vec_lvsl(int __a, const unsigned char *__b)
2429 {
2430   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2431 }
2432 #endif
2433
2434 #ifdef __LITTLE_ENDIAN__
2435 static vector unsigned char __ATTRS_o_ai
2436 __attribute__((__deprecated__("use assignment for unaligned little endian \
2437 loads/stores")))
2438 vec_lvsl(int __a, const short *__b)
2439 {
2440   vector unsigned char mask =
2441     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2442   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2443   return vec_perm(mask, mask, reverse);
2444 }
2445 #else
2446 static vector unsigned char __ATTRS_o_ai
2447 vec_lvsl(int __a, const short *__b)
2448 {
2449   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2450 }
2451 #endif
2452
2453 #ifdef __LITTLE_ENDIAN__
2454 static vector unsigned char __ATTRS_o_ai
2455 __attribute__((__deprecated__("use assignment for unaligned little endian \
2456 loads/stores")))
2457 vec_lvsl(int __a, const unsigned short *__b)
2458 {
2459   vector unsigned char mask =
2460     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2461   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2462   return vec_perm(mask, mask, reverse);
2463 }
2464 #else
2465 static vector unsigned char __ATTRS_o_ai
2466 vec_lvsl(int __a, const unsigned short *__b)
2467 {
2468   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2469 }
2470 #endif
2471
2472 #ifdef __LITTLE_ENDIAN__
2473 static vector unsigned char __ATTRS_o_ai
2474 __attribute__((__deprecated__("use assignment for unaligned little endian \
2475 loads/stores")))
2476 vec_lvsl(int __a, const int *__b)
2477 {
2478   vector unsigned char mask =
2479     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2480   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2481   return vec_perm(mask, mask, reverse);
2482 }
2483 #else
2484 static vector unsigned char __ATTRS_o_ai
2485 vec_lvsl(int __a, const int *__b)
2486 {
2487   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2488 }
2489 #endif
2490
2491 #ifdef __LITTLE_ENDIAN__
2492 static vector unsigned char __ATTRS_o_ai
2493 __attribute__((__deprecated__("use assignment for unaligned little endian \
2494 loads/stores")))
2495 vec_lvsl(int __a, const unsigned int *__b)
2496 {
2497   vector unsigned char mask =
2498     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2499   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2500   return vec_perm(mask, mask, reverse);
2501 }
2502 #else
2503 static vector unsigned char __ATTRS_o_ai
2504 vec_lvsl(int __a, const unsigned int *__b)
2505 {
2506   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2507 }
2508 #endif
2509
2510 #ifdef __LITTLE_ENDIAN__
2511 static vector unsigned char __ATTRS_o_ai
2512 __attribute__((__deprecated__("use assignment for unaligned little endian \
2513 loads/stores")))
2514 vec_lvsl(int __a, const float *__b)
2515 {
2516   vector unsigned char mask =
2517     (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2518   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2519   return vec_perm(mask, mask, reverse);
2520 }
2521 #else
2522 static vector unsigned char __ATTRS_o_ai
2523 vec_lvsl(int __a, const float *__b)
2524 {
2525   return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2526 }
2527 #endif
2528
2529 /* vec_lvsr */
2530
2531 #ifdef __LITTLE_ENDIAN__
2532 static vector unsigned char __ATTRS_o_ai
2533 __attribute__((__deprecated__("use assignment for unaligned little endian \
2534 loads/stores")))
2535 vec_lvsr(int __a, const signed char *__b)
2536 {
2537   vector unsigned char mask =
2538     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2539   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2540   return vec_perm(mask, mask, reverse);
2541 }
2542 #else
2543 static vector unsigned char __ATTRS_o_ai
2544 vec_lvsr(int __a, const signed char *__b)
2545 {
2546   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2547 }
2548 #endif
2549
2550 #ifdef __LITTLE_ENDIAN__
2551 static vector unsigned char __ATTRS_o_ai
2552 __attribute__((__deprecated__("use assignment for unaligned little endian \
2553 loads/stores")))
2554 vec_lvsr(int __a, const unsigned char *__b)
2555 {
2556   vector unsigned char mask =
2557     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2558   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2559   return vec_perm(mask, mask, reverse);
2560 }
2561 #else
2562 static vector unsigned char __ATTRS_o_ai
2563 vec_lvsr(int __a, const unsigned char *__b)
2564 {
2565   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2566 }
2567 #endif
2568
2569 #ifdef __LITTLE_ENDIAN__
2570 static vector unsigned char __ATTRS_o_ai
2571 __attribute__((__deprecated__("use assignment for unaligned little endian \
2572 loads/stores")))
2573 vec_lvsr(int __a, const short *__b)
2574 {
2575   vector unsigned char mask =
2576     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2577   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2578   return vec_perm(mask, mask, reverse);
2579 }
2580 #else
2581 static vector unsigned char __ATTRS_o_ai
2582 vec_lvsr(int __a, const short *__b)
2583 {
2584   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2585 }
2586 #endif
2587
2588 #ifdef __LITTLE_ENDIAN__
2589 static vector unsigned char __ATTRS_o_ai
2590 __attribute__((__deprecated__("use assignment for unaligned little endian \
2591 loads/stores")))
2592 vec_lvsr(int __a, const unsigned short *__b)
2593 {
2594   vector unsigned char mask =
2595     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2596   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2597   return vec_perm(mask, mask, reverse);
2598 }
2599 #else
2600 static vector unsigned char __ATTRS_o_ai
2601 vec_lvsr(int __a, const unsigned short *__b)
2602 {
2603   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2604 }
2605 #endif
2606
2607 #ifdef __LITTLE_ENDIAN__
2608 static vector unsigned char __ATTRS_o_ai
2609 __attribute__((__deprecated__("use assignment for unaligned little endian \
2610 loads/stores")))
2611 vec_lvsr(int __a, const int *__b)
2612 {
2613   vector unsigned char mask =
2614     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2615   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2616   return vec_perm(mask, mask, reverse);
2617 }
2618 #else
2619 static vector unsigned char __ATTRS_o_ai
2620 vec_lvsr(int __a, const int *__b)
2621 {
2622   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2623 }
2624 #endif
2625
2626 #ifdef __LITTLE_ENDIAN__
2627 static vector unsigned char __ATTRS_o_ai
2628 __attribute__((__deprecated__("use assignment for unaligned little endian \
2629 loads/stores")))
2630 vec_lvsr(int __a, const unsigned int *__b)
2631 {
2632   vector unsigned char mask =
2633     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2634   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2635   return vec_perm(mask, mask, reverse);
2636 }
2637 #else
2638 static vector unsigned char __ATTRS_o_ai
2639 vec_lvsr(int __a, const unsigned int *__b)
2640 {
2641   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2642 }
2643 #endif
2644
2645 #ifdef __LITTLE_ENDIAN__
2646 static vector unsigned char __ATTRS_o_ai
2647 __attribute__((__deprecated__("use assignment for unaligned little endian \
2648 loads/stores")))
2649 vec_lvsr(int __a, const float *__b)
2650 {
2651   vector unsigned char mask =
2652     (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2653   vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
2654   return vec_perm(mask, mask, reverse);
2655 }
2656 #else
2657 static vector unsigned char __ATTRS_o_ai
2658 vec_lvsr(int __a, const float *__b)
2659 {
2660   return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2661 }
2662 #endif
2663
2664 /* vec_madd */
2665
2666 static vector float __attribute__((__always_inline__))
2667 vec_madd(vector float __a, vector float __b, vector float __c)
2668 {
2669   return __builtin_altivec_vmaddfp(__a, __b, __c);
2670 }
2671
2672 /* vec_vmaddfp */
2673
2674 static vector float __attribute__((__always_inline__))
2675 vec_vmaddfp(vector float __a, vector float __b, vector float __c)
2676 {
2677   return __builtin_altivec_vmaddfp(__a, __b, __c);
2678 }
2679
2680 /* vec_madds */
2681
2682 static vector signed short __attribute__((__always_inline__))
2683 vec_madds(vector signed short __a, vector signed short __b, vector signed short __c)
2684 {
2685   return __builtin_altivec_vmhaddshs(__a, __b, __c);
2686 }
2687
2688 /* vec_vmhaddshs */
2689 static vector signed short __attribute__((__always_inline__))
2690 vec_vmhaddshs(vector signed short __a,
2691               vector signed short __b,
2692               vector signed short __c)
2693 {
2694   return __builtin_altivec_vmhaddshs(__a, __b, __c);
2695 }
2696
2697 /* vec_max */
2698
2699 static vector signed char __ATTRS_o_ai
2700 vec_max(vector signed char __a, vector signed char __b)
2701 {
2702   return __builtin_altivec_vmaxsb(__a, __b);
2703 }
2704
2705 static vector signed char __ATTRS_o_ai
2706 vec_max(vector bool char __a, vector signed char __b)
2707 {
2708   return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
2709 }
2710
2711 static vector signed char __ATTRS_o_ai
2712 vec_max(vector signed char __a, vector bool char __b)
2713 {
2714   return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
2715 }
2716
2717 static vector unsigned char __ATTRS_o_ai
2718 vec_max(vector unsigned char __a, vector unsigned char __b)
2719 {
2720   return __builtin_altivec_vmaxub(__a, __b);
2721 }
2722
2723 static vector unsigned char __ATTRS_o_ai
2724 vec_max(vector bool char __a, vector unsigned char __b)
2725 {
2726   return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
2727 }
2728
2729 static vector unsigned char __ATTRS_o_ai
2730 vec_max(vector unsigned char __a, vector bool char __b)
2731 {
2732   return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
2733 }
2734
2735 static vector short __ATTRS_o_ai
2736 vec_max(vector short __a, vector short __b)
2737 {
2738   return __builtin_altivec_vmaxsh(__a, __b);
2739 }
2740
2741 static vector short __ATTRS_o_ai
2742 vec_max(vector bool short __a, vector short __b)
2743 {
2744   return __builtin_altivec_vmaxsh((vector short)__a, __b);
2745 }
2746
2747 static vector short __ATTRS_o_ai
2748 vec_max(vector short __a, vector bool short __b)
2749 {
2750   return __builtin_altivec_vmaxsh(__a, (vector short)__b);
2751 }
2752
2753 static vector unsigned short __ATTRS_o_ai
2754 vec_max(vector unsigned short __a, vector unsigned short __b)
2755 {
2756   return __builtin_altivec_vmaxuh(__a, __b);
2757 }
2758
2759 static vector unsigned short __ATTRS_o_ai
2760 vec_max(vector bool short __a, vector unsigned short __b)
2761 {
2762   return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
2763 }
2764
2765 static vector unsigned short __ATTRS_o_ai
2766 vec_max(vector unsigned short __a, vector bool short __b)
2767 {
2768   return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
2769 }
2770
2771 static vector int __ATTRS_o_ai
2772 vec_max(vector int __a, vector int __b)
2773 {
2774   return __builtin_altivec_vmaxsw(__a, __b);
2775 }
2776
2777 static vector int __ATTRS_o_ai
2778 vec_max(vector bool int __a, vector int __b)
2779 {
2780   return __builtin_altivec_vmaxsw((vector int)__a, __b);
2781 }
2782
2783 static vector int __ATTRS_o_ai
2784 vec_max(vector int __a, vector bool int __b)
2785 {
2786   return __builtin_altivec_vmaxsw(__a, (vector int)__b);
2787 }
2788
2789 static vector unsigned int __ATTRS_o_ai
2790 vec_max(vector unsigned int __a, vector unsigned int __b)
2791 {
2792   return __builtin_altivec_vmaxuw(__a, __b);
2793 }
2794
2795 static vector unsigned int __ATTRS_o_ai
2796 vec_max(vector bool int __a, vector unsigned int __b)
2797 {
2798   return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
2799 }
2800
2801 static vector unsigned int __ATTRS_o_ai
2802 vec_max(vector unsigned int __a, vector bool int __b)
2803 {
2804   return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
2805 }
2806
2807 #ifdef __POWER8_VECTOR__
2808 static vector signed long long __ATTRS_o_ai
2809 vec_max(vector signed long long __a, vector signed long long __b) 
2810 {
2811   return __builtin_altivec_vmaxsd(__a, __b);
2812 }
2813
2814 static vector unsigned long long __ATTRS_o_ai
2815 vec_max(vector unsigned long long __a, vector unsigned long long __b)
2816 {
2817   return __builtin_altivec_vmaxud(__a, __b);
2818 }
2819 #endif
2820
2821 static vector float __ATTRS_o_ai
2822 vec_max(vector float __a, vector float __b)
2823 {
2824 #ifdef __VSX__
2825   return __builtin_vsx_xvmaxsp(__a, __b);
2826 #else
2827   return __builtin_altivec_vmaxfp(__a, __b);
2828 #endif
2829 }
2830
2831 #ifdef __VSX__
2832 static vector double __ATTRS_o_ai
2833 vec_max(vector double __a, vector double __b)
2834 {
2835   return __builtin_vsx_xvmaxdp(__a, __b);
2836 }
2837 #endif
2838
2839 /* vec_vmaxsb */
2840
2841 static vector signed char __ATTRS_o_ai
2842 vec_vmaxsb(vector signed char __a, vector signed char __b)
2843 {
2844   return __builtin_altivec_vmaxsb(__a, __b);
2845 }
2846
2847 static vector signed char __ATTRS_o_ai
2848 vec_vmaxsb(vector bool char __a, vector signed char __b)
2849 {
2850   return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
2851 }
2852
2853 static vector signed char __ATTRS_o_ai
2854 vec_vmaxsb(vector signed char __a, vector bool char __b)
2855 {
2856   return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
2857 }
2858
2859 /* vec_vmaxub */
2860
2861 static vector unsigned char __ATTRS_o_ai
2862 vec_vmaxub(vector unsigned char __a, vector unsigned char __b)
2863 {
2864   return __builtin_altivec_vmaxub(__a, __b);
2865 }
2866
2867 static vector unsigned char __ATTRS_o_ai
2868 vec_vmaxub(vector bool char __a, vector unsigned char __b)
2869 {
2870   return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
2871 }
2872
2873 static vector unsigned char __ATTRS_o_ai
2874 vec_vmaxub(vector unsigned char __a, vector bool char __b)
2875 {
2876   return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
2877 }
2878
2879 /* vec_vmaxsh */
2880
2881 static vector short __ATTRS_o_ai
2882 vec_vmaxsh(vector short __a, vector short __b)
2883 {
2884   return __builtin_altivec_vmaxsh(__a, __b);
2885 }
2886
2887 static vector short __ATTRS_o_ai
2888 vec_vmaxsh(vector bool short __a, vector short __b)
2889 {
2890   return __builtin_altivec_vmaxsh((vector short)__a, __b);
2891 }
2892
2893 static vector short __ATTRS_o_ai
2894 vec_vmaxsh(vector short __a, vector bool short __b)
2895 {
2896   return __builtin_altivec_vmaxsh(__a, (vector short)__b);
2897 }
2898
2899 /* vec_vmaxuh */
2900
2901 static vector unsigned short __ATTRS_o_ai
2902 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b)
2903 {
2904   return __builtin_altivec_vmaxuh(__a, __b);
2905 }
2906
2907 static vector unsigned short __ATTRS_o_ai
2908 vec_vmaxuh(vector bool short __a, vector unsigned short __b)
2909 {
2910   return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
2911 }
2912
2913 static vector unsigned short __ATTRS_o_ai
2914 vec_vmaxuh(vector unsigned short __a, vector bool short __b)
2915 {
2916   return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
2917 }
2918
2919 /* vec_vmaxsw */
2920
2921 static vector int __ATTRS_o_ai
2922 vec_vmaxsw(vector int __a, vector int __b)
2923 {
2924   return __builtin_altivec_vmaxsw(__a, __b);
2925 }
2926
2927 static vector int __ATTRS_o_ai
2928 vec_vmaxsw(vector bool int __a, vector int __b)
2929 {
2930   return __builtin_altivec_vmaxsw((vector int)__a, __b);
2931 }
2932
2933 static vector int __ATTRS_o_ai
2934 vec_vmaxsw(vector int __a, vector bool int __b)
2935 {
2936   return __builtin_altivec_vmaxsw(__a, (vector int)__b);
2937 }
2938
2939 /* vec_vmaxuw */
2940
2941 static vector unsigned int __ATTRS_o_ai
2942 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b)
2943 {
2944   return __builtin_altivec_vmaxuw(__a, __b);
2945 }
2946
2947 static vector unsigned int __ATTRS_o_ai
2948 vec_vmaxuw(vector bool int __a, vector unsigned int __b)
2949 {
2950   return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
2951 }
2952
2953 static vector unsigned int __ATTRS_o_ai
2954 vec_vmaxuw(vector unsigned int __a, vector bool int __b)
2955 {
2956   return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
2957 }
2958
2959 /* vec_vmaxfp */
2960
2961 static vector float __attribute__((__always_inline__))
2962 vec_vmaxfp(vector float __a, vector float __b)
2963 {
2964 #ifdef __VSX__
2965   return __builtin_vsx_xvmaxsp(__a, __b);
2966 #else
2967   return __builtin_altivec_vmaxfp(__a, __b);
2968 #endif
2969 }
2970
2971 /* vec_mergeh */
2972
2973 static vector signed char __ATTRS_o_ai
2974 vec_mergeh(vector signed char __a, vector signed char __b)
2975 {
2976   return vec_perm(__a, __b, (vector unsigned char)
2977     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
2978      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2979 }
2980
2981 static vector unsigned char __ATTRS_o_ai
2982 vec_mergeh(vector unsigned char __a, vector unsigned char __b)
2983 {
2984   return vec_perm(__a, __b, (vector unsigned char)
2985     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
2986      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2987 }
2988
2989 static vector bool char __ATTRS_o_ai
2990 vec_mergeh(vector bool char __a, vector bool char __b)
2991 {
2992   return vec_perm(__a, __b, (vector unsigned char)
2993     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
2994      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2995 }
2996
2997 static vector short __ATTRS_o_ai
2998 vec_mergeh(vector short __a, vector short __b)
2999 {
3000   return vec_perm(__a, __b, (vector unsigned char)
3001     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3002      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3003 }
3004
3005 static vector unsigned short __ATTRS_o_ai
3006 vec_mergeh(vector unsigned short __a, vector unsigned short __b)
3007 {
3008   return vec_perm(__a, __b, (vector unsigned char)
3009     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3010      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3011 }
3012
3013 static vector bool short __ATTRS_o_ai
3014 vec_mergeh(vector bool short __a, vector bool short __b)
3015 {
3016   return vec_perm(__a, __b, (vector unsigned char)
3017     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3018      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3019 }
3020
3021 static vector pixel __ATTRS_o_ai
3022 vec_mergeh(vector pixel __a, vector pixel __b)
3023 {
3024   return vec_perm(__a, __b, (vector unsigned char)
3025     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3026      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3027 }
3028
3029 static vector int __ATTRS_o_ai
3030 vec_mergeh(vector int __a, vector int __b)
3031 {
3032   return vec_perm(__a, __b, (vector unsigned char)
3033     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3034      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3035 }
3036
3037 static vector unsigned int __ATTRS_o_ai
3038 vec_mergeh(vector unsigned int __a, vector unsigned int __b)
3039 {
3040   return vec_perm(__a, __b, (vector unsigned char)
3041     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3042      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3043 }
3044
3045 static vector bool int __ATTRS_o_ai
3046 vec_mergeh(vector bool int __a, vector bool int __b)
3047 {
3048   return vec_perm(__a, __b, (vector unsigned char)
3049     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3050      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3051 }
3052
3053 static vector float __ATTRS_o_ai
3054 vec_mergeh(vector float __a, vector float __b)
3055 {
3056   return vec_perm(__a, __b, (vector unsigned char)
3057     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3058      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3059 }
3060
3061 /* vec_vmrghb */
3062
3063 #define __builtin_altivec_vmrghb vec_vmrghb
3064
3065 static vector signed char __ATTRS_o_ai
3066 vec_vmrghb(vector signed char __a, vector signed char __b)
3067 {
3068   return vec_perm(__a, __b, (vector unsigned char)
3069     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
3070      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
3071 }
3072
3073 static vector unsigned char __ATTRS_o_ai
3074 vec_vmrghb(vector unsigned char __a, vector unsigned char __b)
3075 {
3076   return vec_perm(__a, __b, (vector unsigned char)
3077     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
3078      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
3079 }
3080
3081 static vector bool char __ATTRS_o_ai
3082 vec_vmrghb(vector bool char __a, vector bool char __b)
3083 {
3084   return vec_perm(__a, __b, (vector unsigned char)
3085     (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, 
3086      0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
3087 }
3088
3089 /* vec_vmrghh */
3090
3091 #define __builtin_altivec_vmrghh vec_vmrghh
3092
3093 static vector short __ATTRS_o_ai
3094 vec_vmrghh(vector short __a, vector short __b)
3095 {
3096   return vec_perm(__a, __b, (vector unsigned char)
3097     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3098      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3099 }
3100
3101 static vector unsigned short __ATTRS_o_ai
3102 vec_vmrghh(vector unsigned short __a, vector unsigned short __b)
3103 {
3104   return vec_perm(__a, __b, (vector unsigned char)
3105     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3106      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3107 }
3108
3109 static vector bool short __ATTRS_o_ai
3110 vec_vmrghh(vector bool short __a, vector bool short __b)
3111 {
3112   return vec_perm(__a, __b, (vector unsigned char)
3113     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3114      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3115 }
3116
3117 static vector pixel __ATTRS_o_ai
3118 vec_vmrghh(vector pixel __a, vector pixel __b)
3119 {
3120   return vec_perm(__a, __b, (vector unsigned char)
3121     (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
3122      0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
3123 }
3124
3125 /* vec_vmrghw */
3126
3127 #define __builtin_altivec_vmrghw vec_vmrghw
3128
3129 static vector int __ATTRS_o_ai
3130 vec_vmrghw(vector int __a, vector int __b)
3131 {
3132   return vec_perm(__a, __b, (vector unsigned char)
3133     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3134      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3135 }
3136
3137 static vector unsigned int __ATTRS_o_ai
3138 vec_vmrghw(vector unsigned int __a, vector unsigned int __b)
3139 {
3140   return vec_perm(__a, __b, (vector unsigned char)
3141     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3142      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3143 }
3144
3145 static vector bool int __ATTRS_o_ai
3146 vec_vmrghw(vector bool int __a, vector bool int __b)
3147 {
3148   return vec_perm(__a, __b, (vector unsigned char)
3149     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3150      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3151 }
3152
3153 static vector float __ATTRS_o_ai
3154 vec_vmrghw(vector float __a, vector float __b)
3155 {
3156   return vec_perm(__a, __b, (vector unsigned char)
3157     (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
3158      0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
3159 }
3160
3161 /* vec_mergel */
3162
3163 static vector signed char __ATTRS_o_ai
3164 vec_mergel(vector signed char __a, vector signed char __b)
3165 {
3166   return vec_perm(__a, __b, (vector unsigned char)
3167     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3168      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3169 }
3170
3171 static vector unsigned char __ATTRS_o_ai
3172 vec_mergel(vector unsigned char __a, vector unsigned char __b)
3173 {
3174   return vec_perm(__a, __b, (vector unsigned char)
3175     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3176      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3177 }
3178
3179 static vector bool char __ATTRS_o_ai
3180 vec_mergel(vector bool char __a, vector bool char __b)
3181 {
3182   return vec_perm(__a, __b, (vector unsigned char)
3183     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3184      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3185 }
3186
3187 static vector short __ATTRS_o_ai
3188 vec_mergel(vector short __a, vector short __b)
3189 {
3190   return vec_perm(__a, __b, (vector unsigned char)
3191     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3192      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3193 }
3194
3195 static vector unsigned short __ATTRS_o_ai
3196 vec_mergel(vector unsigned short __a, vector unsigned short __b)
3197 {
3198   return vec_perm(__a, __b, (vector unsigned char)
3199     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3200      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3201 }
3202
3203 static vector bool short __ATTRS_o_ai
3204 vec_mergel(vector bool short __a, vector bool short __b)
3205 {
3206   return vec_perm(__a, __b, (vector unsigned char)
3207     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3208      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3209 }
3210
3211 static vector pixel __ATTRS_o_ai
3212 vec_mergel(vector pixel __a, vector pixel __b)
3213 {
3214   return vec_perm(__a, __b, (vector unsigned char)
3215     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3216      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3217 }
3218
3219 static vector int __ATTRS_o_ai
3220 vec_mergel(vector int __a, vector int __b)
3221 {
3222   return vec_perm(__a, __b, (vector unsigned char)
3223     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3224      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3225 }
3226
3227 static vector unsigned int __ATTRS_o_ai
3228 vec_mergel(vector unsigned int __a, vector unsigned int __b)
3229 {
3230   return vec_perm(__a, __b, (vector unsigned char)
3231     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3232      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3233 }
3234
3235 static vector bool int __ATTRS_o_ai
3236 vec_mergel(vector bool int __a, vector bool int __b)
3237 {
3238   return vec_perm(__a, __b, (vector unsigned char)
3239     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3240      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3241 }
3242
3243 static vector float __ATTRS_o_ai
3244 vec_mergel(vector float __a, vector float __b)
3245 {
3246   return vec_perm(__a, __b, (vector unsigned char)
3247     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3248      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3249 }
3250
3251 /* vec_vmrglb */
3252
3253 #define __builtin_altivec_vmrglb vec_vmrglb
3254
3255 static vector signed char __ATTRS_o_ai
3256 vec_vmrglb(vector signed char __a, vector signed char __b)
3257 {
3258   return vec_perm(__a, __b, (vector unsigned char)
3259     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3260      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3261 }
3262
3263 static vector unsigned char __ATTRS_o_ai
3264 vec_vmrglb(vector unsigned char __a, vector unsigned char __b)
3265 {
3266   return vec_perm(__a, __b, (vector unsigned char)
3267     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3268      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3269 }
3270
3271 static vector bool char __ATTRS_o_ai
3272 vec_vmrglb(vector bool char __a, vector bool char __b)
3273 {
3274   return vec_perm(__a, __b, (vector unsigned char)
3275     (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, 
3276      0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
3277 }
3278
3279 /* vec_vmrglh */
3280
3281 #define __builtin_altivec_vmrglh vec_vmrglh
3282
3283 static vector short __ATTRS_o_ai
3284 vec_vmrglh(vector short __a, vector short __b)
3285 {
3286   return vec_perm(__a, __b, (vector unsigned char)
3287     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3288      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3289 }
3290
3291 static vector unsigned short __ATTRS_o_ai
3292 vec_vmrglh(vector unsigned short __a, vector unsigned short __b)
3293 {
3294   return vec_perm(__a, __b, (vector unsigned char)
3295     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3296      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3297 }
3298
3299 static vector bool short __ATTRS_o_ai
3300 vec_vmrglh(vector bool short __a, vector bool short __b)
3301 {
3302   return vec_perm(__a, __b, (vector unsigned char)
3303     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3304      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3305 }
3306
3307 static vector pixel __ATTRS_o_ai
3308 vec_vmrglh(vector pixel __a, vector pixel __b)
3309 {
3310   return vec_perm(__a, __b, (vector unsigned char)
3311     (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
3312      0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
3313 }
3314
3315 /* vec_vmrglw */
3316
3317 #define __builtin_altivec_vmrglw vec_vmrglw
3318
3319 static vector int __ATTRS_o_ai
3320 vec_vmrglw(vector int __a, vector int __b)
3321 {
3322   return vec_perm(__a, __b, (vector unsigned char)
3323     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3324      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3325 }
3326
3327 static vector unsigned int __ATTRS_o_ai
3328 vec_vmrglw(vector unsigned int __a, vector unsigned int __b)
3329 {
3330   return vec_perm(__a, __b, (vector unsigned char)
3331     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3332      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3333 }
3334
3335 static vector bool int __ATTRS_o_ai
3336 vec_vmrglw(vector bool int __a, vector bool int __b)
3337 {
3338   return vec_perm(__a, __b, (vector unsigned char)
3339     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3340      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3341 }
3342
3343 static vector float __ATTRS_o_ai
3344 vec_vmrglw(vector float __a, vector float __b)
3345 {
3346   return vec_perm(__a, __b, (vector unsigned char)
3347     (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
3348      0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
3349 }
3350
3351 /* vec_mfvscr */
3352
3353 static vector unsigned short __attribute__((__always_inline__))
3354 vec_mfvscr(void)
3355 {
3356   return __builtin_altivec_mfvscr();
3357 }
3358
3359 /* vec_min */
3360
3361 static vector signed char __ATTRS_o_ai
3362 vec_min(vector signed char __a, vector signed char __b)
3363 {
3364   return __builtin_altivec_vminsb(__a, __b);
3365 }
3366
3367 static vector signed char __ATTRS_o_ai
3368 vec_min(vector bool char __a, vector signed char __b)
3369 {
3370   return __builtin_altivec_vminsb((vector signed char)__a, __b);
3371 }
3372
3373 static vector signed char __ATTRS_o_ai
3374 vec_min(vector signed char __a, vector bool char __b)
3375 {
3376   return __builtin_altivec_vminsb(__a, (vector signed char)__b);
3377 }
3378
3379 static vector unsigned char __ATTRS_o_ai
3380 vec_min(vector unsigned char __a, vector unsigned char __b)
3381 {
3382   return __builtin_altivec_vminub(__a, __b);
3383 }
3384
3385 static vector unsigned char __ATTRS_o_ai
3386 vec_min(vector bool char __a, vector unsigned char __b)
3387 {
3388   return __builtin_altivec_vminub((vector unsigned char)__a, __b);
3389 }
3390
3391 static vector unsigned char __ATTRS_o_ai
3392 vec_min(vector unsigned char __a, vector bool char __b)
3393 {
3394   return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
3395 }
3396
3397 static vector short __ATTRS_o_ai
3398 vec_min(vector short __a, vector short __b)
3399 {
3400   return __builtin_altivec_vminsh(__a, __b);
3401 }
3402
3403 static vector short __ATTRS_o_ai
3404 vec_min(vector bool short __a, vector short __b)
3405 {
3406   return __builtin_altivec_vminsh((vector short)__a, __b);
3407 }
3408
3409 static vector short __ATTRS_o_ai
3410 vec_min(vector short __a, vector bool short __b)
3411 {
3412   return __builtin_altivec_vminsh(__a, (vector short)__b);
3413 }
3414
3415 static vector unsigned short __ATTRS_o_ai
3416 vec_min(vector unsigned short __a, vector unsigned short __b)
3417 {
3418   return __builtin_altivec_vminuh(__a, __b);
3419 }
3420
3421 static vector unsigned short __ATTRS_o_ai
3422 vec_min(vector bool short __a, vector unsigned short __b)
3423 {
3424   return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
3425 }
3426
3427 static vector unsigned short __ATTRS_o_ai
3428 vec_min(vector unsigned short __a, vector bool short __b)
3429 {
3430   return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
3431 }
3432
3433 static vector int __ATTRS_o_ai
3434 vec_min(vector int __a, vector int __b)
3435 {
3436   return __builtin_altivec_vminsw(__a, __b);
3437 }
3438
3439 static vector int __ATTRS_o_ai
3440 vec_min(vector bool int __a, vector int __b)
3441 {
3442   return __builtin_altivec_vminsw((vector int)__a, __b);
3443 }
3444
3445 static vector int __ATTRS_o_ai
3446 vec_min(vector int __a, vector bool int __b)
3447 {
3448   return __builtin_altivec_vminsw(__a, (vector int)__b);
3449 }
3450
3451 static vector unsigned int __ATTRS_o_ai
3452 vec_min(vector unsigned int __a, vector unsigned int __b)
3453 {
3454   return __builtin_altivec_vminuw(__a, __b);
3455 }
3456
3457 static vector unsigned int __ATTRS_o_ai
3458 vec_min(vector bool int __a, vector unsigned int __b)
3459 {
3460   return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
3461 }
3462
3463 static vector unsigned int __ATTRS_o_ai
3464 vec_min(vector unsigned int __a, vector bool int __b)
3465 {
3466   return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
3467 }
3468
3469 #ifdef __POWER8_VECTOR__
3470 static vector signed long long __ATTRS_o_ai
3471 vec_min(vector signed long long __a, vector signed long long __b)
3472 {
3473   return __builtin_altivec_vminsd(__a, __b);
3474 }
3475
3476 static vector unsigned long long __ATTRS_o_ai
3477 vec_min(vector unsigned long long __a, vector unsigned long long __b)
3478 {
3479   return __builtin_altivec_vminud(__a, __b);
3480 }
3481 #endif
3482
3483 static vector float __ATTRS_o_ai
3484 vec_min(vector float __a, vector float __b)
3485 {
3486 #ifdef __VSX__
3487   return __builtin_vsx_xvminsp(__a, __b);
3488 #else
3489   return __builtin_altivec_vminfp(__a, __b);
3490 #endif
3491 }
3492
3493 #ifdef __VSX__
3494 static vector double __ATTRS_o_ai
3495 vec_min(vector double __a, vector double __b)
3496 {
3497   return __builtin_vsx_xvmindp(__a, __b);
3498 }
3499 #endif
3500
3501 /* vec_vminsb */
3502
3503 static vector signed char __ATTRS_o_ai
3504 vec_vminsb(vector signed char __a, vector signed char __b)
3505 {
3506   return __builtin_altivec_vminsb(__a, __b);
3507 }
3508
3509 static vector signed char __ATTRS_o_ai
3510 vec_vminsb(vector bool char __a, vector signed char __b)
3511 {
3512   return __builtin_altivec_vminsb((vector signed char)__a, __b);
3513 }
3514
3515 static vector signed char __ATTRS_o_ai
3516 vec_vminsb(vector signed char __a, vector bool char __b)
3517 {
3518   return __builtin_altivec_vminsb(__a, (vector signed char)__b);
3519 }
3520
3521 /* vec_vminub */
3522
3523 static vector unsigned char __ATTRS_o_ai
3524 vec_vminub(vector unsigned char __a, vector unsigned char __b)
3525 {
3526   return __builtin_altivec_vminub(__a, __b);
3527 }
3528
3529 static vector unsigned char __ATTRS_o_ai
3530 vec_vminub(vector bool char __a, vector unsigned char __b)
3531 {
3532   return __builtin_altivec_vminub((vector unsigned char)__a, __b);
3533 }
3534
3535 static vector unsigned char __ATTRS_o_ai
3536 vec_vminub(vector unsigned char __a, vector bool char __b)
3537 {
3538   return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
3539 }
3540
3541 /* vec_vminsh */
3542
3543 static vector short __ATTRS_o_ai
3544 vec_vminsh(vector short __a, vector short __b)
3545 {
3546   return __builtin_altivec_vminsh(__a, __b);
3547 }
3548
3549 static vector short __ATTRS_o_ai
3550 vec_vminsh(vector bool short __a, vector short __b)
3551 {
3552   return __builtin_altivec_vminsh((vector short)__a, __b);
3553 }
3554
3555 static vector short __ATTRS_o_ai
3556 vec_vminsh(vector short __a, vector bool short __b)
3557 {
3558   return __builtin_altivec_vminsh(__a, (vector short)__b);
3559 }
3560
3561 /* vec_vminuh */
3562
3563 static vector unsigned short __ATTRS_o_ai
3564 vec_vminuh(vector unsigned short __a, vector unsigned short __b)
3565 {
3566   return __builtin_altivec_vminuh(__a, __b);
3567 }
3568
3569 static vector unsigned short __ATTRS_o_ai
3570 vec_vminuh(vector bool short __a, vector unsigned short __b)
3571 {
3572   return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
3573 }
3574
3575 static vector unsigned short __ATTRS_o_ai
3576 vec_vminuh(vector unsigned short __a, vector bool short __b)
3577 {
3578   return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
3579 }
3580
3581 /* vec_vminsw */
3582
3583 static vector int __ATTRS_o_ai
3584 vec_vminsw(vector int __a, vector int __b)
3585 {
3586   return __builtin_altivec_vminsw(__a, __b);
3587 }
3588
3589 static vector int __ATTRS_o_ai
3590 vec_vminsw(vector bool int __a, vector int __b)
3591 {
3592   return __builtin_altivec_vminsw((vector int)__a, __b);
3593 }
3594
3595 static vector int __ATTRS_o_ai
3596 vec_vminsw(vector int __a, vector bool int __b)
3597 {
3598   return __builtin_altivec_vminsw(__a, (vector int)__b);
3599 }
3600
3601 /* vec_vminuw */
3602
3603 static vector unsigned int __ATTRS_o_ai
3604 vec_vminuw(vector unsigned int __a, vector unsigned int __b)
3605 {
3606   return __builtin_altivec_vminuw(__a, __b);
3607 }
3608
3609 static vector unsigned int __ATTRS_o_ai
3610 vec_vminuw(vector bool int __a, vector unsigned int __b)
3611 {
3612   return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
3613 }
3614
3615 static vector unsigned int __ATTRS_o_ai
3616 vec_vminuw(vector unsigned int __a, vector bool int __b)
3617 {
3618   return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
3619 }
3620
3621 /* vec_vminfp */
3622
3623 static vector float __attribute__((__always_inline__))
3624 vec_vminfp(vector float __a, vector float __b)
3625 {
3626 #ifdef __VSX__
3627   return __builtin_vsx_xvminsp(__a, __b);
3628 #else
3629   return __builtin_altivec_vminfp(__a, __b);
3630 #endif
3631 }
3632
3633 /* vec_mladd */
3634
3635 #define __builtin_altivec_vmladduhm vec_mladd
3636
3637 static vector short __ATTRS_o_ai
3638 vec_mladd(vector short __a, vector short __b, vector short __c)
3639 {
3640   return __a * __b + __c;
3641 }
3642
3643 static vector short __ATTRS_o_ai
3644 vec_mladd(vector short __a, vector unsigned short __b, vector unsigned short __c)
3645 {
3646   return __a * (vector short)__b + (vector short)__c;
3647 }
3648
3649 static vector short __ATTRS_o_ai
3650 vec_mladd(vector unsigned short __a, vector short __b, vector short __c)
3651 {
3652   return (vector short)__a * __b + __c;
3653 }
3654
3655 static vector unsigned short __ATTRS_o_ai
3656 vec_mladd(vector unsigned short __a,
3657           vector unsigned short __b,
3658           vector unsigned short __c)
3659 {
3660   return __a * __b + __c;
3661 }
3662
3663 /* vec_vmladduhm */
3664
3665 static vector short __ATTRS_o_ai
3666 vec_vmladduhm(vector short __a, vector short __b, vector short __c)
3667 {
3668   return __a * __b + __c;
3669 }
3670
3671 static vector short __ATTRS_o_ai
3672 vec_vmladduhm(vector short __a, vector unsigned short __b, vector unsigned short __c)
3673 {
3674   return __a * (vector short)__b + (vector short)__c;
3675 }
3676
3677 static vector short __ATTRS_o_ai
3678 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c)
3679 {
3680   return (vector short)__a * __b + __c;
3681 }
3682
3683 static vector unsigned short __ATTRS_o_ai
3684 vec_vmladduhm(vector unsigned short __a,
3685               vector unsigned short __b,
3686               vector unsigned short __c)
3687 {
3688   return __a * __b + __c;
3689 }
3690
3691 /* vec_mradds */
3692
3693 static vector short __attribute__((__always_inline__))
3694 vec_mradds(vector short __a, vector short __b, vector short __c)
3695 {
3696   return __builtin_altivec_vmhraddshs(__a, __b, __c);
3697 }
3698
3699 /* vec_vmhraddshs */
3700
3701 static vector short __attribute__((__always_inline__))
3702 vec_vmhraddshs(vector short __a, vector short __b, vector short __c)
3703 {
3704   return __builtin_altivec_vmhraddshs(__a, __b, __c);
3705 }
3706
3707 /* vec_msum */
3708
3709 static vector int __ATTRS_o_ai
3710 vec_msum(vector signed char __a, vector unsigned char __b, vector int __c)
3711 {
3712   return __builtin_altivec_vmsummbm(__a, __b, __c);
3713 }
3714
3715 static vector unsigned int __ATTRS_o_ai
3716 vec_msum(vector unsigned char __a, vector unsigned char __b, vector unsigned int __c)
3717 {
3718   return __builtin_altivec_vmsumubm(__a, __b, __c);
3719 }
3720
3721 static vector int __ATTRS_o_ai
3722 vec_msum(vector short __a, vector short __b, vector int __c)
3723 {
3724   return __builtin_altivec_vmsumshm(__a, __b, __c);
3725 }
3726
3727 static vector unsigned int __ATTRS_o_ai
3728 vec_msum(vector unsigned short __a,
3729          vector unsigned short __b,
3730          vector unsigned int __c)
3731 {
3732   return __builtin_altivec_vmsumuhm(__a, __b, __c);
3733 }
3734
3735 /* vec_vmsummbm */
3736
3737 static vector int __attribute__((__always_inline__))
3738 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c)
3739 {
3740   return __builtin_altivec_vmsummbm(__a, __b, __c);
3741 }
3742
3743 /* vec_vmsumubm */
3744
3745 static vector unsigned int __attribute__((__always_inline__))
3746 vec_vmsumubm(vector unsigned char __a,
3747              vector unsigned char __b,
3748              vector unsigned int __c)
3749 {
3750   return __builtin_altivec_vmsumubm(__a, __b, __c);
3751 }
3752
3753 /* vec_vmsumshm */
3754
3755 static vector int __attribute__((__always_inline__))
3756 vec_vmsumshm(vector short __a, vector short __b, vector int __c)
3757 {
3758   return __builtin_altivec_vmsumshm(__a, __b, __c);
3759 }
3760
3761 /* vec_vmsumuhm */
3762
3763 static vector unsigned int __attribute__((__always_inline__))
3764 vec_vmsumuhm(vector unsigned short __a,
3765              vector unsigned short __b,
3766              vector unsigned int __c)
3767 {
3768   return __builtin_altivec_vmsumuhm(__a, __b, __c);
3769 }
3770
3771 /* vec_msums */
3772
3773 static vector int __ATTRS_o_ai
3774 vec_msums(vector short __a, vector short __b, vector int __c)
3775 {
3776   return __builtin_altivec_vmsumshs(__a, __b, __c);
3777 }
3778
3779 static vector unsigned int __ATTRS_o_ai
3780 vec_msums(vector unsigned short __a,
3781           vector unsigned short __b,
3782           vector unsigned int __c)
3783 {
3784   return __builtin_altivec_vmsumuhs(__a, __b, __c);
3785 }
3786
3787 /* vec_vmsumshs */
3788
3789 static vector int __attribute__((__always_inline__))
3790 vec_vmsumshs(vector short __a, vector short __b, vector int __c)
3791 {
3792   return __builtin_altivec_vmsumshs(__a, __b, __c);
3793 }
3794
3795 /* vec_vmsumuhs */
3796
3797 static vector unsigned int __attribute__((__always_inline__))
3798 vec_vmsumuhs(vector unsigned short __a,
3799              vector unsigned short __b,
3800              vector unsigned int __c)
3801 {
3802   return __builtin_altivec_vmsumuhs(__a, __b, __c);
3803 }
3804
3805 /* vec_mtvscr */
3806
3807 static void __ATTRS_o_ai
3808 vec_mtvscr(vector signed char __a)
3809 {
3810   __builtin_altivec_mtvscr((vector int)__a);
3811 }
3812
3813 static void __ATTRS_o_ai
3814 vec_mtvscr(vector unsigned char __a)
3815 {
3816   __builtin_altivec_mtvscr((vector int)__a);
3817 }
3818
3819 static void __ATTRS_o_ai
3820 vec_mtvscr(vector bool char __a)
3821 {
3822   __builtin_altivec_mtvscr((vector int)__a);
3823 }
3824
3825 static void __ATTRS_o_ai
3826 vec_mtvscr(vector short __a)
3827 {
3828   __builtin_altivec_mtvscr((vector int)__a);
3829 }
3830
3831 static void __ATTRS_o_ai
3832 vec_mtvscr(vector unsigned short __a)
3833 {
3834   __builtin_altivec_mtvscr((vector int)__a);
3835 }
3836
3837 static void __ATTRS_o_ai
3838 vec_mtvscr(vector bool short __a)
3839 {
3840   __builtin_altivec_mtvscr((vector int)__a);
3841 }
3842
3843 static void __ATTRS_o_ai
3844 vec_mtvscr(vector pixel __a)
3845 {
3846   __builtin_altivec_mtvscr((vector int)__a);
3847 }
3848
3849 static void __ATTRS_o_ai
3850 vec_mtvscr(vector int __a)
3851 {
3852   __builtin_altivec_mtvscr((vector int)__a);
3853 }
3854
3855 static void __ATTRS_o_ai
3856 vec_mtvscr(vector unsigned int __a)
3857 {
3858   __builtin_altivec_mtvscr((vector int)__a);
3859 }
3860
3861 static void __ATTRS_o_ai
3862 vec_mtvscr(vector bool int __a)
3863 {
3864   __builtin_altivec_mtvscr((vector int)__a);
3865 }
3866
3867 static void __ATTRS_o_ai
3868 vec_mtvscr(vector float __a)
3869 {
3870   __builtin_altivec_mtvscr((vector int)__a);
3871 }
3872
3873 /* The vmulos* and vmules* instructions have a big endian bias, so
3874    we must reverse the meaning of "even" and "odd" for little endian.  */
3875
3876 /* vec_mule */
3877
3878 static vector short __ATTRS_o_ai
3879 vec_mule(vector signed char __a, vector signed char __b)
3880 {
3881 #ifdef __LITTLE_ENDIAN__
3882   return __builtin_altivec_vmulosb(__a, __b);
3883 #else
3884   return __builtin_altivec_vmulesb(__a, __b);
3885 #endif
3886 }
3887
3888 static vector unsigned short __ATTRS_o_ai
3889 vec_mule(vector unsigned char __a, vector unsigned char __b)
3890 {
3891 #ifdef __LITTLE_ENDIAN__
3892   return __builtin_altivec_vmuloub(__a, __b);
3893 #else
3894   return __builtin_altivec_vmuleub(__a, __b);
3895 #endif
3896 }
3897
3898 static vector int __ATTRS_o_ai
3899 vec_mule(vector short __a, vector short __b)
3900 {
3901 #ifdef __LITTLE_ENDIAN__
3902   return __builtin_altivec_vmulosh(__a, __b);
3903 #else
3904   return __builtin_altivec_vmulesh(__a, __b);
3905 #endif
3906 }
3907
3908 static vector unsigned int __ATTRS_o_ai
3909 vec_mule(vector unsigned short __a, vector unsigned short __b)
3910 {
3911 #ifdef __LITTLE_ENDIAN__
3912   return __builtin_altivec_vmulouh(__a, __b);
3913 #else
3914   return __builtin_altivec_vmuleuh(__a, __b);
3915 #endif
3916 }
3917
3918 #ifdef __POWER8_VECTOR__
3919 static vector signed long long __ATTRS_o_ai
3920 vec_mule(vector signed int __a, vector signed int __b)
3921 {
3922 #ifdef __LITTLE_ENDIAN__
3923   return __builtin_altivec_vmulosw(__a, __b);
3924 #else
3925   return __builtin_altivec_vmulesw(__a, __b);
3926 #endif
3927 }
3928
3929 static vector unsigned long long __ATTRS_o_ai
3930 vec_mule(vector unsigned int __a, vector unsigned int __b)
3931 {
3932 #ifdef __LITTLE_ENDIAN__
3933   return __builtin_altivec_vmulouw(__a, __b);
3934 #else
3935   return __builtin_altivec_vmuleuw(__a, __b);
3936 #endif
3937 }
3938 #endif
3939
3940 /* vec_vmulesb */
3941
3942 static vector short __attribute__((__always_inline__))
3943 vec_vmulesb(vector signed char __a, vector signed char __b)
3944 {
3945 #ifdef __LITTLE_ENDIAN__
3946   return __builtin_altivec_vmulosb(__a, __b);
3947 #else
3948   return __builtin_altivec_vmulesb(__a, __b);
3949 #endif
3950 }
3951
3952 /* vec_vmuleub */
3953
3954 static vector unsigned short __attribute__((__always_inline__))
3955 vec_vmuleub(vector unsigned char __a, vector unsigned char __b)
3956 {
3957 #ifdef __LITTLE_ENDIAN__
3958   return __builtin_altivec_vmuloub(__a, __b);
3959 #else
3960   return __builtin_altivec_vmuleub(__a, __b);
3961 #endif
3962 }
3963
3964 /* vec_vmulesh */
3965
3966 static vector int __attribute__((__always_inline__))
3967 vec_vmulesh(vector short __a, vector short __b)
3968 {
3969 #ifdef __LITTLE_ENDIAN__
3970   return __builtin_altivec_vmulosh(__a, __b);
3971 #else
3972   return __builtin_altivec_vmulesh(__a, __b);
3973 #endif
3974 }
3975
3976 /* vec_vmuleuh */
3977
3978 static vector unsigned int __attribute__((__always_inline__))
3979 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b)
3980 {
3981 #ifdef __LITTLE_ENDIAN__
3982   return __builtin_altivec_vmulouh(__a, __b);
3983 #else
3984   return __builtin_altivec_vmuleuh(__a, __b);
3985 #endif
3986 }
3987
3988 /* vec_mulo */
3989
3990 static vector short __ATTRS_o_ai
3991 vec_mulo(vector signed char __a, vector signed char __b)
3992 {
3993 #ifdef __LITTLE_ENDIAN__
3994   return __builtin_altivec_vmulesb(__a, __b);
3995 #else
3996   return __builtin_altivec_vmulosb(__a, __b);
3997 #endif
3998 }
3999
4000 static vector unsigned short __ATTRS_o_ai
4001 vec_mulo(vector unsigned char __a, vector unsigned char __b)
4002 {
4003 #ifdef __LITTLE_ENDIAN__
4004   return __builtin_altivec_vmuleub(__a, __b);
4005 #else
4006   return __builtin_altivec_vmuloub(__a, __b);
4007 #endif
4008 }
4009
4010 static vector int __ATTRS_o_ai
4011 vec_mulo(vector short __a, vector short __b)
4012 {
4013 #ifdef __LITTLE_ENDIAN__
4014   return __builtin_altivec_vmulesh(__a, __b);
4015 #else
4016   return __builtin_altivec_vmulosh(__a, __b);
4017 #endif
4018 }
4019
4020 static vector unsigned int __ATTRS_o_ai
4021 vec_mulo(vector unsigned short __a, vector unsigned short __b)
4022 {
4023 #ifdef __LITTLE_ENDIAN__
4024   return __builtin_altivec_vmuleuh(__a, __b);
4025 #else
4026   return __builtin_altivec_vmulouh(__a, __b);
4027 #endif
4028 }
4029
4030 #ifdef __POWER8_VECTOR__
4031 static vector signed long long __ATTRS_o_ai
4032 vec_mulo(vector signed int __a, vector signed int __b) 
4033 {
4034 #ifdef __LITTLE_ENDIAN__
4035   return __builtin_altivec_vmulesw(__a, __b);
4036 #else
4037   return __builtin_altivec_vmulosw(__a, __b);
4038 #endif
4039 }
4040
4041 static vector unsigned long long __ATTRS_o_ai
4042 vec_mulo(vector unsigned int __a, vector unsigned int __b) 
4043 {
4044 #ifdef __LITTLE_ENDIAN__
4045   return __builtin_altivec_vmuleuw(__a, __b);
4046 #else
4047   return __builtin_altivec_vmulouw(__a, __b);
4048 #endif
4049 }
4050 #endif
4051
4052 /* vec_vmulosb */
4053
4054 static vector short __attribute__((__always_inline__))
4055 vec_vmulosb(vector signed char __a, vector signed char __b)
4056 {
4057 #ifdef __LITTLE_ENDIAN__
4058   return __builtin_altivec_vmulesb(__a, __b);
4059 #else
4060   return __builtin_altivec_vmulosb(__a, __b);
4061 #endif
4062 }
4063
4064 /* vec_vmuloub */
4065
4066 static vector unsigned short __attribute__((__always_inline__))
4067 vec_vmuloub(vector unsigned char __a, vector unsigned char __b)
4068 {
4069 #ifdef __LITTLE_ENDIAN__
4070   return __builtin_altivec_vmuleub(__a, __b);
4071 #else
4072   return __builtin_altivec_vmuloub(__a, __b);
4073 #endif
4074 }
4075
4076 /* vec_vmulosh */
4077
4078 static vector int __attribute__((__always_inline__))
4079 vec_vmulosh(vector short __a, vector short __b)
4080 {
4081 #ifdef __LITTLE_ENDIAN__
4082   return __builtin_altivec_vmulesh(__a, __b);
4083 #else
4084   return __builtin_altivec_vmulosh(__a, __b);
4085 #endif
4086 }
4087
4088 /* vec_vmulouh */
4089
4090 static vector unsigned int __attribute__((__always_inline__))
4091 vec_vmulouh(vector unsigned short __a, vector unsigned short __b)
4092 {
4093 #ifdef __LITTLE_ENDIAN__
4094   return __builtin_altivec_vmuleuh(__a, __b);
4095 #else
4096   return __builtin_altivec_vmulouh(__a, __b);
4097 #endif
4098 }
4099
4100 /* vec_nmsub */
4101
4102 static vector float __attribute__((__always_inline__))
4103 vec_nmsub(vector float __a, vector float __b, vector float __c)
4104 {
4105   return __builtin_altivec_vnmsubfp(__a, __b, __c);
4106 }
4107
4108 /* vec_vnmsubfp */
4109
4110 static vector float __attribute__((__always_inline__))
4111 vec_vnmsubfp(vector float __a, vector float __b, vector float __c)
4112 {
4113   return __builtin_altivec_vnmsubfp(__a, __b, __c);
4114 }
4115
4116 /* vec_nor */
4117
4118 #define __builtin_altivec_vnor vec_nor
4119
4120 static vector signed char __ATTRS_o_ai
4121 vec_nor(vector signed char __a, vector signed char __b)
4122 {
4123   return ~(__a | __b);
4124 }
4125
4126 static vector unsigned char __ATTRS_o_ai
4127 vec_nor(vector unsigned char __a, vector unsigned char __b)
4128 {
4129   return ~(__a | __b);
4130 }
4131
4132 static vector bool char __ATTRS_o_ai
4133 vec_nor(vector bool char __a, vector bool char __b)
4134 {
4135   return ~(__a | __b);
4136 }
4137
4138 static vector short __ATTRS_o_ai
4139 vec_nor(vector short __a, vector short __b)
4140 {
4141   return ~(__a | __b);
4142 }
4143
4144 static vector unsigned short __ATTRS_o_ai
4145 vec_nor(vector unsigned short __a, vector unsigned short __b)
4146 {
4147   return ~(__a | __b);
4148 }
4149
4150 static vector bool short __ATTRS_o_ai
4151 vec_nor(vector bool short __a, vector bool short __b)
4152 {
4153   return ~(__a | __b);
4154 }
4155
4156 static vector int __ATTRS_o_ai
4157 vec_nor(vector int __a, vector int __b)
4158 {
4159   return ~(__a | __b);
4160 }
4161
4162 static vector unsigned int __ATTRS_o_ai
4163 vec_nor(vector unsigned int __a, vector unsigned int __b)
4164 {
4165   return ~(__a | __b);
4166 }
4167
4168 static vector bool int __ATTRS_o_ai
4169 vec_nor(vector bool int __a, vector bool int __b)
4170 {
4171   return ~(__a | __b);
4172 }
4173
4174 static vector float __ATTRS_o_ai
4175 vec_nor(vector float __a, vector float __b)
4176 {
4177   vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b);
4178   return (vector float)__res;
4179 }
4180
4181 /* vec_vnor */
4182
4183 static vector signed char __ATTRS_o_ai
4184 vec_vnor(vector signed char __a, vector signed char __b)
4185 {
4186   return ~(__a | __b);
4187 }
4188
4189 static vector unsigned char __ATTRS_o_ai
4190 vec_vnor(vector unsigned char __a, vector unsigned char __b)
4191 {
4192   return ~(__a | __b);
4193 }
4194
4195 static vector bool char __ATTRS_o_ai
4196 vec_vnor(vector bool char __a, vector bool char __b)
4197 {
4198   return ~(__a | __b);
4199 }
4200
4201 static vector short __ATTRS_o_ai
4202 vec_vnor(vector short __a, vector short __b)
4203 {
4204   return ~(__a | __b);
4205 }
4206
4207 static vector unsigned short __ATTRS_o_ai
4208 vec_vnor(vector unsigned short __a, vector unsigned short __b)
4209 {
4210   return ~(__a | __b);
4211 }
4212
4213 static vector bool short __ATTRS_o_ai
4214 vec_vnor(vector bool short __a, vector bool short __b)
4215 {
4216   return ~(__a | __b);
4217 }
4218
4219 static vector int __ATTRS_o_ai
4220 vec_vnor(vector int __a, vector int __b)
4221 {
4222   return ~(__a | __b);
4223 }
4224
4225 static vector unsigned int __ATTRS_o_ai
4226 vec_vnor(vector unsigned int __a, vector unsigned int __b)
4227 {
4228   return ~(__a | __b);
4229 }
4230
4231 static vector bool int __ATTRS_o_ai
4232 vec_vnor(vector bool int __a, vector bool int __b)
4233 {
4234   return ~(__a | __b);
4235 }
4236
4237 static vector float __ATTRS_o_ai
4238 vec_vnor(vector float __a, vector float __b)
4239 {
4240   vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b);
4241   return (vector float)__res;
4242 }
4243
4244 /* vec_or */
4245
4246 #define __builtin_altivec_vor vec_or
4247
4248 static vector signed char __ATTRS_o_ai
4249 vec_or(vector signed char __a, vector signed char __b)
4250 {
4251   return __a | __b;
4252 }
4253
4254 static vector signed char __ATTRS_o_ai
4255 vec_or(vector bool char __a, vector signed char __b)
4256 {
4257   return (vector signed char)__a | __b;
4258 }
4259
4260 static vector signed char __ATTRS_o_ai
4261 vec_or(vector signed char __a, vector bool char __b)
4262 {
4263   return __a | (vector signed char)__b;
4264 }
4265
4266 static vector unsigned char __ATTRS_o_ai
4267 vec_or(vector unsigned char __a, vector unsigned char __b)
4268 {
4269   return __a | __b;
4270 }
4271
4272 static vector unsigned char __ATTRS_o_ai
4273 vec_or(vector bool char __a, vector unsigned char __b)
4274 {
4275   return (vector unsigned char)__a | __b;
4276 }
4277
4278 static vector unsigned char __ATTRS_o_ai
4279 vec_or(vector unsigned char __a, vector bool char __b)
4280 {
4281   return __a | (vector unsigned char)__b;
4282 }
4283
4284 static vector bool char __ATTRS_o_ai
4285 vec_or(vector bool char __a, vector bool char __b)
4286 {
4287   return __a | __b;
4288 }
4289
4290 static vector short __ATTRS_o_ai
4291 vec_or(vector short __a, vector short __b)
4292 {
4293   return __a | __b;
4294 }
4295
4296 static vector short __ATTRS_o_ai
4297 vec_or(vector bool short __a, vector short __b)
4298 {
4299   return (vector short)__a | __b;
4300 }
4301
4302 static vector short __ATTRS_o_ai
4303 vec_or(vector short __a, vector bool short __b)
4304 {
4305   return __a | (vector short)__b;
4306 }
4307
4308 static vector unsigned short __ATTRS_o_ai
4309 vec_or(vector unsigned short __a, vector unsigned short __b)
4310 {
4311   return __a | __b;
4312 }
4313
4314 static vector unsigned short __ATTRS_o_ai
4315 vec_or(vector bool short __a, vector unsigned short __b)
4316 {
4317   return (vector unsigned short)__a | __b;
4318 }
4319
4320 static vector unsigned short __ATTRS_o_ai
4321 vec_or(vector unsigned short __a, vector bool short __b)
4322 {
4323   return __a | (vector unsigned short)__b;
4324 }
4325
4326 static vector bool short __ATTRS_o_ai
4327 vec_or(vector bool short __a, vector bool short __b)
4328 {
4329   return __a | __b;
4330 }
4331
4332 static vector int __ATTRS_o_ai
4333 vec_or(vector int __a, vector int __b)
4334 {
4335   return __a | __b;
4336 }
4337
4338 static vector int __ATTRS_o_ai
4339 vec_or(vector bool int __a, vector int __b)
4340 {
4341   return (vector int)__a | __b;
4342 }
4343
4344 static vector int __ATTRS_o_ai
4345 vec_or(vector int __a, vector bool int __b)
4346 {
4347   return __a | (vector int)__b;
4348 }
4349
4350 static vector unsigned int __ATTRS_o_ai
4351 vec_or(vector unsigned int __a, vector unsigned int __b)
4352 {
4353   return __a | __b;
4354 }
4355
4356 static vector unsigned int __ATTRS_o_ai
4357 vec_or(vector bool int __a, vector unsigned int __b)
4358 {
4359   return (vector unsigned int)__a | __b;
4360 }
4361
4362 static vector unsigned int __ATTRS_o_ai
4363 vec_or(vector unsigned int __a, vector bool int __b)
4364 {
4365   return __a | (vector unsigned int)__b;
4366 }
4367
4368 static vector bool int __ATTRS_o_ai
4369 vec_or(vector bool int __a, vector bool int __b)
4370 {
4371   return __a | __b;
4372 }
4373
4374 static vector float __ATTRS_o_ai
4375 vec_or(vector float __a, vector float __b)
4376 {
4377   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4378   return (vector float)__res;
4379 }
4380
4381 static vector float __ATTRS_o_ai
4382 vec_or(vector bool int __a, vector float __b)
4383 {
4384   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4385   return (vector float)__res;
4386 }
4387
4388 static vector float __ATTRS_o_ai
4389 vec_or(vector float __a, vector bool int __b)
4390 {
4391   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4392   return (vector float)__res;
4393 }
4394
4395 /* vec_vor */
4396
4397 static vector signed char __ATTRS_o_ai
4398 vec_vor(vector signed char __a, vector signed char __b)
4399 {
4400   return __a | __b;
4401 }
4402
4403 static vector signed char __ATTRS_o_ai
4404 vec_vor(vector bool char __a, vector signed char __b)
4405 {
4406   return (vector signed char)__a | __b;
4407 }
4408
4409 static vector signed char __ATTRS_o_ai
4410 vec_vor(vector signed char __a, vector bool char __b)
4411 {
4412   return __a | (vector signed char)__b;
4413 }
4414
4415 static vector unsigned char __ATTRS_o_ai
4416 vec_vor(vector unsigned char __a, vector unsigned char __b)
4417 {
4418   return __a | __b;
4419 }
4420
4421 static vector unsigned char __ATTRS_o_ai
4422 vec_vor(vector bool char __a, vector unsigned char __b)
4423 {
4424   return (vector unsigned char)__a | __b;
4425 }
4426
4427 static vector unsigned char __ATTRS_o_ai
4428 vec_vor(vector unsigned char __a, vector bool char __b)
4429 {
4430   return __a | (vector unsigned char)__b;
4431 }
4432
4433 static vector bool char __ATTRS_o_ai
4434 vec_vor(vector bool char __a, vector bool char __b)
4435 {
4436   return __a | __b;
4437 }
4438
4439 static vector short __ATTRS_o_ai
4440 vec_vor(vector short __a, vector short __b)
4441 {
4442   return __a | __b;
4443 }
4444
4445 static vector short __ATTRS_o_ai
4446 vec_vor(vector bool short __a, vector short __b)
4447 {
4448   return (vector short)__a | __b;
4449 }
4450
4451 static vector short __ATTRS_o_ai
4452 vec_vor(vector short __a, vector bool short __b)
4453 {
4454   return __a | (vector short)__b;
4455 }
4456
4457 static vector unsigned short __ATTRS_o_ai
4458 vec_vor(vector unsigned short __a, vector unsigned short __b)
4459 {
4460   return __a | __b;
4461 }
4462
4463 static vector unsigned short __ATTRS_o_ai
4464 vec_vor(vector bool short __a, vector unsigned short __b)
4465 {
4466   return (vector unsigned short)__a | __b;
4467 }
4468
4469 static vector unsigned short __ATTRS_o_ai
4470 vec_vor(vector unsigned short __a, vector bool short __b)
4471 {
4472   return __a | (vector unsigned short)__b;
4473 }
4474
4475 static vector bool short __ATTRS_o_ai
4476 vec_vor(vector bool short __a, vector bool short __b)
4477 {
4478   return __a | __b;
4479 }
4480
4481 static vector int __ATTRS_o_ai
4482 vec_vor(vector int __a, vector int __b)
4483 {
4484   return __a | __b;
4485 }
4486
4487 static vector int __ATTRS_o_ai
4488 vec_vor(vector bool int __a, vector int __b)
4489 {
4490   return (vector int)__a | __b;
4491 }
4492
4493 static vector int __ATTRS_o_ai
4494 vec_vor(vector int __a, vector bool int __b)
4495 {
4496   return __a | (vector int)__b;
4497 }
4498
4499 static vector unsigned int __ATTRS_o_ai
4500 vec_vor(vector unsigned int __a, vector unsigned int __b)
4501 {
4502   return __a | __b;
4503 }
4504
4505 static vector unsigned int __ATTRS_o_ai
4506 vec_vor(vector bool int __a, vector unsigned int __b)
4507 {
4508   return (vector unsigned int)__a | __b;
4509 }
4510
4511 static vector unsigned int __ATTRS_o_ai
4512 vec_vor(vector unsigned int __a, vector bool int __b)
4513 {
4514   return __a | (vector unsigned int)__b;
4515 }
4516
4517 static vector bool int __ATTRS_o_ai
4518 vec_vor(vector bool int __a, vector bool int __b)
4519 {
4520   return __a | __b;
4521 }
4522
4523 static vector float __ATTRS_o_ai
4524 vec_vor(vector float __a, vector float __b)
4525 {
4526   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4527   return (vector float)__res;
4528 }
4529
4530 static vector float __ATTRS_o_ai
4531 vec_vor(vector bool int __a, vector float __b)
4532 {
4533   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4534   return (vector float)__res;
4535 }
4536
4537 static vector float __ATTRS_o_ai
4538 vec_vor(vector float __a, vector bool int __b)
4539 {
4540   vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4541   return (vector float)__res;
4542 }
4543
4544 /* vec_pack */
4545
4546 /* The various vector pack instructions have a big-endian bias, so for
4547    little endian we must handle reversed element numbering.  */
4548
4549 static vector signed char __ATTRS_o_ai
4550 vec_pack(vector signed short __a, vector signed short __b)
4551 {
4552 #ifdef __LITTLE_ENDIAN__
4553   return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
4554     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4555      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4556 #else
4557   return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
4558     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4559      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4560 #endif
4561 }
4562
4563 static vector unsigned char __ATTRS_o_ai
4564 vec_pack(vector unsigned short __a, vector unsigned short __b)
4565 {
4566 #ifdef __LITTLE_ENDIAN__
4567   return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
4568     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4569      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4570 #else
4571   return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
4572     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4573      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4574 #endif
4575 }
4576
4577 static vector bool char __ATTRS_o_ai
4578 vec_pack(vector bool short __a, vector bool short __b)
4579 {
4580 #ifdef __LITTLE_ENDIAN__
4581   return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
4582     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4583      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4584 #else
4585   return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
4586     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4587      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4588 #endif
4589 }
4590
4591 static vector short __ATTRS_o_ai
4592 vec_pack(vector int __a, vector int __b)
4593 {
4594 #ifdef __LITTLE_ENDIAN__
4595   return (vector short)vec_perm(__a, __b, (vector unsigned char)
4596     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4597      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4598 #else
4599   return (vector short)vec_perm(__a, __b, (vector unsigned char)
4600     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4601      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4602 #endif
4603 }
4604
4605 static vector unsigned short __ATTRS_o_ai
4606 vec_pack(vector unsigned int __a, vector unsigned int __b)
4607 {
4608 #ifdef __LITTLE_ENDIAN__
4609   return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
4610     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4611      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4612 #else
4613   return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
4614     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4615      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4616 #endif
4617 }
4618
4619 static vector bool short __ATTRS_o_ai
4620 vec_pack(vector bool int __a, vector bool int __b)
4621 {
4622 #ifdef __LITTLE_ENDIAN__
4623   return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
4624     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4625      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4626 #else
4627   return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
4628     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4629      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4630 #endif
4631 }
4632
4633 /* vec_vpkuhum */
4634
4635 #define __builtin_altivec_vpkuhum vec_vpkuhum
4636
4637 static vector signed char __ATTRS_o_ai
4638 vec_vpkuhum(vector signed short __a, vector signed short __b)
4639 {
4640 #ifdef __LITTLE_ENDIAN__
4641   return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
4642     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4643      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4644 #else
4645   return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
4646     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4647      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4648 #endif
4649 }
4650
4651 static vector unsigned char __ATTRS_o_ai
4652 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b)
4653 {
4654 #ifdef __LITTLE_ENDIAN__
4655   return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
4656     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4657      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4658 #else
4659   return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
4660     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4661      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4662 #endif
4663 }
4664
4665 static vector bool char __ATTRS_o_ai
4666 vec_vpkuhum(vector bool short __a, vector bool short __b)
4667 {
4668 #ifdef __LITTLE_ENDIAN__
4669   return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
4670     (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
4671      0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
4672 #else
4673   return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
4674     (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4675      0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4676 #endif
4677 }
4678
4679 /* vec_vpkuwum */
4680
4681 #define __builtin_altivec_vpkuwum vec_vpkuwum
4682
4683 static vector short __ATTRS_o_ai
4684 vec_vpkuwum(vector int __a, vector int __b)
4685 {
4686 #ifdef __LITTLE_ENDIAN__
4687   return (vector short)vec_perm(__a, __b, (vector unsigned char)
4688     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4689      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4690 #else
4691   return (vector short)vec_perm(__a, __b, (vector unsigned char)
4692     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4693      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4694 #endif
4695 }
4696
4697 static vector unsigned short __ATTRS_o_ai
4698 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b)
4699 {
4700 #ifdef __LITTLE_ENDIAN__
4701   return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
4702     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4703      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4704 #else
4705   return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
4706     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4707      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4708 #endif
4709 }
4710
4711 static vector bool short __ATTRS_o_ai
4712 vec_vpkuwum(vector bool int __a, vector bool int __b)
4713 {
4714 #ifdef __LITTLE_ENDIAN__
4715   return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
4716     (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
4717      0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
4718 #else
4719   return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
4720     (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4721      0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4722 #endif
4723 }
4724
4725 /* vec_vpkudum */
4726
4727 #ifdef __POWER8_VECTOR__
4728 #define __builtin_altivec_vpkudum vec_vpkudum
4729
4730 static vector int __ATTRS_o_ai
4731 vec_vpkudum(vector long long __a, vector long long __b)
4732 {
4733 #ifdef __LITTLE_ENDIAN__
4734   return (vector int)vec_perm(__a, __b, (vector unsigned char)
4735     (0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
4736      0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
4737 #else
4738   return (vector int)vec_perm(__a, __b, (vector unsigned char)
4739     (0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
4740      0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
4741 #endif
4742 }
4743
4744 static vector unsigned int __ATTRS_o_ai
4745 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b)
4746 {
4747 #ifdef __LITTLE_ENDIAN__
4748   return (vector unsigned int)vec_perm(__a, __b, (vector unsigned char)
4749     (0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
4750      0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
4751 #else
4752   return (vector unsigned int)vec_perm(__a, __b, (vector unsigned char)
4753     (0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
4754      0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
4755 #endif
4756 }
4757
4758 static vector bool int __ATTRS_o_ai
4759 vec_vpkudum(vector bool long long __a, vector bool long long __b)
4760 {
4761 #ifdef __LITTLE_ENDIAN__
4762   return (vector bool int)vec_perm((vector long long)__a,
4763                                    (vector long long)__b,
4764                                    (vector unsigned char)
4765     (0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
4766      0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
4767 #else
4768   return (vector bool int)vec_perm((vector long long)__a,
4769                                    (vector long long)__b,
4770                                    (vector unsigned char)
4771     (0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
4772      0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
4773 #endif
4774 }
4775 #endif
4776
4777 /* vec_packpx */
4778
4779 static vector pixel __attribute__((__always_inline__))
4780 vec_packpx(vector unsigned int __a, vector unsigned int __b)
4781 {
4782 #ifdef __LITTLE_ENDIAN__
4783   return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
4784 #else
4785   return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
4786 #endif
4787 }
4788
4789 /* vec_vpkpx */
4790
4791 static vector pixel __attribute__((__always_inline__))
4792 vec_vpkpx(vector unsigned int __a, vector unsigned int __b)
4793 {
4794 #ifdef __LITTLE_ENDIAN__
4795   return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
4796 #else
4797   return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
4798 #endif
4799 }
4800
4801 /* vec_packs */
4802
4803 static vector signed char __ATTRS_o_ai
4804 vec_packs(vector short __a, vector short __b)
4805 {
4806 #ifdef __LITTLE_ENDIAN__
4807   return __builtin_altivec_vpkshss(__b, __a);
4808 #else
4809   return __builtin_altivec_vpkshss(__a, __b);
4810 #endif
4811 }
4812
4813 static vector unsigned char __ATTRS_o_ai
4814 vec_packs(vector unsigned short __a, vector unsigned short __b)
4815 {
4816 #ifdef __LITTLE_ENDIAN__
4817   return __builtin_altivec_vpkuhus(__b, __a);
4818 #else
4819   return __builtin_altivec_vpkuhus(__a, __b);
4820 #endif
4821 }
4822
4823 static vector signed short __ATTRS_o_ai
4824 vec_packs(vector int __a, vector int __b)
4825 {
4826 #ifdef __LITTLE_ENDIAN__
4827   return __builtin_altivec_vpkswss(__b, __a);
4828 #else
4829   return __builtin_altivec_vpkswss(__a, __b);
4830 #endif
4831 }
4832
4833 static vector unsigned short __ATTRS_o_ai
4834 vec_packs(vector unsigned int __a, vector unsigned int __b)
4835 {
4836 #ifdef __LITTLE_ENDIAN__
4837   return __builtin_altivec_vpkuwus(__b, __a);
4838 #else
4839   return __builtin_altivec_vpkuwus(__a, __b);
4840 #endif
4841 }
4842
4843 #ifdef __POWER8_VECTOR__
4844 static vector int __ATTRS_o_ai
4845 vec_packs(vector long long __a, vector long long __b)
4846 {
4847 #ifdef __LITTLE_ENDIAN__
4848   return __builtin_altivec_vpksdss(__b, __a);
4849 #else
4850   return __builtin_altivec_vpksdss(__a, __b);
4851 #endif
4852 }
4853
4854 static vector unsigned int __ATTRS_o_ai
4855 vec_packs(vector unsigned long long __a, vector unsigned long long __b)
4856 {
4857 #ifdef __LITTLE_ENDIAN__
4858   return __builtin_altivec_vpkudus(__b, __a);
4859 #else
4860   return __builtin_altivec_vpkudus(__a, __b);
4861 #endif
4862 }
4863 #endif
4864
4865 /* vec_vpkshss */
4866
4867 static vector signed char __attribute__((__always_inline__))
4868 vec_vpkshss(vector short __a, vector short __b)
4869 {
4870 #ifdef __LITTLE_ENDIAN__
4871   return __builtin_altivec_vpkshss(__b, __a);
4872 #else
4873   return __builtin_altivec_vpkshss(__a, __b);
4874 #endif
4875 }
4876
4877 /* vec_vpksdss */
4878
4879 #ifdef __POWER8_VECTOR__
4880 static vector int __ATTRS_o_ai
4881 vec_vpksdss(vector long long __a, vector long long __b)
4882 {
4883 #ifdef __LITTLE_ENDIAN__
4884   return __builtin_altivec_vpksdss(__b, __a);
4885 #else
4886   return __builtin_altivec_vpksdss(__a, __b);
4887 #endif
4888 }
4889 #endif
4890
4891 /* vec_vpkuhus */
4892
4893 static vector unsigned char __attribute__((__always_inline__))
4894 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b)
4895 {
4896 #ifdef __LITTLE_ENDIAN__
4897   return __builtin_altivec_vpkuhus(__b, __a);
4898 #else
4899   return __builtin_altivec_vpkuhus(__a, __b);
4900 #endif
4901 }
4902
4903 /* vec_vpkudus */
4904
4905 #ifdef __POWER8_VECTOR__
4906 static vector unsigned int __attribute__((__always_inline__))
4907 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b)
4908 {
4909 #ifdef __LITTLE_ENDIAN__
4910   return __builtin_altivec_vpkudus(__b, __a);
4911 #else
4912   return __builtin_altivec_vpkudus(__a, __b);
4913 #endif
4914 }
4915 #endif
4916
4917 /* vec_vpkswss */
4918
4919 static vector signed short __attribute__((__always_inline__))
4920 vec_vpkswss(vector int __a, vector int __b)
4921 {
4922 #ifdef __LITTLE_ENDIAN__
4923   return __builtin_altivec_vpkswss(__b, __a);
4924 #else
4925   return __builtin_altivec_vpkswss(__a, __b);
4926 #endif
4927 }
4928
4929 /* vec_vpkuwus */
4930
4931 static vector unsigned short __attribute__((__always_inline__))
4932 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b)
4933 {
4934 #ifdef __LITTLE_ENDIAN__
4935   return __builtin_altivec_vpkuwus(__b, __a);
4936 #else
4937   return __builtin_altivec_vpkuwus(__a, __b);
4938 #endif
4939 }
4940
4941 /* vec_packsu */
4942
4943 static vector unsigned char __ATTRS_o_ai
4944 vec_packsu(vector short __a, vector short __b)
4945 {
4946 #ifdef __LITTLE_ENDIAN__
4947   return __builtin_altivec_vpkshus(__b, __a);
4948 #else
4949   return __builtin_altivec_vpkshus(__a, __b);
4950 #endif
4951 }
4952
4953 static vector unsigned char __ATTRS_o_ai
4954 vec_packsu(vector unsigned short __a, vector unsigned short __b)
4955 {
4956 #ifdef __LITTLE_ENDIAN__
4957   return __builtin_altivec_vpkuhus(__b, __a);
4958 #else
4959   return __builtin_altivec_vpkuhus(__a, __b);
4960 #endif
4961 }
4962
4963 static vector unsigned short __ATTRS_o_ai
4964 vec_packsu(vector int __a, vector int __b)
4965 {
4966 #ifdef __LITTLE_ENDIAN__
4967   return __builtin_altivec_vpkswus(__b, __a);
4968 #else
4969   return __builtin_altivec_vpkswus(__a, __b);
4970 #endif
4971 }
4972
4973 static vector unsigned short __ATTRS_o_ai
4974 vec_packsu(vector unsigned int __a, vector unsigned int __b)
4975 {
4976 #ifdef __LITTLE_ENDIAN__
4977   return __builtin_altivec_vpkuwus(__b, __a);
4978 #else
4979   return __builtin_altivec_vpkuwus(__a, __b);
4980 #endif
4981 }
4982
4983 #ifdef __POWER8_VECTOR__
4984 static vector unsigned int __ATTRS_o_ai
4985 vec_packsu(vector long long __a, vector long long __b)
4986 {
4987 #ifdef __LITTLE_ENDIAN__
4988   return __builtin_altivec_vpksdus(__b, __a);
4989 #else
4990   return __builtin_altivec_vpksdus(__a, __b);
4991 #endif
4992 }
4993
4994 static vector unsigned int __ATTRS_o_ai
4995 vec_packsu(vector unsigned long long __a, vector unsigned long long __b)
4996 {
4997 #ifdef __LITTLE_ENDIAN__
4998   return __builtin_altivec_vpkudus(__b, __a);
4999 #else
5000   return __builtin_altivec_vpkudus(__a, __b);
5001 #endif
5002 }
5003 #endif
5004
5005 /* vec_vpkshus */
5006
5007 static vector unsigned char __ATTRS_o_ai
5008 vec_vpkshus(vector short __a, vector short __b)
5009 {
5010 #ifdef __LITTLE_ENDIAN__
5011   return __builtin_altivec_vpkshus(__b, __a);
5012 #else
5013   return __builtin_altivec_vpkshus(__a, __b);
5014 #endif
5015 }
5016
5017 static vector unsigned char __ATTRS_o_ai
5018 vec_vpkshus(vector unsigned short __a, vector unsigned short __b)
5019 {
5020 #ifdef __LITTLE_ENDIAN__
5021   return __builtin_altivec_vpkuhus(__b, __a);
5022 #else
5023   return __builtin_altivec_vpkuhus(__a, __b);
5024 #endif
5025 }
5026
5027 /* vec_vpkswus */
5028
5029 static vector unsigned short __ATTRS_o_ai
5030 vec_vpkswus(vector int __a, vector int __b)
5031 {
5032 #ifdef __LITTLE_ENDIAN__
5033   return __builtin_altivec_vpkswus(__b, __a);
5034 #else
5035   return __builtin_altivec_vpkswus(__a, __b);
5036 #endif
5037 }
5038
5039 static vector unsigned short __ATTRS_o_ai
5040 vec_vpkswus(vector unsigned int __a, vector unsigned int __b)
5041 {
5042 #ifdef __LITTLE_ENDIAN__
5043   return __builtin_altivec_vpkuwus(__b, __a);
5044 #else
5045   return __builtin_altivec_vpkuwus(__a, __b);
5046 #endif
5047 }
5048
5049 /* vec_vpksdus */
5050
5051 #ifdef __POWER8_VECTOR__
5052 static vector unsigned int __ATTRS_o_ai
5053 vec_vpksdus(vector long long __a, vector long long __b)
5054 {
5055 #ifdef __LITTLE_ENDIAN__
5056   return __builtin_altivec_vpksdus(__b, __a);
5057 #else
5058   return __builtin_altivec_vpksdus(__a, __b);
5059 #endif
5060 }
5061 #endif
5062
5063 /* vec_perm */
5064
5065 // The vperm instruction is defined architecturally with a big-endian bias.
5066 // For little endian, we swap the input operands and invert the permute
5067 // control vector.  Only the rightmost 5 bits matter, so we could use
5068 // a vector of all 31s instead of all 255s to perform the inversion.
5069 // However, when the PCV is not a constant, using 255 has an advantage
5070 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
5071 // later, possibly a vec_nand).
5072
5073 static vector signed char __ATTRS_o_ai
5074 vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c)
5075 {
5076 #ifdef __LITTLE_ENDIAN__
5077   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5078                               255,255,255,255,255,255,255,255};
5079   __d = vec_xor(__c, __d);
5080   return (vector signed char)
5081            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5082 #else
5083   return (vector signed char)
5084            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5085 #endif
5086 }
5087
5088 static vector unsigned char __ATTRS_o_ai
5089 vec_perm(vector unsigned char __a,
5090          vector unsigned char __b,
5091          vector unsigned char __c)
5092 {
5093 #ifdef __LITTLE_ENDIAN__
5094   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5095                               255,255,255,255,255,255,255,255};
5096   __d = vec_xor(__c, __d);
5097   return (vector unsigned char)
5098            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5099 #else
5100   return (vector unsigned char)
5101            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5102 #endif
5103 }
5104
5105 static vector bool char __ATTRS_o_ai
5106 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c)
5107 {
5108 #ifdef __LITTLE_ENDIAN__
5109   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5110                               255,255,255,255,255,255,255,255};
5111   __d = vec_xor(__c, __d);
5112   return (vector bool char)
5113            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5114 #else
5115   return (vector bool char)
5116            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5117 #endif
5118 }
5119
5120 static vector short __ATTRS_o_ai
5121 vec_perm(vector short __a, vector short __b, vector unsigned char __c)
5122 {
5123 #ifdef __LITTLE_ENDIAN__
5124   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5125                               255,255,255,255,255,255,255,255};
5126   __d = vec_xor(__c, __d);
5127   return (vector short)
5128            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5129 #else
5130   return (vector short)
5131            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5132 #endif
5133 }
5134
5135 static vector unsigned short __ATTRS_o_ai
5136 vec_perm(vector unsigned short __a,
5137          vector unsigned short __b,
5138          vector unsigned char __c)
5139 {
5140 #ifdef __LITTLE_ENDIAN__
5141   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5142                               255,255,255,255,255,255,255,255};
5143   __d = vec_xor(__c, __d);
5144   return (vector unsigned short)
5145            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5146 #else
5147   return (vector unsigned short)
5148            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5149 #endif
5150 }
5151
5152 static vector bool short __ATTRS_o_ai
5153 vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c)
5154 {
5155 #ifdef __LITTLE_ENDIAN__
5156   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5157                               255,255,255,255,255,255,255,255};
5158   __d = vec_xor(__c, __d);
5159   return (vector bool short)
5160            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5161 #else
5162   return (vector bool short)
5163            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5164 #endif
5165 }
5166
5167 static vector pixel __ATTRS_o_ai
5168 vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c)
5169 {
5170 #ifdef __LITTLE_ENDIAN__
5171   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5172                               255,255,255,255,255,255,255,255};
5173   __d = vec_xor(__c, __d);
5174   return (vector pixel)
5175            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5176 #else
5177   return (vector pixel)
5178            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5179 #endif
5180 }
5181
5182 static vector int __ATTRS_o_ai
5183 vec_perm(vector int __a, vector int __b, vector unsigned char __c)
5184 {
5185 #ifdef __LITTLE_ENDIAN__
5186   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5187                               255,255,255,255,255,255,255,255};
5188   __d = vec_xor(__c, __d);
5189   return (vector int)__builtin_altivec_vperm_4si(__b, __a, __d);
5190 #else
5191   return (vector int)__builtin_altivec_vperm_4si(__a, __b, __c);
5192 #endif
5193 }
5194
5195 static vector unsigned int __ATTRS_o_ai
5196 vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c)
5197 {
5198 #ifdef __LITTLE_ENDIAN__
5199   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5200                               255,255,255,255,255,255,255,255};
5201   __d = vec_xor(__c, __d);
5202   return (vector unsigned int)
5203            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5204 #else
5205   return (vector unsigned int)
5206            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5207 #endif
5208 }
5209
5210 static vector bool int __ATTRS_o_ai
5211 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c)
5212 {
5213 #ifdef __LITTLE_ENDIAN__
5214   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5215                               255,255,255,255,255,255,255,255};
5216   __d = vec_xor(__c, __d);
5217   return (vector bool int)
5218            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5219 #else
5220   return (vector bool int)
5221            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5222 #endif
5223 }
5224
5225 static vector float __ATTRS_o_ai
5226 vec_perm(vector float __a, vector float __b, vector unsigned char __c)
5227 {
5228 #ifdef __LITTLE_ENDIAN__
5229   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5230                               255,255,255,255,255,255,255,255};
5231   __d = vec_xor(__c, __d);
5232   return (vector float)
5233            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5234 #else
5235   return (vector float)
5236            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5237 #endif
5238 }
5239
5240 #ifdef __VSX__
5241 static vector long long __ATTRS_o_ai
5242 vec_perm(vector long long __a, vector long long __b, vector unsigned char __c)
5243 {
5244 #ifdef __LITTLE_ENDIAN__
5245   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5246                               255,255,255,255,255,255,255,255};
5247   __d = vec_xor(__c, __d);
5248   return (vector long long)__builtin_altivec_vperm_4si(__b, __a, __d);
5249 #else
5250   return (vector long long)__builtin_altivec_vperm_4si(__a, __b, __c);
5251 #endif
5252 }
5253
5254 static vector unsigned long long __ATTRS_o_ai
5255 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
5256          vector unsigned char __c)
5257 {
5258 #ifdef __LITTLE_ENDIAN__
5259   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5260                               255,255,255,255,255,255,255,255};
5261   __d = vec_xor(__c, __d);
5262   return (vector unsigned long long)
5263            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5264 #else
5265   return (vector unsigned long long)
5266            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5267 #endif
5268 }
5269
5270 static vector double __ATTRS_o_ai
5271 vec_perm(vector double __a, vector double __b, vector unsigned char __c)
5272 {
5273 #ifdef __LITTLE_ENDIAN__
5274   vector unsigned char __d = {255,255,255,255,255,255,255,255,
5275                               255,255,255,255,255,255,255,255};
5276   __d = vec_xor(__c, __d);
5277   return (vector double)
5278            __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
5279 #else
5280   return (vector double)
5281            __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
5282 #endif
5283 }
5284 #endif
5285
5286 /* vec_vperm */
5287
5288 static vector signed char __ATTRS_o_ai
5289 vec_vperm(vector signed char __a, vector signed char __b, vector unsigned char __c)
5290 {
5291   return vec_perm(__a, __b, __c);
5292 }
5293
5294 static vector unsigned char __ATTRS_o_ai
5295 vec_vperm(vector unsigned char __a,
5296           vector unsigned char __b,
5297           vector unsigned char __c)
5298 {
5299   return vec_perm(__a, __b, __c);
5300 }
5301
5302 static vector bool char __ATTRS_o_ai
5303 vec_vperm(vector bool char __a, vector bool char __b, vector unsigned char __c)
5304 {
5305   return vec_perm(__a, __b, __c);
5306 }
5307
5308 static vector short __ATTRS_o_ai
5309 vec_vperm(vector short __a, vector short __b, vector unsigned char __c)
5310 {
5311   return vec_perm(__a, __b, __c);
5312 }
5313
5314 static vector unsigned short __ATTRS_o_ai
5315 vec_vperm(vector unsigned short __a,
5316           vector unsigned short __b,
5317           vector unsigned char __c)
5318 {
5319   return vec_perm(__a, __b, __c);
5320 }
5321
5322 static vector bool short __ATTRS_o_ai
5323 vec_vperm(vector bool short __a, vector bool short __b, vector unsigned char __c)
5324 {
5325   return vec_perm(__a, __b, __c);
5326 }
5327
5328 static vector pixel __ATTRS_o_ai
5329 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c)
5330 {
5331   return vec_perm(__a, __b, __c);
5332 }
5333
5334 static vector int __ATTRS_o_ai
5335 vec_vperm(vector int __a, vector int __b, vector unsigned char __c)
5336 {
5337   return vec_perm(__a, __b, __c);
5338 }
5339
5340 static vector unsigned int __ATTRS_o_ai
5341 vec_vperm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c)
5342 {
5343   return vec_perm(__a, __b, __c);
5344 }
5345
5346 static vector bool int __ATTRS_o_ai
5347 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c)
5348 {
5349   return vec_perm(__a, __b, __c);
5350 }
5351
5352 static vector float __ATTRS_o_ai
5353 vec_vperm(vector float __a, vector float __b, vector unsigned char __c)
5354 {
5355   return vec_perm(__a, __b, __c);
5356 }
5357
5358 #ifdef __VSX__
5359 static vector long long __ATTRS_o_ai
5360 vec_vperm(vector long long __a, vector long long __b, vector unsigned char __c)
5361 {
5362   return vec_perm(__a, __b, __c);
5363 }
5364
5365 static vector unsigned long long __ATTRS_o_ai
5366 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
5367           vector unsigned char __c)
5368 {
5369   return vec_perm(__a, __b, __c);
5370 }
5371
5372 static vector double __ATTRS_o_ai
5373 vec_vperm(vector double __a, vector double __b, vector unsigned char __c)
5374 {
5375   return vec_perm(__a, __b, __c);
5376 }
5377 #endif
5378
5379 /* vec_re */
5380
5381 static vector float __attribute__((__always_inline__))
5382 vec_re(vector float __a)
5383 {
5384   return __builtin_altivec_vrefp(__a);
5385 }
5386
5387 /* vec_vrefp */
5388
5389 static vector float __attribute__((__always_inline__))
5390 vec_vrefp(vector float __a)
5391 {
5392   return __builtin_altivec_vrefp(__a);
5393 }
5394
5395 /* vec_rl */
5396
5397 static vector signed char __ATTRS_o_ai
5398 vec_rl(vector signed char __a, vector unsigned char __b)
5399 {
5400   return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
5401 }
5402
5403 static vector unsigned char __ATTRS_o_ai
5404 vec_rl(vector unsigned char __a, vector unsigned char __b)
5405 {
5406   return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
5407 }
5408
5409 static vector short __ATTRS_o_ai
5410 vec_rl(vector short __a, vector unsigned short __b)
5411 {
5412   return __builtin_altivec_vrlh(__a, __b);
5413 }
5414
5415 static vector unsigned short __ATTRS_o_ai
5416 vec_rl(vector unsigned short __a, vector unsigned short __b)
5417 {
5418   return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
5419 }
5420
5421 static vector int __ATTRS_o_ai
5422 vec_rl(vector int __a, vector unsigned int __b)
5423 {
5424   return __builtin_altivec_vrlw(__a, __b);
5425 }
5426
5427 static vector unsigned int __ATTRS_o_ai
5428 vec_rl(vector unsigned int __a, vector unsigned int __b)
5429 {
5430   return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
5431 }
5432
5433 #ifdef __POWER8_VECTOR__
5434 static vector signed long long __ATTRS_o_ai
5435 vec_rl(vector signed long long __a, vector unsigned long long __b)
5436 {
5437   return __builtin_altivec_vrld(__a, __b);
5438 }
5439
5440 static vector unsigned long long __ATTRS_o_ai
5441 vec_rl(vector unsigned long long __a, vector unsigned long long __b)
5442 {
5443   return __builtin_altivec_vrld(__a, __b);
5444 }
5445 #endif
5446
5447 /* vec_vrlb */
5448
5449 static vector signed char __ATTRS_o_ai
5450 vec_vrlb(vector signed char __a, vector unsigned char __b)
5451 {
5452   return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
5453 }
5454
5455 static vector unsigned char __ATTRS_o_ai
5456 vec_vrlb(vector unsigned char __a, vector unsigned char __b)
5457 {
5458   return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
5459 }
5460
5461 /* vec_vrlh */
5462
5463 static vector short __ATTRS_o_ai
5464 vec_vrlh(vector short __a, vector unsigned short __b)
5465 {
5466   return __builtin_altivec_vrlh(__a, __b);
5467 }
5468
5469 static vector unsigned short __ATTRS_o_ai
5470 vec_vrlh(vector unsigned short __a, vector unsigned short __b)
5471 {
5472   return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
5473 }
5474
5475 /* vec_vrlw */
5476
5477 static vector int __ATTRS_o_ai
5478 vec_vrlw(vector int __a, vector unsigned int __b)
5479 {
5480   return __builtin_altivec_vrlw(__a, __b);
5481 }
5482
5483 static vector unsigned int __ATTRS_o_ai
5484 vec_vrlw(vector unsigned int __a, vector unsigned int __b)
5485 {
5486   return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
5487 }
5488
5489 /* vec_round */
5490
5491 static vector float __attribute__((__always_inline__))
5492 vec_round(vector float __a)
5493 {
5494   return __builtin_altivec_vrfin(__a);
5495 }
5496
5497 /* vec_vrfin */
5498
5499 static vector float __attribute__((__always_inline__))
5500 vec_vrfin(vector float __a)
5501 {
5502   return __builtin_altivec_vrfin(__a);
5503 }
5504
5505 /* vec_rsqrte */
5506
5507 static __vector float __attribute__((__always_inline__))
5508 vec_rsqrte(vector float __a)
5509 {
5510   return __builtin_altivec_vrsqrtefp(__a);
5511 }
5512
5513 /* vec_vrsqrtefp */
5514
5515 static __vector float __attribute__((__always_inline__))
5516 vec_vrsqrtefp(vector float __a)
5517 {
5518   return __builtin_altivec_vrsqrtefp(__a);
5519 }
5520
5521 /* vec_sel */
5522
5523 #define __builtin_altivec_vsel_4si vec_sel
5524
5525 static vector signed char __ATTRS_o_ai
5526 vec_sel(vector signed char __a, vector signed char __b, vector unsigned char __c)
5527 {
5528   return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
5529 }
5530
5531 static vector signed char __ATTRS_o_ai
5532 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c)
5533 {
5534   return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
5535 }
5536
5537 static vector unsigned char __ATTRS_o_ai
5538 vec_sel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c)
5539 {
5540   return (__a & ~__c) | (__b & __c);
5541 }
5542
5543 static vector unsigned char __ATTRS_o_ai
5544 vec_sel(vector unsigned char __a, vector unsigned char __b, vector bool char __c)
5545 {
5546   return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
5547 }
5548
5549 static vector bool char __ATTRS_o_ai
5550 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c)
5551 {
5552   return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
5553 }
5554
5555 static vector bool char __ATTRS_o_ai
5556 vec_sel(vector bool char __a, vector bool char __b, vector bool char __c)
5557 {
5558   return (__a & ~__c) | (__b & __c);
5559 }
5560
5561 static vector short __ATTRS_o_ai
5562 vec_sel(vector short __a, vector short __b, vector unsigned short __c)
5563 {
5564   return (__a & ~(vector short)__c) | (__b & (vector short)__c);
5565 }
5566
5567 static vector short __ATTRS_o_ai
5568 vec_sel(vector short __a, vector short __b, vector bool short __c)
5569 {
5570   return (__a & ~(vector short)__c) | (__b & (vector short)__c);
5571 }
5572
5573 static vector unsigned short __ATTRS_o_ai
5574 vec_sel(vector unsigned short __a,
5575         vector unsigned short __b,
5576         vector unsigned short __c)
5577 {
5578   return (__a & ~__c) | (__b & __c);
5579 }
5580
5581 static vector unsigned short __ATTRS_o_ai
5582 vec_sel(vector unsigned short __a, vector unsigned short __b, vector bool short __c)
5583 {
5584   return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c);
5585 }
5586
5587 static vector bool short __ATTRS_o_ai
5588 vec_sel(vector bool short __a, vector bool short __b, vector unsigned short __c)
5589 {
5590   return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
5591 }
5592
5593 static vector bool short __ATTRS_o_ai
5594 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c)
5595 {
5596   return (__a & ~__c) | (__b & __c);
5597 }
5598
5599 static vector int __ATTRS_o_ai
5600 vec_sel(vector int __a, vector int __b, vector unsigned int __c)
5601 {
5602   return (__a & ~(vector int)__c) | (__b & (vector int)__c);
5603 }
5604
5605 static vector int __ATTRS_o_ai
5606 vec_sel(vector int __a, vector int __b, vector bool int __c)
5607 {
5608   return (__a & ~(vector int)__c) | (__b & (vector int)__c);
5609 }
5610
5611 static vector unsigned int __ATTRS_o_ai
5612 vec_sel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c)
5613 {
5614   return (__a & ~__c) | (__b & __c);
5615 }
5616
5617 static vector unsigned int __ATTRS_o_ai
5618 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c)
5619 {
5620   return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
5621 }
5622
5623 static vector bool int __ATTRS_o_ai
5624 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c)
5625 {
5626   return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
5627 }
5628
5629 static vector bool int __ATTRS_o_ai
5630 vec_sel(vector bool int __a, vector bool int __b, vector bool int __c)
5631 {
5632   return (__a & ~__c) | (__b & __c);
5633 }
5634
5635 static vector float __ATTRS_o_ai
5636 vec_sel(vector float __a, vector float __b, vector unsigned int __c)
5637 {
5638   vector int __res = ((vector int)__a & ~(vector int)__c)
5639                    | ((vector int)__b & (vector int)__c);
5640   return (vector float)__res;
5641 }
5642
5643 static vector float __ATTRS_o_ai
5644 vec_sel(vector float __a, vector float __b, vector bool int __c)
5645 {
5646   vector int __res = ((vector int)__a & ~(vector int)__c)
5647                    | ((vector int)__b & (vector int)__c);
5648   return (vector float)__res;
5649 }
5650
5651 /* vec_vsel */
5652
5653 static vector signed char __ATTRS_o_ai
5654 vec_vsel(vector signed char __a, vector signed char __b, vector unsigned char __c)
5655 {
5656   return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
5657 }
5658
5659 static vector signed char __ATTRS_o_ai
5660 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c)
5661 {
5662   return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
5663 }
5664
5665 static vector unsigned char __ATTRS_o_ai
5666 vec_vsel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c)
5667 {
5668   return (__a & ~__c) | (__b & __c);
5669 }
5670
5671 static vector unsigned char __ATTRS_o_ai
5672 vec_vsel(vector unsigned char __a, vector unsigned char __b, vector bool char __c)
5673 {
5674   return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
5675 }
5676
5677 static vector bool char __ATTRS_o_ai
5678 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c)
5679 {
5680   return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
5681 }
5682
5683 static vector bool char __ATTRS_o_ai
5684 vec_vsel(vector bool char __a, vector bool char __b, vector bool char __c)
5685 {
5686   return (__a & ~__c) | (__b & __c);
5687 }
5688
5689 static vector short __ATTRS_o_ai
5690 vec_vsel(vector short __a, vector short __b, vector unsigned short __c)
5691 {
5692   return (__a & ~(vector short)__c) | (__b & (vector short)__c);
5693 }
5694
5695 static vector short __ATTRS_o_ai
5696 vec_vsel(vector short __a, vector short __b, vector bool short __c)
5697 {
5698   return (__a & ~(vector short)__c) | (__b & (vector short)__c);
5699 }
5700
5701 static vector unsigned short __ATTRS_o_ai
5702 vec_vsel(vector unsigned short __a,
5703          vector unsigned short __b,
5704          vector unsigned short __c)
5705 {
5706   return (__a & ~__c) | (__b & __c);
5707 }
5708
5709 static vector unsigned short __ATTRS_o_ai
5710 vec_vsel(vector unsigned short __a, vector unsigned short __b, vector bool short __c)
5711 {
5712   return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c);
5713 }
5714
5715 static vector bool short __ATTRS_o_ai
5716 vec_vsel(vector bool short __a, vector bool short __b, vector unsigned short __c)
5717 {
5718   return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
5719 }
5720
5721 static vector bool short __ATTRS_o_ai
5722 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c)
5723 {
5724   return (__a & ~__c) | (__b & __c);
5725 }
5726
5727 static vector int __ATTRS_o_ai
5728 vec_vsel(vector int __a, vector int __b, vector unsigned int __c)
5729 {
5730   return (__a & ~(vector int)__c) | (__b & (vector int)__c);
5731 }
5732
5733 static vector int __ATTRS_o_ai
5734 vec_vsel(vector int __a, vector int __b, vector bool int __c)
5735 {
5736   return (__a & ~(vector int)__c) | (__b & (vector int)__c);
5737 }
5738
5739 static vector unsigned int __ATTRS_o_ai
5740 vec_vsel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c)
5741 {
5742   return (__a & ~__c) | (__b & __c);
5743 }
5744
5745 static vector unsigned int __ATTRS_o_ai
5746 vec_vsel(vector unsigned int __a, vector unsigned int __b, vector bool int __c)
5747 {
5748   return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
5749 }
5750
5751 static vector bool int __ATTRS_o_ai
5752 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c)
5753 {
5754   return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
5755 }
5756
5757 static vector bool int __ATTRS_o_ai
5758 vec_vsel(vector bool int __a, vector bool int __b, vector bool int __c)
5759 {
5760   return (__a & ~__c) | (__b & __c);
5761 }
5762
5763 static vector float __ATTRS_o_ai
5764 vec_vsel(vector float __a, vector float __b, vector unsigned int __c)
5765 {
5766   vector int __res = ((vector int)__a & ~(vector int)__c)
5767                    | ((vector int)__b & (vector int)__c);
5768   return (vector float)__res;
5769 }
5770
5771 static vector float __ATTRS_o_ai
5772 vec_vsel(vector float __a, vector float __b, vector bool int __c)
5773 {
5774   vector int __res = ((vector int)__a & ~(vector int)__c)
5775                    | ((vector int)__b & (vector int)__c);
5776   return (vector float)__res;
5777 }
5778
5779 /* vec_sl */
5780
5781 static vector signed char __ATTRS_o_ai
5782 vec_sl(vector signed char __a, vector unsigned char __b)
5783 {
5784   return __a << (vector signed char)__b;
5785 }
5786
5787 static vector unsigned char __ATTRS_o_ai
5788 vec_sl(vector unsigned char __a, vector unsigned char __b)
5789 {
5790   return __a << __b;
5791 }
5792
5793 static vector short __ATTRS_o_ai
5794 vec_sl(vector short __a, vector unsigned short __b)
5795 {
5796   return __a << (vector short)__b;
5797 }
5798
5799 static vector unsigned short __ATTRS_o_ai
5800 vec_sl(vector unsigned short __a, vector unsigned short __b)
5801 {
5802   return __a << __b;
5803 }
5804
5805 static vector int __ATTRS_o_ai
5806 vec_sl(vector int __a, vector unsigned int __b)
5807 {
5808   return __a << (vector int)__b;
5809 }
5810
5811 static vector unsigned int __ATTRS_o_ai
5812 vec_sl(vector unsigned int __a, vector unsigned int __b)
5813 {
5814   return __a << __b;
5815 }
5816
5817 #ifdef __POWER8_VECTOR__
5818 static vector signed long long __ATTRS_o_ai
5819 vec_sl(vector signed long long __a, vector unsigned long long __b)
5820 {
5821   return __a << (vector long long)__b;
5822 }
5823
5824 static vector unsigned long long __ATTRS_o_ai
5825 vec_sl(vector unsigned long long __a, vector unsigned long long __b)
5826 {
5827   return __a << __b;
5828 }
5829 #endif
5830
5831 /* vec_vslb */
5832
5833 #define __builtin_altivec_vslb vec_vslb
5834
5835 static vector signed char __ATTRS_o_ai
5836 vec_vslb(vector signed char __a, vector unsigned char __b)
5837 {
5838   return vec_sl(__a, __b);
5839 }
5840
5841 static vector unsigned char __ATTRS_o_ai
5842 vec_vslb(vector unsigned char __a, vector unsigned char __b)
5843 {
5844   return vec_sl(__a, __b);
5845 }
5846
5847 /* vec_vslh */
5848
5849 #define __builtin_altivec_vslh vec_vslh
5850
5851 static vector short __ATTRS_o_ai
5852 vec_vslh(vector short __a, vector unsigned short __b)
5853 {
5854   return vec_sl(__a, __b);
5855 }
5856
5857 static vector unsigned short __ATTRS_o_ai
5858 vec_vslh(vector unsigned short __a, vector unsigned short __b)
5859 {
5860   return vec_sl(__a, __b);
5861 }
5862
5863 /* vec_vslw */
5864
5865 #define __builtin_altivec_vslw vec_vslw
5866
5867 static vector int __ATTRS_o_ai
5868 vec_vslw(vector int __a, vector unsigned int __b)
5869 {
5870   return vec_sl(__a, __b);
5871 }
5872
5873 static vector unsigned int __ATTRS_o_ai
5874 vec_vslw(vector unsigned int __a, vector unsigned int __b)
5875 {
5876   return vec_sl(__a, __b);
5877 }
5878
5879 /* vec_sld */
5880
5881 #define __builtin_altivec_vsldoi_4si vec_sld
5882
5883 static vector signed char __ATTRS_o_ai
5884 vec_sld(vector signed char __a, vector signed char __b, unsigned char __c)
5885 {
5886   return vec_perm(__a, __b, (vector unsigned char)
5887     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5888      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5889 }
5890
5891 static vector unsigned char __ATTRS_o_ai
5892 vec_sld(vector unsigned char __a, vector unsigned char __b, unsigned char __c)
5893 {
5894   return vec_perm(__a, __b, (vector unsigned char)
5895     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5896      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5897 }
5898
5899 static vector short __ATTRS_o_ai
5900 vec_sld(vector short __a, vector short __b, unsigned char __c)
5901 {
5902   return vec_perm(__a, __b, (vector unsigned char)
5903     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5904      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5905 }
5906
5907 static vector unsigned short __ATTRS_o_ai
5908 vec_sld(vector unsigned short __a, vector unsigned short __b, unsigned char __c)
5909 {
5910   return vec_perm(__a, __b, (vector unsigned char)
5911     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5912      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5913 }
5914
5915 static vector pixel __ATTRS_o_ai
5916 vec_sld(vector pixel __a, vector pixel __b, unsigned char __c)
5917 {
5918   return vec_perm(__a, __b, (vector unsigned char)
5919     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5920      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5921 }
5922
5923 static vector int __ATTRS_o_ai
5924 vec_sld(vector int __a, vector int __b, unsigned char __c)
5925 {
5926   return vec_perm(__a, __b, (vector unsigned char)
5927     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5928      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5929 }
5930
5931 static vector unsigned int __ATTRS_o_ai
5932 vec_sld(vector unsigned int __a, vector unsigned int __b, unsigned char __c)
5933 {
5934   return vec_perm(__a, __b, (vector unsigned char)
5935     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5936      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5937 }
5938
5939 static vector float __ATTRS_o_ai
5940 vec_sld(vector float __a, vector float __b, unsigned char __c)
5941 {
5942   return vec_perm(__a, __b, (vector unsigned char)
5943     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5944      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5945 }
5946
5947 /* vec_vsldoi */
5948
5949 static vector signed char __ATTRS_o_ai
5950 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c)
5951 {
5952   return vec_perm(__a, __b, (vector unsigned char)
5953     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5954      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5955 }
5956
5957 static vector unsigned char __ATTRS_o_ai
5958 vec_vsldoi(vector unsigned char __a, vector unsigned char __b, unsigned char __c)
5959 {
5960   return vec_perm(__a, __b, (vector unsigned char)
5961     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5962      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5963 }
5964
5965 static vector short __ATTRS_o_ai
5966 vec_vsldoi(vector short __a, vector short __b, unsigned char __c)
5967 {
5968   return vec_perm(__a, __b, (vector unsigned char)
5969     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5970      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5971 }
5972
5973 static vector unsigned short __ATTRS_o_ai
5974 vec_vsldoi(vector unsigned short __a, vector unsigned short __b, unsigned char __c)
5975 {
5976   return vec_perm(__a, __b, (vector unsigned char)
5977     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5978      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5979 }
5980
5981 static vector pixel __ATTRS_o_ai
5982 vec_vsldoi(vector pixel __a, vector pixel __b, unsigned char __c)
5983 {
5984   return vec_perm(__a, __b, (vector unsigned char)
5985     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5986      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5987 }
5988
5989 static vector int __ATTRS_o_ai
5990 vec_vsldoi(vector int __a, vector int __b, unsigned char __c)
5991 {
5992   return vec_perm(__a, __b, (vector unsigned char)
5993     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
5994      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
5995 }
5996
5997 static vector unsigned int __ATTRS_o_ai
5998 vec_vsldoi(vector unsigned int __a, vector unsigned int __b, unsigned char __c)
5999 {
6000   return vec_perm(__a, __b, (vector unsigned char)
6001     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
6002      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
6003 }
6004
6005 static vector float __ATTRS_o_ai
6006 vec_vsldoi(vector float __a, vector float __b, unsigned char __c)
6007 {
6008   return vec_perm(__a, __b, (vector unsigned char)
6009     (__c,   __c+1, __c+2,  __c+3,  __c+4,  __c+5,  __c+6,  __c+7,
6010      __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
6011 }
6012
6013 /* vec_sll */
6014
6015 static vector signed char __ATTRS_o_ai
6016 vec_sll(vector signed char __a, vector unsigned char __b)
6017 {
6018   return (vector signed char)
6019            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6020 }
6021
6022 static vector signed char __ATTRS_o_ai
6023 vec_sll(vector signed char __a, vector unsigned short __b)
6024 {
6025   return (vector signed char)
6026            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6027 }
6028
6029 static vector signed char __ATTRS_o_ai
6030 vec_sll(vector signed char __a, vector unsigned int __b)
6031 {
6032   return (vector signed char)
6033            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6034 }
6035
6036 static vector unsigned char __ATTRS_o_ai
6037 vec_sll(vector unsigned char __a, vector unsigned char __b)
6038 {
6039   return (vector unsigned char)
6040            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6041 }
6042
6043 static vector unsigned char __ATTRS_o_ai
6044 vec_sll(vector unsigned char __a, vector unsigned short __b)
6045 {
6046   return (vector unsigned char)
6047            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6048 }
6049
6050 static vector unsigned char __ATTRS_o_ai
6051 vec_sll(vector unsigned char __a, vector unsigned int __b)
6052 {
6053   return (vector unsigned char)
6054            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6055 }
6056
6057 static vector bool char __ATTRS_o_ai
6058 vec_sll(vector bool char __a, vector unsigned char __b)
6059 {
6060   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6061 }
6062
6063 static vector bool char __ATTRS_o_ai
6064 vec_sll(vector bool char __a, vector unsigned short __b)
6065 {
6066   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6067 }
6068
6069 static vector bool char __ATTRS_o_ai
6070 vec_sll(vector bool char __a, vector unsigned int __b)
6071 {
6072   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6073 }
6074
6075 static vector short __ATTRS_o_ai
6076 vec_sll(vector short __a, vector unsigned char __b)
6077 {
6078   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6079 }
6080
6081 static vector short __ATTRS_o_ai
6082 vec_sll(vector short __a, vector unsigned short __b)
6083 {
6084   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6085 }
6086
6087 static vector short __ATTRS_o_ai
6088 vec_sll(vector short __a, vector unsigned int __b)
6089 {
6090   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6091 }
6092
6093 static vector unsigned short __ATTRS_o_ai
6094 vec_sll(vector unsigned short __a, vector unsigned char __b)
6095 {
6096   return (vector unsigned short)
6097            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6098 }
6099
6100 static vector unsigned short __ATTRS_o_ai
6101 vec_sll(vector unsigned short __a, vector unsigned short __b)
6102 {
6103   return (vector unsigned short)
6104            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6105 }
6106
6107 static vector unsigned short __ATTRS_o_ai
6108 vec_sll(vector unsigned short __a, vector unsigned int __b)
6109 {
6110   return (vector unsigned short)
6111            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6112 }
6113
6114 static vector bool short __ATTRS_o_ai
6115 vec_sll(vector bool short __a, vector unsigned char __b)
6116 {
6117   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6118 }
6119
6120 static vector bool short __ATTRS_o_ai
6121 vec_sll(vector bool short __a, vector unsigned short __b)
6122 {
6123   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6124 }
6125
6126 static vector bool short __ATTRS_o_ai
6127 vec_sll(vector bool short __a, vector unsigned int __b)
6128 {
6129   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6130 }
6131
6132 static vector pixel __ATTRS_o_ai
6133 vec_sll(vector pixel __a, vector unsigned char __b)
6134 {
6135   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6136 }
6137
6138 static vector pixel __ATTRS_o_ai
6139 vec_sll(vector pixel __a, vector unsigned short __b)
6140 {
6141   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6142 }
6143
6144 static vector pixel __ATTRS_o_ai
6145 vec_sll(vector pixel __a, vector unsigned int __b)
6146 {
6147   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6148 }
6149
6150 static vector int __ATTRS_o_ai
6151 vec_sll(vector int __a, vector unsigned char __b)
6152 {
6153   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6154 }
6155
6156 static vector int __ATTRS_o_ai
6157 vec_sll(vector int __a, vector unsigned short __b)
6158 {
6159   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6160 }
6161
6162 static vector int __ATTRS_o_ai
6163 vec_sll(vector int __a, vector unsigned int __b)
6164 {
6165   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6166 }
6167
6168 static vector unsigned int __ATTRS_o_ai
6169 vec_sll(vector unsigned int __a, vector unsigned char __b)
6170 {
6171   return (vector unsigned int)
6172            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6173 }
6174
6175 static vector unsigned int __ATTRS_o_ai
6176 vec_sll(vector unsigned int __a, vector unsigned short __b)
6177 {
6178   return (vector unsigned int)
6179            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6180 }
6181
6182 static vector unsigned int __ATTRS_o_ai
6183 vec_sll(vector unsigned int __a, vector unsigned int __b)
6184 {
6185   return (vector unsigned int)
6186            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6187 }
6188
6189 static vector bool int __ATTRS_o_ai
6190 vec_sll(vector bool int __a, vector unsigned char __b)
6191 {
6192   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6193 }
6194
6195 static vector bool int __ATTRS_o_ai
6196 vec_sll(vector bool int __a, vector unsigned short __b)
6197 {
6198   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6199 }
6200
6201 static vector bool int __ATTRS_o_ai
6202 vec_sll(vector bool int __a, vector unsigned int __b)
6203 {
6204   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6205 }
6206
6207 /* vec_vsl */
6208
6209 static vector signed char __ATTRS_o_ai
6210 vec_vsl(vector signed char __a, vector unsigned char __b)
6211 {
6212   return (vector signed char)
6213            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6214 }
6215
6216 static vector signed char __ATTRS_o_ai
6217 vec_vsl(vector signed char __a, vector unsigned short __b)
6218 {
6219   return (vector signed char)
6220            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6221 }
6222
6223 static vector signed char __ATTRS_o_ai
6224 vec_vsl(vector signed char __a, vector unsigned int __b)
6225 {
6226   return (vector signed char)
6227            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6228 }
6229
6230 static vector unsigned char __ATTRS_o_ai
6231 vec_vsl(vector unsigned char __a, vector unsigned char __b)
6232 {
6233   return (vector unsigned char)
6234            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6235 }
6236
6237 static vector unsigned char __ATTRS_o_ai
6238 vec_vsl(vector unsigned char __a, vector unsigned short __b)
6239 {
6240   return (vector unsigned char)
6241            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6242 }
6243
6244 static vector unsigned char __ATTRS_o_ai
6245 vec_vsl(vector unsigned char __a, vector unsigned int __b)
6246 {
6247   return (vector unsigned char)
6248            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6249 }
6250
6251 static vector bool char __ATTRS_o_ai
6252 vec_vsl(vector bool char __a, vector unsigned char __b)
6253 {
6254   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6255 }
6256
6257 static vector bool char __ATTRS_o_ai
6258 vec_vsl(vector bool char __a, vector unsigned short __b)
6259 {
6260   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6261 }
6262
6263 static vector bool char __ATTRS_o_ai
6264 vec_vsl(vector bool char __a, vector unsigned int __b)
6265 {
6266   return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6267 }
6268
6269 static vector short __ATTRS_o_ai
6270 vec_vsl(vector short __a, vector unsigned char __b)
6271 {
6272   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6273 }
6274
6275 static vector short __ATTRS_o_ai
6276 vec_vsl(vector short __a, vector unsigned short __b)
6277 {
6278   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6279 }
6280
6281 static vector short __ATTRS_o_ai
6282 vec_vsl(vector short __a, vector unsigned int __b)
6283 {
6284   return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6285 }
6286
6287 static vector unsigned short __ATTRS_o_ai
6288 vec_vsl(vector unsigned short __a, vector unsigned char __b)
6289 {
6290   return (vector unsigned short)
6291            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6292 }
6293
6294 static vector unsigned short __ATTRS_o_ai
6295 vec_vsl(vector unsigned short __a, vector unsigned short __b)
6296 {
6297   return (vector unsigned short)
6298            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6299 }
6300
6301 static vector unsigned short __ATTRS_o_ai
6302 vec_vsl(vector unsigned short __a, vector unsigned int __b)
6303 {
6304   return (vector unsigned short)
6305            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6306 }
6307
6308 static vector bool short __ATTRS_o_ai
6309 vec_vsl(vector bool short __a, vector unsigned char __b)
6310 {
6311   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6312 }
6313
6314 static vector bool short __ATTRS_o_ai
6315 vec_vsl(vector bool short __a, vector unsigned short __b)
6316 {
6317   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6318 }
6319
6320 static vector bool short __ATTRS_o_ai
6321 vec_vsl(vector bool short __a, vector unsigned int __b)
6322 {
6323   return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6324 }
6325
6326 static vector pixel __ATTRS_o_ai
6327 vec_vsl(vector pixel __a, vector unsigned char __b)
6328 {
6329   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6330 }
6331
6332 static vector pixel __ATTRS_o_ai
6333 vec_vsl(vector pixel __a, vector unsigned short __b)
6334 {
6335   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6336 }
6337
6338 static vector pixel __ATTRS_o_ai
6339 vec_vsl(vector pixel __a, vector unsigned int __b)
6340 {
6341   return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6342 }
6343
6344 static vector int __ATTRS_o_ai
6345 vec_vsl(vector int __a, vector unsigned char __b)
6346 {
6347   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6348 }
6349
6350 static vector int __ATTRS_o_ai
6351 vec_vsl(vector int __a, vector unsigned short __b)
6352 {
6353   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6354 }
6355
6356 static vector int __ATTRS_o_ai
6357 vec_vsl(vector int __a, vector unsigned int __b)
6358 {
6359   return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
6360 }
6361
6362 static vector unsigned int __ATTRS_o_ai
6363 vec_vsl(vector unsigned int __a, vector unsigned char __b)
6364 {
6365   return (vector unsigned int)
6366            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6367 }
6368
6369 static vector unsigned int __ATTRS_o_ai
6370 vec_vsl(vector unsigned int __a, vector unsigned short __b)
6371 {
6372   return (vector unsigned int)
6373            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6374 }
6375
6376 static vector unsigned int __ATTRS_o_ai
6377 vec_vsl(vector unsigned int __a, vector unsigned int __b)
6378 {
6379   return (vector unsigned int)
6380            __builtin_altivec_vsl((vector int)__a, (vector int)__b);
6381 }
6382
6383 static vector bool int __ATTRS_o_ai
6384 vec_vsl(vector bool int __a, vector unsigned char __b)
6385 {
6386   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6387 }
6388
6389 static vector bool int __ATTRS_o_ai
6390 vec_vsl(vector bool int __a, vector unsigned short __b)
6391 {
6392   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6393 }
6394
6395 static vector bool int __ATTRS_o_ai
6396 vec_vsl(vector bool int __a, vector unsigned int __b)
6397 {
6398   return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
6399 }
6400
6401 /* vec_slo */
6402
6403 static vector signed char __ATTRS_o_ai
6404 vec_slo(vector signed char __a, vector signed char __b)
6405 {
6406   return (vector signed char)
6407            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6408 }
6409
6410 static vector signed char __ATTRS_o_ai
6411 vec_slo(vector signed char __a, vector unsigned char __b)
6412 {
6413   return (vector signed char)
6414            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6415 }
6416
6417 static vector unsigned char __ATTRS_o_ai
6418 vec_slo(vector unsigned char __a, vector signed char __b)
6419 {
6420   return (vector unsigned char)
6421            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6422 }
6423
6424 static vector unsigned char __ATTRS_o_ai
6425 vec_slo(vector unsigned char __a, vector unsigned char __b)
6426 {
6427   return (vector unsigned char)
6428            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6429 }
6430
6431 static vector short __ATTRS_o_ai
6432 vec_slo(vector short __a, vector signed char __b)
6433 {
6434   return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6435 }
6436
6437 static vector short __ATTRS_o_ai
6438 vec_slo(vector short __a, vector unsigned char __b)
6439 {
6440   return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6441 }
6442
6443 static vector unsigned short __ATTRS_o_ai
6444 vec_slo(vector unsigned short __a, vector signed char __b)
6445 {
6446   return (vector unsigned short)
6447            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6448 }
6449
6450 static vector unsigned short __ATTRS_o_ai
6451 vec_slo(vector unsigned short __a, vector unsigned char __b)
6452 {
6453   return (vector unsigned short)
6454            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6455 }
6456
6457 static vector pixel __ATTRS_o_ai
6458 vec_slo(vector pixel __a, vector signed char __b)
6459 {
6460   return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6461 }
6462
6463 static vector pixel __ATTRS_o_ai
6464 vec_slo(vector pixel __a, vector unsigned char __b)
6465 {
6466   return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6467 }
6468
6469 static vector int __ATTRS_o_ai
6470 vec_slo(vector int __a, vector signed char __b)
6471 {
6472   return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
6473 }
6474
6475 static vector int __ATTRS_o_ai
6476 vec_slo(vector int __a, vector unsigned char __b)
6477 {
6478   return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
6479 }
6480
6481 static vector unsigned int __ATTRS_o_ai
6482 vec_slo(vector unsigned int __a, vector signed char __b)
6483 {
6484   return (vector unsigned int)
6485            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6486 }
6487
6488 static vector unsigned int __ATTRS_o_ai
6489 vec_slo(vector unsigned int __a, vector unsigned char __b)
6490 {
6491   return (vector unsigned int)
6492            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6493 }
6494
6495 static vector float __ATTRS_o_ai
6496 vec_slo(vector float __a, vector signed char __b)
6497 {
6498   return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6499 }
6500
6501 static vector float __ATTRS_o_ai
6502 vec_slo(vector float __a, vector unsigned char __b)
6503 {
6504   return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6505 }
6506
6507 /* vec_vslo */
6508
6509 static vector signed char __ATTRS_o_ai
6510 vec_vslo(vector signed char __a, vector signed char __b)
6511 {
6512   return (vector signed char)
6513            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6514 }
6515
6516 static vector signed char __ATTRS_o_ai
6517 vec_vslo(vector signed char __a, vector unsigned char __b)
6518 {
6519   return (vector signed char)
6520            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6521 }
6522
6523 static vector unsigned char __ATTRS_o_ai
6524 vec_vslo(vector unsigned char __a, vector signed char __b)
6525 {
6526   return (vector unsigned char)
6527            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6528 }
6529
6530 static vector unsigned char __ATTRS_o_ai
6531 vec_vslo(vector unsigned char __a, vector unsigned char __b)
6532 {
6533   return (vector unsigned char)
6534            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6535 }
6536
6537 static vector short __ATTRS_o_ai
6538 vec_vslo(vector short __a, vector signed char __b)
6539 {
6540   return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6541 }
6542
6543 static vector short __ATTRS_o_ai
6544 vec_vslo(vector short __a, vector unsigned char __b)
6545 {
6546   return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6547 }
6548
6549 static vector unsigned short __ATTRS_o_ai
6550 vec_vslo(vector unsigned short __a, vector signed char __b)
6551 {
6552   return (vector unsigned short)
6553            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6554 }
6555
6556 static vector unsigned short __ATTRS_o_ai
6557 vec_vslo(vector unsigned short __a, vector unsigned char __b)
6558 {
6559   return (vector unsigned short)
6560            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6561 }
6562
6563 static vector pixel __ATTRS_o_ai
6564 vec_vslo(vector pixel __a, vector signed char __b)
6565 {
6566   return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6567 }
6568
6569 static vector pixel __ATTRS_o_ai
6570 vec_vslo(vector pixel __a, vector unsigned char __b)
6571 {
6572   return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6573 }
6574
6575 static vector int __ATTRS_o_ai
6576 vec_vslo(vector int __a, vector signed char __b)
6577 {
6578   return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
6579 }
6580
6581 static vector int __ATTRS_o_ai
6582 vec_vslo(vector int __a, vector unsigned char __b)
6583 {
6584   return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
6585 }
6586
6587 static vector unsigned int __ATTRS_o_ai
6588 vec_vslo(vector unsigned int __a, vector signed char __b)
6589 {
6590   return (vector unsigned int)
6591            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6592 }
6593
6594 static vector unsigned int __ATTRS_o_ai
6595 vec_vslo(vector unsigned int __a, vector unsigned char __b)
6596 {
6597   return (vector unsigned int)
6598            __builtin_altivec_vslo((vector int)__a, (vector int)__b);
6599 }
6600
6601 static vector float __ATTRS_o_ai
6602 vec_vslo(vector float __a, vector signed char __b)
6603 {
6604   return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6605 }
6606
6607 static vector float __ATTRS_o_ai
6608 vec_vslo(vector float __a, vector unsigned char __b)
6609 {
6610   return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
6611 }
6612
6613 /* vec_splat */
6614
6615 static vector signed char __ATTRS_o_ai
6616 vec_splat(vector signed char __a, unsigned char __b)
6617 {
6618   return vec_perm(__a, __a, (vector unsigned char)(__b));
6619 }
6620
6621 static vector unsigned char __ATTRS_o_ai
6622 vec_splat(vector unsigned char __a, unsigned char __b)
6623 {
6624   return vec_perm(__a, __a, (vector unsigned char)(__b));
6625 }
6626
6627 static vector bool char __ATTRS_o_ai
6628 vec_splat(vector bool char __a, unsigned char __b)
6629 {
6630   return vec_perm(__a, __a, (vector unsigned char)(__b));
6631 }
6632
6633 static vector short __ATTRS_o_ai
6634 vec_splat(vector short __a, unsigned char __b)
6635
6636   __b *= 2;
6637   unsigned char b1=__b+1;
6638   return vec_perm(__a, __a, (vector unsigned char)
6639     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6640 }
6641
6642 static vector unsigned short __ATTRS_o_ai
6643 vec_splat(vector unsigned short __a, unsigned char __b)
6644
6645   __b *= 2;
6646   unsigned char b1=__b+1;
6647   return vec_perm(__a, __a, (vector unsigned char)
6648     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6649 }
6650
6651 static vector bool short __ATTRS_o_ai
6652 vec_splat(vector bool short __a, unsigned char __b)
6653
6654   __b *= 2;
6655   unsigned char b1=__b+1;
6656   return vec_perm(__a, __a, (vector unsigned char)
6657     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6658 }
6659
6660 static vector pixel __ATTRS_o_ai
6661 vec_splat(vector pixel __a, unsigned char __b)
6662
6663   __b *= 2;
6664   unsigned char b1=__b+1;
6665   return vec_perm(__a, __a, (vector unsigned char)
6666     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6667 }
6668
6669 static vector int __ATTRS_o_ai
6670 vec_splat(vector int __a, unsigned char __b)
6671
6672   __b *= 4;
6673   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6674   return vec_perm(__a, __a, (vector unsigned char)
6675     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6676 }
6677
6678 static vector unsigned int __ATTRS_o_ai
6679 vec_splat(vector unsigned int __a, unsigned char __b)
6680
6681   __b *= 4;
6682   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6683   return vec_perm(__a, __a, (vector unsigned char)
6684     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6685 }
6686
6687 static vector bool int __ATTRS_o_ai
6688 vec_splat(vector bool int __a, unsigned char __b)
6689
6690   __b *= 4;
6691   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6692   return vec_perm(__a, __a, (vector unsigned char)
6693     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6694 }
6695
6696 static vector float __ATTRS_o_ai
6697 vec_splat(vector float __a, unsigned char __b)
6698
6699   __b *= 4;
6700   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6701   return vec_perm(__a, __a, (vector unsigned char)
6702     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6703 }
6704
6705 /* vec_vspltb */
6706
6707 #define __builtin_altivec_vspltb vec_vspltb
6708
6709 static vector signed char __ATTRS_o_ai
6710 vec_vspltb(vector signed char __a, unsigned char __b)
6711 {
6712   return vec_perm(__a, __a, (vector unsigned char)(__b));
6713 }
6714
6715 static vector unsigned char __ATTRS_o_ai
6716 vec_vspltb(vector unsigned char __a, unsigned char __b)
6717 {
6718   return vec_perm(__a, __a, (vector unsigned char)(__b));
6719 }
6720
6721 static vector bool char __ATTRS_o_ai
6722 vec_vspltb(vector bool char __a, unsigned char __b)
6723 {
6724   return vec_perm(__a, __a, (vector unsigned char)(__b));
6725 }
6726
6727 /* vec_vsplth */
6728
6729 #define __builtin_altivec_vsplth vec_vsplth
6730
6731 static vector short __ATTRS_o_ai
6732 vec_vsplth(vector short __a, unsigned char __b)
6733 {
6734   __b *= 2;
6735   unsigned char b1=__b+1;
6736   return vec_perm(__a, __a, (vector unsigned char)
6737     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6738 }
6739
6740 static vector unsigned short __ATTRS_o_ai
6741 vec_vsplth(vector unsigned short __a, unsigned char __b)
6742 {
6743   __b *= 2;
6744   unsigned char b1=__b+1;
6745   return vec_perm(__a, __a, (vector unsigned char)
6746     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6747 }
6748
6749 static vector bool short __ATTRS_o_ai
6750 vec_vsplth(vector bool short __a, unsigned char __b)
6751 {
6752   __b *= 2;
6753   unsigned char b1=__b+1;
6754   return vec_perm(__a, __a, (vector unsigned char)
6755     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6756 }
6757
6758 static vector pixel __ATTRS_o_ai
6759 vec_vsplth(vector pixel __a, unsigned char __b)
6760 {
6761   __b *= 2;
6762   unsigned char b1=__b+1;
6763   return vec_perm(__a, __a, (vector unsigned char)
6764     (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
6765 }
6766
6767 /* vec_vspltw */
6768
6769 #define __builtin_altivec_vspltw vec_vspltw
6770
6771 static vector int __ATTRS_o_ai
6772 vec_vspltw(vector int __a, unsigned char __b)
6773 {
6774   __b *= 4;
6775   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6776   return vec_perm(__a, __a, (vector unsigned char)
6777     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6778 }
6779
6780 static vector unsigned int __ATTRS_o_ai
6781 vec_vspltw(vector unsigned int __a, unsigned char __b)
6782 {
6783   __b *= 4;
6784   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6785   return vec_perm(__a, __a, (vector unsigned char)
6786     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6787 }
6788
6789 static vector bool int __ATTRS_o_ai
6790 vec_vspltw(vector bool int __a, unsigned char __b)
6791 {
6792   __b *= 4;
6793   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6794   return vec_perm(__a, __a, (vector unsigned char)
6795     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6796 }
6797
6798 static vector float __ATTRS_o_ai
6799 vec_vspltw(vector float __a, unsigned char __b)
6800 {
6801   __b *= 4;
6802   unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
6803   return vec_perm(__a, __a, (vector unsigned char)
6804     (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
6805 }
6806
6807 /* vec_splat_s8 */
6808
6809 #define __builtin_altivec_vspltisb vec_splat_s8
6810
6811 // FIXME: parameter should be treated as 5-bit signed literal
6812 static vector signed char __ATTRS_o_ai
6813 vec_splat_s8(signed char __a)
6814 {
6815   return (vector signed char)(__a);
6816 }
6817
6818 /* vec_vspltisb */
6819
6820 // FIXME: parameter should be treated as 5-bit signed literal
6821 static vector signed char __ATTRS_o_ai
6822 vec_vspltisb(signed char __a)
6823 {
6824   return (vector signed char)(__a);
6825 }
6826
6827 /* vec_splat_s16 */
6828
6829 #define __builtin_altivec_vspltish vec_splat_s16
6830
6831 // FIXME: parameter should be treated as 5-bit signed literal
6832 static vector short __ATTRS_o_ai
6833 vec_splat_s16(signed char __a)
6834 {
6835   return (vector short)(__a);
6836 }
6837
6838 /* vec_vspltish */
6839
6840 // FIXME: parameter should be treated as 5-bit signed literal
6841 static vector short __ATTRS_o_ai
6842 vec_vspltish(signed char __a)
6843 {
6844   return (vector short)(__a);
6845 }
6846
6847 /* vec_splat_s32 */
6848
6849 #define __builtin_altivec_vspltisw vec_splat_s32
6850
6851 // FIXME: parameter should be treated as 5-bit signed literal
6852 static vector int __ATTRS_o_ai
6853 vec_splat_s32(signed char __a)
6854 {
6855   return (vector int)(__a);
6856 }
6857
6858 /* vec_vspltisw */
6859
6860 // FIXME: parameter should be treated as 5-bit signed literal
6861 static vector int __ATTRS_o_ai
6862 vec_vspltisw(signed char __a)
6863 {
6864   return (vector int)(__a);
6865 }
6866
6867 /* vec_splat_u8 */
6868
6869 // FIXME: parameter should be treated as 5-bit signed literal
6870 static vector unsigned char __ATTRS_o_ai
6871 vec_splat_u8(unsigned char __a)
6872 {
6873   return (vector unsigned char)(__a);
6874 }
6875
6876 /* vec_splat_u16 */
6877
6878 // FIXME: parameter should be treated as 5-bit signed literal
6879 static vector unsigned short __ATTRS_o_ai
6880 vec_splat_u16(signed char __a)
6881 {
6882   return (vector unsigned short)(__a);
6883 }
6884
6885 /* vec_splat_u32 */
6886
6887 // FIXME: parameter should be treated as 5-bit signed literal
6888 static vector unsigned int __ATTRS_o_ai
6889 vec_splat_u32(signed char __a)
6890 {
6891   return (vector unsigned int)(__a);
6892 }
6893
6894 /* vec_sr */
6895
6896 static vector signed char __ATTRS_o_ai
6897 vec_sr(vector signed char __a, vector unsigned char __b)
6898 {
6899   return __a >> (vector signed char)__b;
6900 }
6901
6902 static vector unsigned char __ATTRS_o_ai
6903 vec_sr(vector unsigned char __a, vector unsigned char __b)
6904 {
6905   return __a >> __b;
6906 }
6907
6908 static vector short __ATTRS_o_ai
6909 vec_sr(vector short __a, vector unsigned short __b)
6910 {
6911   return __a >> (vector short)__b;
6912 }
6913
6914 static vector unsigned short __ATTRS_o_ai
6915 vec_sr(vector unsigned short __a, vector unsigned short __b)
6916 {
6917   return __a >> __b;
6918 }
6919
6920 static vector int __ATTRS_o_ai
6921 vec_sr(vector int __a, vector unsigned int __b)
6922 {
6923   return __a >> (vector int)__b;
6924 }
6925
6926 static vector unsigned int __ATTRS_o_ai
6927 vec_sr(vector unsigned int __a, vector unsigned int __b)
6928 {
6929   return __a >> __b;
6930 }
6931
6932 #ifdef __POWER8_VECTOR__
6933 static vector signed long long __ATTRS_o_ai
6934 vec_sr(vector signed long long __a, vector unsigned long long __b)
6935 {
6936   return __a >> (vector long long)__b;
6937 }
6938
6939 static vector unsigned long long __ATTRS_o_ai
6940 vec_sr(vector unsigned long long __a, vector unsigned long long __b)
6941 {
6942   return __a >> __b;
6943 }
6944 #endif
6945
6946 /* vec_vsrb */
6947
6948 #define __builtin_altivec_vsrb vec_vsrb
6949
6950 static vector signed char __ATTRS_o_ai
6951 vec_vsrb(vector signed char __a, vector unsigned char __b)
6952 {
6953   return __a >> (vector signed char)__b;
6954 }
6955
6956 static vector unsigned char __ATTRS_o_ai
6957 vec_vsrb(vector unsigned char __a, vector unsigned char __b)
6958 {
6959   return __a >> __b;
6960 }
6961
6962 /* vec_vsrh */
6963
6964 #define __builtin_altivec_vsrh vec_vsrh
6965
6966 static vector short __ATTRS_o_ai
6967 vec_vsrh(vector short __a, vector unsigned short __b)
6968 {
6969   return __a >> (vector short)__b;
6970 }
6971
6972 static vector unsigned short __ATTRS_o_ai
6973 vec_vsrh(vector unsigned short __a, vector unsigned short __b)
6974 {
6975   return __a >> __b;
6976 }
6977
6978 /* vec_vsrw */
6979
6980 #define __builtin_altivec_vsrw vec_vsrw
6981
6982 static vector int __ATTRS_o_ai
6983 vec_vsrw(vector int __a, vector unsigned int __b)
6984 {
6985   return __a >> (vector int)__b;
6986 }
6987
6988 static vector unsigned int __ATTRS_o_ai
6989 vec_vsrw(vector unsigned int __a, vector unsigned int __b)
6990 {
6991   return __a >> __b;
6992 }
6993
6994 /* vec_sra */
6995
6996 static vector signed char __ATTRS_o_ai
6997 vec_sra(vector signed char __a, vector unsigned char __b)
6998 {
6999   return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
7000 }
7001
7002 static vector unsigned char __ATTRS_o_ai
7003 vec_sra(vector unsigned char __a, vector unsigned char __b)
7004 {
7005   return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
7006 }
7007
7008 static vector short __ATTRS_o_ai
7009 vec_sra(vector short __a, vector unsigned short __b)
7010 {
7011   return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
7012 }
7013
7014 static vector unsigned short __ATTRS_o_ai
7015 vec_sra(vector unsigned short __a, vector unsigned short __b)
7016 {
7017   return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
7018 }
7019
7020 static vector int __ATTRS_o_ai
7021 vec_sra(vector int __a, vector unsigned int __b)
7022 {
7023   return __builtin_altivec_vsraw(__a, __b);
7024 }
7025
7026 static vector unsigned int __ATTRS_o_ai
7027 vec_sra(vector unsigned int __a, vector unsigned int __b)
7028 {
7029   return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
7030 }
7031
7032 #ifdef __POWER8_VECTOR__
7033 static vector signed long long __ATTRS_o_ai
7034 vec_sra(vector signed long long __a, vector unsigned long long __b)
7035 {
7036   return __a >> __b;
7037 }
7038
7039 static vector unsigned long long __ATTRS_o_ai
7040 vec_sra(vector unsigned long long __a, vector unsigned long long __b)
7041 {
7042   return (vector unsigned long long) ( (vector signed long long) __a >> __b);
7043 }
7044 #endif
7045
7046 /* vec_vsrab */
7047
7048 static vector signed char __ATTRS_o_ai
7049 vec_vsrab(vector signed char __a, vector unsigned char __b)
7050 {
7051   return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
7052 }
7053
7054 static vector unsigned char __ATTRS_o_ai
7055 vec_vsrab(vector unsigned char __a, vector unsigned char __b)
7056 {
7057   return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
7058 }
7059
7060 /* vec_vsrah */
7061
7062 static vector short __ATTRS_o_ai
7063 vec_vsrah(vector short __a, vector unsigned short __b)
7064 {
7065   return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
7066 }
7067
7068 static vector unsigned short __ATTRS_o_ai
7069 vec_vsrah(vector unsigned short __a, vector unsigned short __b)
7070 {
7071   return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
7072 }
7073
7074 /* vec_vsraw */
7075
7076 static vector int __ATTRS_o_ai
7077 vec_vsraw(vector int __a, vector unsigned int __b)
7078 {
7079   return __builtin_altivec_vsraw(__a, __b);
7080 }
7081
7082 static vector unsigned int __ATTRS_o_ai
7083 vec_vsraw(vector unsigned int __a, vector unsigned int __b)
7084 {
7085   return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
7086 }
7087
7088 /* vec_srl */
7089
7090 static vector signed char __ATTRS_o_ai
7091 vec_srl(vector signed char __a, vector unsigned char __b)
7092 {
7093   return (vector signed char)
7094            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7095 }
7096
7097 static vector signed char __ATTRS_o_ai
7098 vec_srl(vector signed char __a, vector unsigned short __b)
7099 {
7100   return (vector signed char)
7101            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7102 }
7103
7104 static vector signed char __ATTRS_o_ai
7105 vec_srl(vector signed char __a, vector unsigned int __b)
7106 {
7107   return (vector signed char)
7108            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7109 }
7110
7111 static vector unsigned char __ATTRS_o_ai
7112 vec_srl(vector unsigned char __a, vector unsigned char __b)
7113 {
7114   return (vector unsigned char)
7115            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7116 }
7117
7118 static vector unsigned char __ATTRS_o_ai
7119 vec_srl(vector unsigned char __a, vector unsigned short __b)
7120 {
7121   return (vector unsigned char)
7122            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7123 }
7124
7125 static vector unsigned char __ATTRS_o_ai
7126 vec_srl(vector unsigned char __a, vector unsigned int __b)
7127 {
7128   return (vector unsigned char)
7129            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7130 }
7131
7132 static vector bool char __ATTRS_o_ai
7133 vec_srl(vector bool char __a, vector unsigned char __b)
7134 {
7135   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7136 }
7137
7138 static vector bool char __ATTRS_o_ai
7139 vec_srl(vector bool char __a, vector unsigned short __b)
7140 {
7141   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7142 }
7143
7144 static vector bool char __ATTRS_o_ai
7145 vec_srl(vector bool char __a, vector unsigned int __b)
7146 {
7147   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7148 }
7149
7150 static vector short __ATTRS_o_ai
7151 vec_srl(vector short __a, vector unsigned char __b)
7152 {
7153   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7154 }
7155
7156 static vector short __ATTRS_o_ai
7157 vec_srl(vector short __a, vector unsigned short __b)
7158 {
7159   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7160 }
7161
7162 static vector short __ATTRS_o_ai
7163 vec_srl(vector short __a, vector unsigned int __b)
7164 {
7165   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7166 }
7167
7168 static vector unsigned short __ATTRS_o_ai
7169 vec_srl(vector unsigned short __a, vector unsigned char __b)
7170 {
7171   return (vector unsigned short)
7172            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7173 }
7174
7175 static vector unsigned short __ATTRS_o_ai
7176 vec_srl(vector unsigned short __a, vector unsigned short __b)
7177 {
7178   return (vector unsigned short)
7179            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7180 }
7181
7182 static vector unsigned short __ATTRS_o_ai
7183 vec_srl(vector unsigned short __a, vector unsigned int __b)
7184 {
7185   return (vector unsigned short)
7186            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7187 }
7188
7189 static vector bool short __ATTRS_o_ai
7190 vec_srl(vector bool short __a, vector unsigned char __b)
7191 {
7192   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7193 }
7194
7195 static vector bool short __ATTRS_o_ai
7196 vec_srl(vector bool short __a, vector unsigned short __b)
7197 {
7198   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7199 }
7200
7201 static vector bool short __ATTRS_o_ai
7202 vec_srl(vector bool short __a, vector unsigned int __b)
7203 {
7204   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7205 }
7206
7207 static vector pixel __ATTRS_o_ai
7208 vec_srl(vector pixel __a, vector unsigned char __b)
7209 {
7210   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7211 }
7212
7213 static vector pixel __ATTRS_o_ai
7214 vec_srl(vector pixel __a, vector unsigned short __b)
7215 {
7216   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7217 }
7218
7219 static vector pixel __ATTRS_o_ai
7220 vec_srl(vector pixel __a, vector unsigned int __b)
7221 {
7222   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7223 }
7224
7225 static vector int __ATTRS_o_ai
7226 vec_srl(vector int __a, vector unsigned char __b)
7227 {
7228   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7229 }
7230
7231 static vector int __ATTRS_o_ai
7232 vec_srl(vector int __a, vector unsigned short __b)
7233 {
7234   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7235 }
7236
7237 static vector int __ATTRS_o_ai
7238 vec_srl(vector int __a, vector unsigned int __b)
7239 {
7240   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7241 }
7242
7243 static vector unsigned int __ATTRS_o_ai
7244 vec_srl(vector unsigned int __a, vector unsigned char __b)
7245 {
7246   return (vector unsigned int)
7247            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7248 }
7249
7250 static vector unsigned int __ATTRS_o_ai
7251 vec_srl(vector unsigned int __a, vector unsigned short __b)
7252 {
7253   return (vector unsigned int)
7254            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7255 }
7256
7257 static vector unsigned int __ATTRS_o_ai
7258 vec_srl(vector unsigned int __a, vector unsigned int __b)
7259 {
7260   return (vector unsigned int)
7261            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7262 }
7263
7264 static vector bool int __ATTRS_o_ai
7265 vec_srl(vector bool int __a, vector unsigned char __b)
7266 {
7267   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7268 }
7269
7270 static vector bool int __ATTRS_o_ai
7271 vec_srl(vector bool int __a, vector unsigned short __b)
7272 {
7273   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7274 }
7275
7276 static vector bool int __ATTRS_o_ai
7277 vec_srl(vector bool int __a, vector unsigned int __b)
7278 {
7279   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7280 }
7281
7282 /* vec_vsr */
7283
7284 static vector signed char __ATTRS_o_ai
7285 vec_vsr(vector signed char __a, vector unsigned char __b)
7286 {
7287   return (vector signed char)
7288            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7289 }
7290
7291 static vector signed char __ATTRS_o_ai
7292 vec_vsr(vector signed char __a, vector unsigned short __b)
7293 {
7294   return (vector signed char)
7295            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7296 }
7297
7298 static vector signed char __ATTRS_o_ai
7299 vec_vsr(vector signed char __a, vector unsigned int __b)
7300 {
7301   return (vector signed char)
7302            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7303 }
7304
7305 static vector unsigned char __ATTRS_o_ai
7306 vec_vsr(vector unsigned char __a, vector unsigned char __b)
7307 {
7308   return (vector unsigned char)
7309            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7310 }
7311
7312 static vector unsigned char __ATTRS_o_ai
7313 vec_vsr(vector unsigned char __a, vector unsigned short __b)
7314 {
7315   return (vector unsigned char)
7316            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7317 }
7318
7319 static vector unsigned char __ATTRS_o_ai
7320 vec_vsr(vector unsigned char __a, vector unsigned int __b)
7321 {
7322   return (vector unsigned char)
7323            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7324 }
7325
7326 static vector bool char __ATTRS_o_ai
7327 vec_vsr(vector bool char __a, vector unsigned char __b)
7328 {
7329   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7330 }
7331
7332 static vector bool char __ATTRS_o_ai
7333 vec_vsr(vector bool char __a, vector unsigned short __b)
7334 {
7335   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7336 }
7337
7338 static vector bool char __ATTRS_o_ai
7339 vec_vsr(vector bool char __a, vector unsigned int __b)
7340 {
7341   return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7342 }
7343
7344 static vector short __ATTRS_o_ai
7345 vec_vsr(vector short __a, vector unsigned char __b)
7346 {
7347   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7348 }
7349
7350 static vector short __ATTRS_o_ai
7351 vec_vsr(vector short __a, vector unsigned short __b)
7352 {
7353   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7354 }
7355
7356 static vector short __ATTRS_o_ai
7357 vec_vsr(vector short __a, vector unsigned int __b)
7358 {
7359   return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7360 }
7361
7362 static vector unsigned short __ATTRS_o_ai
7363 vec_vsr(vector unsigned short __a, vector unsigned char __b)
7364 {
7365   return (vector unsigned short)
7366            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7367 }
7368
7369 static vector unsigned short __ATTRS_o_ai
7370 vec_vsr(vector unsigned short __a, vector unsigned short __b)
7371 {
7372   return (vector unsigned short)
7373            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7374 }
7375
7376 static vector unsigned short __ATTRS_o_ai
7377 vec_vsr(vector unsigned short __a, vector unsigned int __b)
7378 {
7379   return (vector unsigned short)
7380            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7381 }
7382
7383 static vector bool short __ATTRS_o_ai
7384 vec_vsr(vector bool short __a, vector unsigned char __b)
7385 {
7386   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7387 }
7388
7389 static vector bool short __ATTRS_o_ai
7390 vec_vsr(vector bool short __a, vector unsigned short __b)
7391 {
7392   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7393 }
7394
7395 static vector bool short __ATTRS_o_ai
7396 vec_vsr(vector bool short __a, vector unsigned int __b)
7397 {
7398   return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7399 }
7400
7401 static vector pixel __ATTRS_o_ai
7402 vec_vsr(vector pixel __a, vector unsigned char __b)
7403 {
7404   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7405 }
7406
7407 static vector pixel __ATTRS_o_ai
7408 vec_vsr(vector pixel __a, vector unsigned short __b)
7409 {
7410   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7411 }
7412
7413 static vector pixel __ATTRS_o_ai
7414 vec_vsr(vector pixel __a, vector unsigned int __b)
7415 {
7416   return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7417 }
7418
7419 static vector int __ATTRS_o_ai
7420 vec_vsr(vector int __a, vector unsigned char __b)
7421 {
7422   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7423 }
7424
7425 static vector int __ATTRS_o_ai
7426 vec_vsr(vector int __a, vector unsigned short __b)
7427 {
7428   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7429 }
7430
7431 static vector int __ATTRS_o_ai
7432 vec_vsr(vector int __a, vector unsigned int __b)
7433 {
7434   return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
7435 }
7436
7437 static vector unsigned int __ATTRS_o_ai
7438 vec_vsr(vector unsigned int __a, vector unsigned char __b)
7439 {
7440   return (vector unsigned int)
7441            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7442 }
7443
7444 static vector unsigned int __ATTRS_o_ai
7445 vec_vsr(vector unsigned int __a, vector unsigned short __b)
7446 {
7447   return (vector unsigned int)
7448            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7449 }
7450
7451 static vector unsigned int __ATTRS_o_ai
7452 vec_vsr(vector unsigned int __a, vector unsigned int __b)
7453 {
7454   return (vector unsigned int)
7455            __builtin_altivec_vsr((vector int)__a, (vector int)__b);
7456 }
7457
7458 static vector bool int __ATTRS_o_ai
7459 vec_vsr(vector bool int __a, vector unsigned char __b)
7460 {
7461   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7462 }
7463
7464 static vector bool int __ATTRS_o_ai
7465 vec_vsr(vector bool int __a, vector unsigned short __b)
7466 {
7467   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7468 }
7469
7470 static vector bool int __ATTRS_o_ai
7471 vec_vsr(vector bool int __a, vector unsigned int __b)
7472 {
7473   return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
7474 }
7475
7476 /* vec_sro */
7477
7478 static vector signed char __ATTRS_o_ai
7479 vec_sro(vector signed char __a, vector signed char __b)
7480 {
7481   return (vector signed char)
7482            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7483 }
7484
7485 static vector signed char __ATTRS_o_ai
7486 vec_sro(vector signed char __a, vector unsigned char __b)
7487 {
7488   return (vector signed char)
7489            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7490 }
7491
7492 static vector unsigned char __ATTRS_o_ai
7493 vec_sro(vector unsigned char __a, vector signed char __b)
7494 {
7495   return (vector unsigned char)
7496            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7497 }
7498
7499 static vector unsigned char __ATTRS_o_ai
7500 vec_sro(vector unsigned char __a, vector unsigned char __b)
7501 {
7502   return (vector unsigned char)
7503            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7504 }
7505
7506 static vector short __ATTRS_o_ai
7507 vec_sro(vector short __a, vector signed char __b)
7508 {
7509   return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7510 }
7511
7512 static vector short __ATTRS_o_ai
7513 vec_sro(vector short __a, vector unsigned char __b)
7514 {
7515   return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7516 }
7517
7518 static vector unsigned short __ATTRS_o_ai
7519 vec_sro(vector unsigned short __a, vector signed char __b)
7520 {
7521   return (vector unsigned short)
7522            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7523 }
7524
7525 static vector unsigned short __ATTRS_o_ai
7526 vec_sro(vector unsigned short __a, vector unsigned char __b)
7527 {
7528   return (vector unsigned short)
7529            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7530 }
7531
7532 static vector pixel __ATTRS_o_ai
7533 vec_sro(vector pixel __a, vector signed char __b)
7534 {
7535   return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7536 }
7537
7538 static vector pixel __ATTRS_o_ai
7539 vec_sro(vector pixel __a, vector unsigned char __b)
7540 {
7541   return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7542 }
7543
7544 static vector int __ATTRS_o_ai
7545 vec_sro(vector int __a, vector signed char __b)
7546 {
7547   return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
7548 }
7549
7550 static vector int __ATTRS_o_ai
7551 vec_sro(vector int __a, vector unsigned char __b)
7552 {
7553   return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
7554 }
7555
7556 static vector unsigned int __ATTRS_o_ai
7557 vec_sro(vector unsigned int __a, vector signed char __b)
7558 {
7559   return (vector unsigned int)
7560            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7561 }
7562
7563 static vector unsigned int __ATTRS_o_ai
7564 vec_sro(vector unsigned int __a, vector unsigned char __b)
7565 {
7566   return (vector unsigned int)
7567            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7568 }
7569
7570 static vector float __ATTRS_o_ai
7571 vec_sro(vector float __a, vector signed char __b)
7572 {
7573   return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7574 }
7575
7576 static vector float __ATTRS_o_ai
7577 vec_sro(vector float __a, vector unsigned char __b)
7578 {
7579   return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7580 }
7581
7582 /* vec_vsro */
7583
7584 static vector signed char __ATTRS_o_ai
7585 vec_vsro(vector signed char __a, vector signed char __b)
7586 {
7587   return (vector signed char)
7588            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7589 }
7590
7591 static vector signed char __ATTRS_o_ai
7592 vec_vsro(vector signed char __a, vector unsigned char __b)
7593 {
7594   return (vector signed char)
7595            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7596 }
7597
7598 static vector unsigned char __ATTRS_o_ai
7599 vec_vsro(vector unsigned char __a, vector signed char __b)
7600 {
7601   return (vector unsigned char)
7602            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7603 }
7604
7605 static vector unsigned char __ATTRS_o_ai
7606 vec_vsro(vector unsigned char __a, vector unsigned char __b)
7607 {
7608   return (vector unsigned char)
7609            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7610 }
7611
7612 static vector short __ATTRS_o_ai
7613 vec_vsro(vector short __a, vector signed char __b)
7614 {
7615   return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7616 }
7617
7618 static vector short __ATTRS_o_ai
7619 vec_vsro(vector short __a, vector unsigned char __b)
7620 {
7621   return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7622 }
7623
7624 static vector unsigned short __ATTRS_o_ai
7625 vec_vsro(vector unsigned short __a, vector signed char __b)
7626 {
7627   return (vector unsigned short)
7628            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7629 }
7630
7631 static vector unsigned short __ATTRS_o_ai
7632 vec_vsro(vector unsigned short __a, vector unsigned char __b)
7633 {
7634   return (vector unsigned short)
7635            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7636 }
7637
7638 static vector pixel __ATTRS_o_ai
7639 vec_vsro(vector pixel __a, vector signed char __b)
7640 {
7641   return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7642 }
7643
7644 static vector pixel __ATTRS_o_ai
7645 vec_vsro(vector pixel __a, vector unsigned char __b)
7646 {
7647   return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7648 }
7649
7650 static vector int __ATTRS_o_ai
7651 vec_vsro(vector int __a, vector signed char __b)
7652 {
7653   return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
7654 }
7655
7656 static vector int __ATTRS_o_ai
7657 vec_vsro(vector int __a, vector unsigned char __b)
7658 {
7659   return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
7660 }
7661
7662 static vector unsigned int __ATTRS_o_ai
7663 vec_vsro(vector unsigned int __a, vector signed char __b)
7664 {
7665   return (vector unsigned int)
7666            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7667 }
7668
7669 static vector unsigned int __ATTRS_o_ai
7670 vec_vsro(vector unsigned int __a, vector unsigned char __b)
7671 {
7672   return (vector unsigned int)
7673            __builtin_altivec_vsro((vector int)__a, (vector int)__b);
7674 }
7675
7676 static vector float __ATTRS_o_ai
7677 vec_vsro(vector float __a, vector signed char __b)
7678 {
7679   return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7680 }
7681
7682 static vector float __ATTRS_o_ai
7683 vec_vsro(vector float __a, vector unsigned char __b)
7684 {
7685   return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
7686 }
7687
7688 /* vec_st */
7689
7690 static void __ATTRS_o_ai
7691 vec_st(vector signed char __a, int __b, vector signed char *__c)
7692 {
7693   __builtin_altivec_stvx((vector int)__a, __b, __c);
7694 }
7695
7696 static void __ATTRS_o_ai
7697 vec_st(vector signed char __a, int __b, signed char *__c)
7698 {
7699   __builtin_altivec_stvx((vector int)__a, __b, __c);
7700 }
7701
7702 static void __ATTRS_o_ai
7703 vec_st(vector unsigned char __a, int __b, vector unsigned char *__c)
7704 {
7705   __builtin_altivec_stvx((vector int)__a, __b, __c);
7706 }
7707
7708 static void __ATTRS_o_ai
7709 vec_st(vector unsigned char __a, int __b, unsigned char *__c)
7710 {
7711   __builtin_altivec_stvx((vector int)__a, __b, __c);
7712 }
7713
7714 static void __ATTRS_o_ai
7715 vec_st(vector bool char __a, int __b, signed char *__c)
7716 {
7717   __builtin_altivec_stvx((vector int)__a, __b, __c);
7718 }
7719
7720 static void __ATTRS_o_ai
7721 vec_st(vector bool char __a, int __b, unsigned char *__c)
7722 {
7723   __builtin_altivec_stvx((vector int)__a, __b, __c);
7724 }
7725
7726 static void __ATTRS_o_ai
7727 vec_st(vector bool char __a, int __b, vector bool char *__c)
7728 {
7729   __builtin_altivec_stvx((vector int)__a, __b, __c);
7730 }
7731
7732 static void __ATTRS_o_ai
7733 vec_st(vector short __a, int __b, vector short *__c)
7734 {
7735   __builtin_altivec_stvx((vector int)__a, __b, __c);
7736 }
7737
7738 static void __ATTRS_o_ai
7739 vec_st(vector short __a, int __b, short *__c)
7740 {
7741   __builtin_altivec_stvx((vector int)__a, __b, __c);
7742 }
7743
7744 static void __ATTRS_o_ai
7745 vec_st(vector unsigned short __a, int __b, vector unsigned short *__c)
7746 {
7747   __builtin_altivec_stvx((vector int)__a, __b, __c);
7748 }
7749
7750 static void __ATTRS_o_ai
7751 vec_st(vector unsigned short __a, int __b, unsigned short *__c)
7752 {
7753   __builtin_altivec_stvx((vector int)__a, __b, __c);
7754 }
7755
7756 static void __ATTRS_o_ai
7757 vec_st(vector bool short __a, int __b, short *__c)
7758 {
7759   __builtin_altivec_stvx((vector int)__a, __b, __c);
7760 }
7761
7762 static void __ATTRS_o_ai
7763 vec_st(vector bool short __a, int __b, unsigned short *__c)
7764 {
7765   __builtin_altivec_stvx((vector int)__a, __b, __c);
7766 }
7767
7768 static void __ATTRS_o_ai
7769 vec_st(vector bool short __a, int __b, vector bool short *__c)
7770 {
7771   __builtin_altivec_stvx((vector int)__a, __b, __c);
7772 }
7773
7774 static void __ATTRS_o_ai
7775 vec_st(vector pixel __a, int __b, short *__c)
7776 {
7777   __builtin_altivec_stvx((vector int)__a, __b, __c);
7778 }
7779
7780 static void __ATTRS_o_ai
7781 vec_st(vector pixel __a, int __b, unsigned short *__c)
7782 {
7783   __builtin_altivec_stvx((vector int)__a, __b, __c);
7784 }
7785
7786 static void __ATTRS_o_ai
7787 vec_st(vector pixel __a, int __b, vector pixel *__c)
7788 {
7789   __builtin_altivec_stvx((vector int)__a, __b, __c);
7790 }
7791
7792 static void __ATTRS_o_ai
7793 vec_st(vector int __a, int __b, vector int *__c)
7794 {
7795   __builtin_altivec_stvx(__a, __b, __c);
7796 }
7797
7798 static void __ATTRS_o_ai
7799 vec_st(vector int __a, int __b, int *__c)
7800 {
7801   __builtin_altivec_stvx(__a, __b, __c);
7802 }
7803
7804 static void __ATTRS_o_ai
7805 vec_st(vector unsigned int __a, int __b, vector unsigned int *__c)
7806 {
7807   __builtin_altivec_stvx((vector int)__a, __b, __c);
7808 }
7809
7810 static void __ATTRS_o_ai
7811 vec_st(vector unsigned int __a, int __b, unsigned int *__c)
7812 {
7813   __builtin_altivec_stvx((vector int)__a, __b, __c);
7814 }
7815
7816 static void __ATTRS_o_ai
7817 vec_st(vector bool int __a, int __b, int *__c)
7818 {
7819   __builtin_altivec_stvx((vector int)__a, __b, __c);
7820 }
7821
7822 static void __ATTRS_o_ai
7823 vec_st(vector bool int __a, int __b, unsigned int *__c)
7824 {
7825   __builtin_altivec_stvx((vector int)__a, __b, __c);
7826 }
7827
7828 static void __ATTRS_o_ai
7829 vec_st(vector bool int __a, int __b, vector bool int *__c)
7830 {
7831   __builtin_altivec_stvx((vector int)__a, __b, __c);
7832 }
7833
7834 static void __ATTRS_o_ai
7835 vec_st(vector float __a, int __b, vector float *__c)
7836 {
7837   __builtin_altivec_stvx((vector int)__a, __b, __c);
7838 }
7839
7840 static void __ATTRS_o_ai
7841 vec_st(vector float __a, int __b, float *__c)
7842 {
7843   __builtin_altivec_stvx((vector int)__a, __b, __c);
7844 }
7845
7846 /* vec_stvx */
7847
7848 static void __ATTRS_o_ai
7849 vec_stvx(vector signed char __a, int __b, vector signed char *__c)
7850 {
7851   __builtin_altivec_stvx((vector int)__a, __b, __c);
7852 }
7853
7854 static void __ATTRS_o_ai
7855 vec_stvx(vector signed char __a, int __b, signed char *__c)
7856 {
7857   __builtin_altivec_stvx((vector int)__a, __b, __c);
7858 }
7859
7860 static void __ATTRS_o_ai
7861 vec_stvx(vector unsigned char __a, int __b, vector unsigned char *__c)
7862 {
7863   __builtin_altivec_stvx((vector int)__a, __b, __c);
7864 }
7865
7866 static void __ATTRS_o_ai
7867 vec_stvx(vector unsigned char __a, int __b, unsigned char *__c)
7868 {
7869   __builtin_altivec_stvx((vector int)__a, __b, __c);
7870 }
7871
7872 static void __ATTRS_o_ai
7873 vec_stvx(vector bool char __a, int __b, signed char *__c)
7874 {
7875   __builtin_altivec_stvx((vector int)__a, __b, __c);
7876 }
7877
7878 static void __ATTRS_o_ai
7879 vec_stvx(vector bool char __a, int __b, unsigned char *__c)
7880 {
7881   __builtin_altivec_stvx((vector int)__a, __b, __c);
7882 }
7883
7884 static void __ATTRS_o_ai
7885 vec_stvx(vector bool char __a, int __b, vector bool char *__c)
7886 {
7887   __builtin_altivec_stvx((vector int)__a, __b, __c);
7888 }
7889
7890 static void __ATTRS_o_ai
7891 vec_stvx(vector short __a, int __b, vector short *__c)
7892 {
7893   __builtin_altivec_stvx((vector int)__a, __b, __c);
7894 }
7895
7896 static void __ATTRS_o_ai
7897 vec_stvx(vector short __a, int __b, short *__c)
7898 {
7899   __builtin_altivec_stvx((vector int)__a, __b, __c);
7900 }
7901
7902 static void __ATTRS_o_ai
7903 vec_stvx(vector unsigned short __a, int __b, vector unsigned short *__c)
7904 {
7905   __builtin_altivec_stvx((vector int)__a, __b, __c);
7906 }
7907
7908 static void __ATTRS_o_ai
7909 vec_stvx(vector unsigned short __a, int __b, unsigned short *__c)
7910 {
7911   __builtin_altivec_stvx((vector int)__a, __b, __c);
7912 }
7913
7914 static void __ATTRS_o_ai
7915 vec_stvx(vector bool short __a, int __b, short *__c)
7916 {
7917   __builtin_altivec_stvx((vector int)__a, __b, __c);
7918 }
7919
7920 static void __ATTRS_o_ai
7921 vec_stvx(vector bool short __a, int __b, unsigned short *__c)
7922 {
7923   __builtin_altivec_stvx((vector int)__a, __b, __c);
7924 }
7925
7926 static void __ATTRS_o_ai
7927 vec_stvx(vector bool short __a, int __b, vector bool short *__c)
7928 {
7929   __builtin_altivec_stvx((vector int)__a, __b, __c);
7930 }
7931
7932 static void __ATTRS_o_ai
7933 vec_stvx(vector pixel __a, int __b, short *__c)
7934 {
7935   __builtin_altivec_stvx((vector int)__a, __b, __c);
7936 }
7937
7938 static void __ATTRS_o_ai
7939 vec_stvx(vector pixel __a, int __b, unsigned short *__c)
7940 {
7941   __builtin_altivec_stvx((vector int)__a, __b, __c);
7942 }
7943
7944 static void __ATTRS_o_ai
7945 vec_stvx(vector pixel __a, int __b, vector pixel *__c)
7946 {
7947   __builtin_altivec_stvx((vector int)__a, __b, __c);
7948 }
7949
7950 static void __ATTRS_o_ai
7951 vec_stvx(vector int __a, int __b, vector int *__c)
7952 {
7953   __builtin_altivec_stvx(__a, __b, __c);
7954 }
7955
7956 static void __ATTRS_o_ai
7957 vec_stvx(vector int __a, int __b, int *__c)
7958 {
7959   __builtin_altivec_stvx(__a, __b, __c);
7960 }
7961
7962 static void __ATTRS_o_ai
7963 vec_stvx(vector unsigned int __a, int __b, vector unsigned int *__c)
7964 {
7965   __builtin_altivec_stvx((vector int)__a, __b, __c);
7966 }
7967
7968 static void __ATTRS_o_ai
7969 vec_stvx(vector unsigned int __a, int __b, unsigned int *__c)
7970 {
7971   __builtin_altivec_stvx((vector int)__a, __b, __c);
7972 }
7973
7974 static void __ATTRS_o_ai
7975 vec_stvx(vector bool int __a, int __b, int *__c)
7976 {
7977   __builtin_altivec_stvx((vector int)__a, __b, __c);
7978 }
7979
7980 static void __ATTRS_o_ai
7981 vec_stvx(vector bool int __a, int __b, unsigned int *__c)
7982 {
7983   __builtin_altivec_stvx((vector int)__a, __b, __c);
7984 }
7985
7986 static void __ATTRS_o_ai
7987 vec_stvx(vector bool int __a, int __b, vector bool int *__c)
7988 {
7989   __builtin_altivec_stvx((vector int)__a, __b, __c);
7990 }
7991
7992 static void __ATTRS_o_ai
7993 vec_stvx(vector float __a, int __b, vector float *__c)
7994 {
7995   __builtin_altivec_stvx((vector int)__a, __b, __c);
7996 }
7997
7998 static void __ATTRS_o_ai
7999 vec_stvx(vector float __a, int __b, float *__c)
8000 {
8001   __builtin_altivec_stvx((vector int)__a, __b, __c);
8002 }
8003
8004 /* vec_ste */
8005
8006 static void __ATTRS_o_ai
8007 vec_ste(vector signed char __a, int __b, signed char *__c)
8008 {
8009   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8010 }
8011
8012 static void __ATTRS_o_ai
8013 vec_ste(vector unsigned char __a, int __b, unsigned char *__c)
8014 {
8015   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8016 }
8017
8018 static void __ATTRS_o_ai
8019 vec_ste(vector bool char __a, int __b, signed char *__c)
8020 {
8021   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8022 }
8023
8024 static void __ATTRS_o_ai
8025 vec_ste(vector bool char __a, int __b, unsigned char *__c)
8026 {
8027   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8028 }
8029
8030 static void __ATTRS_o_ai
8031 vec_ste(vector short __a, int __b, short *__c)
8032 {
8033   __builtin_altivec_stvehx(__a, __b, __c);
8034 }
8035
8036 static void __ATTRS_o_ai
8037 vec_ste(vector unsigned short __a, int __b, unsigned short *__c)
8038 {
8039   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8040 }
8041
8042 static void __ATTRS_o_ai
8043 vec_ste(vector bool short __a, int __b, short *__c)
8044 {
8045   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8046 }
8047
8048 static void __ATTRS_o_ai
8049 vec_ste(vector bool short __a, int __b, unsigned short *__c)
8050 {
8051   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8052 }
8053
8054 static void __ATTRS_o_ai
8055 vec_ste(vector pixel __a, int __b, short *__c)
8056 {
8057   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8058 }
8059
8060 static void __ATTRS_o_ai
8061 vec_ste(vector pixel __a, int __b, unsigned short *__c)
8062 {
8063   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8064 }
8065
8066 static void __ATTRS_o_ai
8067 vec_ste(vector int __a, int __b, int *__c)
8068 {
8069   __builtin_altivec_stvewx(__a, __b, __c);
8070 }
8071
8072 static void __ATTRS_o_ai
8073 vec_ste(vector unsigned int __a, int __b, unsigned int *__c)
8074 {
8075   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8076 }
8077
8078 static void __ATTRS_o_ai
8079 vec_ste(vector bool int __a, int __b, int *__c)
8080 {
8081   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8082 }
8083
8084 static void __ATTRS_o_ai
8085 vec_ste(vector bool int __a, int __b, unsigned int *__c)
8086 {
8087   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8088 }
8089
8090 static void __ATTRS_o_ai
8091 vec_ste(vector float __a, int __b, float *__c)
8092 {
8093   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8094 }
8095
8096 /* vec_stvebx */
8097
8098 static void __ATTRS_o_ai
8099 vec_stvebx(vector signed char __a, int __b, signed char *__c)
8100 {
8101   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8102 }
8103
8104 static void __ATTRS_o_ai
8105 vec_stvebx(vector unsigned char __a, int __b, unsigned char *__c)
8106 {
8107   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8108 }
8109
8110 static void __ATTRS_o_ai
8111 vec_stvebx(vector bool char __a, int __b, signed char *__c)
8112 {
8113   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8114 }
8115
8116 static void __ATTRS_o_ai
8117 vec_stvebx(vector bool char __a, int __b, unsigned char *__c)
8118 {
8119   __builtin_altivec_stvebx((vector char)__a, __b, __c);
8120 }
8121
8122 /* vec_stvehx */
8123
8124 static void __ATTRS_o_ai
8125 vec_stvehx(vector short __a, int __b, short *__c)
8126 {
8127   __builtin_altivec_stvehx(__a, __b, __c);
8128 }
8129
8130 static void __ATTRS_o_ai
8131 vec_stvehx(vector unsigned short __a, int __b, unsigned short *__c)
8132 {
8133   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8134 }
8135
8136 static void __ATTRS_o_ai
8137 vec_stvehx(vector bool short __a, int __b, short *__c)
8138 {
8139   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8140 }
8141
8142 static void __ATTRS_o_ai
8143 vec_stvehx(vector bool short __a, int __b, unsigned short *__c)
8144 {
8145   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8146 }
8147
8148 static void __ATTRS_o_ai
8149 vec_stvehx(vector pixel __a, int __b, short *__c)
8150 {
8151   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8152 }
8153
8154 static void __ATTRS_o_ai
8155 vec_stvehx(vector pixel __a, int __b, unsigned short *__c)
8156 {
8157   __builtin_altivec_stvehx((vector short)__a, __b, __c);
8158 }
8159
8160 /* vec_stvewx */
8161
8162 static void __ATTRS_o_ai
8163 vec_stvewx(vector int __a, int __b, int *__c)
8164 {
8165   __builtin_altivec_stvewx(__a, __b, __c);
8166 }
8167
8168 static void __ATTRS_o_ai
8169 vec_stvewx(vector unsigned int __a, int __b, unsigned int *__c)
8170 {
8171   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8172 }
8173
8174 static void __ATTRS_o_ai
8175 vec_stvewx(vector bool int __a, int __b, int *__c)
8176 {
8177   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8178 }
8179
8180 static void __ATTRS_o_ai
8181 vec_stvewx(vector bool int __a, int __b, unsigned int *__c)
8182 {
8183   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8184 }
8185
8186 static void __ATTRS_o_ai
8187 vec_stvewx(vector float __a, int __b, float *__c)
8188 {
8189   __builtin_altivec_stvewx((vector int)__a, __b, __c);
8190 }
8191
8192 /* vec_stl */
8193
8194 static void __ATTRS_o_ai
8195 vec_stl(vector signed char __a, int __b, vector signed char *__c)
8196 {
8197   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8198 }
8199
8200 static void __ATTRS_o_ai
8201 vec_stl(vector signed char __a, int __b, signed char *__c)
8202 {
8203   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8204 }
8205
8206 static void __ATTRS_o_ai
8207 vec_stl(vector unsigned char __a, int __b, vector unsigned char *__c)
8208 {
8209   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8210 }
8211
8212 static void __ATTRS_o_ai
8213 vec_stl(vector unsigned char __a, int __b, unsigned char *__c)
8214 {
8215   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8216 }
8217
8218 static void __ATTRS_o_ai
8219 vec_stl(vector bool char __a, int __b, signed char *__c)
8220 {
8221   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8222 }
8223
8224 static void __ATTRS_o_ai
8225 vec_stl(vector bool char __a, int __b, unsigned char *__c)
8226 {
8227   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8228 }
8229
8230 static void __ATTRS_o_ai
8231 vec_stl(vector bool char __a, int __b, vector bool char *__c)
8232 {
8233   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8234 }
8235
8236 static void __ATTRS_o_ai
8237 vec_stl(vector short __a, int __b, vector short *__c)
8238 {
8239   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8240 }
8241
8242 static void __ATTRS_o_ai
8243 vec_stl(vector short __a, int __b, short *__c)
8244 {
8245   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8246 }
8247
8248 static void __ATTRS_o_ai
8249 vec_stl(vector unsigned short __a, int __b, vector unsigned short *__c)
8250 {
8251   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8252 }
8253
8254 static void __ATTRS_o_ai
8255 vec_stl(vector unsigned short __a, int __b, unsigned short *__c)
8256 {
8257   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8258 }
8259
8260 static void __ATTRS_o_ai
8261 vec_stl(vector bool short __a, int __b, short *__c)
8262 {
8263   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8264 }
8265
8266 static void __ATTRS_o_ai
8267 vec_stl(vector bool short __a, int __b, unsigned short *__c)
8268 {
8269   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8270 }
8271
8272 static void __ATTRS_o_ai
8273 vec_stl(vector bool short __a, int __b, vector bool short *__c)
8274 {
8275   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8276 }
8277
8278 static void __ATTRS_o_ai
8279 vec_stl(vector pixel __a, int __b, short *__c)
8280 {
8281   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8282 }
8283
8284 static void __ATTRS_o_ai
8285 vec_stl(vector pixel __a, int __b, unsigned short *__c)
8286 {
8287   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8288 }
8289
8290 static void __ATTRS_o_ai
8291 vec_stl(vector pixel __a, int __b, vector pixel *__c)
8292 {
8293   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8294 }
8295
8296 static void __ATTRS_o_ai
8297 vec_stl(vector int __a, int __b, vector int *__c)
8298 {
8299   __builtin_altivec_stvxl(__a, __b, __c);
8300 }
8301
8302 static void __ATTRS_o_ai
8303 vec_stl(vector int __a, int __b, int *__c)
8304 {
8305   __builtin_altivec_stvxl(__a, __b, __c);
8306 }
8307
8308 static void __ATTRS_o_ai
8309 vec_stl(vector unsigned int __a, int __b, vector unsigned int *__c)
8310 {
8311   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8312 }
8313
8314 static void __ATTRS_o_ai
8315 vec_stl(vector unsigned int __a, int __b, unsigned int *__c)
8316 {
8317   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8318 }
8319
8320 static void __ATTRS_o_ai
8321 vec_stl(vector bool int __a, int __b, int *__c)
8322 {
8323   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8324 }
8325
8326 static void __ATTRS_o_ai
8327 vec_stl(vector bool int __a, int __b, unsigned int *__c)
8328 {
8329   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8330 }
8331
8332 static void __ATTRS_o_ai
8333 vec_stl(vector bool int __a, int __b, vector bool int *__c)
8334 {
8335   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8336 }
8337
8338 static void __ATTRS_o_ai
8339 vec_stl(vector float __a, int __b, vector float *__c)
8340 {
8341   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8342 }
8343
8344 static void __ATTRS_o_ai
8345 vec_stl(vector float __a, int __b, float *__c)
8346 {
8347   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8348 }
8349
8350 /* vec_stvxl */
8351
8352 static void __ATTRS_o_ai
8353 vec_stvxl(vector signed char __a, int __b, vector signed char *__c)
8354 {
8355   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8356 }
8357
8358 static void __ATTRS_o_ai
8359 vec_stvxl(vector signed char __a, int __b, signed char *__c)
8360 {
8361   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8362 }
8363
8364 static void __ATTRS_o_ai
8365 vec_stvxl(vector unsigned char __a, int __b, vector unsigned char *__c)
8366 {
8367   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8368 }
8369
8370 static void __ATTRS_o_ai
8371 vec_stvxl(vector unsigned char __a, int __b, unsigned char *__c)
8372 {
8373   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8374 }
8375
8376 static void __ATTRS_o_ai
8377 vec_stvxl(vector bool char __a, int __b, signed char *__c)
8378 {
8379   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8380 }
8381
8382 static void __ATTRS_o_ai
8383 vec_stvxl(vector bool char __a, int __b, unsigned char *__c)
8384 {
8385   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8386 }
8387
8388 static void __ATTRS_o_ai
8389 vec_stvxl(vector bool char __a, int __b, vector bool char *__c)
8390 {
8391   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8392 }
8393
8394 static void __ATTRS_o_ai
8395 vec_stvxl(vector short __a, int __b, vector short *__c)
8396 {
8397   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8398 }
8399
8400 static void __ATTRS_o_ai
8401 vec_stvxl(vector short __a, int __b, short *__c)
8402 {
8403   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8404 }
8405
8406 static void __ATTRS_o_ai
8407 vec_stvxl(vector unsigned short __a, int __b, vector unsigned short *__c)
8408 {
8409   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8410 }
8411
8412 static void __ATTRS_o_ai
8413 vec_stvxl(vector unsigned short __a, int __b, unsigned short *__c)
8414 {
8415   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8416 }
8417
8418 static void __ATTRS_o_ai
8419 vec_stvxl(vector bool short __a, int __b, short *__c)
8420 {
8421   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8422 }
8423
8424 static void __ATTRS_o_ai
8425 vec_stvxl(vector bool short __a, int __b, unsigned short *__c)
8426 {
8427   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8428 }
8429
8430 static void __ATTRS_o_ai
8431 vec_stvxl(vector bool short __a, int __b, vector bool short *__c)
8432 {
8433   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8434 }
8435
8436 static void __ATTRS_o_ai
8437 vec_stvxl(vector pixel __a, int __b, short *__c)
8438 {
8439   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8440 }
8441
8442 static void __ATTRS_o_ai
8443 vec_stvxl(vector pixel __a, int __b, unsigned short *__c)
8444 {
8445   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8446 }
8447
8448 static void __ATTRS_o_ai
8449 vec_stvxl(vector pixel __a, int __b, vector pixel *__c)
8450 {
8451   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8452 }
8453
8454 static void __ATTRS_o_ai
8455 vec_stvxl(vector int __a, int __b, vector int *__c)
8456 {
8457   __builtin_altivec_stvxl(__a, __b, __c);
8458 }
8459
8460 static void __ATTRS_o_ai
8461 vec_stvxl(vector int __a, int __b, int *__c)
8462 {
8463   __builtin_altivec_stvxl(__a, __b, __c);
8464 }
8465
8466 static void __ATTRS_o_ai
8467 vec_stvxl(vector unsigned int __a, int __b, vector unsigned int *__c)
8468 {
8469   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8470 }
8471
8472 static void __ATTRS_o_ai
8473 vec_stvxl(vector unsigned int __a, int __b, unsigned int *__c)
8474 {
8475   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8476 }
8477
8478 static void __ATTRS_o_ai
8479 vec_stvxl(vector bool int __a, int __b, int *__c)
8480 {
8481   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8482 }
8483
8484 static void __ATTRS_o_ai
8485 vec_stvxl(vector bool int __a, int __b, unsigned int *__c)
8486 {
8487   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8488 }
8489
8490 static void __ATTRS_o_ai
8491 vec_stvxl(vector bool int __a, int __b, vector bool int *__c)
8492 {
8493   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8494 }
8495
8496 static void __ATTRS_o_ai
8497 vec_stvxl(vector float __a, int __b, vector float *__c)
8498 {
8499   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8500 }
8501
8502 static void __ATTRS_o_ai
8503 vec_stvxl(vector float __a, int __b, float *__c)
8504 {
8505   __builtin_altivec_stvxl((vector int)__a, __b, __c);
8506 }
8507
8508 /* vec_sub */
8509
8510 static vector signed char __ATTRS_o_ai
8511 vec_sub(vector signed char __a, vector signed char __b)
8512 {
8513   return __a - __b;
8514 }
8515
8516 static vector signed char __ATTRS_o_ai
8517 vec_sub(vector bool char __a, vector signed char __b)
8518 {
8519   return (vector signed char)__a - __b;
8520 }
8521
8522 static vector signed char __ATTRS_o_ai
8523 vec_sub(vector signed char __a, vector bool char __b)
8524 {
8525   return __a - (vector signed char)__b;
8526 }
8527
8528 static vector unsigned char __ATTRS_o_ai
8529 vec_sub(vector unsigned char __a, vector unsigned char __b)
8530 {
8531   return __a - __b;
8532 }
8533
8534 static vector unsigned char __ATTRS_o_ai
8535 vec_sub(vector bool char __a, vector unsigned char __b)
8536 {
8537   return (vector unsigned char)__a - __b;
8538 }
8539
8540 static vector unsigned char __ATTRS_o_ai
8541 vec_sub(vector unsigned char __a, vector bool char __b)
8542 {
8543   return __a - (vector unsigned char)__b;
8544 }
8545
8546 static vector short __ATTRS_o_ai
8547 vec_sub(vector short __a, vector short __b)
8548 {
8549   return __a - __b;
8550 }
8551
8552 static vector short __ATTRS_o_ai
8553 vec_sub(vector bool short __a, vector short __b)
8554 {
8555   return (vector short)__a - __b;
8556 }
8557
8558 static vector short __ATTRS_o_ai
8559 vec_sub(vector short __a, vector bool short __b)
8560 {
8561   return __a - (vector short)__b;
8562 }
8563
8564 static vector unsigned short __ATTRS_o_ai
8565 vec_sub(vector unsigned short __a, vector unsigned short __b)
8566 {
8567   return __a - __b;
8568 }
8569
8570 static vector unsigned short __ATTRS_o_ai
8571 vec_sub(vector bool short __a, vector unsigned short __b)
8572 {
8573   return (vector unsigned short)__a - __b;
8574 }
8575
8576 static vector unsigned short __ATTRS_o_ai
8577 vec_sub(vector unsigned short __a, vector bool short __b)
8578 {
8579   return __a - (vector unsigned short)__b;
8580 }
8581
8582 static vector int __ATTRS_o_ai
8583 vec_sub(vector int __a, vector int __b)
8584 {
8585   return __a - __b;
8586 }
8587
8588 static vector int __ATTRS_o_ai
8589 vec_sub(vector bool int __a, vector int __b)
8590 {
8591   return (vector int)__a - __b;
8592 }
8593
8594 static vector int __ATTRS_o_ai
8595 vec_sub(vector int __a, vector bool int __b)
8596 {
8597   return __a - (vector int)__b;
8598 }
8599
8600 static vector unsigned int __ATTRS_o_ai
8601 vec_sub(vector unsigned int __a, vector unsigned int __b)
8602 {
8603   return __a - __b;
8604 }
8605
8606 static vector unsigned int __ATTRS_o_ai
8607 vec_sub(vector bool int __a, vector unsigned int __b)
8608 {
8609   return (vector unsigned int)__a - __b;
8610 }
8611
8612 static vector unsigned int __ATTRS_o_ai
8613 vec_sub(vector unsigned int __a, vector bool int __b)
8614 {
8615   return __a - (vector unsigned int)__b;
8616 }
8617
8618 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
8619 static vector signed __int128 __ATTRS_o_ai
8620 vec_sub(vector signed __int128 __a, vector signed __int128 __b)
8621 {
8622   return __a - __b;
8623 }
8624
8625 static vector unsigned __int128 __ATTRS_o_ai
8626 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b)
8627 {
8628   return __a - __b;
8629 }
8630 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
8631
8632 static vector float __ATTRS_o_ai
8633 vec_sub(vector float __a, vector float __b)
8634 {
8635   return __a - __b;
8636 }
8637
8638 /* vec_vsububm */
8639
8640 #define __builtin_altivec_vsububm vec_vsububm
8641
8642 static vector signed char __ATTRS_o_ai
8643 vec_vsububm(vector signed char __a, vector signed char __b)
8644 {
8645   return __a - __b;
8646 }
8647
8648 static vector signed char __ATTRS_o_ai
8649 vec_vsububm(vector bool char __a, vector signed char __b)
8650 {
8651   return (vector signed char)__a - __b;
8652 }
8653
8654 static vector signed char __ATTRS_o_ai
8655 vec_vsububm(vector signed char __a, vector bool char __b)
8656 {
8657   return __a - (vector signed char)__b;
8658 }
8659
8660 static vector unsigned char __ATTRS_o_ai
8661 vec_vsububm(vector unsigned char __a, vector unsigned char __b)
8662 {
8663   return __a - __b;
8664 }
8665
8666 static vector unsigned char __ATTRS_o_ai
8667 vec_vsububm(vector bool char __a, vector unsigned char __b)
8668 {
8669   return (vector unsigned char)__a - __b;
8670 }
8671
8672 static vector unsigned char __ATTRS_o_ai
8673 vec_vsububm(vector unsigned char __a, vector bool char __b)
8674 {
8675   return __a - (vector unsigned char)__b;
8676 }
8677
8678 /* vec_vsubuhm */
8679
8680 #define __builtin_altivec_vsubuhm vec_vsubuhm
8681
8682 static vector short __ATTRS_o_ai
8683 vec_vsubuhm(vector short __a, vector short __b)
8684 {
8685   return __a - __b;
8686 }
8687
8688 static vector short __ATTRS_o_ai
8689 vec_vsubuhm(vector bool short __a, vector short __b)
8690 {
8691   return (vector short)__a - __b;
8692 }
8693
8694 static vector short __ATTRS_o_ai
8695 vec_vsubuhm(vector short __a, vector bool short __b)
8696 {
8697   return __a - (vector short)__b;
8698 }
8699
8700 static vector unsigned short __ATTRS_o_ai
8701 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b)
8702 {
8703   return __a - __b;
8704 }
8705
8706 static vector unsigned short __ATTRS_o_ai
8707 vec_vsubuhm(vector bool short __a, vector unsigned short __b)
8708 {
8709   return (vector unsigned short)__a - __b;
8710 }
8711
8712 static vector unsigned short __ATTRS_o_ai
8713 vec_vsubuhm(vector unsigned short __a, vector bool short __b)
8714 {
8715   return __a - (vector unsigned short)__b;
8716 }
8717
8718 /* vec_vsubuwm */
8719
8720 #define __builtin_altivec_vsubuwm vec_vsubuwm
8721
8722 static vector int __ATTRS_o_ai
8723 vec_vsubuwm(vector int __a, vector int __b)
8724 {
8725   return __a - __b;
8726 }
8727
8728 static vector int __ATTRS_o_ai
8729 vec_vsubuwm(vector bool int __a, vector int __b)
8730 {
8731   return (vector int)__a - __b;
8732 }
8733
8734 static vector int __ATTRS_o_ai
8735 vec_vsubuwm(vector int __a, vector bool int __b)
8736 {
8737   return __a - (vector int)__b;
8738 }
8739
8740 static vector unsigned int __ATTRS_o_ai
8741 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b)
8742 {
8743   return __a - __b;
8744 }
8745
8746 static vector unsigned int __ATTRS_o_ai
8747 vec_vsubuwm(vector bool int __a, vector unsigned int __b)
8748 {
8749   return (vector unsigned int)__a - __b;
8750 }
8751
8752 static vector unsigned int __ATTRS_o_ai
8753 vec_vsubuwm(vector unsigned int __a, vector bool int __b)
8754 {
8755   return __a - (vector unsigned int)__b;
8756 }
8757
8758 /* vec_vsubfp */
8759
8760 #define __builtin_altivec_vsubfp vec_vsubfp
8761
8762 static vector float __attribute__((__always_inline__))
8763 vec_vsubfp(vector float __a, vector float __b)
8764 {
8765   return __a - __b;
8766 }
8767
8768 /* vec_subc */
8769
8770 static vector unsigned int __ATTRS_o_ai
8771 vec_subc(vector unsigned int __a, vector unsigned int __b)
8772 {
8773   return __builtin_altivec_vsubcuw(__a, __b);
8774 }
8775
8776 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
8777 static vector unsigned __int128 __ATTRS_o_ai
8778 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b)
8779 {
8780   return __builtin_altivec_vsubcuq(__a, __b);
8781 }
8782
8783 static vector signed __int128 __ATTRS_o_ai
8784 vec_subc(vector signed __int128 __a, vector signed __int128 __b)
8785 {
8786   return __builtin_altivec_vsubcuq(__a, __b);
8787 }
8788 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
8789
8790 /* vec_vsubcuw */
8791
8792 static vector unsigned int __attribute__((__always_inline__))
8793 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b)
8794 {
8795   return __builtin_altivec_vsubcuw(__a, __b);
8796 }
8797
8798 /* vec_subs */
8799
8800 static vector signed char __ATTRS_o_ai
8801 vec_subs(vector signed char __a, vector signed char __b)
8802 {
8803   return __builtin_altivec_vsubsbs(__a, __b);
8804 }
8805
8806 static vector signed char __ATTRS_o_ai
8807 vec_subs(vector bool char __a, vector signed char __b)
8808 {
8809   return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
8810 }
8811
8812 static vector signed char __ATTRS_o_ai
8813 vec_subs(vector signed char __a, vector bool char __b)
8814 {
8815   return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
8816 }
8817
8818 static vector unsigned char __ATTRS_o_ai
8819 vec_subs(vector unsigned char __a, vector unsigned char __b)
8820 {
8821   return __builtin_altivec_vsububs(__a, __b);
8822 }
8823
8824 static vector unsigned char __ATTRS_o_ai
8825 vec_subs(vector bool char __a, vector unsigned char __b)
8826 {
8827   return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
8828 }
8829
8830 static vector unsigned char __ATTRS_o_ai
8831 vec_subs(vector unsigned char __a, vector bool char __b)
8832 {
8833   return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
8834 }
8835
8836 static vector short __ATTRS_o_ai
8837 vec_subs(vector short __a, vector short __b)
8838 {
8839   return __builtin_altivec_vsubshs(__a, __b);
8840 }
8841
8842 static vector short __ATTRS_o_ai
8843 vec_subs(vector bool short __a, vector short __b)
8844 {
8845   return __builtin_altivec_vsubshs((vector short)__a, __b);
8846 }
8847
8848 static vector short __ATTRS_o_ai
8849 vec_subs(vector short __a, vector bool short __b)
8850 {
8851   return __builtin_altivec_vsubshs(__a, (vector short)__b);
8852 }
8853
8854 static vector unsigned short __ATTRS_o_ai
8855 vec_subs(vector unsigned short __a, vector unsigned short __b)
8856 {
8857   return __builtin_altivec_vsubuhs(__a, __b);
8858 }
8859
8860 static vector unsigned short __ATTRS_o_ai
8861 vec_subs(vector bool short __a, vector unsigned short __b)
8862 {
8863   return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
8864 }
8865
8866 static vector unsigned short __ATTRS_o_ai
8867 vec_subs(vector unsigned short __a, vector bool short __b)
8868 {
8869   return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
8870 }
8871
8872 static vector int __ATTRS_o_ai
8873 vec_subs(vector int __a, vector int __b)
8874 {
8875   return __builtin_altivec_vsubsws(__a, __b);
8876 }
8877
8878 static vector int __ATTRS_o_ai
8879 vec_subs(vector bool int __a, vector int __b)
8880 {
8881   return __builtin_altivec_vsubsws((vector int)__a, __b);
8882 }
8883
8884 static vector int __ATTRS_o_ai
8885 vec_subs(vector int __a, vector bool int __b)
8886 {
8887   return __builtin_altivec_vsubsws(__a, (vector int)__b);
8888 }
8889
8890 static vector unsigned int __ATTRS_o_ai
8891 vec_subs(vector unsigned int __a, vector unsigned int __b)
8892 {
8893   return __builtin_altivec_vsubuws(__a, __b);
8894 }
8895
8896 static vector unsigned int __ATTRS_o_ai
8897 vec_subs(vector bool int __a, vector unsigned int __b)
8898 {
8899   return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
8900 }
8901
8902 static vector unsigned int __ATTRS_o_ai
8903 vec_subs(vector unsigned int __a, vector bool int __b)
8904 {
8905   return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
8906 }
8907
8908 /* vec_vsubsbs */
8909
8910 static vector signed char __ATTRS_o_ai
8911 vec_vsubsbs(vector signed char __a, vector signed char __b)
8912 {
8913   return __builtin_altivec_vsubsbs(__a, __b);
8914 }
8915
8916 static vector signed char __ATTRS_o_ai
8917 vec_vsubsbs(vector bool char __a, vector signed char __b)
8918 {
8919   return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
8920 }
8921
8922 static vector signed char __ATTRS_o_ai
8923 vec_vsubsbs(vector signed char __a, vector bool char __b)
8924 {
8925   return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
8926 }
8927
8928 /* vec_vsububs */
8929
8930 static vector unsigned char __ATTRS_o_ai
8931 vec_vsububs(vector unsigned char __a, vector unsigned char __b)
8932 {
8933   return __builtin_altivec_vsububs(__a, __b);
8934 }
8935
8936 static vector unsigned char __ATTRS_o_ai
8937 vec_vsububs(vector bool char __a, vector unsigned char __b)
8938 {
8939   return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
8940 }
8941
8942 static vector unsigned char __ATTRS_o_ai
8943 vec_vsububs(vector unsigned char __a, vector bool char __b)
8944 {
8945   return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
8946 }
8947
8948 /* vec_vsubshs */
8949
8950 static vector short __ATTRS_o_ai
8951 vec_vsubshs(vector short __a, vector short __b)
8952 {
8953   return __builtin_altivec_vsubshs(__a, __b);
8954 }
8955
8956 static vector short __ATTRS_o_ai
8957 vec_vsubshs(vector bool short __a, vector short __b)
8958 {
8959   return __builtin_altivec_vsubshs((vector short)__a, __b);
8960 }
8961
8962 static vector short __ATTRS_o_ai
8963 vec_vsubshs(vector short __a, vector bool short __b)
8964 {
8965   return __builtin_altivec_vsubshs(__a, (vector short)__b);
8966 }
8967
8968 /* vec_vsubuhs */
8969
8970 static vector unsigned short __ATTRS_o_ai
8971 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b)
8972 {
8973   return __builtin_altivec_vsubuhs(__a, __b);
8974 }
8975
8976 static vector unsigned short __ATTRS_o_ai
8977 vec_vsubuhs(vector bool short __a, vector unsigned short __b)
8978 {
8979   return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
8980 }
8981
8982 static vector unsigned short __ATTRS_o_ai
8983 vec_vsubuhs(vector unsigned short __a, vector bool short __b)
8984 {
8985   return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
8986 }
8987
8988 /* vec_vsubsws */
8989
8990 static vector int __ATTRS_o_ai
8991 vec_vsubsws(vector int __a, vector int __b)
8992 {
8993   return __builtin_altivec_vsubsws(__a, __b);
8994 }
8995
8996 static vector int __ATTRS_o_ai
8997 vec_vsubsws(vector bool int __a, vector int __b)
8998 {
8999   return __builtin_altivec_vsubsws((vector int)__a, __b);
9000 }
9001
9002 static vector int __ATTRS_o_ai
9003 vec_vsubsws(vector int __a, vector bool int __b)
9004 {
9005   return __builtin_altivec_vsubsws(__a, (vector int)__b);
9006 }
9007
9008 /* vec_vsubuws */
9009
9010 static vector unsigned int __ATTRS_o_ai
9011 vec_vsubuws(vector unsigned int __a, vector unsigned int __b)
9012 {
9013   return __builtin_altivec_vsubuws(__a, __b);
9014 }
9015
9016 static vector unsigned int __ATTRS_o_ai
9017 vec_vsubuws(vector bool int __a, vector unsigned int __b)
9018 {
9019   return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
9020 }
9021
9022 static vector unsigned int __ATTRS_o_ai
9023 vec_vsubuws(vector unsigned int __a, vector bool int __b)
9024 {
9025   return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
9026 }
9027
9028 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9029 /* vec_vsubuqm */
9030
9031 static vector signed __int128 __ATTRS_o_ai
9032 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b)
9033 {  
9034   return __a - __b;
9035 }
9036
9037 static vector unsigned __int128 __ATTRS_o_ai
9038 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b)
9039 {  
9040   return __a - __b;
9041 }
9042
9043 /* vec_vsubeuqm */
9044
9045 static vector signed __int128 __ATTRS_o_ai
9046 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
9047              vector signed __int128 __c)
9048 {  
9049   return __builtin_altivec_vsubeuqm(__a, __b, __c);
9050 }
9051
9052 static vector unsigned __int128 __ATTRS_o_ai
9053 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
9054              vector unsigned __int128 __c)
9055 {  
9056   return __builtin_altivec_vsubeuqm(__a, __b, __c);
9057 }
9058
9059 /* vec_vsubcuq */
9060
9061 static vector signed __int128 __ATTRS_o_ai
9062 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b)
9063 {  
9064   return __builtin_altivec_vsubcuq(__a, __b);
9065 }
9066
9067 static vector unsigned __int128 __ATTRS_o_ai
9068 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b)
9069 {  
9070   return __builtin_altivec_vsubcuq(__a, __b);
9071 }
9072
9073 /* vec_vsubecuq */
9074
9075 static vector signed __int128 __ATTRS_o_ai
9076 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
9077              vector signed __int128 __c)
9078 {  
9079   return __builtin_altivec_vsubecuq(__a, __b, __c);
9080 }
9081
9082 static vector unsigned __int128 __ATTRS_o_ai
9083 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
9084              vector unsigned __int128 __c)
9085 {  
9086   return __builtin_altivec_vsubecuq(__a, __b, __c);
9087 }
9088 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9089
9090 /* vec_sum4s */
9091
9092 static vector int __ATTRS_o_ai
9093 vec_sum4s(vector signed char __a, vector int __b)
9094 {
9095   return __builtin_altivec_vsum4sbs(__a, __b);
9096 }
9097
9098 static vector unsigned int __ATTRS_o_ai
9099 vec_sum4s(vector unsigned char __a, vector unsigned int __b)
9100 {
9101   return __builtin_altivec_vsum4ubs(__a, __b);
9102 }
9103
9104 static vector int __ATTRS_o_ai
9105 vec_sum4s(vector signed short __a, vector int __b)
9106 {
9107   return __builtin_altivec_vsum4shs(__a, __b);
9108 }
9109
9110 /* vec_vsum4sbs */
9111
9112 static vector int __attribute__((__always_inline__))
9113 vec_vsum4sbs(vector signed char __a, vector int __b)
9114 {
9115   return __builtin_altivec_vsum4sbs(__a, __b);
9116 }
9117
9118 /* vec_vsum4ubs */
9119
9120 static vector unsigned int __attribute__((__always_inline__))
9121 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b)
9122 {
9123   return __builtin_altivec_vsum4ubs(__a, __b);
9124 }
9125
9126 /* vec_vsum4shs */
9127
9128 static vector int __attribute__((__always_inline__))
9129 vec_vsum4shs(vector signed short __a, vector int __b)
9130 {
9131   return __builtin_altivec_vsum4shs(__a, __b);
9132 }
9133
9134 /* vec_sum2s */
9135
9136 /* The vsum2sws instruction has a big-endian bias, so that the second
9137    input vector and the result always reference big-endian elements
9138    1 and 3 (little-endian element 0 and 2).  For ease of porting the
9139    programmer wants elements 1 and 3 in both cases, so for little
9140    endian we must perform some permutes.  */
9141
9142 static vector signed int __attribute__((__always_inline__))
9143 vec_sum2s(vector int __a, vector int __b)
9144 {
9145 #ifdef __LITTLE_ENDIAN__
9146   vector int __c = (vector signed int)
9147     vec_perm(__b, __b, (vector unsigned char)
9148              (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11));
9149   __c = __builtin_altivec_vsum2sws(__a, __c);
9150   return (vector signed int)
9151     vec_perm(__c, __c, (vector unsigned char)
9152              (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11));
9153 #else
9154   return __builtin_altivec_vsum2sws(__a, __b);
9155 #endif
9156 }
9157
9158 /* vec_vsum2sws */
9159
9160 static vector signed int __attribute__((__always_inline__))
9161 vec_vsum2sws(vector int __a, vector int __b)
9162 {
9163 #ifdef __LITTLE_ENDIAN__
9164   vector int __c = (vector signed int)
9165     vec_perm(__b, __b, (vector unsigned char)
9166              (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11));
9167   __c = __builtin_altivec_vsum2sws(__a, __c);
9168   return (vector signed int)
9169     vec_perm(__c, __c, (vector unsigned char)
9170              (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11));
9171 #else
9172   return __builtin_altivec_vsum2sws(__a, __b);
9173 #endif
9174 }
9175
9176 /* vec_sums */
9177
9178 /* The vsumsws instruction has a big-endian bias, so that the second
9179    input vector and the result always reference big-endian element 3
9180    (little-endian element 0).  For ease of porting the programmer
9181    wants element 3 in both cases, so for little endian we must perform
9182    some permutes.  */
9183
9184 static vector signed int __attribute__((__always_inline__))
9185 vec_sums(vector signed int __a, vector signed int __b)
9186 {
9187 #ifdef __LITTLE_ENDIAN__
9188   __b = (vector signed int)vec_splat(__b, 3);
9189   __b = __builtin_altivec_vsumsws(__a, __b);
9190   return (vector signed int)(0, 0, 0, __b[0]);
9191 #else
9192   return __builtin_altivec_vsumsws(__a, __b);
9193 #endif
9194 }
9195
9196 /* vec_vsumsws */
9197
9198 static vector signed int __attribute__((__always_inline__))
9199 vec_vsumsws(vector signed int __a, vector signed int __b)
9200 {
9201 #ifdef __LITTLE_ENDIAN__
9202   __b = (vector signed int)vec_splat(__b, 3);
9203   __b = __builtin_altivec_vsumsws(__a, __b);
9204   return (vector signed int)(0, 0, 0, __b[0]);
9205 #else
9206   return __builtin_altivec_vsumsws(__a, __b);
9207 #endif
9208 }
9209
9210 /* vec_trunc */
9211
9212 static vector float __attribute__((__always_inline__))
9213 vec_trunc(vector float __a)
9214 {
9215   return __builtin_altivec_vrfiz(__a);
9216 }
9217
9218 /* vec_vrfiz */
9219
9220 static vector float __attribute__((__always_inline__))
9221 vec_vrfiz(vector float __a)
9222 {
9223   return __builtin_altivec_vrfiz(__a);
9224 }
9225
9226 /* vec_unpackh */
9227
9228 /* The vector unpack instructions all have a big-endian bias, so for
9229    little endian we must reverse the meanings of "high" and "low."  */
9230
9231 static vector short __ATTRS_o_ai
9232 vec_unpackh(vector signed char __a)
9233 {
9234 #ifdef __LITTLE_ENDIAN__
9235   return __builtin_altivec_vupklsb((vector char)__a);
9236 #else
9237   return __builtin_altivec_vupkhsb((vector char)__a);
9238 #endif
9239 }
9240
9241 static vector bool short __ATTRS_o_ai
9242 vec_unpackh(vector bool char __a)
9243 {
9244 #ifdef __LITTLE_ENDIAN__
9245   return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
9246 #else
9247   return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
9248 #endif
9249 }
9250
9251 static vector int __ATTRS_o_ai
9252 vec_unpackh(vector short __a)
9253 {
9254 #ifdef __LITTLE_ENDIAN__
9255   return __builtin_altivec_vupklsh(__a);
9256 #else
9257   return __builtin_altivec_vupkhsh(__a);
9258 #endif
9259 }
9260
9261 static vector bool int __ATTRS_o_ai
9262 vec_unpackh(vector bool short __a)
9263 {
9264 #ifdef __LITTLE_ENDIAN__
9265   return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
9266 #else
9267   return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
9268 #endif
9269 }
9270
9271 static vector unsigned int __ATTRS_o_ai
9272 vec_unpackh(vector pixel __a)
9273 {
9274 #ifdef __LITTLE_ENDIAN__
9275   return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
9276 #else
9277   return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
9278 #endif
9279 }
9280
9281 #ifdef __POWER8_VECTOR__
9282 static vector long long __ATTRS_o_ai
9283 vec_unpackh(vector int __a)
9284 {
9285 #ifdef __LITTLE_ENDIAN__
9286   return __builtin_altivec_vupklsw(__a);
9287 #else
9288   return __builtin_altivec_vupkhsw(__a);
9289 #endif
9290 }
9291
9292 static vector bool long long __ATTRS_o_ai
9293 vec_unpackh(vector bool int __a)
9294 {
9295 #ifdef __LITTLE_ENDIAN__
9296   return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
9297 #else
9298   return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
9299 #endif
9300 }
9301 #endif
9302
9303 /* vec_vupkhsb */
9304
9305 static vector short __ATTRS_o_ai
9306 vec_vupkhsb(vector signed char __a)
9307 {
9308 #ifdef __LITTLE_ENDIAN__
9309   return __builtin_altivec_vupklsb((vector char)__a);
9310 #else
9311   return __builtin_altivec_vupkhsb((vector char)__a);
9312 #endif
9313 }
9314
9315 static vector bool short __ATTRS_o_ai
9316 vec_vupkhsb(vector bool char __a)
9317 {
9318 #ifdef __LITTLE_ENDIAN__
9319   return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
9320 #else
9321   return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
9322 #endif
9323 }
9324
9325 /* vec_vupkhsh */
9326
9327 static vector int __ATTRS_o_ai
9328 vec_vupkhsh(vector short __a)
9329 {
9330 #ifdef __LITTLE_ENDIAN__
9331   return __builtin_altivec_vupklsh(__a);
9332 #else
9333   return __builtin_altivec_vupkhsh(__a);
9334 #endif
9335 }
9336
9337 static vector bool int __ATTRS_o_ai
9338 vec_vupkhsh(vector bool short __a)
9339 {
9340 #ifdef __LITTLE_ENDIAN__
9341   return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
9342 #else
9343   return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
9344 #endif
9345 }
9346
9347 static vector unsigned int __ATTRS_o_ai
9348 vec_vupkhsh(vector pixel __a)
9349 {
9350 #ifdef __LITTLE_ENDIAN__
9351   return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
9352 #else
9353   return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
9354 #endif
9355 }
9356
9357 /* vec_vupkhsw */
9358
9359 #ifdef __POWER8_VECTOR__
9360 static vector long long __ATTRS_o_ai
9361 vec_vupkhsw(vector int __a)
9362 {
9363 #ifdef __LITTLE_ENDIAN__
9364   return __builtin_altivec_vupklsw(__a);
9365 #else
9366   return __builtin_altivec_vupkhsw(__a);
9367 #endif
9368 }
9369
9370 static vector bool long long __ATTRS_o_ai
9371 vec_vupkhsw(vector bool int __a)
9372 {
9373 #ifdef __LITTLE_ENDIAN__
9374   return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
9375 #else
9376   return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
9377 #endif
9378 }
9379 #endif
9380
9381 /* vec_unpackl */
9382
9383 static vector short __ATTRS_o_ai
9384 vec_unpackl(vector signed char __a)
9385 {
9386 #ifdef __LITTLE_ENDIAN__
9387   return __builtin_altivec_vupkhsb((vector char)__a);
9388 #else
9389   return __builtin_altivec_vupklsb((vector char)__a);
9390 #endif
9391 }
9392
9393 static vector bool short __ATTRS_o_ai
9394 vec_unpackl(vector bool char __a)
9395 {
9396 #ifdef __LITTLE_ENDIAN__
9397   return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
9398 #else
9399   return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
9400 #endif
9401 }
9402
9403 static vector int __ATTRS_o_ai
9404 vec_unpackl(vector short __a)
9405 {
9406 #ifdef __LITTLE_ENDIAN__
9407   return __builtin_altivec_vupkhsh(__a);
9408 #else
9409   return __builtin_altivec_vupklsh(__a);
9410 #endif
9411 }
9412
9413 static vector bool int __ATTRS_o_ai
9414 vec_unpackl(vector bool short __a)
9415 {
9416 #ifdef __LITTLE_ENDIAN__
9417   return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
9418 #else
9419   return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
9420 #endif
9421 }
9422
9423 static vector unsigned int __ATTRS_o_ai
9424 vec_unpackl(vector pixel __a)
9425 {
9426 #ifdef __LITTLE_ENDIAN__
9427   return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
9428 #else
9429   return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
9430 #endif
9431 }
9432
9433 #ifdef __POWER8_VECTOR__
9434 static vector long long __ATTRS_o_ai
9435 vec_unpackl(vector int __a)
9436 {
9437 #ifdef __LITTLE_ENDIAN__
9438   return __builtin_altivec_vupkhsw(__a);
9439 #else
9440   return __builtin_altivec_vupklsw(__a);
9441 #endif
9442 }
9443
9444 static vector bool long long __ATTRS_o_ai
9445 vec_unpackl(vector bool int __a)
9446 {
9447 #ifdef __LITTLE_ENDIAN__
9448   return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
9449 #else
9450   return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
9451 #endif
9452 }
9453 #endif
9454
9455 /* vec_vupklsb */
9456
9457 static vector short __ATTRS_o_ai
9458 vec_vupklsb(vector signed char __a)
9459 {
9460 #ifdef __LITTLE_ENDIAN__
9461   return __builtin_altivec_vupkhsb((vector char)__a);
9462 #else
9463   return __builtin_altivec_vupklsb((vector char)__a);
9464 #endif
9465 }
9466
9467 static vector bool short __ATTRS_o_ai
9468 vec_vupklsb(vector bool char __a)
9469 {
9470 #ifdef __LITTLE_ENDIAN__
9471   return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
9472 #else
9473   return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
9474 #endif
9475 }
9476
9477 /* vec_vupklsh */
9478
9479 static vector int __ATTRS_o_ai
9480 vec_vupklsh(vector short __a)
9481 {
9482 #ifdef __LITTLE_ENDIAN__
9483   return __builtin_altivec_vupkhsh(__a);
9484 #else
9485   return __builtin_altivec_vupklsh(__a);
9486 #endif
9487 }
9488
9489 static vector bool int __ATTRS_o_ai
9490 vec_vupklsh(vector bool short __a)
9491 {
9492 #ifdef __LITTLE_ENDIAN__
9493   return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
9494 #else
9495   return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
9496 #endif
9497 }
9498
9499 static vector unsigned int __ATTRS_o_ai
9500 vec_vupklsh(vector pixel __a)
9501 {
9502 #ifdef __LITTLE_ENDIAN__
9503   return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
9504 #else
9505   return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
9506 #endif
9507 }
9508
9509 /* vec_vupklsw */
9510
9511 #ifdef __POWER8_VECTOR__
9512 static vector long long __ATTRS_o_ai
9513 vec_vupklsw(vector int __a)
9514 {
9515 #ifdef __LITTLE_ENDIAN__
9516   return __builtin_altivec_vupkhsw(__a);
9517 #else
9518   return __builtin_altivec_vupklsw(__a);
9519 #endif
9520 }
9521
9522 static vector bool long long __ATTRS_o_ai
9523 vec_vupklsw(vector bool int __a)
9524 {
9525 #ifdef __LITTLE_ENDIAN__
9526   return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
9527 #else
9528   return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
9529 #endif
9530 }
9531 #endif
9532
9533 /* vec_vsx_ld */
9534
9535 #ifdef __VSX__
9536
9537 static vector signed int __ATTRS_o_ai
9538 vec_vsx_ld(int __a, const vector signed int *__b)
9539 {
9540   return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
9541 }
9542
9543 static vector unsigned int __ATTRS_o_ai
9544 vec_vsx_ld(int __a, const vector unsigned int *__b)
9545 {
9546   return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
9547 }
9548
9549 static vector float __ATTRS_o_ai
9550 vec_vsx_ld(int __a, const vector float *__b)
9551 {
9552   return (vector float)__builtin_vsx_lxvw4x(__a, __b);
9553 }
9554
9555 static vector signed long long __ATTRS_o_ai
9556 vec_vsx_ld(int __a, const vector signed long long *__b)
9557 {
9558   return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
9559 }
9560
9561 static vector unsigned long long __ATTRS_o_ai
9562 vec_vsx_ld(int __a, const vector unsigned long long *__b)
9563 {
9564   return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
9565 }
9566
9567 static vector double __ATTRS_o_ai
9568 vec_vsx_ld(int __a, const vector double *__b)
9569 {
9570   return (vector double)__builtin_vsx_lxvd2x(__a, __b);
9571 }
9572
9573 #endif
9574
9575 /* vec_vsx_st */
9576
9577 #ifdef __VSX__
9578
9579 static void __ATTRS_o_ai
9580 vec_vsx_st(vector signed int __a, int __b, vector signed int *__c)
9581 {
9582   __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
9583 }
9584
9585 static void __ATTRS_o_ai
9586 vec_vsx_st(vector unsigned int __a, int __b, vector unsigned int *__c)
9587 {
9588   __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
9589 }
9590
9591 static void __ATTRS_o_ai
9592 vec_vsx_st(vector float __a, int __b, vector float *__c)
9593 {
9594   __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
9595 }
9596
9597 static void __ATTRS_o_ai
9598 vec_vsx_st(vector signed long long __a, int __b, vector signed long long *__c)
9599 {
9600   __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
9601 }
9602
9603 static void __ATTRS_o_ai
9604 vec_vsx_st(vector unsigned long long __a, int __b,
9605            vector unsigned long long *__c)
9606 {
9607   __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
9608 }
9609
9610 static void __ATTRS_o_ai
9611 vec_vsx_st(vector double __a, int __b, vector double *__c)
9612 {
9613   __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
9614 }
9615
9616 #endif
9617
9618 /* vec_xor */
9619
9620 #define __builtin_altivec_vxor vec_xor
9621
9622 static vector signed char __ATTRS_o_ai
9623 vec_xor(vector signed char __a, vector signed char __b)
9624 {
9625   return __a ^ __b;
9626 }
9627
9628 static vector signed char __ATTRS_o_ai
9629 vec_xor(vector bool char __a, vector signed char __b)
9630 {
9631   return (vector signed char)__a ^ __b;
9632 }
9633
9634 static vector signed char __ATTRS_o_ai
9635 vec_xor(vector signed char __a, vector bool char __b)
9636 {
9637   return __a ^ (vector signed char)__b;
9638 }
9639
9640 static vector unsigned char __ATTRS_o_ai
9641 vec_xor(vector unsigned char __a, vector unsigned char __b)
9642 {
9643   return __a ^ __b;
9644 }
9645
9646 static vector unsigned char __ATTRS_o_ai
9647 vec_xor(vector bool char __a, vector unsigned char __b)
9648 {
9649   return (vector unsigned char)__a ^ __b;
9650 }
9651
9652 static vector unsigned char __ATTRS_o_ai
9653 vec_xor(vector unsigned char __a, vector bool char __b)
9654 {
9655   return __a ^ (vector unsigned char)__b;
9656 }
9657
9658 static vector bool char __ATTRS_o_ai
9659 vec_xor(vector bool char __a, vector bool char __b)
9660 {
9661   return __a ^ __b;
9662 }
9663
9664 static vector short __ATTRS_o_ai
9665 vec_xor(vector short __a, vector short __b)
9666 {
9667   return __a ^ __b;
9668 }
9669
9670 static vector short __ATTRS_o_ai
9671 vec_xor(vector bool short __a, vector short __b)
9672 {
9673   return (vector short)__a ^ __b;
9674 }
9675
9676 static vector short __ATTRS_o_ai
9677 vec_xor(vector short __a, vector bool short __b)
9678 {
9679   return __a ^ (vector short)__b;
9680 }
9681
9682 static vector unsigned short __ATTRS_o_ai
9683 vec_xor(vector unsigned short __a, vector unsigned short __b)
9684 {
9685   return __a ^ __b;
9686 }
9687
9688 static vector unsigned short __ATTRS_o_ai
9689 vec_xor(vector bool short __a, vector unsigned short __b)
9690 {
9691   return (vector unsigned short)__a ^ __b;
9692 }
9693
9694 static vector unsigned short __ATTRS_o_ai
9695 vec_xor(vector unsigned short __a, vector bool short __b)
9696 {
9697   return __a ^ (vector unsigned short)__b;
9698 }
9699
9700 static vector bool short __ATTRS_o_ai
9701 vec_xor(vector bool short __a, vector bool short __b)
9702 {
9703   return __a ^ __b;
9704 }
9705
9706 static vector int __ATTRS_o_ai
9707 vec_xor(vector int __a, vector int __b)
9708 {
9709   return __a ^ __b;
9710 }
9711
9712 static vector int __ATTRS_o_ai
9713 vec_xor(vector bool int __a, vector int __b)
9714 {
9715   return (vector int)__a ^ __b;
9716 }
9717
9718 static vector int __ATTRS_o_ai
9719 vec_xor(vector int __a, vector bool int __b)
9720 {
9721   return __a ^ (vector int)__b;
9722 }
9723
9724 static vector unsigned int __ATTRS_o_ai
9725 vec_xor(vector unsigned int __a, vector unsigned int __b)
9726 {
9727   return __a ^ __b;
9728 }
9729
9730 static vector unsigned int __ATTRS_o_ai
9731 vec_xor(vector bool int __a, vector unsigned int __b)
9732 {
9733   return (vector unsigned int)__a ^ __b;
9734 }
9735
9736 static vector unsigned int __ATTRS_o_ai
9737 vec_xor(vector unsigned int __a, vector bool int __b)
9738 {
9739   return __a ^ (vector unsigned int)__b;
9740 }
9741
9742 static vector bool int __ATTRS_o_ai
9743 vec_xor(vector bool int __a, vector bool int __b)
9744 {
9745   return __a ^ __b;
9746 }
9747
9748 static vector float __ATTRS_o_ai
9749 vec_xor(vector float __a, vector float __b)
9750 {
9751   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9752   return (vector float)__res;
9753 }
9754
9755 static vector float __ATTRS_o_ai
9756 vec_xor(vector bool int __a, vector float __b)
9757 {
9758   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9759   return (vector float)__res;
9760 }
9761
9762 static vector float __ATTRS_o_ai
9763 vec_xor(vector float __a, vector bool int __b)
9764 {
9765   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9766   return (vector float)__res;
9767 }
9768
9769 /* vec_vxor */
9770
9771 static vector signed char __ATTRS_o_ai
9772 vec_vxor(vector signed char __a, vector signed char __b)
9773 {
9774   return __a ^ __b;
9775 }
9776
9777 static vector signed char __ATTRS_o_ai
9778 vec_vxor(vector bool char __a, vector signed char __b)
9779 {
9780   return (vector signed char)__a ^ __b;
9781 }
9782
9783 static vector signed char __ATTRS_o_ai
9784 vec_vxor(vector signed char __a, vector bool char __b)
9785 {
9786   return __a ^ (vector signed char)__b;
9787 }
9788
9789 static vector unsigned char __ATTRS_o_ai
9790 vec_vxor(vector unsigned char __a, vector unsigned char __b)
9791 {
9792   return __a ^ __b;
9793 }
9794
9795 static vector unsigned char __ATTRS_o_ai
9796 vec_vxor(vector bool char __a, vector unsigned char __b)
9797 {
9798   return (vector unsigned char)__a ^ __b;
9799 }
9800
9801 static vector unsigned char __ATTRS_o_ai
9802 vec_vxor(vector unsigned char __a, vector bool char __b)
9803 {
9804   return __a ^ (vector unsigned char)__b;
9805 }
9806
9807 static vector bool char __ATTRS_o_ai
9808 vec_vxor(vector bool char __a, vector bool char __b)
9809 {
9810   return __a ^ __b;
9811 }
9812
9813 static vector short __ATTRS_o_ai
9814 vec_vxor(vector short __a, vector short __b)
9815 {
9816   return __a ^ __b;
9817 }
9818
9819 static vector short __ATTRS_o_ai
9820 vec_vxor(vector bool short __a, vector short __b)
9821 {
9822   return (vector short)__a ^ __b;
9823 }
9824
9825 static vector short __ATTRS_o_ai
9826 vec_vxor(vector short __a, vector bool short __b)
9827 {
9828   return __a ^ (vector short)__b;
9829 }
9830
9831 static vector unsigned short __ATTRS_o_ai
9832 vec_vxor(vector unsigned short __a, vector unsigned short __b)
9833 {
9834   return __a ^ __b;
9835 }
9836
9837 static vector unsigned short __ATTRS_o_ai
9838 vec_vxor(vector bool short __a, vector unsigned short __b)
9839 {
9840   return (vector unsigned short)__a ^ __b;
9841 }
9842
9843 static vector unsigned short __ATTRS_o_ai
9844 vec_vxor(vector unsigned short __a, vector bool short __b)
9845 {
9846   return __a ^ (vector unsigned short)__b;
9847 }
9848
9849 static vector bool short __ATTRS_o_ai
9850 vec_vxor(vector bool short __a, vector bool short __b)
9851 {
9852   return __a ^ __b;
9853 }
9854
9855 static vector int __ATTRS_o_ai
9856 vec_vxor(vector int __a, vector int __b)
9857 {
9858   return __a ^ __b;
9859 }
9860
9861 static vector int __ATTRS_o_ai
9862 vec_vxor(vector bool int __a, vector int __b)
9863 {
9864   return (vector int)__a ^ __b;
9865 }
9866
9867 static vector int __ATTRS_o_ai
9868 vec_vxor(vector int __a, vector bool int __b)
9869 {
9870   return __a ^ (vector int)__b;
9871 }
9872
9873 static vector unsigned int __ATTRS_o_ai
9874 vec_vxor(vector unsigned int __a, vector unsigned int __b)
9875 {
9876   return __a ^ __b;
9877 }
9878
9879 static vector unsigned int __ATTRS_o_ai
9880 vec_vxor(vector bool int __a, vector unsigned int __b)
9881 {
9882   return (vector unsigned int)__a ^ __b;
9883 }
9884
9885 static vector unsigned int __ATTRS_o_ai
9886 vec_vxor(vector unsigned int __a, vector bool int __b)
9887 {
9888   return __a ^ (vector unsigned int)__b;
9889 }
9890
9891 static vector bool int __ATTRS_o_ai
9892 vec_vxor(vector bool int __a, vector bool int __b)
9893 {
9894   return __a ^ __b;
9895 }
9896
9897 static vector float __ATTRS_o_ai
9898 vec_vxor(vector float __a, vector float __b)
9899 {
9900   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9901   return (vector float)__res;
9902 }
9903
9904 static vector float __ATTRS_o_ai
9905 vec_vxor(vector bool int __a, vector float __b)
9906 {
9907   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9908   return (vector float)__res;
9909 }
9910
9911 static vector float __ATTRS_o_ai
9912 vec_vxor(vector float __a, vector bool int __b)
9913 {
9914   vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
9915   return (vector float)__res;
9916 }
9917
9918 /* ------------------------ extensions for CBEA ----------------------------- */
9919
9920 /* vec_extract */
9921
9922 static signed char __ATTRS_o_ai
9923 vec_extract(vector signed char __a, int __b)
9924 {
9925   return __a[__b];
9926 }
9927
9928 static unsigned char __ATTRS_o_ai
9929 vec_extract(vector unsigned char __a, int __b)
9930 {
9931   return __a[__b];
9932 }
9933
9934 static short __ATTRS_o_ai
9935 vec_extract(vector short __a, int __b)
9936 {
9937   return __a[__b];
9938 }
9939
9940 static unsigned short __ATTRS_o_ai
9941 vec_extract(vector unsigned short __a, int __b)
9942 {
9943   return __a[__b];
9944 }
9945
9946 static int __ATTRS_o_ai
9947 vec_extract(vector int __a, int __b)
9948 {
9949   return __a[__b];
9950 }
9951
9952 static unsigned int __ATTRS_o_ai
9953 vec_extract(vector unsigned int __a, int __b)
9954 {
9955   return __a[__b];
9956 }
9957
9958 static float __ATTRS_o_ai
9959 vec_extract(vector float __a, int __b)
9960 {
9961   return __a[__b];
9962 }
9963
9964 /* vec_insert */
9965
9966 static vector signed char __ATTRS_o_ai
9967 vec_insert(signed char __a, vector signed char __b, int __c)
9968 {
9969   __b[__c] = __a;
9970   return __b;
9971 }
9972
9973 static vector unsigned char __ATTRS_o_ai
9974 vec_insert(unsigned char __a, vector unsigned char __b, int __c)
9975 {
9976   __b[__c] = __a;
9977   return __b;
9978 }
9979
9980 static vector short __ATTRS_o_ai
9981 vec_insert(short __a, vector short __b, int __c)
9982 {
9983   __b[__c] = __a;
9984   return __b;
9985 }
9986
9987 static vector unsigned short __ATTRS_o_ai
9988 vec_insert(unsigned short __a, vector unsigned short __b, int __c)
9989 {
9990   __b[__c] = __a;
9991   return __b;
9992 }
9993
9994 static vector int __ATTRS_o_ai
9995 vec_insert(int __a, vector int __b, int __c)
9996 {
9997   __b[__c] = __a;
9998   return __b;
9999 }
10000
10001 static vector unsigned int __ATTRS_o_ai
10002 vec_insert(unsigned int __a, vector unsigned int __b, int __c)
10003 {
10004   __b[__c] = __a;
10005   return __b;
10006 }
10007
10008 static vector float __ATTRS_o_ai
10009 vec_insert(float __a, vector float __b, int __c)
10010 {
10011   __b[__c] = __a;
10012   return __b;
10013 }
10014
10015 /* vec_lvlx */
10016
10017 static vector signed char __ATTRS_o_ai
10018 vec_lvlx(int __a, const signed char *__b)
10019 {
10020   return vec_perm(vec_ld(__a, __b),
10021                   (vector signed char)(0),
10022                   vec_lvsl(__a, __b));
10023 }
10024
10025 static vector signed char __ATTRS_o_ai
10026 vec_lvlx(int __a, const vector signed char *__b)
10027 {
10028   return vec_perm(vec_ld(__a, __b),
10029                   (vector signed char)(0),
10030                   vec_lvsl(__a, (unsigned char *)__b));
10031 }
10032
10033 static vector unsigned char __ATTRS_o_ai
10034 vec_lvlx(int __a, const unsigned char *__b)
10035 {
10036   return vec_perm(vec_ld(__a, __b),
10037                   (vector unsigned char)(0),
10038                   vec_lvsl(__a, __b));
10039 }
10040
10041 static vector unsigned char __ATTRS_o_ai
10042 vec_lvlx(int __a, const vector unsigned char *__b)
10043 {
10044   return vec_perm(vec_ld(__a, __b),
10045                   (vector unsigned char)(0),
10046                   vec_lvsl(__a, (unsigned char *)__b));
10047 }
10048
10049 static vector bool char __ATTRS_o_ai
10050 vec_lvlx(int __a, const vector bool char *__b)
10051 {
10052   return vec_perm(vec_ld(__a, __b),
10053                   (vector bool char)(0),
10054                   vec_lvsl(__a, (unsigned char *)__b));
10055 }
10056
10057 static vector short __ATTRS_o_ai
10058 vec_lvlx(int __a, const short *__b)
10059 {
10060   return vec_perm(vec_ld(__a, __b),
10061                   (vector short)(0),
10062                   vec_lvsl(__a, __b));
10063 }
10064
10065 static vector short __ATTRS_o_ai
10066 vec_lvlx(int __a, const vector short *__b)
10067 {
10068   return vec_perm(vec_ld(__a, __b),
10069                   (vector short)(0),
10070                   vec_lvsl(__a, (unsigned char *)__b));
10071 }
10072
10073 static vector unsigned short __ATTRS_o_ai
10074 vec_lvlx(int __a, const unsigned short *__b)
10075 {
10076   return vec_perm(vec_ld(__a, __b),
10077                   (vector unsigned short)(0),
10078                   vec_lvsl(__a, __b));
10079 }
10080
10081 static vector unsigned short __ATTRS_o_ai
10082 vec_lvlx(int __a, const vector unsigned short *__b)
10083 {
10084   return vec_perm(vec_ld(__a, __b),
10085                   (vector unsigned short)(0),
10086                   vec_lvsl(__a, (unsigned char *)__b));
10087 }
10088
10089 static vector bool short __ATTRS_o_ai
10090 vec_lvlx(int __a, const vector bool short *__b)
10091 {
10092   return vec_perm(vec_ld(__a, __b),
10093                   (vector bool short)(0),
10094                   vec_lvsl(__a, (unsigned char *)__b));
10095 }
10096
10097 static vector pixel __ATTRS_o_ai
10098 vec_lvlx(int __a, const vector pixel *__b)
10099 {
10100   return vec_perm(vec_ld(__a, __b),
10101                   (vector pixel)(0),
10102                   vec_lvsl(__a, (unsigned char *)__b));
10103 }
10104
10105 static vector int __ATTRS_o_ai
10106 vec_lvlx(int __a, const int *__b)
10107 {
10108   return vec_perm(vec_ld(__a, __b),
10109                   (vector int)(0),
10110                   vec_lvsl(__a, __b));
10111 }
10112
10113 static vector int __ATTRS_o_ai
10114 vec_lvlx(int __a, const vector int *__b)
10115 {
10116   return vec_perm(vec_ld(__a, __b),
10117                   (vector int)(0),
10118                   vec_lvsl(__a, (unsigned char *)__b));
10119 }
10120
10121 static vector unsigned int __ATTRS_o_ai
10122 vec_lvlx(int __a, const unsigned int *__b)
10123 {
10124   return vec_perm(vec_ld(__a, __b),
10125                   (vector unsigned int)(0),
10126                   vec_lvsl(__a, __b));
10127 }
10128
10129 static vector unsigned int __ATTRS_o_ai
10130 vec_lvlx(int __a, const vector unsigned int *__b)
10131 {
10132   return vec_perm(vec_ld(__a, __b),
10133                   (vector unsigned int)(0),
10134                   vec_lvsl(__a, (unsigned char *)__b));
10135 }
10136
10137 static vector bool int __ATTRS_o_ai
10138 vec_lvlx(int __a, const vector bool int *__b)
10139 {
10140   return vec_perm(vec_ld(__a, __b),
10141                   (vector bool int)(0),
10142                   vec_lvsl(__a, (unsigned char *)__b));
10143 }
10144
10145 static vector float __ATTRS_o_ai
10146 vec_lvlx(int __a, const float *__b)
10147 {
10148   return vec_perm(vec_ld(__a, __b),
10149                   (vector float)(0),
10150                   vec_lvsl(__a, __b));
10151 }
10152
10153 static vector float __ATTRS_o_ai
10154 vec_lvlx(int __a, const vector float *__b)
10155 {
10156   return vec_perm(vec_ld(__a, __b),
10157                   (vector float)(0),
10158                   vec_lvsl(__a, (unsigned char *)__b));
10159 }
10160
10161 /* vec_lvlxl */
10162
10163 static vector signed char __ATTRS_o_ai
10164 vec_lvlxl(int __a, const signed char *__b)
10165 {
10166   return vec_perm(vec_ldl(__a, __b),
10167                   (vector signed char)(0),
10168                   vec_lvsl(__a, __b));
10169 }
10170
10171 static vector signed char __ATTRS_o_ai
10172 vec_lvlxl(int __a, const vector signed char *__b)
10173 {
10174   return vec_perm(vec_ldl(__a, __b),
10175                   (vector signed char)(0),
10176                   vec_lvsl(__a, (unsigned char *)__b));
10177 }
10178
10179 static vector unsigned char __ATTRS_o_ai
10180 vec_lvlxl(int __a, const unsigned char *__b)
10181 {
10182   return vec_perm(vec_ldl(__a, __b),
10183                   (vector unsigned char)(0),
10184                   vec_lvsl(__a, __b));
10185 }
10186
10187 static vector unsigned char __ATTRS_o_ai
10188 vec_lvlxl(int __a, const vector unsigned char *__b)
10189 {
10190   return vec_perm(vec_ldl(__a, __b),
10191                   (vector unsigned char)(0),
10192                   vec_lvsl(__a, (unsigned char *)__b));
10193 }
10194
10195 static vector bool char __ATTRS_o_ai
10196 vec_lvlxl(int __a, const vector bool char *__b)
10197 {
10198   return vec_perm(vec_ldl(__a, __b),
10199                   (vector bool char)(0),
10200                   vec_lvsl(__a, (unsigned char *)__b));
10201 }
10202
10203 static vector short __ATTRS_o_ai
10204 vec_lvlxl(int __a, const short *__b)
10205 {
10206   return vec_perm(vec_ldl(__a, __b),
10207                   (vector short)(0),
10208                   vec_lvsl(__a, __b));
10209 }
10210
10211 static vector short __ATTRS_o_ai
10212 vec_lvlxl(int __a, const vector short *__b)
10213 {
10214   return vec_perm(vec_ldl(__a, __b),
10215                   (vector short)(0),
10216                   vec_lvsl(__a, (unsigned char *)__b));
10217 }
10218
10219 static vector unsigned short __ATTRS_o_ai
10220 vec_lvlxl(int __a, const unsigned short *__b)
10221 {
10222   return vec_perm(vec_ldl(__a, __b),
10223                   (vector unsigned short)(0),
10224                   vec_lvsl(__a, __b));
10225 }
10226
10227 static vector unsigned short __ATTRS_o_ai
10228 vec_lvlxl(int __a, const vector unsigned short *__b)
10229 {
10230   return vec_perm(vec_ldl(__a, __b),
10231                   (vector unsigned short)(0),
10232                   vec_lvsl(__a, (unsigned char *)__b));
10233 }
10234
10235 static vector bool short __ATTRS_o_ai
10236 vec_lvlxl(int __a, const vector bool short *__b)
10237 {
10238   return vec_perm(vec_ldl(__a, __b),
10239                   (vector bool short)(0),
10240                   vec_lvsl(__a, (unsigned char *)__b));
10241 }
10242
10243 static vector pixel __ATTRS_o_ai
10244 vec_lvlxl(int __a, const vector pixel *__b)
10245 {
10246   return vec_perm(vec_ldl(__a, __b),
10247                   (vector pixel)(0),
10248                   vec_lvsl(__a, (unsigned char *)__b));
10249 }
10250
10251 static vector int __ATTRS_o_ai
10252 vec_lvlxl(int __a, const int *__b)
10253 {
10254   return vec_perm(vec_ldl(__a, __b),
10255                   (vector int)(0),
10256                   vec_lvsl(__a, __b));
10257 }
10258
10259 static vector int __ATTRS_o_ai
10260 vec_lvlxl(int __a, const vector int *__b)
10261 {
10262   return vec_perm(vec_ldl(__a, __b),
10263                   (vector int)(0),
10264                   vec_lvsl(__a, (unsigned char *)__b));
10265 }
10266
10267 static vector unsigned int __ATTRS_o_ai
10268 vec_lvlxl(int __a, const unsigned int *__b)
10269 {
10270   return vec_perm(vec_ldl(__a, __b),
10271                   (vector unsigned int)(0),
10272                   vec_lvsl(__a, __b));
10273 }
10274
10275 static vector unsigned int __ATTRS_o_ai
10276 vec_lvlxl(int __a, const vector unsigned int *__b)
10277 {
10278   return vec_perm(vec_ldl(__a, __b),
10279                   (vector unsigned int)(0),
10280                   vec_lvsl(__a, (unsigned char *)__b));
10281 }
10282
10283 static vector bool int __ATTRS_o_ai
10284 vec_lvlxl(int __a, const vector bool int *__b)
10285 {
10286   return vec_perm(vec_ldl(__a, __b),
10287                   (vector bool int)(0),
10288                   vec_lvsl(__a, (unsigned char *)__b));
10289 }
10290
10291 static vector float __ATTRS_o_ai
10292 vec_lvlxl(int __a, const float *__b)
10293 {
10294   return vec_perm(vec_ldl(__a, __b),
10295                   (vector float)(0),
10296                   vec_lvsl(__a, __b));
10297 }
10298
10299 static vector float __ATTRS_o_ai
10300 vec_lvlxl(int __a, vector float *__b)
10301 {
10302   return vec_perm(vec_ldl(__a, __b),
10303                   (vector float)(0),
10304                   vec_lvsl(__a, (unsigned char *)__b));
10305 }
10306
10307 /* vec_lvrx */
10308
10309 static vector signed char __ATTRS_o_ai
10310 vec_lvrx(int __a, const signed char *__b)
10311 {
10312   return vec_perm((vector signed char)(0),
10313                   vec_ld(__a, __b),
10314                   vec_lvsl(__a, __b));
10315 }
10316
10317 static vector signed char __ATTRS_o_ai
10318 vec_lvrx(int __a, const vector signed char *__b)
10319 {
10320   return vec_perm((vector signed char)(0),
10321                   vec_ld(__a, __b),
10322                   vec_lvsl(__a, (unsigned char *)__b));
10323 }
10324
10325 static vector unsigned char __ATTRS_o_ai
10326 vec_lvrx(int __a, const unsigned char *__b)
10327 {
10328   return vec_perm((vector unsigned char)(0),
10329                   vec_ld(__a, __b),
10330                   vec_lvsl(__a, __b));
10331 }
10332
10333 static vector unsigned char __ATTRS_o_ai
10334 vec_lvrx(int __a, const vector unsigned char *__b)
10335 {
10336   return vec_perm((vector unsigned char)(0),
10337                   vec_ld(__a, __b),
10338                   vec_lvsl(__a, (unsigned char *)__b));
10339 }
10340
10341 static vector bool char __ATTRS_o_ai
10342 vec_lvrx(int __a, const vector bool char *__b)
10343 {
10344   return vec_perm((vector bool char)(0),
10345                   vec_ld(__a, __b),
10346                   vec_lvsl(__a, (unsigned char *)__b));
10347 }
10348
10349 static vector short __ATTRS_o_ai
10350 vec_lvrx(int __a, const short *__b)
10351 {
10352   return vec_perm((vector short)(0),
10353                   vec_ld(__a, __b),
10354                   vec_lvsl(__a, __b));
10355 }
10356
10357 static vector short __ATTRS_o_ai
10358 vec_lvrx(int __a, const vector short *__b)
10359 {
10360   return vec_perm((vector short)(0),
10361                   vec_ld(__a, __b),
10362                   vec_lvsl(__a, (unsigned char *)__b));
10363 }
10364
10365 static vector unsigned short __ATTRS_o_ai
10366 vec_lvrx(int __a, const unsigned short *__b)
10367 {
10368   return vec_perm((vector unsigned short)(0),
10369                   vec_ld(__a, __b),
10370                   vec_lvsl(__a, __b));
10371 }
10372
10373 static vector unsigned short __ATTRS_o_ai
10374 vec_lvrx(int __a, const vector unsigned short *__b)
10375 {
10376   return vec_perm((vector unsigned short)(0),
10377                   vec_ld(__a, __b),
10378                   vec_lvsl(__a, (unsigned char *)__b));
10379 }
10380
10381 static vector bool short __ATTRS_o_ai
10382 vec_lvrx(int __a, const vector bool short *__b)
10383 {
10384   return vec_perm((vector bool short)(0),
10385                   vec_ld(__a, __b),
10386                   vec_lvsl(__a, (unsigned char *)__b));
10387 }
10388
10389 static vector pixel __ATTRS_o_ai
10390 vec_lvrx(int __a, const vector pixel *__b)
10391 {
10392   return vec_perm((vector pixel)(0),
10393                   vec_ld(__a, __b),
10394                   vec_lvsl(__a, (unsigned char *)__b));
10395 }
10396
10397 static vector int __ATTRS_o_ai
10398 vec_lvrx(int __a, const int *__b)
10399 {
10400   return vec_perm((vector int)(0),
10401                   vec_ld(__a, __b),
10402                   vec_lvsl(__a, __b));
10403 }
10404
10405 static vector int __ATTRS_o_ai
10406 vec_lvrx(int __a, const vector int *__b)
10407 {
10408   return vec_perm((vector int)(0),
10409                   vec_ld(__a, __b),
10410                   vec_lvsl(__a, (unsigned char *)__b));
10411 }
10412
10413 static vector unsigned int __ATTRS_o_ai
10414 vec_lvrx(int __a, const unsigned int *__b)
10415 {
10416   return vec_perm((vector unsigned int)(0),
10417                   vec_ld(__a, __b),
10418                   vec_lvsl(__a, __b));
10419 }
10420
10421 static vector unsigned int __ATTRS_o_ai
10422 vec_lvrx(int __a, const vector unsigned int *__b)
10423 {
10424   return vec_perm((vector unsigned int)(0),
10425                   vec_ld(__a, __b),
10426                   vec_lvsl(__a, (unsigned char *)__b));
10427 }
10428
10429 static vector bool int __ATTRS_o_ai
10430 vec_lvrx(int __a, const vector bool int *__b)
10431 {
10432   return vec_perm((vector bool int)(0),
10433                   vec_ld(__a, __b),
10434                   vec_lvsl(__a, (unsigned char *)__b));
10435 }
10436
10437 static vector float __ATTRS_o_ai
10438 vec_lvrx(int __a, const float *__b)
10439 {
10440   return vec_perm((vector float)(0),
10441                   vec_ld(__a, __b),
10442                   vec_lvsl(__a, __b));
10443 }
10444
10445 static vector float __ATTRS_o_ai
10446 vec_lvrx(int __a, const vector float *__b)
10447 {
10448   return vec_perm((vector float)(0),
10449                   vec_ld(__a, __b),
10450                   vec_lvsl(__a, (unsigned char *)__b));
10451 }
10452
10453 /* vec_lvrxl */
10454
10455 static vector signed char __ATTRS_o_ai
10456 vec_lvrxl(int __a, const signed char *__b)
10457 {
10458   return vec_perm((vector signed char)(0),
10459                   vec_ldl(__a, __b),
10460                   vec_lvsl(__a, __b));
10461 }
10462
10463 static vector signed char __ATTRS_o_ai
10464 vec_lvrxl(int __a, const vector signed char *__b)
10465 {
10466   return vec_perm((vector signed char)(0),
10467                   vec_ldl(__a, __b),
10468                   vec_lvsl(__a, (unsigned char *)__b));
10469 }
10470
10471 static vector unsigned char __ATTRS_o_ai
10472 vec_lvrxl(int __a, const unsigned char *__b)
10473 {
10474   return vec_perm((vector unsigned char)(0),
10475                   vec_ldl(__a, __b),
10476                   vec_lvsl(__a, __b));
10477 }
10478
10479 static vector unsigned char __ATTRS_o_ai
10480 vec_lvrxl(int __a, const vector unsigned char *__b)
10481 {
10482   return vec_perm((vector unsigned char)(0),
10483                   vec_ldl(__a, __b),
10484                   vec_lvsl(__a, (unsigned char *)__b));
10485 }
10486
10487 static vector bool char __ATTRS_o_ai
10488 vec_lvrxl(int __a, const vector bool char *__b)
10489 {
10490   return vec_perm((vector bool char)(0),
10491                   vec_ldl(__a, __b),
10492                   vec_lvsl(__a, (unsigned char *)__b));
10493 }
10494
10495 static vector short __ATTRS_o_ai
10496 vec_lvrxl(int __a, const short *__b)
10497 {
10498   return vec_perm((vector short)(0),
10499                   vec_ldl(__a, __b),
10500                   vec_lvsl(__a, __b));
10501 }
10502
10503 static vector short __ATTRS_o_ai
10504 vec_lvrxl(int __a, const vector short *__b)
10505 {
10506   return vec_perm((vector short)(0),
10507                   vec_ldl(__a, __b),
10508                   vec_lvsl(__a, (unsigned char *)__b));
10509 }
10510
10511 static vector unsigned short __ATTRS_o_ai
10512 vec_lvrxl(int __a, const unsigned short *__b)
10513 {
10514   return vec_perm((vector unsigned short)(0),
10515                   vec_ldl(__a, __b),
10516                   vec_lvsl(__a, __b));
10517 }
10518
10519 static vector unsigned short __ATTRS_o_ai
10520 vec_lvrxl(int __a, const vector unsigned short *__b)
10521 {
10522   return vec_perm((vector unsigned short)(0),
10523                   vec_ldl(__a, __b),
10524                   vec_lvsl(__a, (unsigned char *)__b));
10525 }
10526
10527 static vector bool short __ATTRS_o_ai
10528 vec_lvrxl(int __a, const vector bool short *__b)
10529 {
10530   return vec_perm((vector bool short)(0),
10531                   vec_ldl(__a, __b),
10532                   vec_lvsl(__a, (unsigned char *)__b));
10533 }
10534
10535 static vector pixel __ATTRS_o_ai
10536 vec_lvrxl(int __a, const vector pixel *__b)
10537 {
10538   return vec_perm((vector pixel)(0),
10539                   vec_ldl(__a, __b),
10540                   vec_lvsl(__a, (unsigned char *)__b));
10541 }
10542
10543 static vector int __ATTRS_o_ai
10544 vec_lvrxl(int __a, const int *__b)
10545 {
10546   return vec_perm((vector int)(0),
10547                   vec_ldl(__a, __b),
10548                   vec_lvsl(__a, __b));
10549 }
10550
10551 static vector int __ATTRS_o_ai
10552 vec_lvrxl(int __a, const vector int *__b)
10553 {
10554   return vec_perm((vector int)(0),
10555                   vec_ldl(__a, __b),
10556                   vec_lvsl(__a, (unsigned char *)__b));
10557 }
10558
10559 static vector unsigned int __ATTRS_o_ai
10560 vec_lvrxl(int __a, const unsigned int *__b)
10561 {
10562   return vec_perm((vector unsigned int)(0),
10563                   vec_ldl(__a, __b),
10564                   vec_lvsl(__a, __b));
10565 }
10566
10567 static vector unsigned int __ATTRS_o_ai
10568 vec_lvrxl(int __a, const vector unsigned int *__b)
10569 {
10570   return vec_perm((vector unsigned int)(0),
10571                   vec_ldl(__a, __b),
10572                   vec_lvsl(__a, (unsigned char *)__b));
10573 }
10574
10575 static vector bool int __ATTRS_o_ai
10576 vec_lvrxl(int __a, const vector bool int *__b)
10577 {
10578   return vec_perm((vector bool int)(0),
10579                   vec_ldl(__a, __b),
10580                   vec_lvsl(__a, (unsigned char *)__b));
10581 }
10582
10583 static vector float __ATTRS_o_ai
10584 vec_lvrxl(int __a, const float *__b)
10585 {
10586   return vec_perm((vector float)(0),
10587                   vec_ldl(__a, __b),
10588                   vec_lvsl(__a, __b));
10589 }
10590
10591 static vector float __ATTRS_o_ai
10592 vec_lvrxl(int __a, const vector float *__b)
10593 {
10594   return vec_perm((vector float)(0),
10595                   vec_ldl(__a, __b),
10596                   vec_lvsl(__a, (unsigned char *)__b));
10597 }
10598
10599 /* vec_stvlx */
10600
10601 static void __ATTRS_o_ai
10602 vec_stvlx(vector signed char __a, int __b, signed char *__c)
10603 {
10604   return vec_st(vec_perm(vec_lvrx(__b, __c),
10605                          __a,
10606                          vec_lvsr(__b, __c)),
10607                 __b, __c);
10608 }
10609
10610 static void __ATTRS_o_ai
10611 vec_stvlx(vector signed char __a, int __b, vector signed char *__c)
10612 {
10613   return vec_st(vec_perm(vec_lvrx(__b, __c),
10614                          __a,
10615                          vec_lvsr(__b, (unsigned char *)__c)),
10616                 __b, __c);
10617 }
10618
10619 static void __ATTRS_o_ai
10620 vec_stvlx(vector unsigned char __a, int __b, unsigned char *__c)
10621 {
10622   return vec_st(vec_perm(vec_lvrx(__b, __c),
10623                          __a,
10624                          vec_lvsr(__b, __c)),
10625                 __b, __c);
10626 }
10627
10628 static void __ATTRS_o_ai
10629 vec_stvlx(vector unsigned char __a, int __b, vector unsigned char *__c)
10630 {
10631   return vec_st(vec_perm(vec_lvrx(__b, __c),
10632                          __a,
10633                          vec_lvsr(__b, (unsigned char *)__c)),
10634                 __b, __c);
10635 }
10636
10637 static void __ATTRS_o_ai
10638 vec_stvlx(vector bool char __a, int __b, vector bool char *__c)
10639 {
10640   return vec_st(vec_perm(vec_lvrx(__b, __c),
10641                          __a,
10642                          vec_lvsr(__b, (unsigned char *)__c)),
10643                 __b, __c);
10644 }
10645
10646 static void __ATTRS_o_ai
10647 vec_stvlx(vector short __a, int __b, short *__c)
10648 {
10649   return vec_st(vec_perm(vec_lvrx(__b, __c),
10650                          __a,
10651                          vec_lvsr(__b, __c)),
10652                 __b, __c);
10653 }
10654
10655 static void __ATTRS_o_ai
10656 vec_stvlx(vector short __a, int __b, vector short *__c)
10657 {
10658   return vec_st(vec_perm(vec_lvrx(__b, __c),
10659                          __a,
10660                          vec_lvsr(__b, (unsigned char *)__c)),
10661                 __b, __c);
10662 }
10663
10664 static void __ATTRS_o_ai
10665 vec_stvlx(vector unsigned short __a, int __b, unsigned short *__c)
10666 {
10667   return vec_st(vec_perm(vec_lvrx(__b, __c),
10668                          __a,
10669                          vec_lvsr(__b, __c)),
10670                 __b, __c);
10671 }
10672
10673 static void __ATTRS_o_ai
10674 vec_stvlx(vector unsigned short __a, int __b, vector unsigned short *__c)
10675 {
10676   return vec_st(vec_perm(vec_lvrx(__b, __c),
10677                          __a,
10678                          vec_lvsr(__b, (unsigned char *)__c)),
10679                 __b, __c);
10680 }
10681
10682 static void __ATTRS_o_ai
10683 vec_stvlx(vector bool short __a, int __b, vector bool short *__c)
10684 {
10685   return vec_st(vec_perm(vec_lvrx(__b, __c),
10686                          __a,
10687                          vec_lvsr(__b, (unsigned char *)__c)),
10688                 __b, __c);
10689 }
10690
10691 static void __ATTRS_o_ai
10692 vec_stvlx(vector pixel __a, int __b, vector pixel *__c)
10693 {
10694   return vec_st(vec_perm(vec_lvrx(__b, __c),
10695                          __a,
10696                          vec_lvsr(__b, (unsigned char *)__c)),
10697                 __b, __c);
10698 }
10699
10700 static void __ATTRS_o_ai
10701 vec_stvlx(vector int __a, int __b, int *__c)
10702 {
10703   return vec_st(vec_perm(vec_lvrx(__b, __c),
10704                          __a,
10705                          vec_lvsr(__b, __c)),
10706                 __b, __c);
10707 }
10708
10709 static void __ATTRS_o_ai
10710 vec_stvlx(vector int __a, int __b, vector int *__c)
10711 {
10712   return vec_st(vec_perm(vec_lvrx(__b, __c),
10713                          __a,
10714                          vec_lvsr(__b, (unsigned char *)__c)),
10715                 __b, __c);
10716 }
10717
10718 static void __ATTRS_o_ai
10719 vec_stvlx(vector unsigned int __a, int __b, unsigned int *__c)
10720 {
10721   return vec_st(vec_perm(vec_lvrx(__b, __c),
10722                          __a,
10723                          vec_lvsr(__b, __c)),
10724                 __b, __c);
10725 }
10726
10727 static void __ATTRS_o_ai
10728 vec_stvlx(vector unsigned int __a, int __b, vector unsigned int *__c)
10729 {
10730   return vec_st(vec_perm(vec_lvrx(__b, __c),
10731                          __a,
10732                          vec_lvsr(__b, (unsigned char *)__c)),
10733                 __b, __c);
10734 }
10735
10736 static void __ATTRS_o_ai
10737 vec_stvlx(vector bool int __a, int __b, vector bool int *__c)
10738 {
10739   return vec_st(vec_perm(vec_lvrx(__b, __c),
10740                          __a,
10741                          vec_lvsr(__b, (unsigned char *)__c)),
10742                 __b, __c);
10743 }
10744
10745 static void __ATTRS_o_ai
10746 vec_stvlx(vector float __a, int __b, vector float *__c)
10747 {
10748   return vec_st(vec_perm(vec_lvrx(__b, __c),
10749                          __a,
10750                          vec_lvsr(__b, (unsigned char *)__c)),
10751                 __b, __c);
10752 }
10753
10754 /* vec_stvlxl */
10755
10756 static void __ATTRS_o_ai
10757 vec_stvlxl(vector signed char __a, int __b, signed char *__c)
10758 {
10759   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10760                           __a,
10761                           vec_lvsr(__b, __c)),
10762                  __b, __c);
10763 }
10764
10765 static void __ATTRS_o_ai
10766 vec_stvlxl(vector signed char __a, int __b, vector signed char *__c)
10767 {
10768   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10769                           __a,
10770                           vec_lvsr(__b, (unsigned char *)__c)),
10771                  __b, __c);
10772 }
10773
10774 static void __ATTRS_o_ai
10775 vec_stvlxl(vector unsigned char __a, int __b, unsigned char *__c)
10776 {
10777   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10778                           __a,
10779                           vec_lvsr(__b, __c)),
10780                  __b, __c);
10781 }
10782
10783 static void __ATTRS_o_ai
10784 vec_stvlxl(vector unsigned char __a, int __b, vector unsigned char *__c)
10785 {
10786   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10787                           __a,
10788                           vec_lvsr(__b, (unsigned char *)__c)),
10789                  __b, __c);
10790 }
10791
10792 static void __ATTRS_o_ai
10793 vec_stvlxl(vector bool char __a, int __b, vector bool char *__c)
10794 {
10795   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10796                           __a,
10797                           vec_lvsr(__b, (unsigned char *)__c)),
10798                  __b, __c);
10799 }
10800
10801 static void __ATTRS_o_ai
10802 vec_stvlxl(vector short __a, int __b, short *__c)
10803 {
10804   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10805                           __a,
10806                           vec_lvsr(__b, __c)),
10807                  __b, __c);
10808 }
10809
10810 static void __ATTRS_o_ai
10811 vec_stvlxl(vector short __a, int __b, vector short *__c)
10812 {
10813   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10814                           __a,
10815                           vec_lvsr(__b, (unsigned char *)__c)),
10816                  __b, __c);
10817 }
10818
10819 static void __ATTRS_o_ai
10820 vec_stvlxl(vector unsigned short __a, int __b, unsigned short *__c)
10821 {
10822   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10823                           __a,
10824                           vec_lvsr(__b, __c)),
10825                  __b, __c);
10826 }
10827
10828 static void __ATTRS_o_ai
10829 vec_stvlxl(vector unsigned short __a, int __b, vector unsigned short *__c)
10830 {
10831   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10832                           __a,
10833                           vec_lvsr(__b, (unsigned char *)__c)),
10834                  __b, __c);
10835 }
10836
10837 static void __ATTRS_o_ai
10838 vec_stvlxl(vector bool short __a, int __b, vector bool short *__c)
10839 {
10840   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10841                           __a,
10842                           vec_lvsr(__b, (unsigned char *)__c)),
10843                  __b, __c);
10844 }
10845
10846 static void __ATTRS_o_ai
10847 vec_stvlxl(vector pixel __a, int __b, vector pixel *__c)
10848 {
10849   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10850                           __a,
10851                           vec_lvsr(__b, (unsigned char *)__c)),
10852                  __b, __c);
10853 }
10854
10855 static void __ATTRS_o_ai
10856 vec_stvlxl(vector int __a, int __b, int *__c)
10857 {
10858   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10859                           __a,
10860                           vec_lvsr(__b, __c)),
10861                  __b, __c);
10862 }
10863
10864 static void __ATTRS_o_ai
10865 vec_stvlxl(vector int __a, int __b, vector int *__c)
10866 {
10867   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10868                           __a,
10869                           vec_lvsr(__b, (unsigned char *)__c)),
10870                  __b, __c);
10871 }
10872
10873 static void __ATTRS_o_ai
10874 vec_stvlxl(vector unsigned int __a, int __b, unsigned int *__c)
10875 {
10876   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10877                           __a,
10878                           vec_lvsr(__b, __c)),
10879                  __b, __c);
10880 }
10881
10882 static void __ATTRS_o_ai
10883 vec_stvlxl(vector unsigned int __a, int __b, vector unsigned int *__c)
10884 {
10885   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10886                           __a,
10887                           vec_lvsr(__b, (unsigned char *)__c)),
10888                  __b, __c);
10889 }
10890
10891 static void __ATTRS_o_ai
10892 vec_stvlxl(vector bool int __a, int __b, vector bool int *__c)
10893 {
10894   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10895                           __a,
10896                           vec_lvsr(__b, (unsigned char *)__c)),
10897                  __b, __c);
10898 }
10899
10900 static void __ATTRS_o_ai
10901 vec_stvlxl(vector float __a, int __b, vector float *__c)
10902 {
10903   return vec_stl(vec_perm(vec_lvrx(__b, __c),
10904                           __a,
10905                           vec_lvsr(__b, (unsigned char *)__c)),
10906                  __b, __c);
10907 }
10908
10909 /* vec_stvrx */
10910
10911 static void __ATTRS_o_ai
10912 vec_stvrx(vector signed char __a, int __b, signed char *__c)
10913 {
10914   return vec_st(vec_perm(__a,
10915                          vec_lvlx(__b, __c),
10916                          vec_lvsr(__b, __c)),
10917                 __b, __c);
10918 }
10919
10920 static void __ATTRS_o_ai
10921 vec_stvrx(vector signed char __a, int __b, vector signed char *__c)
10922 {
10923   return vec_st(vec_perm(__a,
10924                          vec_lvlx(__b, __c),
10925                          vec_lvsr(__b, (unsigned char *)__c)),
10926                 __b, __c);
10927 }
10928
10929 static void __ATTRS_o_ai
10930 vec_stvrx(vector unsigned char __a, int __b, unsigned char *__c)
10931 {
10932   return vec_st(vec_perm(__a,
10933                          vec_lvlx(__b, __c),
10934                          vec_lvsr(__b, __c)),
10935                 __b, __c);
10936 }
10937
10938 static void __ATTRS_o_ai
10939 vec_stvrx(vector unsigned char __a, int __b, vector unsigned char *__c)
10940 {
10941   return vec_st(vec_perm(__a,
10942                          vec_lvlx(__b, __c),
10943                          vec_lvsr(__b, (unsigned char *)__c)),
10944                 __b, __c);
10945 }
10946
10947 static void __ATTRS_o_ai
10948 vec_stvrx(vector bool char __a, int __b, vector bool char *__c)
10949 {
10950   return vec_st(vec_perm(__a,
10951                          vec_lvlx(__b, __c),
10952                          vec_lvsr(__b, (unsigned char *)__c)),
10953                 __b, __c);
10954 }
10955
10956 static void __ATTRS_o_ai
10957 vec_stvrx(vector short __a, int __b, short *__c)
10958 {
10959   return vec_st(vec_perm(__a,
10960                          vec_lvlx(__b, __c),
10961                          vec_lvsr(__b, __c)),
10962                 __b, __c);
10963 }
10964
10965 static void __ATTRS_o_ai
10966 vec_stvrx(vector short __a, int __b, vector short *__c)
10967 {
10968   return vec_st(vec_perm(__a,
10969                          vec_lvlx(__b, __c),
10970                          vec_lvsr(__b, (unsigned char *)__c)),
10971                 __b, __c);
10972 }
10973
10974 static void __ATTRS_o_ai
10975 vec_stvrx(vector unsigned short __a, int __b, unsigned short *__c)
10976 {
10977   return vec_st(vec_perm(__a,
10978                          vec_lvlx(__b, __c),
10979                          vec_lvsr(__b, __c)),
10980                 __b, __c);
10981 }
10982
10983 static void __ATTRS_o_ai
10984 vec_stvrx(vector unsigned short __a, int __b, vector unsigned short *__c)
10985 {
10986   return vec_st(vec_perm(__a,
10987                          vec_lvlx(__b, __c),
10988                          vec_lvsr(__b, (unsigned char *)__c)),
10989                 __b, __c);
10990 }
10991
10992 static void __ATTRS_o_ai
10993 vec_stvrx(vector bool short __a, int __b, vector bool short *__c)
10994 {
10995   return vec_st(vec_perm(__a,
10996                          vec_lvlx(__b, __c),
10997                          vec_lvsr(__b, (unsigned char *)__c)),
10998                 __b, __c);
10999 }
11000
11001 static void __ATTRS_o_ai
11002 vec_stvrx(vector pixel __a, int __b, vector pixel *__c)
11003 {
11004   return vec_st(vec_perm(__a,
11005                          vec_lvlx(__b, __c),
11006                          vec_lvsr(__b, (unsigned char *)__c)),
11007                 __b, __c);
11008 }
11009
11010 static void __ATTRS_o_ai
11011 vec_stvrx(vector int __a, int __b, int *__c)
11012 {
11013   return vec_st(vec_perm(__a,
11014                          vec_lvlx(__b, __c),
11015                          vec_lvsr(__b, __c)),
11016                 __b, __c);
11017 }
11018
11019 static void __ATTRS_o_ai
11020 vec_stvrx(vector int __a, int __b, vector int *__c)
11021 {
11022   return vec_st(vec_perm(__a,
11023                          vec_lvlx(__b, __c),
11024                          vec_lvsr(__b, (unsigned char *)__c)),
11025                 __b, __c);
11026 }
11027
11028 static void __ATTRS_o_ai
11029 vec_stvrx(vector unsigned int __a, int __b, unsigned int *__c)
11030 {
11031   return vec_st(vec_perm(__a,
11032                          vec_lvlx(__b, __c),
11033                          vec_lvsr(__b, __c)),
11034                 __b, __c);
11035 }
11036
11037 static void __ATTRS_o_ai
11038 vec_stvrx(vector unsigned int __a, int __b, vector unsigned int *__c)
11039 {
11040   return vec_st(vec_perm(__a,
11041                          vec_lvlx(__b, __c),
11042                          vec_lvsr(__b, (unsigned char *)__c)),
11043                 __b, __c);
11044 }
11045
11046 static void __ATTRS_o_ai
11047 vec_stvrx(vector bool int __a, int __b, vector bool int *__c)
11048 {
11049   return vec_st(vec_perm(__a,
11050                          vec_lvlx(__b, __c),
11051                          vec_lvsr(__b, (unsigned char *)__c)),
11052                 __b, __c);
11053 }
11054
11055 static void __ATTRS_o_ai
11056 vec_stvrx(vector float __a, int __b, vector float *__c)
11057 {
11058   return vec_st(vec_perm(__a,
11059                          vec_lvlx(__b, __c),
11060                          vec_lvsr(__b, (unsigned char *)__c)),
11061                 __b, __c);
11062 }
11063
11064 /* vec_stvrxl */
11065
11066 static void __ATTRS_o_ai
11067 vec_stvrxl(vector signed char __a, int __b, signed char *__c)
11068 {
11069   return vec_stl(vec_perm(__a,
11070                           vec_lvlx(__b, __c),
11071                           vec_lvsr(__b, __c)),
11072                  __b, __c);
11073 }
11074
11075 static void __ATTRS_o_ai
11076 vec_stvrxl(vector signed char __a, int __b, vector signed char *__c)
11077 {
11078   return vec_stl(vec_perm(__a,
11079                           vec_lvlx(__b, __c),
11080                           vec_lvsr(__b, (unsigned char *)__c)),
11081                  __b, __c);
11082 }
11083
11084 static void __ATTRS_o_ai
11085 vec_stvrxl(vector unsigned char __a, int __b, unsigned char *__c)
11086 {
11087   return vec_stl(vec_perm(__a,
11088                           vec_lvlx(__b, __c),
11089                           vec_lvsr(__b, __c)),
11090                  __b, __c);
11091 }
11092
11093 static void __ATTRS_o_ai
11094 vec_stvrxl(vector unsigned char __a, int __b, vector unsigned char *__c)
11095 {
11096   return vec_stl(vec_perm(__a,
11097                           vec_lvlx(__b, __c),
11098                           vec_lvsr(__b, (unsigned char *)__c)),
11099                  __b, __c);
11100 }
11101
11102 static void __ATTRS_o_ai
11103 vec_stvrxl(vector bool char __a, int __b, vector bool char *__c)
11104 {
11105   return vec_stl(vec_perm(__a,
11106                           vec_lvlx(__b, __c),
11107                           vec_lvsr(__b, (unsigned char *)__c)),
11108                  __b, __c);
11109 }
11110
11111 static void __ATTRS_o_ai
11112 vec_stvrxl(vector short __a, int __b, short *__c)
11113 {
11114   return vec_stl(vec_perm(__a,
11115                           vec_lvlx(__b, __c),
11116                           vec_lvsr(__b, __c)),
11117                  __b, __c);
11118 }
11119
11120 static void __ATTRS_o_ai
11121 vec_stvrxl(vector short __a, int __b, vector short *__c)
11122 {
11123   return vec_stl(vec_perm(__a,
11124                           vec_lvlx(__b, __c),
11125                           vec_lvsr(__b, (unsigned char *)__c)),
11126                  __b, __c);
11127 }
11128
11129 static void __ATTRS_o_ai
11130 vec_stvrxl(vector unsigned short __a, int __b, unsigned short *__c)
11131 {
11132   return vec_stl(vec_perm(__a,
11133                           vec_lvlx(__b, __c),
11134                           vec_lvsr(__b, __c)),
11135                  __b, __c);
11136 }
11137
11138 static void __ATTRS_o_ai
11139 vec_stvrxl(vector unsigned short __a, int __b, vector unsigned short *__c)
11140 {
11141   return vec_stl(vec_perm(__a,
11142                           vec_lvlx(__b, __c),
11143                           vec_lvsr(__b, (unsigned char *)__c)),
11144                  __b, __c);
11145 }
11146
11147 static void __ATTRS_o_ai
11148 vec_stvrxl(vector bool short __a, int __b, vector bool short *__c)
11149 {
11150   return vec_stl(vec_perm(__a,
11151                           vec_lvlx(__b, __c),
11152                           vec_lvsr(__b, (unsigned char *)__c)),
11153                  __b, __c);
11154 }
11155
11156 static void __ATTRS_o_ai
11157 vec_stvrxl(vector pixel __a, int __b, vector pixel *__c)
11158 {
11159   return vec_stl(vec_perm(__a,
11160                           vec_lvlx(__b, __c),
11161                           vec_lvsr(__b, (unsigned char *)__c)),
11162                  __b, __c);
11163 }
11164
11165 static void __ATTRS_o_ai
11166 vec_stvrxl(vector int __a, int __b, int *__c)
11167 {
11168   return vec_stl(vec_perm(__a,
11169                           vec_lvlx(__b, __c),
11170                           vec_lvsr(__b, __c)),
11171                  __b, __c);
11172 }
11173
11174 static void __ATTRS_o_ai
11175 vec_stvrxl(vector int __a, int __b, vector int *__c)
11176 {
11177   return vec_stl(vec_perm(__a,
11178                           vec_lvlx(__b, __c),
11179                           vec_lvsr(__b, (unsigned char *)__c)),
11180                  __b, __c);
11181 }
11182
11183 static void __ATTRS_o_ai
11184 vec_stvrxl(vector unsigned int __a, int __b, unsigned int *__c)
11185 {
11186   return vec_stl(vec_perm(__a,
11187                           vec_lvlx(__b, __c),
11188                           vec_lvsr(__b, __c)),
11189                  __b, __c);
11190 }
11191
11192 static void __ATTRS_o_ai
11193 vec_stvrxl(vector unsigned int __a, int __b, vector unsigned int *__c)
11194 {
11195   return vec_stl(vec_perm(__a,
11196                           vec_lvlx(__b, __c),
11197                           vec_lvsr(__b, (unsigned char *)__c)),
11198                  __b, __c);
11199 }
11200
11201 static void __ATTRS_o_ai
11202 vec_stvrxl(vector bool int __a, int __b, vector bool int *__c)
11203 {
11204   return vec_stl(vec_perm(__a,
11205                           vec_lvlx(__b, __c),
11206                           vec_lvsr(__b, (unsigned char *)__c)),
11207                  __b, __c);
11208 }
11209
11210 static void __ATTRS_o_ai
11211 vec_stvrxl(vector float __a, int __b, vector float *__c)
11212 {
11213   return vec_stl(vec_perm(__a,
11214                           vec_lvlx(__b, __c),
11215                           vec_lvsr(__b, (unsigned char *)__c)),
11216                  __b, __c);
11217 }
11218
11219 /* vec_promote */
11220
11221 static vector signed char __ATTRS_o_ai
11222 vec_promote(signed char __a, int __b)
11223 {
11224   vector signed char __res = (vector signed char)(0);
11225   __res[__b] = __a;
11226   return __res;
11227 }
11228
11229 static vector unsigned char __ATTRS_o_ai
11230 vec_promote(unsigned char __a, int __b)
11231 {
11232   vector unsigned char __res = (vector unsigned char)(0);
11233   __res[__b] = __a;
11234   return __res;
11235 }
11236
11237 static vector short __ATTRS_o_ai
11238 vec_promote(short __a, int __b)
11239 {
11240   vector short __res = (vector short)(0);
11241   __res[__b] = __a;
11242   return __res;
11243 }
11244
11245 static vector unsigned short __ATTRS_o_ai
11246 vec_promote(unsigned short __a, int __b)
11247 {
11248   vector unsigned short __res = (vector unsigned short)(0);
11249   __res[__b] = __a;
11250   return __res;
11251 }
11252
11253 static vector int __ATTRS_o_ai
11254 vec_promote(int __a, int __b)
11255 {
11256   vector int __res = (vector int)(0);
11257   __res[__b] = __a;
11258   return __res;
11259 }
11260
11261 static vector unsigned int __ATTRS_o_ai
11262 vec_promote(unsigned int __a, int __b)
11263 {
11264   vector unsigned int __res = (vector unsigned int)(0);
11265   __res[__b] = __a;
11266   return __res;
11267 }
11268
11269 static vector float __ATTRS_o_ai
11270 vec_promote(float __a, int __b)
11271 {
11272   vector float __res = (vector float)(0);
11273   __res[__b] = __a;
11274   return __res;
11275 }
11276
11277 /* vec_splats */
11278
11279 static vector signed char __ATTRS_o_ai
11280 vec_splats(signed char __a)
11281 {
11282   return (vector signed char)(__a);
11283 }
11284
11285 static vector unsigned char __ATTRS_o_ai
11286 vec_splats(unsigned char __a)
11287 {
11288   return (vector unsigned char)(__a);
11289 }
11290
11291 static vector short __ATTRS_o_ai
11292 vec_splats(short __a)
11293 {
11294   return (vector short)(__a);
11295 }
11296
11297 static vector unsigned short __ATTRS_o_ai
11298 vec_splats(unsigned short __a)
11299 {
11300   return (vector unsigned short)(__a);
11301 }
11302
11303 static vector int __ATTRS_o_ai
11304 vec_splats(int __a)
11305 {
11306   return (vector int)(__a);
11307 }
11308
11309 static vector unsigned int __ATTRS_o_ai
11310 vec_splats(unsigned int __a)
11311 {
11312   return (vector unsigned int)(__a);
11313 }
11314
11315 static vector float __ATTRS_o_ai
11316 vec_splats(float __a)
11317 {
11318   return (vector float)(__a);
11319 }
11320
11321 /* ----------------------------- predicates --------------------------------- */
11322
11323 /* vec_all_eq */
11324
11325 static int __ATTRS_o_ai
11326 vec_all_eq(vector signed char __a, vector signed char __b)
11327 {
11328   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11329 }
11330
11331 static int __ATTRS_o_ai
11332 vec_all_eq(vector signed char __a, vector bool char __b)
11333 {
11334   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11335 }
11336
11337 static int __ATTRS_o_ai
11338 vec_all_eq(vector unsigned char __a, vector unsigned char __b)
11339 {
11340   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11341 }
11342
11343 static int __ATTRS_o_ai
11344 vec_all_eq(vector unsigned char __a, vector bool char __b)
11345 {
11346   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11347 }
11348
11349 static int __ATTRS_o_ai
11350 vec_all_eq(vector bool char __a, vector signed char __b)
11351 {
11352   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11353 }
11354
11355 static int __ATTRS_o_ai
11356 vec_all_eq(vector bool char __a, vector unsigned char __b)
11357 {
11358   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11359 }
11360
11361 static int __ATTRS_o_ai
11362 vec_all_eq(vector bool char __a, vector bool char __b)
11363 {
11364   return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
11365 }
11366
11367 static int __ATTRS_o_ai
11368 vec_all_eq(vector short __a, vector short __b)
11369 {
11370   return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
11371 }
11372
11373 static int __ATTRS_o_ai
11374 vec_all_eq(vector short __a, vector bool short __b)
11375 {
11376   return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
11377 }
11378
11379 static int __ATTRS_o_ai
11380 vec_all_eq(vector unsigned short __a, vector unsigned short __b)
11381 {
11382   return
11383     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11384 }
11385
11386 static int __ATTRS_o_ai
11387 vec_all_eq(vector unsigned short __a, vector bool short __b)
11388 {
11389   return
11390     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11391 }
11392
11393 static int __ATTRS_o_ai
11394 vec_all_eq(vector bool short __a, vector short __b)
11395 {
11396   return
11397     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11398 }
11399
11400 static int __ATTRS_o_ai
11401 vec_all_eq(vector bool short __a, vector unsigned short __b)
11402 {
11403   return
11404     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11405 }
11406
11407 static int __ATTRS_o_ai
11408 vec_all_eq(vector bool short __a, vector bool short __b)
11409 {
11410   return
11411     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11412 }
11413
11414 static int __ATTRS_o_ai
11415 vec_all_eq(vector pixel __a, vector pixel __b)
11416 {
11417   return
11418     __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
11419 }
11420
11421 static int __ATTRS_o_ai
11422 vec_all_eq(vector int __a, vector int __b)
11423 {
11424   return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
11425 }
11426
11427 static int __ATTRS_o_ai
11428 vec_all_eq(vector int __a, vector bool int __b)
11429 {
11430   return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
11431 }
11432
11433 static int __ATTRS_o_ai
11434 vec_all_eq(vector unsigned int __a, vector unsigned int __b)
11435 {
11436   return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
11437 }
11438
11439 static int __ATTRS_o_ai
11440 vec_all_eq(vector unsigned int __a, vector bool int __b)
11441 {
11442   return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
11443 }
11444
11445 static int __ATTRS_o_ai
11446 vec_all_eq(vector bool int __a, vector int __b)
11447 {
11448   return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
11449 }
11450
11451 static int __ATTRS_o_ai
11452 vec_all_eq(vector bool int __a, vector unsigned int __b)
11453 {
11454   return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
11455 }
11456
11457 static int __ATTRS_o_ai
11458 vec_all_eq(vector bool int __a, vector bool int __b)
11459 {
11460   return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
11461 }
11462
11463 #ifdef __POWER8_VECTOR__
11464 static int __ATTRS_o_ai
11465 vec_all_eq(vector signed long long __a, vector signed long long __b)
11466 {
11467   return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
11468 }
11469
11470 static int __ATTRS_o_ai
11471 vec_all_eq(vector long long __a, vector bool long long __b)
11472 {
11473   return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
11474 }
11475
11476 static int __ATTRS_o_ai
11477 vec_all_eq(vector unsigned long long __a, vector unsigned long long __b)
11478 {
11479   return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, 
11480                                       (vector long long)__b);
11481 }
11482
11483 static int __ATTRS_o_ai
11484 vec_all_eq(vector unsigned long long __a, vector bool long long __b)
11485 {
11486   return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, 
11487                                       (vector long long)__b);
11488 }
11489
11490 static int __ATTRS_o_ai
11491 vec_all_eq(vector bool long long __a, vector long long __b)
11492 {
11493   return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, 
11494                                       (vector long long)__b);
11495 }
11496
11497 static int __ATTRS_o_ai
11498 vec_all_eq(vector bool long long __a, vector unsigned long long __b)
11499 {
11500   return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, 
11501                                       (vector long long)__b);
11502 }
11503
11504 static int __ATTRS_o_ai
11505 vec_all_eq(vector bool long long __a, vector bool long long __b)
11506 {
11507   return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, 
11508                                       (vector long long)__b);
11509 }
11510 #endif
11511
11512 static int __ATTRS_o_ai
11513 vec_all_eq(vector float __a, vector float __b)
11514 {
11515   return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
11516 }
11517
11518 /* vec_all_ge */
11519
11520 static int __ATTRS_o_ai
11521 vec_all_ge(vector signed char __a, vector signed char __b)
11522 {
11523   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
11524 }
11525
11526 static int __ATTRS_o_ai
11527 vec_all_ge(vector signed char __a, vector bool char __b)
11528 {
11529   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
11530 }
11531
11532 static int __ATTRS_o_ai
11533 vec_all_ge(vector unsigned char __a, vector unsigned char __b)
11534 {
11535   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
11536 }
11537
11538 static int __ATTRS_o_ai
11539 vec_all_ge(vector unsigned char __a, vector bool char __b)
11540 {
11541   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
11542 }
11543
11544 static int __ATTRS_o_ai
11545 vec_all_ge(vector bool char __a, vector signed char __b)
11546 {
11547   return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
11548                                       (vector unsigned char)__b,
11549                                       (vector unsigned char)__a);
11550 }
11551
11552 static int __ATTRS_o_ai
11553 vec_all_ge(vector bool char __a, vector unsigned char __b)
11554 {
11555   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
11556 }
11557
11558 static int __ATTRS_o_ai
11559 vec_all_ge(vector bool char __a, vector bool char __b)
11560 {
11561   return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
11562                                       (vector unsigned char)__b,
11563                                       (vector unsigned char)__a);
11564 }
11565
11566 static int __ATTRS_o_ai
11567 vec_all_ge(vector short __a, vector short __b)
11568 {
11569   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
11570 }
11571
11572 static int __ATTRS_o_ai
11573 vec_all_ge(vector short __a, vector bool short __b)
11574 {
11575   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
11576 }
11577
11578 static int __ATTRS_o_ai
11579 vec_all_ge(vector unsigned short __a, vector unsigned short __b)
11580 {
11581   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
11582 }
11583
11584 static int __ATTRS_o_ai
11585 vec_all_ge(vector unsigned short __a, vector bool short __b)
11586 {
11587   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b, __a);
11588 }
11589
11590 static int __ATTRS_o_ai
11591 vec_all_ge(vector bool short __a, vector short __b)
11592 {
11593   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
11594                                       (vector unsigned short)__b,
11595                                       (vector unsigned short)__a);
11596 }
11597
11598 static int __ATTRS_o_ai
11599 vec_all_ge(vector bool short __a, vector unsigned short __b)
11600 {
11601   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, (vector unsigned short)__a);
11602 }
11603
11604 static int __ATTRS_o_ai
11605 vec_all_ge(vector bool short __a, vector bool short __b)
11606 {
11607   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
11608                                       (vector unsigned short)__b,
11609                                       (vector unsigned short)__a);
11610 }
11611
11612 static int __ATTRS_o_ai
11613 vec_all_ge(vector int __a, vector int __b)
11614 {
11615   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
11616 }
11617
11618 static int __ATTRS_o_ai
11619 vec_all_ge(vector int __a, vector bool int __b)
11620 {
11621   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
11622 }
11623
11624 static int __ATTRS_o_ai
11625 vec_all_ge(vector unsigned int __a, vector unsigned int __b)
11626 {
11627   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
11628 }
11629
11630 static int __ATTRS_o_ai
11631 vec_all_ge(vector unsigned int __a, vector bool int __b)
11632 {
11633   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
11634 }
11635
11636 static int __ATTRS_o_ai
11637 vec_all_ge(vector bool int __a, vector int __b)
11638 {
11639   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
11640                                       (vector unsigned int)__b,
11641                                       (vector unsigned int)__a);
11642 }
11643
11644 static int __ATTRS_o_ai
11645 vec_all_ge(vector bool int __a, vector unsigned int __b)
11646 {
11647   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
11648 }
11649
11650 static int __ATTRS_o_ai
11651 vec_all_ge(vector bool int __a, vector bool int __b)
11652 {
11653   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
11654                                       (vector unsigned int)__b,
11655                                       (vector unsigned int)__a);
11656 }
11657
11658 #ifdef __POWER8_VECTOR__
11659 static int __ATTRS_o_ai
11660 vec_all_ge(vector signed long long __a, vector signed long long __b)
11661 {
11662   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
11663 }
11664 static int __ATTRS_o_ai
11665 vec_all_ge(vector signed long long __a, vector bool long long __b)
11666 {
11667   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
11668                                       __a);
11669 }
11670
11671 static int __ATTRS_o_ai
11672 vec_all_ge(vector unsigned long long __a, vector unsigned long long __b)
11673 {
11674   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
11675 }
11676
11677 static int __ATTRS_o_ai
11678 vec_all_ge(vector unsigned long long __a, vector bool long long __b)
11679 {
11680   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
11681                                       __a);
11682 }
11683
11684 static int __ATTRS_o_ai
11685 vec_all_ge(vector bool long long __a, vector signed long long __b)
11686 {
11687   return __builtin_altivec_vcmpgtud_p(__CR6_EQ,
11688                                       (vector unsigned long long)__b,
11689                                       (vector unsigned long long)__a);
11690 }
11691
11692 static int __ATTRS_o_ai
11693 vec_all_ge(vector bool long long __a, vector unsigned long long __b)
11694 {
11695   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
11696                                       (vector unsigned long long)__a);
11697 }
11698
11699 static int __ATTRS_o_ai
11700 vec_all_ge(vector bool long long __a, vector bool long long __b)
11701 {
11702   return __builtin_altivec_vcmpgtud_p(__CR6_EQ,
11703                                       (vector unsigned long long)__b,
11704                                       (vector unsigned long long)__a);
11705 }
11706 #endif
11707
11708 static int __ATTRS_o_ai
11709 vec_all_ge(vector float __a, vector float __b)
11710 {
11711   return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
11712 }
11713
11714 /* vec_all_gt */
11715
11716 static int __ATTRS_o_ai
11717 vec_all_gt(vector signed char __a, vector signed char __b)
11718 {
11719   return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
11720 }
11721
11722 static int __ATTRS_o_ai
11723 vec_all_gt(vector signed char __a, vector bool char __b)
11724 {
11725   return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
11726 }
11727
11728 static int __ATTRS_o_ai
11729 vec_all_gt(vector unsigned char __a, vector unsigned char __b)
11730 {
11731   return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
11732 }
11733
11734 static int __ATTRS_o_ai
11735 vec_all_gt(vector unsigned char __a, vector bool char __b)
11736 {
11737   return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
11738 }
11739
11740 static int __ATTRS_o_ai
11741 vec_all_gt(vector bool char __a, vector signed char __b)
11742 {
11743   return __builtin_altivec_vcmpgtub_p(__CR6_LT,
11744                                       (vector unsigned char)__a,
11745                                       (vector unsigned char)__b);
11746 }
11747
11748 static int __ATTRS_o_ai
11749 vec_all_gt(vector bool char __a, vector unsigned char __b)
11750 {
11751   return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
11752 }
11753
11754 static int __ATTRS_o_ai
11755 vec_all_gt(vector bool char __a, vector bool char __b)
11756 {
11757   return __builtin_altivec_vcmpgtub_p(__CR6_LT,
11758                                       (vector unsigned char)__a,
11759                                       (vector unsigned char)__b);
11760 }
11761
11762 static int __ATTRS_o_ai
11763 vec_all_gt(vector short __a, vector short __b)
11764 {
11765   return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
11766 }
11767
11768 static int __ATTRS_o_ai
11769 vec_all_gt(vector short __a, vector bool short __b)
11770 {
11771   return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
11772 }
11773
11774 static int __ATTRS_o_ai
11775 vec_all_gt(vector unsigned short __a, vector unsigned short __b)
11776 {
11777   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
11778 }
11779
11780 static int __ATTRS_o_ai
11781 vec_all_gt(vector unsigned short __a, vector bool short __b)
11782 {
11783   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, (vector unsigned short)__b);
11784 }
11785
11786 static int __ATTRS_o_ai
11787 vec_all_gt(vector bool short __a, vector short __b)
11788 {
11789   return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
11790                                       (vector unsigned short)__a,
11791                                       (vector unsigned short)__b);
11792 }
11793
11794 static int __ATTRS_o_ai
11795 vec_all_gt(vector bool short __a, vector unsigned short __b)
11796 {
11797   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a, __b);
11798 }
11799
11800 static int __ATTRS_o_ai
11801 vec_all_gt(vector bool short __a, vector bool short __b)
11802 {
11803   return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
11804                                       (vector unsigned short)__a,
11805                                       (vector unsigned short)__b);
11806 }
11807
11808 static int __ATTRS_o_ai
11809 vec_all_gt(vector int __a, vector int __b)
11810 {
11811   return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
11812 }
11813
11814 static int __ATTRS_o_ai
11815 vec_all_gt(vector int __a, vector bool int __b)
11816 {
11817   return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
11818 }
11819
11820 static int __ATTRS_o_ai
11821 vec_all_gt(vector unsigned int __a, vector unsigned int __b)
11822 {
11823   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
11824 }
11825
11826 static int __ATTRS_o_ai
11827 vec_all_gt(vector unsigned int __a, vector bool int __b)
11828 {
11829   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
11830 }
11831
11832 static int __ATTRS_o_ai
11833 vec_all_gt(vector bool int __a, vector int __b)
11834 {
11835   return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
11836                                       (vector unsigned int)__a,
11837                                       (vector unsigned int)__b);
11838 }
11839
11840 static int __ATTRS_o_ai
11841 vec_all_gt(vector bool int __a, vector unsigned int __b)
11842 {
11843   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
11844 }
11845
11846 static int __ATTRS_o_ai
11847 vec_all_gt(vector bool int __a, vector bool int __b)
11848 {
11849   return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
11850                                       (vector unsigned int)__a,
11851                                       (vector unsigned int)__b);
11852 }
11853
11854 #ifdef __POWER8_VECTOR__
11855 static int __ATTRS_o_ai
11856 vec_all_gt(vector signed long long __a, vector signed long long __b)
11857 {
11858   return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
11859 }
11860 static int __ATTRS_o_ai
11861 vec_all_gt(vector signed long long __a, vector bool long long __b)
11862 {
11863   return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
11864                                       (vector signed long long)__b);
11865 }
11866
11867 static int __ATTRS_o_ai
11868 vec_all_gt(vector unsigned long long __a, vector unsigned long long __b)
11869 {
11870   return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
11871 }
11872
11873 static int __ATTRS_o_ai
11874 vec_all_gt(vector unsigned long long __a, vector bool long long __b)
11875 {
11876   return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, 
11877                                       (vector unsigned long long)__b);
11878 }
11879
11880 static int __ATTRS_o_ai
11881 vec_all_gt(vector bool long long __a, vector signed long long __b)
11882 {
11883   return __builtin_altivec_vcmpgtud_p(__CR6_LT,
11884                                       (vector unsigned long long)__a,
11885                                       (vector unsigned long long)__b);
11886 }
11887
11888 static int __ATTRS_o_ai
11889 vec_all_gt(vector bool long long __a, vector unsigned long long __b)
11890 {
11891   return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
11892                                       __b);
11893 }
11894
11895 static int __ATTRS_o_ai
11896 vec_all_gt(vector bool long long __a, vector bool long long __b)
11897 {
11898   return __builtin_altivec_vcmpgtud_p(__CR6_LT,
11899                                       (vector unsigned long long)__a,
11900                                       (vector unsigned long long)__b);
11901 }
11902 #endif
11903
11904 static int __ATTRS_o_ai
11905 vec_all_gt(vector float __a, vector float __b)
11906 {
11907   return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
11908 }
11909
11910 /* vec_all_in */
11911
11912 static int __attribute__((__always_inline__))
11913 vec_all_in(vector float __a, vector float __b)
11914 {
11915   return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
11916 }
11917
11918 /* vec_all_le */
11919
11920 static int __ATTRS_o_ai
11921 vec_all_le(vector signed char __a, vector signed char __b)
11922 {
11923   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
11924 }
11925
11926 static int __ATTRS_o_ai
11927 vec_all_le(vector signed char __a, vector bool char __b)
11928 {
11929   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
11930 }
11931
11932 static int __ATTRS_o_ai
11933 vec_all_le(vector unsigned char __a, vector unsigned char __b)
11934 {
11935   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
11936 }
11937
11938 static int __ATTRS_o_ai
11939 vec_all_le(vector unsigned char __a, vector bool char __b)
11940 {
11941   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
11942 }
11943
11944 static int __ATTRS_o_ai
11945 vec_all_le(vector bool char __a, vector signed char __b)
11946 {
11947   return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
11948                                       (vector unsigned char)__a,
11949                                       (vector unsigned char)__b);
11950 }
11951
11952 static int __ATTRS_o_ai
11953 vec_all_le(vector bool char __a, vector unsigned char __b)
11954 {
11955   return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
11956 }
11957
11958 static int __ATTRS_o_ai
11959 vec_all_le(vector bool char __a, vector bool char __b)
11960 {
11961   return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
11962                                       (vector unsigned char)__a,
11963                                       (vector unsigned char)__b);
11964 }
11965
11966 static int __ATTRS_o_ai
11967 vec_all_le(vector short __a, vector short __b)
11968 {
11969   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
11970 }
11971
11972 static int __ATTRS_o_ai
11973 vec_all_le(vector short __a, vector bool short __b)
11974 {
11975   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
11976 }
11977
11978 static int __ATTRS_o_ai
11979 vec_all_le(vector unsigned short __a, vector unsigned short __b)
11980 {
11981   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
11982 }
11983
11984 static int __ATTRS_o_ai
11985 vec_all_le(vector unsigned short __a, vector bool short __b)
11986 {
11987   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, (vector unsigned short)__b);
11988 }
11989
11990 static int __ATTRS_o_ai
11991 vec_all_le(vector bool short __a, vector short __b)
11992 {
11993   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
11994                                       (vector unsigned short)__a,
11995                                       (vector unsigned short)__b);
11996 }
11997
11998 static int __ATTRS_o_ai
11999 vec_all_le(vector bool short __a, vector unsigned short __b)
12000 {
12001   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a, __b);
12002 }
12003
12004 static int __ATTRS_o_ai
12005 vec_all_le(vector bool short __a, vector bool short __b)
12006 {
12007   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
12008                                       (vector unsigned short)__a,
12009                                       (vector unsigned short)__b);
12010 }
12011
12012 static int __ATTRS_o_ai
12013 vec_all_le(vector int __a, vector int __b)
12014 {
12015   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
12016 }
12017
12018 static int __ATTRS_o_ai
12019 vec_all_le(vector int __a, vector bool int __b)
12020 {
12021   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
12022 }
12023
12024 static int __ATTRS_o_ai
12025 vec_all_le(vector unsigned int __a, vector unsigned int __b)
12026 {
12027   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
12028 }
12029
12030 static int __ATTRS_o_ai
12031 vec_all_le(vector unsigned int __a, vector bool int __b)
12032 {
12033   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
12034 }
12035
12036 static int __ATTRS_o_ai
12037 vec_all_le(vector bool int __a, vector int __b)
12038 {
12039   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
12040                                       (vector unsigned int)__a,
12041                                       (vector unsigned int)__b);
12042 }
12043
12044 static int __ATTRS_o_ai
12045 vec_all_le(vector bool int __a, vector unsigned int __b)
12046 {
12047   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
12048 }
12049
12050 static int __ATTRS_o_ai
12051 vec_all_le(vector bool int __a, vector bool int __b)
12052 {
12053   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
12054                                       (vector unsigned int)__a,
12055                                       (vector unsigned int)__b);
12056 }
12057
12058 #ifdef __POWER8_VECTOR__
12059 static int __ATTRS_o_ai
12060 vec_all_le(vector signed long long __a, vector signed long long __b)
12061 {
12062   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
12063 }
12064
12065 static int __ATTRS_o_ai
12066 vec_all_le(vector unsigned long long __a, vector unsigned long long __b)
12067 {
12068   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
12069 }
12070
12071 static int __ATTRS_o_ai
12072 vec_all_le(vector signed long long __a, vector bool long long __b)
12073 {
12074   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
12075                                       (vector signed long long)__b);
12076 }
12077
12078 static int __ATTRS_o_ai
12079 vec_all_le(vector unsigned long long __a, vector bool long long __b)
12080 {
12081   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, 
12082                                       (vector unsigned long long)__b);
12083 }
12084
12085 static int __ATTRS_o_ai
12086 vec_all_le(vector bool long long __a, vector signed long long __b)
12087 {
12088   return __builtin_altivec_vcmpgtud_p(__CR6_EQ,
12089                                       (vector unsigned long long)__a,
12090                                       (vector unsigned long long)__b);
12091 }
12092
12093 static int __ATTRS_o_ai
12094 vec_all_le(vector bool long long __a, vector unsigned long long __b)
12095 {
12096   return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12097                                       __b);
12098 }
12099
12100 static int __ATTRS_o_ai
12101 vec_all_le(vector bool long long __a, vector bool long long __b)
12102 {
12103   return __builtin_altivec_vcmpgtud_p(__CR6_EQ,
12104                                       (vector unsigned long long)__a,
12105                                       (vector unsigned long long)__b);
12106 }
12107 #endif
12108
12109 static int __ATTRS_o_ai
12110 vec_all_le(vector float __a, vector float __b)
12111 {
12112   return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
12113 }
12114
12115 /* vec_all_lt */
12116
12117 static int __ATTRS_o_ai
12118 vec_all_lt(vector signed char __a, vector signed char __b)
12119 {
12120   return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
12121 }
12122
12123 static int __ATTRS_o_ai
12124 vec_all_lt(vector signed char __a, vector bool char __b)
12125 {
12126   return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
12127 }
12128
12129 static int __ATTRS_o_ai
12130 vec_all_lt(vector unsigned char __a, vector unsigned char __b)
12131 {
12132   return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
12133 }
12134
12135 static int __ATTRS_o_ai
12136 vec_all_lt(vector unsigned char __a, vector bool char __b)
12137 {
12138   return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
12139 }
12140
12141 static int __ATTRS_o_ai
12142 vec_all_lt(vector bool char __a, vector signed char __b)
12143 {
12144   return __builtin_altivec_vcmpgtub_p(__CR6_LT,
12145                                       (vector unsigned char)__b,
12146                                       (vector unsigned char)__a);
12147 }
12148
12149 static int __ATTRS_o_ai
12150 vec_all_lt(vector bool char __a, vector unsigned char __b)
12151 {
12152   return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
12153 }
12154
12155 static int __ATTRS_o_ai
12156 vec_all_lt(vector bool char __a, vector bool char __b)
12157 {
12158   return __builtin_altivec_vcmpgtub_p(__CR6_LT,
12159                                       (vector unsigned char)__b,
12160                                       (vector unsigned char)__a);
12161 }
12162
12163 static int __ATTRS_o_ai
12164 vec_all_lt(vector short __a, vector short __b)
12165 {
12166   return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
12167 }
12168
12169 static int __ATTRS_o_ai
12170 vec_all_lt(vector short __a, vector bool short __b)
12171 {
12172   return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
12173 }
12174
12175 static int __ATTRS_o_ai
12176 vec_all_lt(vector unsigned short __a, vector unsigned short __b)
12177 {
12178   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
12179 }
12180
12181 static int __ATTRS_o_ai
12182 vec_all_lt(vector unsigned short __a, vector bool short __b)
12183 {
12184   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b, __a);
12185 }
12186
12187 static int __ATTRS_o_ai
12188 vec_all_lt(vector bool short __a, vector short __b)
12189 {
12190   return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
12191                                       (vector unsigned short)__b,
12192                                       (vector unsigned short)__a);
12193 }
12194
12195 static int __ATTRS_o_ai
12196 vec_all_lt(vector bool short __a, vector unsigned short __b)
12197 {
12198   return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, (vector unsigned short)__a);
12199 }
12200
12201 static int __ATTRS_o_ai
12202 vec_all_lt(vector bool short __a, vector bool short __b)
12203 {
12204   return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
12205                                       (vector unsigned short)__b,
12206                                       (vector unsigned short)__a);
12207 }
12208
12209 static int __ATTRS_o_ai
12210 vec_all_lt(vector int __a, vector int __b)
12211 {
12212   return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
12213 }
12214
12215 static int __ATTRS_o_ai
12216 vec_all_lt(vector int __a, vector bool int __b)
12217 {
12218   return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
12219 }
12220
12221 static int __ATTRS_o_ai
12222 vec_all_lt(vector unsigned int __a, vector unsigned int __b)
12223 {
12224   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
12225 }
12226
12227 static int __ATTRS_o_ai
12228 vec_all_lt(vector unsigned int __a, vector bool int __b)
12229 {
12230   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
12231 }
12232
12233 static int __ATTRS_o_ai
12234 vec_all_lt(vector bool int __a, vector int __b)
12235 {
12236   return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
12237                                       (vector unsigned int)__b,
12238                                       (vector unsigned int)__a);
12239 }
12240
12241 static int __ATTRS_o_ai
12242 vec_all_lt(vector bool int __a, vector unsigned int __b)
12243 {
12244   return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
12245 }
12246
12247 static int __ATTRS_o_ai
12248 vec_all_lt(vector bool int __a, vector bool int __b)
12249 {
12250   return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
12251                                       (vector unsigned int)__b,
12252                                       (vector unsigned int)__a);
12253 }
12254
12255 #ifdef __POWER8_VECTOR__
12256 static int __ATTRS_o_ai
12257 vec_all_lt(vector signed long long __a, vector signed long long __b)
12258 {
12259   return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
12260 }
12261
12262 static int __ATTRS_o_ai
12263 vec_all_lt(vector unsigned long long __a, vector unsigned long long __b)
12264 {
12265   return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
12266 }
12267
12268 static int __ATTRS_o_ai
12269 vec_all_lt(vector signed long long __a, vector bool long long __b)
12270 {
12271   return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
12272                                       __a);
12273 }
12274
12275 static int __ATTRS_o_ai
12276 vec_all_lt(vector unsigned long long __a, vector bool long long __b)
12277 {
12278   return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12279                                       __a);
12280 }
12281
12282 static int __ATTRS_o_ai
12283 vec_all_lt(vector bool long long __a, vector signed long long __b)
12284 {
12285   return __builtin_altivec_vcmpgtud_p(__CR6_LT,
12286                                       (vector unsigned long long)__b,
12287                                       (vector unsigned long long)__a);
12288 }
12289
12290 static int __ATTRS_o_ai
12291 vec_all_lt(vector bool long long __a, vector unsigned long long __b)
12292 {
12293   return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
12294                                       (vector unsigned long long)__a);
12295 }
12296
12297 static int __ATTRS_o_ai
12298 vec_all_lt(vector bool long long __a, vector bool long long __b)
12299 {
12300   return __builtin_altivec_vcmpgtud_p(__CR6_LT,
12301                                       (vector unsigned long long)__b,
12302                                       (vector unsigned long long)__a);
12303 }
12304 #endif
12305
12306 static int __ATTRS_o_ai
12307 vec_all_lt(vector float __a, vector float __b)
12308 {
12309   return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
12310 }
12311
12312 /* vec_all_nan */
12313
12314 static int __attribute__((__always_inline__))
12315 vec_all_nan(vector float __a)
12316 {
12317   return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
12318 }
12319
12320 /* vec_all_ne */
12321
12322 static int __ATTRS_o_ai
12323 vec_all_ne(vector signed char __a, vector signed char __b)
12324 {
12325   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12326 }
12327
12328 static int __ATTRS_o_ai
12329 vec_all_ne(vector signed char __a, vector bool char __b)
12330 {
12331   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12332 }
12333
12334 static int __ATTRS_o_ai
12335 vec_all_ne(vector unsigned char __a, vector unsigned char __b)
12336 {
12337   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12338 }
12339
12340 static int __ATTRS_o_ai
12341 vec_all_ne(vector unsigned char __a, vector bool char __b)
12342 {
12343   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12344 }
12345
12346 static int __ATTRS_o_ai
12347 vec_all_ne(vector bool char __a, vector signed char __b)
12348 {
12349   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12350 }
12351
12352 static int __ATTRS_o_ai
12353 vec_all_ne(vector bool char __a, vector unsigned char __b)
12354 {
12355   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12356 }
12357
12358 static int __ATTRS_o_ai
12359 vec_all_ne(vector bool char __a, vector bool char __b)
12360 {
12361   return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
12362 }
12363
12364 static int __ATTRS_o_ai
12365 vec_all_ne(vector short __a, vector short __b)
12366 {
12367   return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
12368 }
12369
12370 static int __ATTRS_o_ai
12371 vec_all_ne(vector short __a, vector bool short __b)
12372 {
12373   return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
12374 }
12375
12376 static int __ATTRS_o_ai
12377 vec_all_ne(vector unsigned short __a, vector unsigned short __b)
12378 {
12379   return
12380     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12381 }
12382
12383 static int __ATTRS_o_ai
12384 vec_all_ne(vector unsigned short __a, vector bool short __b)
12385 {
12386   return
12387     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12388 }
12389
12390 static int __ATTRS_o_ai
12391 vec_all_ne(vector bool short __a, vector short __b)
12392 {
12393   return
12394     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12395 }
12396
12397 static int __ATTRS_o_ai
12398 vec_all_ne(vector bool short __a, vector unsigned short __b)
12399 {
12400   return
12401     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12402 }
12403
12404 static int __ATTRS_o_ai
12405 vec_all_ne(vector bool short __a, vector bool short __b)
12406 {
12407   return
12408     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12409 }
12410
12411 static int __ATTRS_o_ai
12412 vec_all_ne(vector pixel __a, vector pixel __b)
12413 {
12414   return
12415     __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
12416 }
12417
12418 static int __ATTRS_o_ai
12419 vec_all_ne(vector int __a, vector int __b)
12420 {
12421   return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
12422 }
12423
12424 static int __ATTRS_o_ai
12425 vec_all_ne(vector int __a, vector bool int __b)
12426 {
12427   return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
12428 }
12429
12430 static int __ATTRS_o_ai
12431 vec_all_ne(vector unsigned int __a, vector unsigned int __b)
12432 {
12433   return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
12434 }
12435
12436 static int __ATTRS_o_ai
12437 vec_all_ne(vector unsigned int __a, vector bool int __b)
12438 {
12439   return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
12440 }
12441
12442 static int __ATTRS_o_ai
12443 vec_all_ne(vector bool int __a, vector int __b)
12444 {
12445   return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
12446 }
12447
12448 static int __ATTRS_o_ai
12449 vec_all_ne(vector bool int __a, vector unsigned int __b)
12450 {
12451   return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
12452 }
12453
12454 static int __ATTRS_o_ai
12455 vec_all_ne(vector bool int __a, vector bool int __b)
12456 {
12457   return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
12458 }
12459
12460 #ifdef __POWER8_VECTOR__
12461 static int __ATTRS_o_ai
12462 vec_all_ne(vector signed long long __a, vector signed long long __b)
12463 {
12464   return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
12465 }
12466
12467 static int __ATTRS_o_ai
12468 vec_all_ne(vector unsigned long long __a, vector unsigned long long __b)
12469 {
12470   return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a, 
12471                                       (vector long long)__b);
12472 }
12473
12474 static int __ATTRS_o_ai
12475 vec_all_ne(vector signed long long __a, vector bool long long __b)
12476 {
12477   return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
12478                                       (vector signed long long)__b);
12479 }
12480
12481 static int __ATTRS_o_ai
12482 vec_all_ne(vector unsigned long long __a, vector bool long long __b)
12483 {
12484   return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, 
12485                                       (vector signed long long)__b);
12486 }
12487
12488 static int __ATTRS_o_ai
12489 vec_all_ne(vector bool long long __a, vector signed long long __b)
12490 {
12491   return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
12492                                       (vector signed long long)__b);
12493 }
12494
12495 static int __ATTRS_o_ai
12496 vec_all_ne(vector bool long long __a, vector unsigned long long __b)
12497 {
12498   return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, 
12499                                       (vector signed long long)__b);
12500 }
12501
12502 static int __ATTRS_o_ai
12503 vec_all_ne(vector bool long long __a, vector bool long long __b)
12504 {
12505   return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, 
12506                                       (vector signed long long)__b);
12507 }
12508 #endif
12509
12510 static int __ATTRS_o_ai
12511 vec_all_ne(vector float __a, vector float __b)
12512 {
12513   return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
12514 }
12515
12516 /* vec_all_nge */
12517
12518 static int __attribute__((__always_inline__))
12519 vec_all_nge(vector float __a, vector float __b)
12520 {
12521   return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
12522 }
12523
12524 /* vec_all_ngt */
12525
12526 static int __attribute__((__always_inline__))
12527 vec_all_ngt(vector float __a, vector float __b)
12528 {
12529   return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
12530 }
12531
12532 /* vec_all_nle */
12533
12534 static int __attribute__((__always_inline__))
12535 vec_all_nle(vector float __a, vector float __b)
12536 {
12537   return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
12538 }
12539
12540 /* vec_all_nlt */
12541
12542 static int __attribute__((__always_inline__))
12543 vec_all_nlt(vector float __a, vector float __b)
12544 {
12545   return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
12546 }
12547
12548 /* vec_all_numeric */
12549
12550 static int __attribute__((__always_inline__))
12551 vec_all_numeric(vector float __a)
12552 {
12553   return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
12554 }
12555
12556 /* vec_any_eq */
12557
12558 static int __ATTRS_o_ai
12559 vec_any_eq(vector signed char __a, vector signed char __b)
12560 {
12561   return
12562     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12563 }
12564
12565 static int __ATTRS_o_ai
12566 vec_any_eq(vector signed char __a, vector bool char __b)
12567 {
12568   return
12569     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12570 }
12571
12572 static int __ATTRS_o_ai
12573 vec_any_eq(vector unsigned char __a, vector unsigned char __b)
12574 {
12575   return
12576     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12577 }
12578
12579 static int __ATTRS_o_ai
12580 vec_any_eq(vector unsigned char __a, vector bool char __b)
12581 {
12582   return
12583     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12584 }
12585
12586 static int __ATTRS_o_ai
12587 vec_any_eq(vector bool char __a, vector signed char __b)
12588 {
12589   return
12590     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12591 }
12592
12593 static int __ATTRS_o_ai
12594 vec_any_eq(vector bool char __a, vector unsigned char __b)
12595 {
12596   return
12597     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12598 }
12599
12600 static int __ATTRS_o_ai
12601 vec_any_eq(vector bool char __a, vector bool char __b)
12602 {
12603   return
12604     __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
12605 }
12606
12607 static int __ATTRS_o_ai
12608 vec_any_eq(vector short __a, vector short __b)
12609 {
12610   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
12611 }
12612
12613 static int __ATTRS_o_ai
12614 vec_any_eq(vector short __a, vector bool short __b)
12615 {
12616   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
12617 }
12618
12619 static int __ATTRS_o_ai
12620 vec_any_eq(vector unsigned short __a, vector unsigned short __b)
12621 {
12622   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, 
12623                                       (vector short)__a,
12624                                       (vector short)__b);
12625 }
12626
12627 static int __ATTRS_o_ai
12628 vec_any_eq(vector unsigned short __a, vector bool short __b)
12629 {
12630   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, 
12631                                       (vector short)__a,
12632                                       (vector short)__b);
12633 }
12634
12635 static int __ATTRS_o_ai
12636 vec_any_eq(vector bool short __a, vector short __b)
12637 {
12638   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
12639                                       (vector short)__a,
12640                                       (vector short)__b);
12641 }
12642
12643 static int __ATTRS_o_ai
12644 vec_any_eq(vector bool short __a, vector unsigned short __b)
12645 {
12646   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
12647                                       (vector short)__a,
12648                                       (vector short)__b);
12649 }
12650
12651 static int __ATTRS_o_ai
12652 vec_any_eq(vector bool short __a, vector bool short __b)
12653 {
12654   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
12655                                       (vector short)__a,
12656                                       (vector short)__b);
12657 }
12658
12659 static int __ATTRS_o_ai
12660 vec_any_eq(vector pixel __a, vector pixel __b)
12661 {
12662   return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, 
12663                                       (vector short)__a,
12664                                       (vector short)__b);
12665 }
12666
12667 static int __ATTRS_o_ai
12668 vec_any_eq(vector int __a, vector int __b)
12669 {
12670   return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
12671 }
12672
12673 static int __ATTRS_o_ai
12674 vec_any_eq(vector int __a, vector bool int __b)
12675 {
12676   return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
12677 }
12678
12679 static int __ATTRS_o_ai
12680 vec_any_eq(vector unsigned int __a, vector unsigned int __b)
12681 {
12682   return
12683     __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
12684 }
12685
12686 static int __ATTRS_o_ai
12687 vec_any_eq(vector unsigned int __a, vector bool int __b)
12688 {
12689   return
12690     __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
12691 }
12692
12693 static int __ATTRS_o_ai
12694 vec_any_eq(vector bool int __a, vector int __b)
12695 {
12696   return
12697     __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
12698 }
12699
12700 static int __ATTRS_o_ai
12701 vec_any_eq(vector bool int __a, vector unsigned int __b)
12702 {
12703   return
12704     __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
12705 }
12706
12707 static int __ATTRS_o_ai
12708 vec_any_eq(vector bool int __a, vector bool int __b)
12709 {
12710   return
12711     __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
12712 }
12713
12714 #ifdef __POWER8_VECTOR__
12715 static int __ATTRS_o_ai
12716 vec_any_eq(vector signed long long __a, vector signed long long __b)
12717 {
12718   return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
12719 }
12720
12721 static int __ATTRS_o_ai
12722 vec_any_eq(vector unsigned long long __a, vector unsigned long long __b)
12723 {
12724   return
12725     __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a, 
12726                                  (vector long long)__b);
12727 }
12728
12729 static int __ATTRS_o_ai
12730 vec_any_eq(vector signed long long __a, vector bool long long __b)
12731 {
12732   return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
12733                                       (vector signed long long)__b);
12734 }
12735
12736 static int __ATTRS_o_ai
12737 vec_any_eq(vector unsigned long long __a, vector bool long long __b)
12738 {
12739   return
12740     __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, 
12741                                  (vector signed long long)__b);
12742 }
12743
12744 static int __ATTRS_o_ai
12745 vec_any_eq(vector bool long long __a, vector signed long long __b)
12746 {
12747   return
12748     __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, 
12749                                  (vector signed long long)__b);
12750 }
12751
12752 static int __ATTRS_o_ai
12753 vec_any_eq(vector bool long long __a, vector unsigned long long __b)
12754 {
12755   return
12756     __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, 
12757                                  (vector signed long long)__b);
12758 }
12759
12760 static int __ATTRS_o_ai
12761 vec_any_eq(vector bool long long __a, vector bool long long __b)
12762 {
12763   return
12764     __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, 
12765                                  (vector signed long long)__b);
12766 }
12767 #endif
12768
12769 static int __ATTRS_o_ai
12770 vec_any_eq(vector float __a, vector float __b)
12771 {
12772   return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
12773 }
12774
12775 /* vec_any_ge */
12776
12777 static int __ATTRS_o_ai
12778 vec_any_ge(vector signed char __a, vector signed char __b)
12779 {
12780   return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
12781 }
12782
12783 static int __ATTRS_o_ai
12784 vec_any_ge(vector signed char __a, vector bool char __b)
12785 {
12786   return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b, __a);
12787 }
12788
12789 static int __ATTRS_o_ai
12790 vec_any_ge(vector unsigned char __a, vector unsigned char __b)
12791 {
12792   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
12793 }
12794
12795 static int __ATTRS_o_ai
12796 vec_any_ge(vector unsigned char __a, vector bool char __b)
12797 {
12798   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b, __a);
12799 }
12800
12801 static int __ATTRS_o_ai
12802 vec_any_ge(vector bool char __a, vector signed char __b)
12803 {
12804   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
12805                                       (vector unsigned char)__b,
12806                                       (vector unsigned char)__a);
12807 }
12808
12809 static int __ATTRS_o_ai
12810 vec_any_ge(vector bool char __a, vector unsigned char __b)
12811 {
12812   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, (vector unsigned char)__a);
12813 }
12814
12815 static int __ATTRS_o_ai
12816 vec_any_ge(vector bool char __a, vector bool char __b)
12817 {
12818   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
12819                                       (vector unsigned char)__b,
12820                                       (vector unsigned char)__a);
12821 }
12822
12823 static int __ATTRS_o_ai
12824 vec_any_ge(vector short __a, vector short __b)
12825 {
12826   return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
12827 }
12828
12829 static int __ATTRS_o_ai
12830 vec_any_ge(vector short __a, vector bool short __b)
12831 {
12832   return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
12833 }
12834
12835 static int __ATTRS_o_ai
12836 vec_any_ge(vector unsigned short __a, vector unsigned short __b)
12837 {
12838   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
12839 }
12840
12841 static int __ATTRS_o_ai
12842 vec_any_ge(vector unsigned short __a, vector bool short __b)
12843 {
12844   return
12845     __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b, __a);
12846 }
12847
12848 static int __ATTRS_o_ai
12849 vec_any_ge(vector bool short __a, vector short __b)
12850 {
12851   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
12852                                       (vector unsigned short)__b,
12853                                       (vector unsigned short)__a);
12854 }
12855
12856 static int __ATTRS_o_ai
12857 vec_any_ge(vector bool short __a, vector unsigned short __b)
12858 {
12859   return 
12860     __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, (vector unsigned short)__a);
12861 }
12862
12863 static int __ATTRS_o_ai
12864 vec_any_ge(vector bool short __a, vector bool short __b)
12865 {
12866   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
12867                                       (vector unsigned short)__b,
12868                                       (vector unsigned short)__a);
12869 }
12870
12871 static int __ATTRS_o_ai
12872 vec_any_ge(vector int __a, vector int __b)
12873 {
12874   return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
12875 }
12876
12877 static int __ATTRS_o_ai
12878 vec_any_ge(vector int __a, vector bool int __b)
12879 {
12880   return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
12881 }
12882
12883 static int __ATTRS_o_ai
12884 vec_any_ge(vector unsigned int __a, vector unsigned int __b)
12885 {
12886   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
12887 }
12888
12889 static int __ATTRS_o_ai
12890 vec_any_ge(vector unsigned int __a, vector bool int __b)
12891 {
12892   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b, __a);
12893 }
12894
12895 static int __ATTRS_o_ai
12896 vec_any_ge(vector bool int __a, vector int __b)
12897 {
12898   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
12899                                       (vector unsigned int)__b,
12900                                       (vector unsigned int)__a);
12901 }
12902
12903 static int __ATTRS_o_ai
12904 vec_any_ge(vector bool int __a, vector unsigned int __b)
12905 {
12906   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, (vector unsigned int)__a);
12907 }
12908
12909 static int __ATTRS_o_ai
12910 vec_any_ge(vector bool int __a, vector bool int __b)
12911 {
12912   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
12913                                       (vector unsigned int)__b,
12914                                       (vector unsigned int)__a);
12915 }
12916
12917 #ifdef __POWER8_VECTOR__
12918 static int __ATTRS_o_ai
12919 vec_any_ge(vector signed long long __a, vector signed long long __b)
12920 {
12921   return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
12922 }
12923
12924 static int __ATTRS_o_ai
12925 vec_any_ge(vector unsigned long long __a, vector unsigned long long __b)
12926 {
12927   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
12928 }
12929
12930 static int __ATTRS_o_ai
12931 vec_any_ge(vector signed long long __a, vector bool long long __b)
12932 {
12933   return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
12934                                       (vector signed long long)__b, __a);
12935 }
12936
12937 static int __ATTRS_o_ai
12938 vec_any_ge(vector unsigned long long __a, vector bool long long __b)
12939 {
12940   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, 
12941                                       (vector unsigned long long)__b, __a);
12942 }
12943
12944 static int __ATTRS_o_ai
12945 vec_any_ge(vector bool long long __a, vector signed long long __b)
12946 {
12947   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
12948                                       (vector unsigned long long)__b,
12949                                       (vector unsigned long long)__a);
12950 }
12951
12952 static int __ATTRS_o_ai
12953 vec_any_ge(vector bool long long __a, vector unsigned long long __b)
12954 {
12955   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
12956                                       (vector unsigned long long)__a);
12957 }
12958
12959 static int __ATTRS_o_ai
12960 vec_any_ge(vector bool long long __a, vector bool long long __b)
12961 {
12962   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
12963                                       (vector unsigned long long)__b,
12964                                       (vector unsigned long long)__a);
12965 }
12966 #endif
12967
12968 static int __ATTRS_o_ai
12969 vec_any_ge(vector float __a, vector float __b)
12970 {
12971   return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
12972 }
12973
12974 /* vec_any_gt */
12975
12976 static int __ATTRS_o_ai
12977 vec_any_gt(vector signed char __a, vector signed char __b)
12978 {
12979   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
12980 }
12981
12982 static int __ATTRS_o_ai
12983 vec_any_gt(vector signed char __a, vector bool char __b)
12984 {
12985   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, (vector signed char)__b);
12986 }
12987
12988 static int __ATTRS_o_ai
12989 vec_any_gt(vector unsigned char __a, vector unsigned char __b)
12990 {
12991   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
12992 }
12993
12994 static int __ATTRS_o_ai
12995 vec_any_gt(vector unsigned char __a, vector bool char __b)
12996 {
12997   return 
12998     __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, (vector unsigned char)__b);
12999 }
13000
13001 static int __ATTRS_o_ai
13002 vec_any_gt(vector bool char __a, vector signed char __b)
13003 {
13004   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
13005                                       (vector unsigned char)__a,
13006                                       (vector unsigned char)__b);
13007 }
13008
13009 static int __ATTRS_o_ai
13010 vec_any_gt(vector bool char __a, vector unsigned char __b)
13011 {
13012   return 
13013     __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a, __b);
13014 }
13015
13016 static int __ATTRS_o_ai
13017 vec_any_gt(vector bool char __a, vector bool char __b)
13018 {
13019   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
13020                                       (vector unsigned char)__a,
13021                                       (vector unsigned char)__b);
13022 }
13023
13024 static int __ATTRS_o_ai
13025 vec_any_gt(vector short __a, vector short __b)
13026 {
13027   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
13028 }
13029
13030 static int __ATTRS_o_ai
13031 vec_any_gt(vector short __a, vector bool short __b)
13032 {
13033   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
13034 }
13035
13036 static int __ATTRS_o_ai
13037 vec_any_gt(vector unsigned short __a, vector unsigned short __b)
13038 {
13039   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
13040 }
13041
13042 static int __ATTRS_o_ai
13043 vec_any_gt(vector unsigned short __a, vector bool short __b)
13044 {
13045   return 
13046     __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, (vector unsigned short)__b);
13047 }
13048
13049 static int __ATTRS_o_ai
13050 vec_any_gt(vector bool short __a, vector short __b)
13051 {
13052   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
13053                                       (vector unsigned short)__a,
13054                                       (vector unsigned short)__b);
13055 }
13056
13057 static int __ATTRS_o_ai
13058 vec_any_gt(vector bool short __a, vector unsigned short __b)
13059 {
13060   return
13061     __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a, __b);
13062 }
13063
13064 static int __ATTRS_o_ai
13065 vec_any_gt(vector bool short __a, vector bool short __b)
13066 {
13067   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
13068                                       (vector unsigned short)__a,
13069                                       (vector unsigned short)__b);
13070 }
13071
13072 static int __ATTRS_o_ai
13073 vec_any_gt(vector int __a, vector int __b)
13074 {
13075   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
13076 }
13077
13078 static int __ATTRS_o_ai
13079 vec_any_gt(vector int __a, vector bool int __b)
13080 {
13081   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
13082 }
13083
13084 static int __ATTRS_o_ai
13085 vec_any_gt(vector unsigned int __a, vector unsigned int __b)
13086 {
13087   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
13088 }
13089
13090 static int __ATTRS_o_ai
13091 vec_any_gt(vector unsigned int __a, vector bool int __b)
13092 {
13093   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, (vector unsigned int)__b);
13094 }
13095
13096 static int __ATTRS_o_ai
13097 vec_any_gt(vector bool int __a, vector int __b)
13098 {
13099   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
13100                                       (vector unsigned int)__a,
13101                                       (vector unsigned int)__b);
13102 }
13103
13104 static int __ATTRS_o_ai
13105 vec_any_gt(vector bool int __a, vector unsigned int __b)
13106 {
13107   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a, __b);
13108 }
13109
13110 static int __ATTRS_o_ai
13111 vec_any_gt(vector bool int __a, vector bool int __b)
13112 {
13113   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
13114                                       (vector unsigned int)__a,
13115                                       (vector unsigned int)__b);
13116 }
13117
13118 #ifdef __POWER8_VECTOR__
13119 static int __ATTRS_o_ai
13120 vec_any_gt(vector signed long long __a, vector signed long long __b)
13121 {
13122   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
13123 }
13124
13125 static int __ATTRS_o_ai
13126 vec_any_gt(vector unsigned long long __a, vector unsigned long long __b)
13127 {
13128   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
13129 }
13130
13131 static int __ATTRS_o_ai
13132 vec_any_gt(vector signed long long __a, vector bool long long __b)
13133 {
13134   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
13135                                       (vector signed long long)__b);
13136 }
13137
13138
13139 static int __ATTRS_o_ai
13140 vec_any_gt(vector unsigned long long __a, vector bool long long __b)
13141 {
13142   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, 
13143                                       (vector unsigned long long)__b);
13144 }
13145
13146 static int __ATTRS_o_ai
13147 vec_any_gt(vector bool long long __a, vector signed long long __b)
13148 {
13149   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13150                                       (vector unsigned long long)__a,
13151                                       (vector unsigned long long)__b);
13152 }
13153
13154 static int __ATTRS_o_ai
13155 vec_any_gt(vector bool long long __a, vector unsigned long long __b)
13156 {
13157   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, 
13158                                       (vector unsigned long long)__a, __b);
13159 }
13160
13161 static int __ATTRS_o_ai
13162 vec_any_gt(vector bool long long __a, vector bool long long __b)
13163 {
13164   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13165                                       (vector unsigned long long)__a,
13166                                       (vector unsigned long long)__b);
13167 }
13168 #endif
13169
13170 static int __ATTRS_o_ai
13171 vec_any_gt(vector float __a, vector float __b)
13172 {
13173   return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
13174 }
13175
13176 /* vec_any_le */
13177
13178 static int __ATTRS_o_ai
13179 vec_any_le(vector signed char __a, vector signed char __b)
13180 {
13181   return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
13182 }
13183
13184 static int __ATTRS_o_ai
13185 vec_any_le(vector signed char __a, vector bool char __b)
13186 {
13187   return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, (vector signed char)__b);
13188 }
13189
13190 static int __ATTRS_o_ai
13191 vec_any_le(vector unsigned char __a, vector unsigned char __b)
13192 {
13193   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
13194 }
13195
13196 static int __ATTRS_o_ai
13197 vec_any_le(vector unsigned char __a, vector bool char __b)
13198 {
13199   return 
13200     __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, (vector unsigned char)__b);
13201 }
13202
13203 static int __ATTRS_o_ai
13204 vec_any_le(vector bool char __a, vector signed char __b)
13205 {
13206   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
13207                                       (vector unsigned char)__a,
13208                                       (vector unsigned char)__b);
13209 }
13210
13211 static int __ATTRS_o_ai
13212 vec_any_le(vector bool char __a, vector unsigned char __b)
13213 {
13214   return 
13215     __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a, __b);
13216 }
13217
13218 static int __ATTRS_o_ai
13219 vec_any_le(vector bool char __a, vector bool char __b)
13220 {
13221   return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
13222                                       (vector unsigned char)__a,
13223                                       (vector unsigned char)__b);
13224 }
13225
13226 static int __ATTRS_o_ai
13227 vec_any_le(vector short __a, vector short __b)
13228 {
13229   return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
13230 }
13231
13232 static int __ATTRS_o_ai
13233 vec_any_le(vector short __a, vector bool short __b)
13234 {
13235   return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
13236 }
13237
13238 static int __ATTRS_o_ai
13239 vec_any_le(vector unsigned short __a, vector unsigned short __b)
13240 {
13241   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
13242 }
13243
13244 static int __ATTRS_o_ai
13245 vec_any_le(vector unsigned short __a, vector bool short __b)
13246 {
13247   return 
13248     __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, (vector unsigned short)__b);
13249 }
13250
13251 static int __ATTRS_o_ai
13252 vec_any_le(vector bool short __a, vector short __b)
13253 {
13254   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
13255                                       (vector unsigned short)__a,
13256                                       (vector unsigned short)__b);
13257 }
13258
13259 static int __ATTRS_o_ai
13260 vec_any_le(vector bool short __a, vector unsigned short __b)
13261 {
13262   return 
13263     __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a, __b);
13264 }
13265
13266 static int __ATTRS_o_ai
13267 vec_any_le(vector bool short __a, vector bool short __b)
13268 {
13269   return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
13270                                       (vector unsigned short)__a,
13271                                       (vector unsigned short)__b);
13272 }
13273
13274 static int __ATTRS_o_ai
13275 vec_any_le(vector int __a, vector int __b)
13276 {
13277   return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
13278 }
13279
13280 static int __ATTRS_o_ai
13281 vec_any_le(vector int __a, vector bool int __b)
13282 {
13283   return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
13284 }
13285
13286 static int __ATTRS_o_ai
13287 vec_any_le(vector unsigned int __a, vector unsigned int __b)
13288 {
13289   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
13290 }
13291
13292 static int __ATTRS_o_ai
13293 vec_any_le(vector unsigned int __a, vector bool int __b)
13294 {
13295   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, (vector unsigned int)__b);
13296 }
13297
13298 static int __ATTRS_o_ai
13299 vec_any_le(vector bool int __a, vector int __b)
13300 {
13301   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
13302                                       (vector unsigned int)__a,
13303                                       (vector unsigned int)__b);
13304 }
13305
13306 static int __ATTRS_o_ai
13307 vec_any_le(vector bool int __a, vector unsigned int __b)
13308 {
13309   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a, __b);
13310 }
13311
13312 static int __ATTRS_o_ai
13313 vec_any_le(vector bool int __a, vector bool int __b)
13314 {
13315   return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
13316                                       (vector unsigned int)__a,
13317                                       (vector unsigned int)__b);
13318 }
13319
13320 #ifdef __POWER8_VECTOR__
13321 static int __ATTRS_o_ai
13322 vec_any_le(vector signed long long __a, vector signed long long __b)
13323 {
13324   return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
13325 }
13326
13327 static int __ATTRS_o_ai
13328 vec_any_le(vector unsigned long long __a, vector unsigned long long __b)
13329 {
13330   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
13331 }
13332
13333 static int __ATTRS_o_ai
13334 vec_any_le(vector signed long long __a, vector bool long long __b)
13335 {
13336   return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
13337                                       (vector signed long long)__b);
13338 }
13339
13340 static int __ATTRS_o_ai
13341 vec_any_le(vector unsigned long long __a, vector bool long long __b)
13342 {
13343   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, 
13344                                       (vector unsigned long long)__b);
13345 }
13346
13347 static int __ATTRS_o_ai
13348 vec_any_le(vector bool long long __a, vector signed long long __b)
13349 {
13350   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13351                                       (vector unsigned long long)__a,
13352                                       (vector unsigned long long)__b);
13353 }
13354
13355 static int __ATTRS_o_ai
13356 vec_any_le(vector bool long long __a, vector unsigned long long __b)
13357 {
13358   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, 
13359                                       (vector unsigned long long)__a, __b);
13360 }
13361
13362 static int __ATTRS_o_ai
13363 vec_any_le(vector bool long long __a, vector bool long long __b)
13364 {
13365   return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13366                                       (vector unsigned long long)__a,
13367                                       (vector unsigned long long)__b);
13368 }
13369 #endif
13370
13371 static int __ATTRS_o_ai
13372 vec_any_le(vector float __a, vector float __b)
13373 {
13374   return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
13375 }
13376
13377 /* vec_any_lt */
13378
13379 static int __ATTRS_o_ai
13380 vec_any_lt(vector signed char __a, vector signed char __b)
13381 {
13382   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
13383 }
13384
13385 static int __ATTRS_o_ai
13386 vec_any_lt(vector signed char __a, vector bool char __b)
13387 {
13388   return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b, __a);
13389 }
13390
13391 static int __ATTRS_o_ai
13392 vec_any_lt(vector unsigned char __a, vector unsigned char __b)
13393 {
13394   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
13395 }
13396
13397 static int __ATTRS_o_ai
13398 vec_any_lt(vector unsigned char __a, vector bool char __b)
13399 {
13400   return 
13401     __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b, __a);
13402 }
13403
13404 static int __ATTRS_o_ai
13405 vec_any_lt(vector bool char __a, vector signed char __b)
13406 {
13407   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
13408                                       (vector unsigned char)__b,
13409                                       (vector unsigned char)__a);
13410 }
13411
13412 static int __ATTRS_o_ai
13413 vec_any_lt(vector bool char __a, vector unsigned char __b)
13414 {
13415   return 
13416     __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, (vector unsigned char)__a);
13417 }
13418
13419 static int __ATTRS_o_ai
13420 vec_any_lt(vector bool char __a, vector bool char __b)
13421 {
13422   return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
13423                                       (vector unsigned char)__b,
13424                                       (vector unsigned char)__a);
13425 }
13426
13427 static int __ATTRS_o_ai
13428 vec_any_lt(vector short __a, vector short __b)
13429 {
13430   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
13431 }
13432
13433 static int __ATTRS_o_ai
13434 vec_any_lt(vector short __a, vector bool short __b)
13435 {
13436   return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
13437 }
13438
13439 static int __ATTRS_o_ai
13440 vec_any_lt(vector unsigned short __a, vector unsigned short __b)
13441 {
13442   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
13443 }
13444
13445 static int __ATTRS_o_ai
13446 vec_any_lt(vector unsigned short __a, vector bool short __b)
13447 {
13448   return 
13449     __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b, __a);
13450 }
13451
13452 static int __ATTRS_o_ai
13453 vec_any_lt(vector bool short __a, vector short __b)
13454 {
13455   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
13456                                       (vector unsigned short)__b,
13457                                       (vector unsigned short)__a);
13458 }
13459
13460 static int __ATTRS_o_ai
13461 vec_any_lt(vector bool short __a, vector unsigned short __b)
13462 {
13463   return 
13464     __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, (vector unsigned short)__a);
13465 }
13466
13467 static int __ATTRS_o_ai
13468 vec_any_lt(vector bool short __a, vector bool short __b)
13469 {
13470   return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
13471                                       (vector unsigned short)__b,
13472                                       (vector unsigned short)__a);
13473 }
13474
13475 static int __ATTRS_o_ai
13476 vec_any_lt(vector int __a, vector int __b)
13477 {
13478   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
13479 }
13480
13481 static int __ATTRS_o_ai
13482 vec_any_lt(vector int __a, vector bool int __b)
13483 {
13484   return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
13485 }
13486
13487 static int __ATTRS_o_ai
13488 vec_any_lt(vector unsigned int __a, vector unsigned int __b)
13489 {
13490   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
13491 }
13492
13493 static int __ATTRS_o_ai
13494 vec_any_lt(vector unsigned int __a, vector bool int __b)
13495 {
13496   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b, __a);
13497 }
13498
13499 static int __ATTRS_o_ai
13500 vec_any_lt(vector bool int __a, vector int __b)
13501 {
13502   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
13503                                       (vector unsigned int)__b,
13504                                       (vector unsigned int)__a);
13505 }
13506
13507 static int __ATTRS_o_ai
13508 vec_any_lt(vector bool int __a, vector unsigned int __b)
13509 {
13510   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, (vector unsigned int)__a);
13511 }
13512
13513 static int __ATTRS_o_ai
13514 vec_any_lt(vector bool int __a, vector bool int __b)
13515 {
13516   return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
13517                                       (vector unsigned int)__b,
13518                                       (vector unsigned int)__a);
13519 }
13520
13521 #ifdef __POWER8_VECTOR__
13522 static int __ATTRS_o_ai
13523 vec_any_lt(vector signed long long __a, vector signed long long __b)
13524 {
13525   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
13526 }
13527
13528 static int __ATTRS_o_ai
13529 vec_any_lt(vector unsigned long long __a, vector unsigned long long __b)
13530 {
13531   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
13532 }
13533
13534 static int __ATTRS_o_ai
13535 vec_any_lt(vector signed long long __a, vector bool long long __b)
13536 {
13537   return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
13538                                       (vector signed long long)__b, __a);
13539 }
13540
13541 static int __ATTRS_o_ai
13542 vec_any_lt(vector unsigned long long __a, vector bool long long __b)
13543 {
13544   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, 
13545                                       (vector unsigned long long)__b, __a);
13546 }
13547
13548 static int __ATTRS_o_ai
13549 vec_any_lt(vector bool long long __a, vector signed long long __b)
13550 {
13551   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13552                                       (vector unsigned long long)__b,
13553                                       (vector unsigned long long)__a);
13554 }
13555
13556 static int __ATTRS_o_ai
13557 vec_any_lt(vector bool long long __a, vector unsigned long long __b)
13558 {
13559   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, 
13560                                       (vector unsigned long long)__a);
13561 }
13562
13563 static int __ATTRS_o_ai
13564 vec_any_lt(vector bool long long __a, vector bool long long __b)
13565 {
13566   return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13567                                       (vector unsigned long long)__b,
13568                                       (vector unsigned long long)__a);
13569 }
13570 #endif
13571
13572 static int __ATTRS_o_ai
13573 vec_any_lt(vector float __a, vector float __b)
13574 {
13575   return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
13576 }
13577
13578 /* vec_any_nan */
13579
13580 static int __attribute__((__always_inline__))
13581 vec_any_nan(vector float __a)
13582 {
13583   return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
13584 }
13585
13586 /* vec_any_ne */
13587
13588 static int __ATTRS_o_ai
13589 vec_any_ne(vector signed char __a, vector signed char __b)
13590 {
13591   return
13592     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13593 }
13594
13595 static int __ATTRS_o_ai
13596 vec_any_ne(vector signed char __a, vector bool char __b)
13597 {
13598   return
13599     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13600 }
13601
13602 static int __ATTRS_o_ai
13603 vec_any_ne(vector unsigned char __a, vector unsigned char __b)
13604 {
13605   return
13606     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13607 }
13608
13609 static int __ATTRS_o_ai
13610 vec_any_ne(vector unsigned char __a, vector bool char __b)
13611 {
13612   return
13613     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13614 }
13615
13616 static int __ATTRS_o_ai
13617 vec_any_ne(vector bool char __a, vector signed char __b)
13618 {
13619   return
13620     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13621 }
13622
13623 static int __ATTRS_o_ai
13624 vec_any_ne(vector bool char __a, vector unsigned char __b)
13625 {
13626   return
13627     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13628 }
13629
13630 static int __ATTRS_o_ai
13631 vec_any_ne(vector bool char __a, vector bool char __b)
13632 {
13633   return
13634     __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
13635 }
13636
13637 static int __ATTRS_o_ai
13638 vec_any_ne(vector short __a, vector short __b)
13639 {
13640   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
13641 }
13642
13643 static int __ATTRS_o_ai
13644 vec_any_ne(vector short __a, vector bool short __b)
13645 {
13646   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
13647 }
13648
13649 static int __ATTRS_o_ai
13650 vec_any_ne(vector unsigned short __a, vector unsigned short __b)
13651 {
13652   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, 
13653                                       (vector short)__a,
13654                                       (vector short)__b);
13655 }
13656
13657 static int __ATTRS_o_ai
13658 vec_any_ne(vector unsigned short __a, vector bool short __b)
13659 {
13660   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
13661                                       (vector short)__a,
13662                                       (vector short)__b);
13663 }
13664
13665 static int __ATTRS_o_ai
13666 vec_any_ne(vector bool short __a, vector short __b)
13667 {
13668   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
13669                                       (vector short)__a,
13670                                       (vector short)__b);
13671 }
13672
13673 static int __ATTRS_o_ai
13674 vec_any_ne(vector bool short __a, vector unsigned short __b)
13675 {
13676   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
13677                                       (vector short)__a,
13678                                       (vector short)__b);
13679 }
13680
13681 static int __ATTRS_o_ai
13682 vec_any_ne(vector bool short __a, vector bool short __b)
13683 {
13684   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
13685                                       (vector short)__a,
13686                                       (vector short)__b);
13687 }
13688
13689 static int __ATTRS_o_ai
13690 vec_any_ne(vector pixel __a, vector pixel __b)
13691 {
13692   return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
13693                                       (vector short)__a,
13694                                       (vector short)__b);
13695 }
13696
13697 static int __ATTRS_o_ai
13698 vec_any_ne(vector int __a, vector int __b)
13699 {
13700   return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
13701 }
13702
13703 static int __ATTRS_o_ai
13704 vec_any_ne(vector int __a, vector bool int __b)
13705 {
13706   return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
13707 }
13708
13709 static int __ATTRS_o_ai
13710 vec_any_ne(vector unsigned int __a, vector unsigned int __b)
13711 {
13712   return
13713     __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
13714 }
13715
13716 static int __ATTRS_o_ai
13717 vec_any_ne(vector unsigned int __a, vector bool int __b)
13718 {
13719   return
13720     __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
13721 }
13722
13723 static int __ATTRS_o_ai
13724 vec_any_ne(vector bool int __a, vector int __b)
13725 {
13726   return
13727     __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
13728 }
13729
13730 static int __ATTRS_o_ai
13731 vec_any_ne(vector bool int __a, vector unsigned int __b)
13732 {
13733   return
13734     __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
13735 }
13736
13737 static int __ATTRS_o_ai
13738 vec_any_ne(vector bool int __a, vector bool int __b)
13739 {
13740   return
13741     __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
13742 }
13743
13744 #ifdef __POWER8_VECTOR__
13745 static int __ATTRS_o_ai
13746 vec_any_ne(vector signed long long __a, vector signed long long __b)
13747 {
13748   return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
13749 }
13750
13751 static int __ATTRS_o_ai
13752 vec_any_ne(vector unsigned long long __a, vector unsigned long long __b)
13753 {
13754   return
13755     __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a, 
13756                                  (vector long long)__b);
13757 }
13758
13759 static int __ATTRS_o_ai
13760 vec_any_ne(vector signed long long __a, vector bool long long __b)
13761 {
13762   return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
13763                                       (vector signed long long)__b);
13764 }
13765
13766 static int __ATTRS_o_ai
13767 vec_any_ne(vector unsigned long long __a, vector bool long long __b)
13768 {
13769   return
13770     __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, 
13771                                  (vector signed long long)__b);
13772 }
13773
13774 static int __ATTRS_o_ai
13775 vec_any_ne(vector bool long long __a, vector signed long long __b)
13776 {
13777   return
13778     __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, 
13779                                  (vector signed long long)__b);
13780 }
13781
13782 static int __ATTRS_o_ai
13783 vec_any_ne(vector bool long long __a, vector unsigned long long __b)
13784 {
13785   return
13786     __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, 
13787                                  (vector signed long long)__b);
13788 }
13789
13790 static int __ATTRS_o_ai
13791 vec_any_ne(vector bool long long __a, vector bool long long __b)
13792 {
13793   return
13794     __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, 
13795                                  (vector signed long long)__b);
13796 }
13797 #endif
13798
13799 static int __ATTRS_o_ai
13800 vec_any_ne(vector float __a, vector float __b)
13801 {
13802   return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
13803 }
13804
13805 /* vec_any_nge */
13806
13807 static int __attribute__((__always_inline__))
13808 vec_any_nge(vector float __a, vector float __b)
13809 {
13810   return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
13811 }
13812
13813 /* vec_any_ngt */
13814
13815 static int __attribute__((__always_inline__))
13816 vec_any_ngt(vector float __a, vector float __b)
13817 {
13818   return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
13819 }
13820
13821 /* vec_any_nle */
13822
13823 static int __attribute__((__always_inline__))
13824 vec_any_nle(vector float __a, vector float __b)
13825 {
13826   return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
13827 }
13828
13829 /* vec_any_nlt */
13830
13831 static int __attribute__((__always_inline__))
13832 vec_any_nlt(vector float __a, vector float __b)
13833 {
13834   return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
13835 }
13836
13837 /* vec_any_numeric */
13838
13839 static int __attribute__((__always_inline__))
13840 vec_any_numeric(vector float __a)
13841 {
13842   return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
13843 }
13844
13845 /* vec_any_out */
13846
13847 static int __attribute__((__always_inline__))
13848 vec_any_out(vector float __a, vector float __b)
13849 {
13850   return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
13851 }
13852
13853 /* Power 8 Crypto functions
13854 Note: We diverge from the current GCC implementation with regard
13855 to cryptography and related functions as follows:
13856 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
13857 - The remaining ones are only available on Power8 and up so
13858   require -mpower8-vector
13859 The justification for this is that export requirements require that
13860 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
13861 support). As a result, we need to be able to turn off support for those.
13862 The remaining ones (currently controlled by -mcrypto for GCC) still
13863 need to be provided on compliant hardware even if Vector.Crypto is not
13864 provided.
13865 FIXME: the naming convention for the builtins will be adjusted due
13866 to the inconsistency (__builtin_crypto_ prefix on builtins that cannot be
13867 removed with -mno-crypto). This is under development.
13868 */
13869 #ifdef __CRYPTO__
13870 static vector unsigned long long __attribute__((__always_inline__))
13871 __builtin_crypto_vsbox (vector unsigned long long __a)
13872 {
13873   return __builtin_altivec_crypto_vsbox(__a);
13874 }
13875
13876 static vector unsigned long long __attribute__((__always_inline__))
13877 __builtin_crypto_vcipher (vector unsigned long long __a,
13878                           vector unsigned long long __b)
13879 {
13880   return __builtin_altivec_crypto_vcipher(__a, __b);
13881 }
13882
13883 static vector unsigned long long __attribute__((__always_inline__))
13884 __builtin_crypto_vcipherlast (vector unsigned long long __a,
13885                               vector unsigned long long __b)
13886 {
13887   return __builtin_altivec_crypto_vcipherlast(__a, __b);
13888 }
13889
13890 static vector unsigned long long __attribute__((__always_inline__))
13891 __builtin_crypto_vncipher (vector unsigned long long __a,
13892                            vector unsigned long long __b)
13893 {
13894   return __builtin_altivec_crypto_vncipher(__a, __b);
13895 }
13896
13897 static vector unsigned long long __attribute__((__always_inline__))
13898 __builtin_crypto_vncipherlast (vector unsigned long long __a,
13899                                vector unsigned long long __b)
13900 {
13901   return __builtin_altivec_crypto_vncipherlast(__a, __b);
13902 }
13903
13904
13905 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
13906 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
13907 #endif
13908
13909 #ifdef __POWER8_VECTOR__
13910 static vector unsigned char __ATTRS_o_ai
13911 __builtin_crypto_vpermxor (vector unsigned char __a,
13912                            vector unsigned char __b,
13913                            vector unsigned char __c)
13914 {
13915   return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
13916 }
13917
13918 static vector unsigned short __ATTRS_o_ai
13919 __builtin_crypto_vpermxor (vector unsigned short __a,
13920                            vector unsigned short __b,
13921                            vector unsigned short __c)
13922 {
13923   return (vector unsigned short)
13924           __builtin_altivec_crypto_vpermxor((vector unsigned char) __a,
13925                                              (vector unsigned char) __b,
13926                                              (vector unsigned char) __c);
13927 }
13928
13929 static vector unsigned int __ATTRS_o_ai
13930 __builtin_crypto_vpermxor (vector unsigned int __a,
13931                            vector unsigned int __b,
13932                            vector unsigned int __c)
13933 {
13934   return (vector unsigned int)
13935           __builtin_altivec_crypto_vpermxor((vector unsigned char) __a,
13936                                               (vector unsigned char) __b,
13937                                               (vector unsigned char) __c);
13938 }
13939
13940 static vector unsigned long long __ATTRS_o_ai
13941 __builtin_crypto_vpermxor (vector unsigned long long __a,
13942                            vector unsigned long long __b,
13943                            vector unsigned long long __c)
13944 {
13945   return (vector unsigned long long)
13946           __builtin_altivec_crypto_vpermxor((vector unsigned char) __a,
13947                                               (vector unsigned char) __b,
13948                                               (vector unsigned char) __c);
13949 }
13950
13951 static vector unsigned char __ATTRS_o_ai
13952 __builtin_crypto_vpmsumb (vector unsigned char __a,
13953                           vector unsigned char __b)
13954 {
13955   return __builtin_altivec_crypto_vpmsumb(__a, __b);
13956 }
13957
13958 static vector unsigned short __ATTRS_o_ai
13959 __builtin_crypto_vpmsumb (vector unsigned short __a,
13960                           vector unsigned short __b)
13961 {
13962   return __builtin_altivec_crypto_vpmsumh(__a, __b);
13963 }
13964
13965 static vector unsigned int __ATTRS_o_ai
13966 __builtin_crypto_vpmsumb (vector unsigned int __a,
13967                           vector unsigned int __b)
13968 {
13969   return __builtin_altivec_crypto_vpmsumw(__a, __b);
13970 }
13971
13972 static vector unsigned long long __ATTRS_o_ai
13973 __builtin_crypto_vpmsumb (vector unsigned long long __a,
13974                           vector unsigned long long __b)
13975 {
13976   return __builtin_altivec_crypto_vpmsumd(__a, __b);
13977 }
13978 #endif
13979
13980 #undef __ATTRS_o_ai
13981
13982 #endif /* __ALTIVEC_H */