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