1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
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:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
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
21 \*===----------------------------------------------------------------------===*/
27 #error "AltiVec support not enabled"
30 /* Constants for mapping CR6 bits to predicate result. */
33 #define __CR6_EQ_REV 1
35 #define __CR6_LT_REV 3
37 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
39 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
40 vector signed char __a, vector signed char __b, vector unsigned char __c);
42 static __inline__ vector unsigned char __ATTRS_o_ai
43 vec_perm(vector unsigned char __a, vector unsigned char __b,
44 vector unsigned char __c);
46 static __inline__ vector bool char __ATTRS_o_ai
47 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
49 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
50 vector signed short __b,
51 vector unsigned char __c);
53 static __inline__ vector unsigned short __ATTRS_o_ai
54 vec_perm(vector unsigned short __a, vector unsigned short __b,
55 vector unsigned char __c);
57 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
58 vector bool short __a, vector bool short __b, vector unsigned char __c);
60 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
62 vector unsigned char __c);
64 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
65 vector signed int __b,
66 vector unsigned char __c);
68 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
69 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
71 static __inline__ vector bool int __ATTRS_o_ai
72 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
74 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
76 vector unsigned char __c);
79 static __inline__ vector long long __ATTRS_o_ai
80 vec_perm(vector signed long long __a, vector signed long long __b,
81 vector unsigned char __c);
83 static __inline__ vector unsigned long long __ATTRS_o_ai
84 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
85 vector unsigned char __c);
87 static __inline__ vector bool long long __ATTRS_o_ai
88 vec_perm(vector bool long long __a, vector bool long long __b,
89 vector unsigned char __c);
91 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
93 vector unsigned char __c);
96 static __inline__ vector unsigned char __ATTRS_o_ai
97 vec_xor(vector unsigned char __a, vector unsigned char __b);
101 #define __builtin_altivec_abs_v16qi vec_abs
102 #define __builtin_altivec_abs_v8hi vec_abs
103 #define __builtin_altivec_abs_v4si vec_abs
105 static __inline__ vector signed char __ATTRS_o_ai
106 vec_abs(vector signed char __a) {
107 return __builtin_altivec_vmaxsb(__a, -__a);
110 static __inline__ vector signed short __ATTRS_o_ai
111 vec_abs(vector signed short __a) {
112 return __builtin_altivec_vmaxsh(__a, -__a);
115 static __inline__ vector signed int __ATTRS_o_ai
116 vec_abs(vector signed int __a) {
117 return __builtin_altivec_vmaxsw(__a, -__a);
120 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
121 static __inline__ vector signed long long __ATTRS_o_ai
122 vec_abs(vector signed long long __a) {
123 return __builtin_altivec_vmaxsd(__a, -__a);
127 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
129 return __builtin_vsx_xvabssp(__a);
131 vector unsigned int __res =
132 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
133 return (vector float)__res;
137 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
138 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
139 return __builtin_vsx_xvabsdp(__a);
144 #define __builtin_altivec_abss_v16qi vec_abss
145 #define __builtin_altivec_abss_v8hi vec_abss
146 #define __builtin_altivec_abss_v4si vec_abss
148 static __inline__ vector signed char __ATTRS_o_ai
149 vec_abss(vector signed char __a) {
150 return __builtin_altivec_vmaxsb(
151 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
154 static __inline__ vector signed short __ATTRS_o_ai
155 vec_abss(vector signed short __a) {
156 return __builtin_altivec_vmaxsh(
157 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
160 static __inline__ vector signed int __ATTRS_o_ai
161 vec_abss(vector signed int __a) {
162 return __builtin_altivec_vmaxsw(
163 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
168 static __inline__ vector signed char __ATTRS_o_ai
169 vec_add(vector signed char __a, vector signed char __b) {
173 static __inline__ vector signed char __ATTRS_o_ai
174 vec_add(vector bool char __a, vector signed char __b) {
175 return (vector signed char)__a + __b;
178 static __inline__ vector signed char __ATTRS_o_ai
179 vec_add(vector signed char __a, vector bool char __b) {
180 return __a + (vector signed char)__b;
183 static __inline__ vector unsigned char __ATTRS_o_ai
184 vec_add(vector unsigned char __a, vector unsigned char __b) {
188 static __inline__ vector unsigned char __ATTRS_o_ai
189 vec_add(vector bool char __a, vector unsigned char __b) {
190 return (vector unsigned char)__a + __b;
193 static __inline__ vector unsigned char __ATTRS_o_ai
194 vec_add(vector unsigned char __a, vector bool char __b) {
195 return __a + (vector unsigned char)__b;
198 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
203 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
205 return (vector short)__a + __b;
208 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
209 vector bool short __b) {
210 return __a + (vector short)__b;
213 static __inline__ vector unsigned short __ATTRS_o_ai
214 vec_add(vector unsigned short __a, vector unsigned short __b) {
218 static __inline__ vector unsigned short __ATTRS_o_ai
219 vec_add(vector bool short __a, vector unsigned short __b) {
220 return (vector unsigned short)__a + __b;
223 static __inline__ vector unsigned short __ATTRS_o_ai
224 vec_add(vector unsigned short __a, vector bool short __b) {
225 return __a + (vector unsigned short)__b;
228 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
233 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
235 return (vector int)__a + __b;
238 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
239 vector bool int __b) {
240 return __a + (vector int)__b;
243 static __inline__ vector unsigned int __ATTRS_o_ai
244 vec_add(vector unsigned int __a, vector unsigned int __b) {
248 static __inline__ vector unsigned int __ATTRS_o_ai
249 vec_add(vector bool int __a, vector unsigned int __b) {
250 return (vector unsigned int)__a + __b;
253 static __inline__ vector unsigned int __ATTRS_o_ai
254 vec_add(vector unsigned int __a, vector bool int __b) {
255 return __a + (vector unsigned int)__b;
258 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
259 static __inline__ vector signed long long __ATTRS_o_ai
260 vec_add(vector signed long long __a, vector signed long long __b) {
264 static __inline__ vector unsigned long long __ATTRS_o_ai
265 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
269 static __inline__ vector signed __int128 __ATTRS_o_ai
270 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
274 static __inline__ vector unsigned __int128 __ATTRS_o_ai
275 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
278 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
280 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
286 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
294 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
295 static __inline__ vector signed __int128 __ATTRS_o_ai
296 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
297 vector signed __int128 __c) {
298 return __builtin_altivec_vaddeuqm(__a, __b, __c);
301 static __inline__ vector unsigned __int128 __ATTRS_o_ai
302 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
303 vector unsigned __int128 __c) {
304 return __builtin_altivec_vaddeuqm(__a, __b, __c);
310 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
311 static __inline__ vector signed __int128 __ATTRS_o_ai
312 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
313 vector signed __int128 __c) {
314 return __builtin_altivec_vaddecuq(__a, __b, __c);
317 static __inline__ vector unsigned __int128 __ATTRS_o_ai
318 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
319 vector unsigned __int128 __c) {
320 return __builtin_altivec_vaddecuq(__a, __b, __c);
326 #define __builtin_altivec_vaddubm vec_vaddubm
328 static __inline__ vector signed char __ATTRS_o_ai
329 vec_vaddubm(vector signed char __a, vector signed char __b) {
333 static __inline__ vector signed char __ATTRS_o_ai
334 vec_vaddubm(vector bool char __a, vector signed char __b) {
335 return (vector signed char)__a + __b;
338 static __inline__ vector signed char __ATTRS_o_ai
339 vec_vaddubm(vector signed char __a, vector bool char __b) {
340 return __a + (vector signed char)__b;
343 static __inline__ vector unsigned char __ATTRS_o_ai
344 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
348 static __inline__ vector unsigned char __ATTRS_o_ai
349 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
350 return (vector unsigned char)__a + __b;
353 static __inline__ vector unsigned char __ATTRS_o_ai
354 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
355 return __a + (vector unsigned char)__b;
360 #define __builtin_altivec_vadduhm vec_vadduhm
362 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
367 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
369 return (vector short)__a + __b;
372 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
373 vector bool short __b) {
374 return __a + (vector short)__b;
377 static __inline__ vector unsigned short __ATTRS_o_ai
378 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
382 static __inline__ vector unsigned short __ATTRS_o_ai
383 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
384 return (vector unsigned short)__a + __b;
387 static __inline__ vector unsigned short __ATTRS_o_ai
388 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
389 return __a + (vector unsigned short)__b;
394 #define __builtin_altivec_vadduwm vec_vadduwm
396 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
401 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
403 return (vector int)__a + __b;
406 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
407 vector bool int __b) {
408 return __a + (vector int)__b;
411 static __inline__ vector unsigned int __ATTRS_o_ai
412 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
416 static __inline__ vector unsigned int __ATTRS_o_ai
417 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
418 return (vector unsigned int)__a + __b;
421 static __inline__ vector unsigned int __ATTRS_o_ai
422 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
423 return __a + (vector unsigned int)__b;
428 #define __builtin_altivec_vaddfp vec_vaddfp
430 static __inline__ vector float __attribute__((__always_inline__))
431 vec_vaddfp(vector float __a, vector float __b) {
437 static __inline__ vector signed int __ATTRS_o_ai
438 vec_addc(vector signed int __a, vector signed int __b) {
439 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
440 (vector unsigned int)__b);
443 static __inline__ vector unsigned int __ATTRS_o_ai
444 vec_addc(vector unsigned int __a, vector unsigned int __b) {
445 return __builtin_altivec_vaddcuw(__a, __b);
448 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
449 static __inline__ vector signed __int128 __ATTRS_o_ai
450 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
451 return (vector signed __int128)__builtin_altivec_vaddcuq(
452 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
455 static __inline__ vector unsigned __int128 __ATTRS_o_ai
456 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
457 return __builtin_altivec_vaddcuq(__a, __b);
459 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
463 static __inline__ vector unsigned int __attribute__((__always_inline__))
464 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
465 return __builtin_altivec_vaddcuw(__a, __b);
470 static __inline__ vector signed char __ATTRS_o_ai
471 vec_adds(vector signed char __a, vector signed char __b) {
472 return __builtin_altivec_vaddsbs(__a, __b);
475 static __inline__ vector signed char __ATTRS_o_ai
476 vec_adds(vector bool char __a, vector signed char __b) {
477 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
480 static __inline__ vector signed char __ATTRS_o_ai
481 vec_adds(vector signed char __a, vector bool char __b) {
482 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
485 static __inline__ vector unsigned char __ATTRS_o_ai
486 vec_adds(vector unsigned char __a, vector unsigned char __b) {
487 return __builtin_altivec_vaddubs(__a, __b);
490 static __inline__ vector unsigned char __ATTRS_o_ai
491 vec_adds(vector bool char __a, vector unsigned char __b) {
492 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
495 static __inline__ vector unsigned char __ATTRS_o_ai
496 vec_adds(vector unsigned char __a, vector bool char __b) {
497 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
500 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
502 return __builtin_altivec_vaddshs(__a, __b);
505 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
507 return __builtin_altivec_vaddshs((vector short)__a, __b);
510 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
511 vector bool short __b) {
512 return __builtin_altivec_vaddshs(__a, (vector short)__b);
515 static __inline__ vector unsigned short __ATTRS_o_ai
516 vec_adds(vector unsigned short __a, vector unsigned short __b) {
517 return __builtin_altivec_vadduhs(__a, __b);
520 static __inline__ vector unsigned short __ATTRS_o_ai
521 vec_adds(vector bool short __a, vector unsigned short __b) {
522 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
525 static __inline__ vector unsigned short __ATTRS_o_ai
526 vec_adds(vector unsigned short __a, vector bool short __b) {
527 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
530 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
532 return __builtin_altivec_vaddsws(__a, __b);
535 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
537 return __builtin_altivec_vaddsws((vector int)__a, __b);
540 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
541 vector bool int __b) {
542 return __builtin_altivec_vaddsws(__a, (vector int)__b);
545 static __inline__ vector unsigned int __ATTRS_o_ai
546 vec_adds(vector unsigned int __a, vector unsigned int __b) {
547 return __builtin_altivec_vadduws(__a, __b);
550 static __inline__ vector unsigned int __ATTRS_o_ai
551 vec_adds(vector bool int __a, vector unsigned int __b) {
552 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
555 static __inline__ vector unsigned int __ATTRS_o_ai
556 vec_adds(vector unsigned int __a, vector bool int __b) {
557 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
562 static __inline__ vector signed char __ATTRS_o_ai
563 vec_vaddsbs(vector signed char __a, vector signed char __b) {
564 return __builtin_altivec_vaddsbs(__a, __b);
567 static __inline__ vector signed char __ATTRS_o_ai
568 vec_vaddsbs(vector bool char __a, vector signed char __b) {
569 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
572 static __inline__ vector signed char __ATTRS_o_ai
573 vec_vaddsbs(vector signed char __a, vector bool char __b) {
574 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
579 static __inline__ vector unsigned char __ATTRS_o_ai
580 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
581 return __builtin_altivec_vaddubs(__a, __b);
584 static __inline__ vector unsigned char __ATTRS_o_ai
585 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
586 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
589 static __inline__ vector unsigned char __ATTRS_o_ai
590 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
591 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
596 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
598 return __builtin_altivec_vaddshs(__a, __b);
601 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
603 return __builtin_altivec_vaddshs((vector short)__a, __b);
606 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
607 vector bool short __b) {
608 return __builtin_altivec_vaddshs(__a, (vector short)__b);
613 static __inline__ vector unsigned short __ATTRS_o_ai
614 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
615 return __builtin_altivec_vadduhs(__a, __b);
618 static __inline__ vector unsigned short __ATTRS_o_ai
619 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
620 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
623 static __inline__ vector unsigned short __ATTRS_o_ai
624 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
625 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
630 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
632 return __builtin_altivec_vaddsws(__a, __b);
635 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
637 return __builtin_altivec_vaddsws((vector int)__a, __b);
640 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
641 vector bool int __b) {
642 return __builtin_altivec_vaddsws(__a, (vector int)__b);
647 static __inline__ vector unsigned int __ATTRS_o_ai
648 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
649 return __builtin_altivec_vadduws(__a, __b);
652 static __inline__ vector unsigned int __ATTRS_o_ai
653 vec_vadduws(vector bool int __a, vector unsigned int __b) {
654 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
657 static __inline__ vector unsigned int __ATTRS_o_ai
658 vec_vadduws(vector unsigned int __a, vector bool int __b) {
659 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
662 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
665 static __inline__ vector signed __int128 __ATTRS_o_ai
666 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
670 static __inline__ vector unsigned __int128 __ATTRS_o_ai
671 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
677 static __inline__ vector signed __int128 __ATTRS_o_ai
678 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
679 vector signed __int128 __c) {
680 return __builtin_altivec_vaddeuqm(__a, __b, __c);
683 static __inline__ vector unsigned __int128 __ATTRS_o_ai
684 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
685 vector unsigned __int128 __c) {
686 return __builtin_altivec_vaddeuqm(__a, __b, __c);
691 static __inline__ vector signed __int128 __ATTRS_o_ai
692 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
693 return __builtin_altivec_vaddcuq(__a, __b);
696 static __inline__ vector unsigned __int128 __ATTRS_o_ai
697 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
698 return __builtin_altivec_vaddcuq(__a, __b);
703 static __inline__ vector signed __int128 __ATTRS_o_ai
704 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
705 vector signed __int128 __c) {
706 return __builtin_altivec_vaddecuq(__a, __b, __c);
709 static __inline__ vector unsigned __int128 __ATTRS_o_ai
710 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
711 vector unsigned __int128 __c) {
712 return __builtin_altivec_vaddecuq(__a, __b, __c);
714 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
718 #define __builtin_altivec_vand vec_and
720 static __inline__ vector signed char __ATTRS_o_ai
721 vec_and(vector signed char __a, vector signed char __b) {
725 static __inline__ vector signed char __ATTRS_o_ai
726 vec_and(vector bool char __a, vector signed char __b) {
727 return (vector signed char)__a & __b;
730 static __inline__ vector signed char __ATTRS_o_ai
731 vec_and(vector signed char __a, vector bool char __b) {
732 return __a & (vector signed char)__b;
735 static __inline__ vector unsigned char __ATTRS_o_ai
736 vec_and(vector unsigned char __a, vector unsigned char __b) {
740 static __inline__ vector unsigned char __ATTRS_o_ai
741 vec_and(vector bool char __a, vector unsigned char __b) {
742 return (vector unsigned char)__a & __b;
745 static __inline__ vector unsigned char __ATTRS_o_ai
746 vec_and(vector unsigned char __a, vector bool char __b) {
747 return __a & (vector unsigned char)__b;
750 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
751 vector bool char __b) {
755 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
760 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
762 return (vector short)__a & __b;
765 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
766 vector bool short __b) {
767 return __a & (vector short)__b;
770 static __inline__ vector unsigned short __ATTRS_o_ai
771 vec_and(vector unsigned short __a, vector unsigned short __b) {
775 static __inline__ vector unsigned short __ATTRS_o_ai
776 vec_and(vector bool short __a, vector unsigned short __b) {
777 return (vector unsigned short)__a & __b;
780 static __inline__ vector unsigned short __ATTRS_o_ai
781 vec_and(vector unsigned short __a, vector bool short __b) {
782 return __a & (vector unsigned short)__b;
785 static __inline__ vector bool short __ATTRS_o_ai
786 vec_and(vector bool short __a, vector bool short __b) {
790 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
795 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
797 return (vector int)__a & __b;
800 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
801 vector bool int __b) {
802 return __a & (vector int)__b;
805 static __inline__ vector unsigned int __ATTRS_o_ai
806 vec_and(vector unsigned int __a, vector unsigned int __b) {
810 static __inline__ vector unsigned int __ATTRS_o_ai
811 vec_and(vector bool int __a, vector unsigned int __b) {
812 return (vector unsigned int)__a & __b;
815 static __inline__ vector unsigned int __ATTRS_o_ai
816 vec_and(vector unsigned int __a, vector bool int __b) {
817 return __a & (vector unsigned int)__b;
820 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
821 vector bool int __b) {
825 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
827 vector unsigned int __res =
828 (vector unsigned int)__a & (vector unsigned int)__b;
829 return (vector float)__res;
832 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
834 vector unsigned int __res =
835 (vector unsigned int)__a & (vector unsigned int)__b;
836 return (vector float)__res;
839 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
840 vector bool int __b) {
841 vector unsigned int __res =
842 (vector unsigned int)__a & (vector unsigned int)__b;
843 return (vector float)__res;
847 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
849 vector unsigned long long __res =
850 (vector unsigned long long)__a & (vector unsigned long long)__b;
851 return (vector double)__res;
854 static __inline__ vector double __ATTRS_o_ai
855 vec_and(vector double __a, vector bool long long __b) {
856 vector unsigned long long __res =
857 (vector unsigned long long)__a & (vector unsigned long long)__b;
858 return (vector double)__res;
861 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
863 vector unsigned long long __res =
864 (vector unsigned long long)__a & (vector unsigned long long)__b;
865 return (vector double)__res;
868 static __inline__ vector signed long long __ATTRS_o_ai
869 vec_and(vector signed long long __a, vector signed long long __b) {
873 static __inline__ vector signed long long __ATTRS_o_ai
874 vec_and(vector bool long long __a, vector signed long long __b) {
875 return (vector signed long long)__a & __b;
878 static __inline__ vector signed long long __ATTRS_o_ai
879 vec_and(vector signed long long __a, vector bool long long __b) {
880 return __a & (vector signed long long)__b;
883 static __inline__ vector unsigned long long __ATTRS_o_ai
884 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
888 static __inline__ vector unsigned long long __ATTRS_o_ai
889 vec_and(vector bool long long __a, vector unsigned long long __b) {
890 return (vector unsigned long long)__a & __b;
893 static __inline__ vector unsigned long long __ATTRS_o_ai
894 vec_and(vector unsigned long long __a, vector bool long long __b) {
895 return __a & (vector unsigned long long)__b;
898 static __inline__ vector bool long long __ATTRS_o_ai
899 vec_and(vector bool long long __a, vector bool long long __b) {
906 static __inline__ vector signed char __ATTRS_o_ai
907 vec_vand(vector signed char __a, vector signed char __b) {
911 static __inline__ vector signed char __ATTRS_o_ai
912 vec_vand(vector bool char __a, vector signed char __b) {
913 return (vector signed char)__a & __b;
916 static __inline__ vector signed char __ATTRS_o_ai
917 vec_vand(vector signed char __a, vector bool char __b) {
918 return __a & (vector signed char)__b;
921 static __inline__ vector unsigned char __ATTRS_o_ai
922 vec_vand(vector unsigned char __a, vector unsigned char __b) {
926 static __inline__ vector unsigned char __ATTRS_o_ai
927 vec_vand(vector bool char __a, vector unsigned char __b) {
928 return (vector unsigned char)__a & __b;
931 static __inline__ vector unsigned char __ATTRS_o_ai
932 vec_vand(vector unsigned char __a, vector bool char __b) {
933 return __a & (vector unsigned char)__b;
936 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
937 vector bool char __b) {
941 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
946 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
948 return (vector short)__a & __b;
951 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
952 vector bool short __b) {
953 return __a & (vector short)__b;
956 static __inline__ vector unsigned short __ATTRS_o_ai
957 vec_vand(vector unsigned short __a, vector unsigned short __b) {
961 static __inline__ vector unsigned short __ATTRS_o_ai
962 vec_vand(vector bool short __a, vector unsigned short __b) {
963 return (vector unsigned short)__a & __b;
966 static __inline__ vector unsigned short __ATTRS_o_ai
967 vec_vand(vector unsigned short __a, vector bool short __b) {
968 return __a & (vector unsigned short)__b;
971 static __inline__ vector bool short __ATTRS_o_ai
972 vec_vand(vector bool short __a, vector bool short __b) {
976 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
981 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
983 return (vector int)__a & __b;
986 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
987 vector bool int __b) {
988 return __a & (vector int)__b;
991 static __inline__ vector unsigned int __ATTRS_o_ai
992 vec_vand(vector unsigned int __a, vector unsigned int __b) {
996 static __inline__ vector unsigned int __ATTRS_o_ai
997 vec_vand(vector bool int __a, vector unsigned int __b) {
998 return (vector unsigned int)__a & __b;
1001 static __inline__ vector unsigned int __ATTRS_o_ai
1002 vec_vand(vector unsigned int __a, vector bool int __b) {
1003 return __a & (vector unsigned int)__b;
1006 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1007 vector bool int __b) {
1011 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1013 vector unsigned int __res =
1014 (vector unsigned int)__a & (vector unsigned int)__b;
1015 return (vector float)__res;
1018 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1020 vector unsigned int __res =
1021 (vector unsigned int)__a & (vector unsigned int)__b;
1022 return (vector float)__res;
1025 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1026 vector bool int __b) {
1027 vector unsigned int __res =
1028 (vector unsigned int)__a & (vector unsigned int)__b;
1029 return (vector float)__res;
1033 static __inline__ vector signed long long __ATTRS_o_ai
1034 vec_vand(vector signed long long __a, vector signed long long __b) {
1038 static __inline__ vector signed long long __ATTRS_o_ai
1039 vec_vand(vector bool long long __a, vector signed long long __b) {
1040 return (vector signed long long)__a & __b;
1043 static __inline__ vector signed long long __ATTRS_o_ai
1044 vec_vand(vector signed long long __a, vector bool long long __b) {
1045 return __a & (vector signed long long)__b;
1048 static __inline__ vector unsigned long long __ATTRS_o_ai
1049 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1053 static __inline__ vector unsigned long long __ATTRS_o_ai
1054 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1055 return (vector unsigned long long)__a & __b;
1058 static __inline__ vector unsigned long long __ATTRS_o_ai
1059 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1060 return __a & (vector unsigned long long)__b;
1063 static __inline__ vector bool long long __ATTRS_o_ai
1064 vec_vand(vector bool long long __a, vector bool long long __b) {
1071 #define __builtin_altivec_vandc vec_andc
1073 static __inline__ vector signed char __ATTRS_o_ai
1074 vec_andc(vector signed char __a, vector signed char __b) {
1078 static __inline__ vector signed char __ATTRS_o_ai
1079 vec_andc(vector bool char __a, vector signed char __b) {
1080 return (vector signed char)__a & ~__b;
1083 static __inline__ vector signed char __ATTRS_o_ai
1084 vec_andc(vector signed char __a, vector bool char __b) {
1085 return __a & ~(vector signed char)__b;
1088 static __inline__ vector unsigned char __ATTRS_o_ai
1089 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1093 static __inline__ vector unsigned char __ATTRS_o_ai
1094 vec_andc(vector bool char __a, vector unsigned char __b) {
1095 return (vector unsigned char)__a & ~__b;
1098 static __inline__ vector unsigned char __ATTRS_o_ai
1099 vec_andc(vector unsigned char __a, vector bool char __b) {
1100 return __a & ~(vector unsigned char)__b;
1103 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1104 vector bool char __b) {
1108 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1113 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1115 return (vector short)__a & ~__b;
1118 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1119 vector bool short __b) {
1120 return __a & ~(vector short)__b;
1123 static __inline__ vector unsigned short __ATTRS_o_ai
1124 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1128 static __inline__ vector unsigned short __ATTRS_o_ai
1129 vec_andc(vector bool short __a, vector unsigned short __b) {
1130 return (vector unsigned short)__a & ~__b;
1133 static __inline__ vector unsigned short __ATTRS_o_ai
1134 vec_andc(vector unsigned short __a, vector bool short __b) {
1135 return __a & ~(vector unsigned short)__b;
1138 static __inline__ vector bool short __ATTRS_o_ai
1139 vec_andc(vector bool short __a, vector bool short __b) {
1143 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1148 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1150 return (vector int)__a & ~__b;
1153 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1154 vector bool int __b) {
1155 return __a & ~(vector int)__b;
1158 static __inline__ vector unsigned int __ATTRS_o_ai
1159 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1163 static __inline__ vector unsigned int __ATTRS_o_ai
1164 vec_andc(vector bool int __a, vector unsigned int __b) {
1165 return (vector unsigned int)__a & ~__b;
1168 static __inline__ vector unsigned int __ATTRS_o_ai
1169 vec_andc(vector unsigned int __a, vector bool int __b) {
1170 return __a & ~(vector unsigned int)__b;
1173 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1174 vector bool int __b) {
1178 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1180 vector unsigned int __res =
1181 (vector unsigned int)__a & ~(vector unsigned int)__b;
1182 return (vector float)__res;
1185 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1187 vector unsigned int __res =
1188 (vector unsigned int)__a & ~(vector unsigned int)__b;
1189 return (vector float)__res;
1192 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1193 vector bool int __b) {
1194 vector unsigned int __res =
1195 (vector unsigned int)__a & ~(vector unsigned int)__b;
1196 return (vector float)__res;
1200 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1201 vector double __b) {
1202 vector unsigned long long __res =
1203 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1204 return (vector double)__res;
1207 static __inline__ vector double __ATTRS_o_ai
1208 vec_andc(vector double __a, vector bool long long __b) {
1209 vector unsigned long long __res =
1210 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1211 return (vector double)__res;
1214 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1215 vector double __b) {
1216 vector unsigned long long __res =
1217 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1218 return (vector double)__res;
1221 static __inline__ vector signed long long __ATTRS_o_ai
1222 vec_andc(vector signed long long __a, vector signed long long __b) {
1226 static __inline__ vector signed long long __ATTRS_o_ai
1227 vec_andc(vector bool long long __a, vector signed long long __b) {
1228 return (vector signed long long)__a & ~__b;
1231 static __inline__ vector signed long long __ATTRS_o_ai
1232 vec_andc(vector signed long long __a, vector bool long long __b) {
1233 return __a & ~(vector signed long long)__b;
1236 static __inline__ vector unsigned long long __ATTRS_o_ai
1237 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1241 static __inline__ vector unsigned long long __ATTRS_o_ai
1242 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1243 return (vector unsigned long long)__a & ~__b;
1246 static __inline__ vector unsigned long long __ATTRS_o_ai
1247 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1248 return __a & ~(vector unsigned long long)__b;
1251 static __inline__ vector bool long long __ATTRS_o_ai
1252 vec_andc(vector bool long long __a, vector bool long long __b) {
1259 static __inline__ vector signed char __ATTRS_o_ai
1260 vec_vandc(vector signed char __a, vector signed char __b) {
1264 static __inline__ vector signed char __ATTRS_o_ai
1265 vec_vandc(vector bool char __a, vector signed char __b) {
1266 return (vector signed char)__a & ~__b;
1269 static __inline__ vector signed char __ATTRS_o_ai
1270 vec_vandc(vector signed char __a, vector bool char __b) {
1271 return __a & ~(vector signed char)__b;
1274 static __inline__ vector unsigned char __ATTRS_o_ai
1275 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1279 static __inline__ vector unsigned char __ATTRS_o_ai
1280 vec_vandc(vector bool char __a, vector unsigned char __b) {
1281 return (vector unsigned char)__a & ~__b;
1284 static __inline__ vector unsigned char __ATTRS_o_ai
1285 vec_vandc(vector unsigned char __a, vector bool char __b) {
1286 return __a & ~(vector unsigned char)__b;
1289 static __inline__ vector bool char __ATTRS_o_ai
1290 vec_vandc(vector bool char __a, vector bool char __b) {
1294 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1299 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1301 return (vector short)__a & ~__b;
1304 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1305 vector bool short __b) {
1306 return __a & ~(vector short)__b;
1309 static __inline__ vector unsigned short __ATTRS_o_ai
1310 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1314 static __inline__ vector unsigned short __ATTRS_o_ai
1315 vec_vandc(vector bool short __a, vector unsigned short __b) {
1316 return (vector unsigned short)__a & ~__b;
1319 static __inline__ vector unsigned short __ATTRS_o_ai
1320 vec_vandc(vector unsigned short __a, vector bool short __b) {
1321 return __a & ~(vector unsigned short)__b;
1324 static __inline__ vector bool short __ATTRS_o_ai
1325 vec_vandc(vector bool short __a, vector bool short __b) {
1329 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1334 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1336 return (vector int)__a & ~__b;
1339 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1340 vector bool int __b) {
1341 return __a & ~(vector int)__b;
1344 static __inline__ vector unsigned int __ATTRS_o_ai
1345 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1349 static __inline__ vector unsigned int __ATTRS_o_ai
1350 vec_vandc(vector bool int __a, vector unsigned int __b) {
1351 return (vector unsigned int)__a & ~__b;
1354 static __inline__ vector unsigned int __ATTRS_o_ai
1355 vec_vandc(vector unsigned int __a, vector bool int __b) {
1356 return __a & ~(vector unsigned int)__b;
1359 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1360 vector bool int __b) {
1364 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1366 vector unsigned int __res =
1367 (vector unsigned int)__a & ~(vector unsigned int)__b;
1368 return (vector float)__res;
1371 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1373 vector unsigned int __res =
1374 (vector unsigned int)__a & ~(vector unsigned int)__b;
1375 return (vector float)__res;
1378 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1379 vector bool int __b) {
1380 vector unsigned int __res =
1381 (vector unsigned int)__a & ~(vector unsigned int)__b;
1382 return (vector float)__res;
1386 static __inline__ vector signed long long __ATTRS_o_ai
1387 vec_vandc(vector signed long long __a, vector signed long long __b) {
1391 static __inline__ vector signed long long __ATTRS_o_ai
1392 vec_vandc(vector bool long long __a, vector signed long long __b) {
1393 return (vector signed long long)__a & ~__b;
1396 static __inline__ vector signed long long __ATTRS_o_ai
1397 vec_vandc(vector signed long long __a, vector bool long long __b) {
1398 return __a & ~(vector signed long long)__b;
1401 static __inline__ vector unsigned long long __ATTRS_o_ai
1402 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1406 static __inline__ vector unsigned long long __ATTRS_o_ai
1407 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1408 return (vector unsigned long long)__a & ~__b;
1411 static __inline__ vector unsigned long long __ATTRS_o_ai
1412 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1413 return __a & ~(vector unsigned long long)__b;
1416 static __inline__ vector bool long long __ATTRS_o_ai
1417 vec_vandc(vector bool long long __a, vector bool long long __b) {
1424 static __inline__ vector signed char __ATTRS_o_ai
1425 vec_avg(vector signed char __a, vector signed char __b) {
1426 return __builtin_altivec_vavgsb(__a, __b);
1429 static __inline__ vector unsigned char __ATTRS_o_ai
1430 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1431 return __builtin_altivec_vavgub(__a, __b);
1434 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1436 return __builtin_altivec_vavgsh(__a, __b);
1439 static __inline__ vector unsigned short __ATTRS_o_ai
1440 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1441 return __builtin_altivec_vavguh(__a, __b);
1444 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1446 return __builtin_altivec_vavgsw(__a, __b);
1449 static __inline__ vector unsigned int __ATTRS_o_ai
1450 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1451 return __builtin_altivec_vavguw(__a, __b);
1456 static __inline__ vector signed char __attribute__((__always_inline__))
1457 vec_vavgsb(vector signed char __a, vector signed char __b) {
1458 return __builtin_altivec_vavgsb(__a, __b);
1463 static __inline__ vector unsigned char __attribute__((__always_inline__))
1464 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1465 return __builtin_altivec_vavgub(__a, __b);
1470 static __inline__ vector short __attribute__((__always_inline__))
1471 vec_vavgsh(vector short __a, vector short __b) {
1472 return __builtin_altivec_vavgsh(__a, __b);
1477 static __inline__ vector unsigned short __attribute__((__always_inline__))
1478 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1479 return __builtin_altivec_vavguh(__a, __b);
1484 static __inline__ vector int __attribute__((__always_inline__))
1485 vec_vavgsw(vector int __a, vector int __b) {
1486 return __builtin_altivec_vavgsw(__a, __b);
1491 static __inline__ vector unsigned int __attribute__((__always_inline__))
1492 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1493 return __builtin_altivec_vavguw(__a, __b);
1498 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1500 return __builtin_vsx_xvrspip(__a);
1502 return __builtin_altivec_vrfip(__a);
1507 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1508 return __builtin_vsx_xvrdpip(__a);
1514 static __inline__ vector float __attribute__((__always_inline__))
1515 vec_vrfip(vector float __a) {
1516 return __builtin_altivec_vrfip(__a);
1521 static __inline__ vector int __attribute__((__always_inline__))
1522 vec_cmpb(vector float __a, vector float __b) {
1523 return __builtin_altivec_vcmpbfp(__a, __b);
1528 static __inline__ vector int __attribute__((__always_inline__))
1529 vec_vcmpbfp(vector float __a, vector float __b) {
1530 return __builtin_altivec_vcmpbfp(__a, __b);
1535 static __inline__ vector bool char __ATTRS_o_ai
1536 vec_cmpeq(vector signed char __a, vector signed char __b) {
1537 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1541 static __inline__ vector bool char __ATTRS_o_ai
1542 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1543 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1547 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1549 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1552 static __inline__ vector bool short __ATTRS_o_ai
1553 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1554 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1558 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1560 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1563 static __inline__ vector bool int __ATTRS_o_ai
1564 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1565 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1569 #ifdef __POWER8_VECTOR__
1570 static __inline__ vector bool long long __ATTRS_o_ai
1571 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1572 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1575 static __inline__ vector bool long long __ATTRS_o_ai
1576 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1577 return (vector bool long long)__builtin_altivec_vcmpequd(
1578 (vector long long)__a, (vector long long)__b);
1582 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1585 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1587 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1592 static __inline__ vector bool long long __ATTRS_o_ai
1593 vec_cmpeq(vector double __a, vector double __b) {
1594 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1600 static __inline__ vector bool char __ATTRS_o_ai
1601 vec_cmpgt(vector signed char __a, vector signed char __b) {
1602 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1605 static __inline__ vector bool char __ATTRS_o_ai
1606 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1607 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1610 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1612 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1615 static __inline__ vector bool short __ATTRS_o_ai
1616 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1617 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1620 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1622 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1625 static __inline__ vector bool int __ATTRS_o_ai
1626 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1627 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1630 #ifdef __POWER8_VECTOR__
1631 static __inline__ vector bool long long __ATTRS_o_ai
1632 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1633 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1636 static __inline__ vector bool long long __ATTRS_o_ai
1637 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1638 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1642 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1645 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1647 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1652 static __inline__ vector bool long long __ATTRS_o_ai
1653 vec_cmpgt(vector double __a, vector double __b) {
1654 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1660 static __inline__ vector bool char __ATTRS_o_ai
1661 vec_cmpge(vector signed char __a, vector signed char __b) {
1662 return ~(vec_cmpgt(__b, __a));
1665 static __inline__ vector bool char __ATTRS_o_ai
1666 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1667 return ~(vec_cmpgt(__b, __a));
1670 static __inline__ vector bool short __ATTRS_o_ai
1671 vec_cmpge(vector signed short __a, vector signed short __b) {
1672 return ~(vec_cmpgt(__b, __a));
1675 static __inline__ vector bool short __ATTRS_o_ai
1676 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1677 return ~(vec_cmpgt(__b, __a));
1680 static __inline__ vector bool int __ATTRS_o_ai
1681 vec_cmpge(vector signed int __a, vector signed int __b) {
1682 return ~(vec_cmpgt(__b, __a));
1685 static __inline__ vector bool int __ATTRS_o_ai
1686 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
1687 return ~(vec_cmpgt(__b, __a));
1690 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
1693 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
1695 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1700 static __inline__ vector bool long long __ATTRS_o_ai
1701 vec_cmpge(vector double __a, vector double __b) {
1702 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
1706 #ifdef __POWER8_VECTOR__
1707 static __inline__ vector bool long long __ATTRS_o_ai
1708 vec_cmpge(vector signed long long __a, vector signed long long __b) {
1709 return ~(vec_cmpgt(__b, __a));
1712 static __inline__ vector bool long long __ATTRS_o_ai
1713 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
1714 return ~(vec_cmpgt(__b, __a));
1720 static __inline__ vector bool int __attribute__((__always_inline__))
1721 vec_vcmpgefp(vector float __a, vector float __b) {
1722 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1727 static __inline__ vector bool char __attribute__((__always_inline__))
1728 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
1729 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1734 static __inline__ vector bool char __attribute__((__always_inline__))
1735 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
1736 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1741 static __inline__ vector bool short __attribute__((__always_inline__))
1742 vec_vcmpgtsh(vector short __a, vector short __b) {
1743 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1748 static __inline__ vector bool short __attribute__((__always_inline__))
1749 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
1750 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1755 static __inline__ vector bool int __attribute__((__always_inline__))
1756 vec_vcmpgtsw(vector int __a, vector int __b) {
1757 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1762 static __inline__ vector bool int __attribute__((__always_inline__))
1763 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
1764 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1769 static __inline__ vector bool int __attribute__((__always_inline__))
1770 vec_vcmpgtfp(vector float __a, vector float __b) {
1771 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1776 static __inline__ vector bool char __ATTRS_o_ai
1777 vec_cmple(vector signed char __a, vector signed char __b) {
1778 return vec_cmpge(__b, __a);
1781 static __inline__ vector bool char __ATTRS_o_ai
1782 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
1783 return vec_cmpge(__b, __a);
1786 static __inline__ vector bool short __ATTRS_o_ai
1787 vec_cmple(vector signed short __a, vector signed short __b) {
1788 return vec_cmpge(__b, __a);
1791 static __inline__ vector bool short __ATTRS_o_ai
1792 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
1793 return vec_cmpge(__b, __a);
1796 static __inline__ vector bool int __ATTRS_o_ai
1797 vec_cmple(vector signed int __a, vector signed int __b) {
1798 return vec_cmpge(__b, __a);
1801 static __inline__ vector bool int __ATTRS_o_ai
1802 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
1803 return vec_cmpge(__b, __a);
1806 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
1808 return vec_cmpge(__b, __a);
1812 static __inline__ vector bool long long __ATTRS_o_ai
1813 vec_cmple(vector double __a, vector double __b) {
1814 return vec_cmpge(__b, __a);
1818 #ifdef __POWER8_VECTOR__
1819 static __inline__ vector bool long long __ATTRS_o_ai
1820 vec_cmple(vector signed long long __a, vector signed long long __b) {
1821 return vec_cmpge(__b, __a);
1824 static __inline__ vector bool long long __ATTRS_o_ai
1825 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
1826 return vec_cmpge(__b, __a);
1832 static __inline__ vector bool char __ATTRS_o_ai
1833 vec_cmplt(vector signed char __a, vector signed char __b) {
1834 return vec_cmpgt(__b, __a);
1837 static __inline__ vector bool char __ATTRS_o_ai
1838 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
1839 return vec_cmpgt(__b, __a);
1842 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
1844 return vec_cmpgt(__b, __a);
1847 static __inline__ vector bool short __ATTRS_o_ai
1848 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
1849 return vec_cmpgt(__b, __a);
1852 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
1854 return vec_cmpgt(__b, __a);
1857 static __inline__ vector bool int __ATTRS_o_ai
1858 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
1859 return vec_cmpgt(__b, __a);
1862 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
1864 return vec_cmpgt(__b, __a);
1868 static __inline__ vector bool long long __ATTRS_o_ai
1869 vec_cmplt(vector double __a, vector double __b) {
1870 return vec_cmpgt(__b, __a);
1874 #ifdef __POWER8_VECTOR__
1875 static __inline__ vector bool long long __ATTRS_o_ai
1876 vec_cmplt(vector signed long long __a, vector signed long long __b) {
1877 return vec_cmpgt(__b, __a);
1880 static __inline__ vector bool long long __ATTRS_o_ai
1881 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
1882 return vec_cmpgt(__b, __a);
1887 static __inline__ vector signed char __ATTRS_o_ai
1888 vec_cntlz(vector signed char __a) {
1889 return __builtin_altivec_vclzb(__a);
1891 static __inline__ vector unsigned char __ATTRS_o_ai
1892 vec_cntlz(vector unsigned char __a) {
1893 return __builtin_altivec_vclzb(__a);
1895 static __inline__ vector signed short __ATTRS_o_ai
1896 vec_cntlz(vector signed short __a) {
1897 return __builtin_altivec_vclzh(__a);
1899 static __inline__ vector unsigned short __ATTRS_o_ai
1900 vec_cntlz(vector unsigned short __a) {
1901 return __builtin_altivec_vclzh(__a);
1903 static __inline__ vector signed int __ATTRS_o_ai
1904 vec_cntlz(vector signed int __a) {
1905 return __builtin_altivec_vclzw(__a);
1907 static __inline__ vector unsigned int __ATTRS_o_ai
1908 vec_cntlz(vector unsigned int __a) {
1909 return __builtin_altivec_vclzw(__a);
1911 static __inline__ vector signed long long __ATTRS_o_ai
1912 vec_cntlz(vector signed long long __a) {
1913 return __builtin_altivec_vclzd(__a);
1915 static __inline__ vector unsigned long long __ATTRS_o_ai
1916 vec_cntlz(vector unsigned long long __a) {
1917 return __builtin_altivec_vclzd(__a);
1924 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
1926 return __builtin_vsx_xvcpsgnsp(__a, __b);
1929 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
1930 vector double __b) {
1931 return __builtin_vsx_xvcpsgndp(__a, __b);
1937 static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {
1938 return __builtin_altivec_vcfsx(__a, __b);
1941 static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a,
1943 return __builtin_altivec_vcfux((vector int)__a, __b);
1947 static __inline__ vector double __ATTRS_o_ai
1948 vec_ctf(vector unsigned long long __a, int __b) {
1949 vector double __ret = __builtin_convertvector(__a, vector double);
1950 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
1954 static __inline__ vector double __ATTRS_o_ai
1955 vec_ctf(vector signed long long __a, int __b) {
1956 vector double __ret = __builtin_convertvector(__a, vector double);
1957 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
1964 static __inline__ vector float __attribute__((__always_inline__))
1965 vec_vcfsx(vector int __a, int __b) {
1966 return __builtin_altivec_vcfsx(__a, __b);
1971 static __inline__ vector float __attribute__((__always_inline__))
1972 vec_vcfux(vector unsigned int __a, int __b) {
1973 return __builtin_altivec_vcfux((vector int)__a, __b);
1978 static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) {
1979 return __builtin_altivec_vctsxs(__a, __b);
1983 static __inline__ vector signed long long __ATTRS_o_ai
1984 vec_cts(vector double __a, int __b) {
1985 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
1986 return __builtin_convertvector(__a, vector signed long long);
1992 static __inline__ vector int __attribute__((__always_inline__))
1993 vec_vctsxs(vector float __a, int __b) {
1994 return __builtin_altivec_vctsxs(__a, __b);
1999 static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a,
2001 return __builtin_altivec_vctuxs(__a, __b);
2005 static __inline__ vector unsigned long long __ATTRS_o_ai
2006 vec_ctu(vector double __a, int __b) {
2007 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2008 return __builtin_convertvector(__a, vector unsigned long long);
2014 static __inline__ vector unsigned int __attribute__((__always_inline__))
2015 vec_vctuxs(vector float __a, int __b) {
2016 return __builtin_altivec_vctuxs(__a, __b);
2022 static __inline__ vector double __ATTRS_o_ai
2023 vec_double(vector signed long long __a) {
2024 vector double __ret = {__a[0], __a[1]};
2028 static __inline__ vector double __ATTRS_o_ai
2029 vec_double(vector unsigned long long __a) {
2030 vector double __ret = {__a[0], __a[1]};
2037 /* Integer vector divides (vectors are scalarized, elements divided
2038 and the vectors reassembled).
2040 static __inline__ vector signed char __ATTRS_o_ai
2041 vec_div(vector signed char __a, vector signed char __b) {
2045 static __inline__ vector unsigned char __ATTRS_o_ai
2046 vec_div(vector unsigned char __a, vector unsigned char __b) {
2050 static __inline__ vector signed short __ATTRS_o_ai
2051 vec_div(vector signed short __a, vector signed short __b) {
2055 static __inline__ vector unsigned short __ATTRS_o_ai
2056 vec_div(vector unsigned short __a, vector unsigned short __b) {
2060 static __inline__ vector signed int __ATTRS_o_ai
2061 vec_div(vector signed int __a, vector signed int __b) {
2065 static __inline__ vector unsigned int __ATTRS_o_ai
2066 vec_div(vector unsigned int __a, vector unsigned int __b) {
2071 static __inline__ vector signed long long __ATTRS_o_ai
2072 vec_div(vector signed long long __a, vector signed long long __b) {
2076 static __inline__ vector unsigned long long __ATTRS_o_ai
2077 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
2081 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
2086 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
2087 vector double __b) {
2094 static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
2095 __builtin_altivec_dss(__a);
2100 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
2101 __builtin_altivec_dssall();
2105 #define vec_dst(__PTR, __CW, __STR) \
2107 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
2110 #define vec_dstst(__PTR, __CW, __STR) \
2112 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
2115 #define vec_dststt(__PTR, __CW, __STR) \
2117 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
2120 #define vec_dstt(__PTR, __CW, __STR) \
2122 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
2126 #ifdef __POWER8_VECTOR__
2127 static __inline__ vector signed char __ATTRS_o_ai
2128 vec_eqv(vector signed char __a, vector signed char __b) {
2129 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2130 (vector unsigned int)__b);
2133 static __inline__ vector unsigned char __ATTRS_o_ai
2134 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
2135 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2136 (vector unsigned int)__b);
2139 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
2140 vector bool char __b) {
2141 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2142 (vector unsigned int)__b);
2145 static __inline__ vector signed short __ATTRS_o_ai
2146 vec_eqv(vector signed short __a, vector signed short __b) {
2147 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2148 (vector unsigned int)__b);
2151 static __inline__ vector unsigned short __ATTRS_o_ai
2152 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
2153 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2154 (vector unsigned int)__b);
2157 static __inline__ vector bool short __ATTRS_o_ai
2158 vec_eqv(vector bool short __a, vector bool short __b) {
2159 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2160 (vector unsigned int)__b);
2163 static __inline__ vector signed int __ATTRS_o_ai
2164 vec_eqv(vector signed int __a, vector signed int __b) {
2165 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
2166 (vector unsigned int)__b);
2169 static __inline__ vector unsigned int __ATTRS_o_ai
2170 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
2171 return __builtin_vsx_xxleqv(__a, __b);
2174 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
2175 vector bool int __b) {
2176 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
2177 (vector unsigned int)__b);
2180 static __inline__ vector signed long long __ATTRS_o_ai
2181 vec_eqv(vector signed long long __a, vector signed long long __b) {
2182 return (vector signed long long)__builtin_vsx_xxleqv(
2183 (vector unsigned int)__a, (vector unsigned int)__b);
2186 static __inline__ vector unsigned long long __ATTRS_o_ai
2187 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
2188 return (vector unsigned long long)__builtin_vsx_xxleqv(
2189 (vector unsigned int)__a, (vector unsigned int)__b);
2192 static __inline__ vector bool long long __ATTRS_o_ai
2193 vec_eqv(vector bool long long __a, vector bool long long __b) {
2194 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
2195 (vector unsigned int)__b);
2198 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
2200 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
2201 (vector unsigned int)__b);
2204 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
2205 vector double __b) {
2206 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
2207 (vector unsigned int)__b);
2213 static __inline__ vector float __attribute__((__always_inline__))
2214 vec_expte(vector float __a) {
2215 return __builtin_altivec_vexptefp(__a);
2220 static __inline__ vector float __attribute__((__always_inline__))
2221 vec_vexptefp(vector float __a) {
2222 return __builtin_altivec_vexptefp(__a);
2227 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
2229 return __builtin_vsx_xvrspim(__a);
2231 return __builtin_altivec_vrfim(__a);
2236 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
2237 return __builtin_vsx_xvrdpim(__a);
2243 static __inline__ vector float __attribute__((__always_inline__))
2244 vec_vrfim(vector float __a) {
2245 return __builtin_altivec_vrfim(__a);
2250 static __inline__ vector signed char __ATTRS_o_ai
2251 vec_ld(int __a, const vector signed char *__b) {
2252 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2255 static __inline__ vector signed char __ATTRS_o_ai
2256 vec_ld(int __a, const signed char *__b) {
2257 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2260 static __inline__ vector unsigned char __ATTRS_o_ai
2261 vec_ld(int __a, const vector unsigned char *__b) {
2262 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2265 static __inline__ vector unsigned char __ATTRS_o_ai
2266 vec_ld(int __a, const unsigned char *__b) {
2267 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2270 static __inline__ vector bool char __ATTRS_o_ai
2271 vec_ld(int __a, const vector bool char *__b) {
2272 return (vector bool char)__builtin_altivec_lvx(__a, __b);
2275 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
2276 const vector short *__b) {
2277 return (vector short)__builtin_altivec_lvx(__a, __b);
2280 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
2281 return (vector short)__builtin_altivec_lvx(__a, __b);
2284 static __inline__ vector unsigned short __ATTRS_o_ai
2285 vec_ld(int __a, const vector unsigned short *__b) {
2286 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2289 static __inline__ vector unsigned short __ATTRS_o_ai
2290 vec_ld(int __a, const unsigned short *__b) {
2291 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2294 static __inline__ vector bool short __ATTRS_o_ai
2295 vec_ld(int __a, const vector bool short *__b) {
2296 return (vector bool short)__builtin_altivec_lvx(__a, __b);
2299 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
2300 const vector pixel *__b) {
2301 return (vector pixel)__builtin_altivec_lvx(__a, __b);
2304 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
2305 const vector int *__b) {
2306 return (vector int)__builtin_altivec_lvx(__a, __b);
2309 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
2310 return (vector int)__builtin_altivec_lvx(__a, __b);
2313 static __inline__ vector unsigned int __ATTRS_o_ai
2314 vec_ld(int __a, const vector unsigned int *__b) {
2315 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2318 static __inline__ vector unsigned int __ATTRS_o_ai
2319 vec_ld(int __a, const unsigned int *__b) {
2320 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2323 static __inline__ vector bool int __ATTRS_o_ai
2324 vec_ld(int __a, const vector bool int *__b) {
2325 return (vector bool int)__builtin_altivec_lvx(__a, __b);
2328 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
2329 const vector float *__b) {
2330 return (vector float)__builtin_altivec_lvx(__a, __b);
2333 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
2334 return (vector float)__builtin_altivec_lvx(__a, __b);
2339 static __inline__ vector signed char __ATTRS_o_ai
2340 vec_lvx(int __a, const vector signed char *__b) {
2341 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2344 static __inline__ vector signed char __ATTRS_o_ai
2345 vec_lvx(int __a, const signed char *__b) {
2346 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2349 static __inline__ vector unsigned char __ATTRS_o_ai
2350 vec_lvx(int __a, const vector unsigned char *__b) {
2351 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2354 static __inline__ vector unsigned char __ATTRS_o_ai
2355 vec_lvx(int __a, const unsigned char *__b) {
2356 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2359 static __inline__ vector bool char __ATTRS_o_ai
2360 vec_lvx(int __a, const vector bool char *__b) {
2361 return (vector bool char)__builtin_altivec_lvx(__a, __b);
2364 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
2365 const vector short *__b) {
2366 return (vector short)__builtin_altivec_lvx(__a, __b);
2369 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
2370 return (vector short)__builtin_altivec_lvx(__a, __b);
2373 static __inline__ vector unsigned short __ATTRS_o_ai
2374 vec_lvx(int __a, const vector unsigned short *__b) {
2375 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2378 static __inline__ vector unsigned short __ATTRS_o_ai
2379 vec_lvx(int __a, const unsigned short *__b) {
2380 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2383 static __inline__ vector bool short __ATTRS_o_ai
2384 vec_lvx(int __a, const vector bool short *__b) {
2385 return (vector bool short)__builtin_altivec_lvx(__a, __b);
2388 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
2389 const vector pixel *__b) {
2390 return (vector pixel)__builtin_altivec_lvx(__a, __b);
2393 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
2394 const vector int *__b) {
2395 return (vector int)__builtin_altivec_lvx(__a, __b);
2398 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
2399 return (vector int)__builtin_altivec_lvx(__a, __b);
2402 static __inline__ vector unsigned int __ATTRS_o_ai
2403 vec_lvx(int __a, const vector unsigned int *__b) {
2404 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2407 static __inline__ vector unsigned int __ATTRS_o_ai
2408 vec_lvx(int __a, const unsigned int *__b) {
2409 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2412 static __inline__ vector bool int __ATTRS_o_ai
2413 vec_lvx(int __a, const vector bool int *__b) {
2414 return (vector bool int)__builtin_altivec_lvx(__a, __b);
2417 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
2418 const vector float *__b) {
2419 return (vector float)__builtin_altivec_lvx(__a, __b);
2422 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
2423 return (vector float)__builtin_altivec_lvx(__a, __b);
2428 static __inline__ vector signed char __ATTRS_o_ai
2429 vec_lde(int __a, const signed char *__b) {
2430 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2433 static __inline__ vector unsigned char __ATTRS_o_ai
2434 vec_lde(int __a, const unsigned char *__b) {
2435 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2438 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
2439 return (vector short)__builtin_altivec_lvehx(__a, __b);
2442 static __inline__ vector unsigned short __ATTRS_o_ai
2443 vec_lde(int __a, const unsigned short *__b) {
2444 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2447 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
2448 return (vector int)__builtin_altivec_lvewx(__a, __b);
2451 static __inline__ vector unsigned int __ATTRS_o_ai
2452 vec_lde(int __a, const unsigned int *__b) {
2453 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2456 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
2457 return (vector float)__builtin_altivec_lvewx(__a, __b);
2462 static __inline__ vector signed char __ATTRS_o_ai
2463 vec_lvebx(int __a, const signed char *__b) {
2464 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2467 static __inline__ vector unsigned char __ATTRS_o_ai
2468 vec_lvebx(int __a, const unsigned char *__b) {
2469 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2474 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
2476 return (vector short)__builtin_altivec_lvehx(__a, __b);
2479 static __inline__ vector unsigned short __ATTRS_o_ai
2480 vec_lvehx(int __a, const unsigned short *__b) {
2481 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2486 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
2487 return (vector int)__builtin_altivec_lvewx(__a, __b);
2490 static __inline__ vector unsigned int __ATTRS_o_ai
2491 vec_lvewx(int __a, const unsigned int *__b) {
2492 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2495 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
2497 return (vector float)__builtin_altivec_lvewx(__a, __b);
2502 static __inline__ vector signed char __ATTRS_o_ai
2503 vec_ldl(int __a, const vector signed char *__b) {
2504 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2507 static __inline__ vector signed char __ATTRS_o_ai
2508 vec_ldl(int __a, const signed char *__b) {
2509 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2512 static __inline__ vector unsigned char __ATTRS_o_ai
2513 vec_ldl(int __a, const vector unsigned char *__b) {
2514 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2517 static __inline__ vector unsigned char __ATTRS_o_ai
2518 vec_ldl(int __a, const unsigned char *__b) {
2519 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2522 static __inline__ vector bool char __ATTRS_o_ai
2523 vec_ldl(int __a, const vector bool char *__b) {
2524 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2527 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
2528 const vector short *__b) {
2529 return (vector short)__builtin_altivec_lvxl(__a, __b);
2532 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
2533 return (vector short)__builtin_altivec_lvxl(__a, __b);
2536 static __inline__ vector unsigned short __ATTRS_o_ai
2537 vec_ldl(int __a, const vector unsigned short *__b) {
2538 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2541 static __inline__ vector unsigned short __ATTRS_o_ai
2542 vec_ldl(int __a, const unsigned short *__b) {
2543 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2546 static __inline__ vector bool short __ATTRS_o_ai
2547 vec_ldl(int __a, const vector bool short *__b) {
2548 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2551 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
2552 const vector pixel *__b) {
2553 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
2556 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
2557 const vector int *__b) {
2558 return (vector int)__builtin_altivec_lvxl(__a, __b);
2561 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
2562 return (vector int)__builtin_altivec_lvxl(__a, __b);
2565 static __inline__ vector unsigned int __ATTRS_o_ai
2566 vec_ldl(int __a, const vector unsigned int *__b) {
2567 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2570 static __inline__ vector unsigned int __ATTRS_o_ai
2571 vec_ldl(int __a, const unsigned int *__b) {
2572 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2575 static __inline__ vector bool int __ATTRS_o_ai
2576 vec_ldl(int __a, const vector bool int *__b) {
2577 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2580 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
2581 const vector float *__b) {
2582 return (vector float)__builtin_altivec_lvxl(__a, __b);
2585 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
2586 return (vector float)__builtin_altivec_lvxl(__a, __b);
2591 static __inline__ vector signed char __ATTRS_o_ai
2592 vec_lvxl(int __a, const vector signed char *__b) {
2593 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2596 static __inline__ vector signed char __ATTRS_o_ai
2597 vec_lvxl(int __a, const signed char *__b) {
2598 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2601 static __inline__ vector unsigned char __ATTRS_o_ai
2602 vec_lvxl(int __a, const vector unsigned char *__b) {
2603 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2606 static __inline__ vector unsigned char __ATTRS_o_ai
2607 vec_lvxl(int __a, const unsigned char *__b) {
2608 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2611 static __inline__ vector bool char __ATTRS_o_ai
2612 vec_lvxl(int __a, const vector bool char *__b) {
2613 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2616 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
2617 const vector short *__b) {
2618 return (vector short)__builtin_altivec_lvxl(__a, __b);
2621 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
2623 return (vector short)__builtin_altivec_lvxl(__a, __b);
2626 static __inline__ vector unsigned short __ATTRS_o_ai
2627 vec_lvxl(int __a, const vector unsigned short *__b) {
2628 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2631 static __inline__ vector unsigned short __ATTRS_o_ai
2632 vec_lvxl(int __a, const unsigned short *__b) {
2633 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2636 static __inline__ vector bool short __ATTRS_o_ai
2637 vec_lvxl(int __a, const vector bool short *__b) {
2638 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2641 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
2642 const vector pixel *__b) {
2643 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
2646 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
2647 const vector int *__b) {
2648 return (vector int)__builtin_altivec_lvxl(__a, __b);
2651 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
2652 return (vector int)__builtin_altivec_lvxl(__a, __b);
2655 static __inline__ vector unsigned int __ATTRS_o_ai
2656 vec_lvxl(int __a, const vector unsigned int *__b) {
2657 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2660 static __inline__ vector unsigned int __ATTRS_o_ai
2661 vec_lvxl(int __a, const unsigned int *__b) {
2662 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2665 static __inline__ vector bool int __ATTRS_o_ai
2666 vec_lvxl(int __a, const vector bool int *__b) {
2667 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2670 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
2671 const vector float *__b) {
2672 return (vector float)__builtin_altivec_lvxl(__a, __b);
2675 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
2677 return (vector float)__builtin_altivec_lvxl(__a, __b);
2682 static __inline__ vector float __attribute__((__always_inline__))
2683 vec_loge(vector float __a) {
2684 return __builtin_altivec_vlogefp(__a);
2689 static __inline__ vector float __attribute__((__always_inline__))
2690 vec_vlogefp(vector float __a) {
2691 return __builtin_altivec_vlogefp(__a);
2696 #ifdef __LITTLE_ENDIAN__
2697 static __inline__ vector unsigned char __ATTRS_o_ai
2698 __attribute__((__deprecated__("use assignment for unaligned little endian \
2699 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
2700 vector unsigned char mask =
2701 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2702 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2703 7, 6, 5, 4, 3, 2, 1, 0};
2704 return vec_perm(mask, mask, reverse);
2707 static __inline__ vector unsigned char __ATTRS_o_ai
2708 vec_lvsl(int __a, const signed char *__b) {
2709 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2713 #ifdef __LITTLE_ENDIAN__
2714 static __inline__ vector unsigned char __ATTRS_o_ai
2715 __attribute__((__deprecated__("use assignment for unaligned little endian \
2716 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
2717 vector unsigned char mask =
2718 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2719 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2720 7, 6, 5, 4, 3, 2, 1, 0};
2721 return vec_perm(mask, mask, reverse);
2724 static __inline__ vector unsigned char __ATTRS_o_ai
2725 vec_lvsl(int __a, const unsigned char *__b) {
2726 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2730 #ifdef __LITTLE_ENDIAN__
2731 static __inline__ vector unsigned char __ATTRS_o_ai
2732 __attribute__((__deprecated__("use assignment for unaligned little endian \
2733 loads/stores"))) vec_lvsl(int __a, const short *__b) {
2734 vector unsigned char mask =
2735 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2736 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2737 7, 6, 5, 4, 3, 2, 1, 0};
2738 return vec_perm(mask, mask, reverse);
2741 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2743 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2747 #ifdef __LITTLE_ENDIAN__
2748 static __inline__ vector unsigned char __ATTRS_o_ai
2749 __attribute__((__deprecated__("use assignment for unaligned little endian \
2750 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
2751 vector unsigned char mask =
2752 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2753 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2754 7, 6, 5, 4, 3, 2, 1, 0};
2755 return vec_perm(mask, mask, reverse);
2758 static __inline__ vector unsigned char __ATTRS_o_ai
2759 vec_lvsl(int __a, const unsigned short *__b) {
2760 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2764 #ifdef __LITTLE_ENDIAN__
2765 static __inline__ vector unsigned char __ATTRS_o_ai
2766 __attribute__((__deprecated__("use assignment for unaligned little endian \
2767 loads/stores"))) vec_lvsl(int __a, const int *__b) {
2768 vector unsigned char mask =
2769 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2770 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2771 7, 6, 5, 4, 3, 2, 1, 0};
2772 return vec_perm(mask, mask, reverse);
2775 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2777 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2781 #ifdef __LITTLE_ENDIAN__
2782 static __inline__ vector unsigned char __ATTRS_o_ai
2783 __attribute__((__deprecated__("use assignment for unaligned little endian \
2784 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
2785 vector unsigned char mask =
2786 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2787 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2788 7, 6, 5, 4, 3, 2, 1, 0};
2789 return vec_perm(mask, mask, reverse);
2792 static __inline__ vector unsigned char __ATTRS_o_ai
2793 vec_lvsl(int __a, const unsigned int *__b) {
2794 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2798 #ifdef __LITTLE_ENDIAN__
2799 static __inline__ vector unsigned char __ATTRS_o_ai
2800 __attribute__((__deprecated__("use assignment for unaligned little endian \
2801 loads/stores"))) vec_lvsl(int __a, const float *__b) {
2802 vector unsigned char mask =
2803 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2804 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2805 7, 6, 5, 4, 3, 2, 1, 0};
2806 return vec_perm(mask, mask, reverse);
2809 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2811 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2817 #ifdef __LITTLE_ENDIAN__
2818 static __inline__ vector unsigned char __ATTRS_o_ai
2819 __attribute__((__deprecated__("use assignment for unaligned little endian \
2820 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
2821 vector unsigned char mask =
2822 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2823 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2824 7, 6, 5, 4, 3, 2, 1, 0};
2825 return vec_perm(mask, mask, reverse);
2828 static __inline__ vector unsigned char __ATTRS_o_ai
2829 vec_lvsr(int __a, const signed char *__b) {
2830 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2834 #ifdef __LITTLE_ENDIAN__
2835 static __inline__ vector unsigned char __ATTRS_o_ai
2836 __attribute__((__deprecated__("use assignment for unaligned little endian \
2837 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
2838 vector unsigned char mask =
2839 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2840 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2841 7, 6, 5, 4, 3, 2, 1, 0};
2842 return vec_perm(mask, mask, reverse);
2845 static __inline__ vector unsigned char __ATTRS_o_ai
2846 vec_lvsr(int __a, const unsigned char *__b) {
2847 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2851 #ifdef __LITTLE_ENDIAN__
2852 static __inline__ vector unsigned char __ATTRS_o_ai
2853 __attribute__((__deprecated__("use assignment for unaligned little endian \
2854 loads/stores"))) vec_lvsr(int __a, const short *__b) {
2855 vector unsigned char mask =
2856 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2857 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2858 7, 6, 5, 4, 3, 2, 1, 0};
2859 return vec_perm(mask, mask, reverse);
2862 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2864 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2868 #ifdef __LITTLE_ENDIAN__
2869 static __inline__ vector unsigned char __ATTRS_o_ai
2870 __attribute__((__deprecated__("use assignment for unaligned little endian \
2871 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
2872 vector unsigned char mask =
2873 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2874 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2875 7, 6, 5, 4, 3, 2, 1, 0};
2876 return vec_perm(mask, mask, reverse);
2879 static __inline__ vector unsigned char __ATTRS_o_ai
2880 vec_lvsr(int __a, const unsigned short *__b) {
2881 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2885 #ifdef __LITTLE_ENDIAN__
2886 static __inline__ vector unsigned char __ATTRS_o_ai
2887 __attribute__((__deprecated__("use assignment for unaligned little endian \
2888 loads/stores"))) vec_lvsr(int __a, const int *__b) {
2889 vector unsigned char mask =
2890 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2891 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2892 7, 6, 5, 4, 3, 2, 1, 0};
2893 return vec_perm(mask, mask, reverse);
2896 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2898 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2902 #ifdef __LITTLE_ENDIAN__
2903 static __inline__ vector unsigned char __ATTRS_o_ai
2904 __attribute__((__deprecated__("use assignment for unaligned little endian \
2905 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
2906 vector unsigned char mask =
2907 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2908 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2909 7, 6, 5, 4, 3, 2, 1, 0};
2910 return vec_perm(mask, mask, reverse);
2913 static __inline__ vector unsigned char __ATTRS_o_ai
2914 vec_lvsr(int __a, const unsigned int *__b) {
2915 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2919 #ifdef __LITTLE_ENDIAN__
2920 static __inline__ vector unsigned char __ATTRS_o_ai
2921 __attribute__((__deprecated__("use assignment for unaligned little endian \
2922 loads/stores"))) vec_lvsr(int __a, const float *__b) {
2923 vector unsigned char mask =
2924 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2925 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2926 7, 6, 5, 4, 3, 2, 1, 0};
2927 return vec_perm(mask, mask, reverse);
2930 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2932 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2937 static __inline__ vector signed short __ATTRS_o_ai
2938 vec_mladd(vector signed short, vector signed short, vector signed short);
2939 static __inline__ vector signed short __ATTRS_o_ai
2940 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
2941 static __inline__ vector signed short __ATTRS_o_ai
2942 vec_mladd(vector unsigned short, vector signed short, vector signed short);
2943 static __inline__ vector unsigned short __ATTRS_o_ai
2944 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
2946 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
2947 vector signed short __a, vector signed short __b, vector signed short __c) {
2948 return vec_mladd(__a, __b, __c);
2951 static __inline__ vector signed short __ATTRS_o_ai
2952 vec_madd(vector signed short __a, vector unsigned short __b,
2953 vector unsigned short __c) {
2954 return vec_mladd(__a, __b, __c);
2957 static __inline__ vector signed short __ATTRS_o_ai
2958 vec_madd(vector unsigned short __a, vector signed short __b,
2959 vector signed short __c) {
2960 return vec_mladd(__a, __b, __c);
2963 static __inline__ vector unsigned short __ATTRS_o_ai
2964 vec_madd(vector unsigned short __a, vector unsigned short __b,
2965 vector unsigned short __c) {
2966 return vec_mladd(__a, __b, __c);
2969 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
2973 return __builtin_vsx_xvmaddasp(__a, __b, __c);
2975 return __builtin_altivec_vmaddfp(__a, __b, __c);
2980 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
2982 vector double __c) {
2983 return __builtin_vsx_xvmaddadp(__a, __b, __c);
2989 static __inline__ vector float __attribute__((__always_inline__))
2990 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
2991 return __builtin_altivec_vmaddfp(__a, __b, __c);
2996 static __inline__ vector signed short __attribute__((__always_inline__))
2997 vec_madds(vector signed short __a, vector signed short __b,
2998 vector signed short __c) {
2999 return __builtin_altivec_vmhaddshs(__a, __b, __c);
3003 static __inline__ vector signed short __attribute__((__always_inline__))
3004 vec_vmhaddshs(vector signed short __a, vector signed short __b,
3005 vector signed short __c) {
3006 return __builtin_altivec_vmhaddshs(__a, __b, __c);
3012 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
3015 return __builtin_vsx_xvmsubasp(__a, __b, __c);
3018 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
3020 vector double __c) {
3021 return __builtin_vsx_xvmsubadp(__a, __b, __c);
3027 static __inline__ vector signed char __ATTRS_o_ai
3028 vec_max(vector signed char __a, vector signed char __b) {
3029 return __builtin_altivec_vmaxsb(__a, __b);
3032 static __inline__ vector signed char __ATTRS_o_ai
3033 vec_max(vector bool char __a, vector signed char __b) {
3034 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
3037 static __inline__ vector signed char __ATTRS_o_ai
3038 vec_max(vector signed char __a, vector bool char __b) {
3039 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
3042 static __inline__ vector unsigned char __ATTRS_o_ai
3043 vec_max(vector unsigned char __a, vector unsigned char __b) {
3044 return __builtin_altivec_vmaxub(__a, __b);
3047 static __inline__ vector unsigned char __ATTRS_o_ai
3048 vec_max(vector bool char __a, vector unsigned char __b) {
3049 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
3052 static __inline__ vector unsigned char __ATTRS_o_ai
3053 vec_max(vector unsigned char __a, vector bool char __b) {
3054 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
3057 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
3059 return __builtin_altivec_vmaxsh(__a, __b);
3062 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
3064 return __builtin_altivec_vmaxsh((vector short)__a, __b);
3067 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
3068 vector bool short __b) {
3069 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
3072 static __inline__ vector unsigned short __ATTRS_o_ai
3073 vec_max(vector unsigned short __a, vector unsigned short __b) {
3074 return __builtin_altivec_vmaxuh(__a, __b);
3077 static __inline__ vector unsigned short __ATTRS_o_ai
3078 vec_max(vector bool short __a, vector unsigned short __b) {
3079 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
3082 static __inline__ vector unsigned short __ATTRS_o_ai
3083 vec_max(vector unsigned short __a, vector bool short __b) {
3084 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
3087 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
3089 return __builtin_altivec_vmaxsw(__a, __b);
3092 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
3094 return __builtin_altivec_vmaxsw((vector int)__a, __b);
3097 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
3098 vector bool int __b) {
3099 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
3102 static __inline__ vector unsigned int __ATTRS_o_ai
3103 vec_max(vector unsigned int __a, vector unsigned int __b) {
3104 return __builtin_altivec_vmaxuw(__a, __b);
3107 static __inline__ vector unsigned int __ATTRS_o_ai
3108 vec_max(vector bool int __a, vector unsigned int __b) {
3109 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
3112 static __inline__ vector unsigned int __ATTRS_o_ai
3113 vec_max(vector unsigned int __a, vector bool int __b) {
3114 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
3117 #ifdef __POWER8_VECTOR__
3118 static __inline__ vector signed long long __ATTRS_o_ai
3119 vec_max(vector signed long long __a, vector signed long long __b) {
3120 return __builtin_altivec_vmaxsd(__a, __b);
3123 static __inline__ vector signed long long __ATTRS_o_ai
3124 vec_max(vector bool long long __a, vector signed long long __b) {
3125 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
3128 static __inline__ vector signed long long __ATTRS_o_ai
3129 vec_max(vector signed long long __a, vector bool long long __b) {
3130 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
3133 static __inline__ vector unsigned long long __ATTRS_o_ai
3134 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
3135 return __builtin_altivec_vmaxud(__a, __b);
3138 static __inline__ vector unsigned long long __ATTRS_o_ai
3139 vec_max(vector bool long long __a, vector unsigned long long __b) {
3140 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
3143 static __inline__ vector unsigned long long __ATTRS_o_ai
3144 vec_max(vector unsigned long long __a, vector bool long long __b) {
3145 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
3149 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
3152 return __builtin_vsx_xvmaxsp(__a, __b);
3154 return __builtin_altivec_vmaxfp(__a, __b);
3159 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
3160 vector double __b) {
3161 return __builtin_vsx_xvmaxdp(__a, __b);
3167 static __inline__ vector signed char __ATTRS_o_ai
3168 vec_vmaxsb(vector signed char __a, vector signed char __b) {
3169 return __builtin_altivec_vmaxsb(__a, __b);
3172 static __inline__ vector signed char __ATTRS_o_ai
3173 vec_vmaxsb(vector bool char __a, vector signed char __b) {
3174 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
3177 static __inline__ vector signed char __ATTRS_o_ai
3178 vec_vmaxsb(vector signed char __a, vector bool char __b) {
3179 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
3184 static __inline__ vector unsigned char __ATTRS_o_ai
3185 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
3186 return __builtin_altivec_vmaxub(__a, __b);
3189 static __inline__ vector unsigned char __ATTRS_o_ai
3190 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
3191 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
3194 static __inline__ vector unsigned char __ATTRS_o_ai
3195 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
3196 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
3201 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
3203 return __builtin_altivec_vmaxsh(__a, __b);
3206 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
3208 return __builtin_altivec_vmaxsh((vector short)__a, __b);
3211 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
3212 vector bool short __b) {
3213 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
3218 static __inline__ vector unsigned short __ATTRS_o_ai
3219 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
3220 return __builtin_altivec_vmaxuh(__a, __b);
3223 static __inline__ vector unsigned short __ATTRS_o_ai
3224 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
3225 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
3228 static __inline__ vector unsigned short __ATTRS_o_ai
3229 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
3230 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
3235 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
3237 return __builtin_altivec_vmaxsw(__a, __b);
3240 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
3242 return __builtin_altivec_vmaxsw((vector int)__a, __b);
3245 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
3246 vector bool int __b) {
3247 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
3252 static __inline__ vector unsigned int __ATTRS_o_ai
3253 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
3254 return __builtin_altivec_vmaxuw(__a, __b);
3257 static __inline__ vector unsigned int __ATTRS_o_ai
3258 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
3259 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
3262 static __inline__ vector unsigned int __ATTRS_o_ai
3263 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
3264 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
3269 static __inline__ vector float __attribute__((__always_inline__))
3270 vec_vmaxfp(vector float __a, vector float __b) {
3272 return __builtin_vsx_xvmaxsp(__a, __b);
3274 return __builtin_altivec_vmaxfp(__a, __b);
3280 static __inline__ vector signed char __ATTRS_o_ai
3281 vec_mergeh(vector signed char __a, vector signed char __b) {
3282 return vec_perm(__a, __b,
3283 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3284 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3285 0x06, 0x16, 0x07, 0x17));
3288 static __inline__ vector unsigned char __ATTRS_o_ai
3289 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
3290 return vec_perm(__a, __b,
3291 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3292 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3293 0x06, 0x16, 0x07, 0x17));
3296 static __inline__ vector bool char __ATTRS_o_ai
3297 vec_mergeh(vector bool char __a, vector bool char __b) {
3298 return vec_perm(__a, __b,
3299 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3300 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3301 0x06, 0x16, 0x07, 0x17));
3304 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
3306 return vec_perm(__a, __b,
3307 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3308 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3309 0x06, 0x07, 0x16, 0x17));
3312 static __inline__ vector unsigned short __ATTRS_o_ai
3313 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
3314 return vec_perm(__a, __b,
3315 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3316 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3317 0x06, 0x07, 0x16, 0x17));
3320 static __inline__ vector bool short __ATTRS_o_ai
3321 vec_mergeh(vector bool short __a, vector bool short __b) {
3322 return vec_perm(__a, __b,
3323 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3324 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3325 0x06, 0x07, 0x16, 0x17));
3328 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
3330 return vec_perm(__a, __b,
3331 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3332 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3333 0x06, 0x07, 0x16, 0x17));
3336 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
3338 return vec_perm(__a, __b,
3339 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3340 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3341 0x14, 0x15, 0x16, 0x17));
3344 static __inline__ vector unsigned int __ATTRS_o_ai
3345 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
3346 return vec_perm(__a, __b,
3347 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3348 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3349 0x14, 0x15, 0x16, 0x17));
3352 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
3353 vector bool int __b) {
3354 return vec_perm(__a, __b,
3355 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3356 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3357 0x14, 0x15, 0x16, 0x17));
3360 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
3362 return vec_perm(__a, __b,
3363 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3364 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3365 0x14, 0x15, 0x16, 0x17));
3369 static __inline__ vector signed long long __ATTRS_o_ai
3370 vec_mergeh(vector signed long long __a, vector signed long long __b) {
3371 return vec_perm(__a, __b,
3372 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3373 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3374 0x14, 0x15, 0x16, 0x17));
3377 static __inline__ vector signed long long __ATTRS_o_ai
3378 vec_mergeh(vector signed long long __a, vector bool long long __b) {
3379 return vec_perm(__a, (vector signed long long)__b,
3380 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3381 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3382 0x14, 0x15, 0x16, 0x17));
3385 static __inline__ vector signed long long __ATTRS_o_ai
3386 vec_mergeh(vector bool long long __a, vector signed long long __b) {
3387 return vec_perm((vector signed long long)__a, __b,
3388 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3389 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3390 0x14, 0x15, 0x16, 0x17));
3393 static __inline__ vector unsigned long long __ATTRS_o_ai
3394 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
3395 return vec_perm(__a, __b,
3396 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3397 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3398 0x14, 0x15, 0x16, 0x17));
3401 static __inline__ vector unsigned long long __ATTRS_o_ai
3402 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
3403 return vec_perm(__a, (vector unsigned long long)__b,
3404 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3405 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3406 0x14, 0x15, 0x16, 0x17));
3409 static __inline__ vector unsigned long long __ATTRS_o_ai
3410 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
3411 return vec_perm((vector unsigned long long)__a, __b,
3412 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3413 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3414 0x14, 0x15, 0x16, 0x17));
3417 static __inline__ vector bool long long __ATTRS_o_ai
3418 vec_mergeh(vector bool long long __a, vector bool long long __b) {
3419 return vec_perm(__a, __b,
3420 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3421 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3422 0x14, 0x15, 0x16, 0x17));
3425 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
3426 vector double __b) {
3427 return vec_perm(__a, __b,
3428 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3429 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3430 0x14, 0x15, 0x16, 0x17));
3432 static __inline__ vector double __ATTRS_o_ai
3433 vec_mergeh(vector double __a, vector bool long long __b) {
3434 return vec_perm(__a, (vector double)__b,
3435 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3436 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3437 0x14, 0x15, 0x16, 0x17));
3439 static __inline__ vector double __ATTRS_o_ai
3440 vec_mergeh(vector bool long long __a, vector double __b) {
3441 return vec_perm((vector double)__a, __b,
3442 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3443 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3444 0x14, 0x15, 0x16, 0x17));
3450 #define __builtin_altivec_vmrghb vec_vmrghb
3452 static __inline__ vector signed char __ATTRS_o_ai
3453 vec_vmrghb(vector signed char __a, vector signed char __b) {
3454 return vec_perm(__a, __b,
3455 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3456 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3457 0x06, 0x16, 0x07, 0x17));
3460 static __inline__ vector unsigned char __ATTRS_o_ai
3461 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
3462 return vec_perm(__a, __b,
3463 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3464 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3465 0x06, 0x16, 0x07, 0x17));
3468 static __inline__ vector bool char __ATTRS_o_ai
3469 vec_vmrghb(vector bool char __a, vector bool char __b) {
3470 return vec_perm(__a, __b,
3471 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3472 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3473 0x06, 0x16, 0x07, 0x17));
3478 #define __builtin_altivec_vmrghh vec_vmrghh
3480 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
3482 return vec_perm(__a, __b,
3483 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3484 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3485 0x06, 0x07, 0x16, 0x17));
3488 static __inline__ vector unsigned short __ATTRS_o_ai
3489 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
3490 return vec_perm(__a, __b,
3491 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3492 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3493 0x06, 0x07, 0x16, 0x17));
3496 static __inline__ vector bool short __ATTRS_o_ai
3497 vec_vmrghh(vector bool short __a, vector bool short __b) {
3498 return vec_perm(__a, __b,
3499 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3500 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3501 0x06, 0x07, 0x16, 0x17));
3504 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
3506 return vec_perm(__a, __b,
3507 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3508 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3509 0x06, 0x07, 0x16, 0x17));
3514 #define __builtin_altivec_vmrghw vec_vmrghw
3516 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
3518 return vec_perm(__a, __b,
3519 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3520 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3521 0x14, 0x15, 0x16, 0x17));
3524 static __inline__ vector unsigned int __ATTRS_o_ai
3525 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
3526 return vec_perm(__a, __b,
3527 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3528 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3529 0x14, 0x15, 0x16, 0x17));
3532 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
3533 vector bool int __b) {
3534 return vec_perm(__a, __b,
3535 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3536 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3537 0x14, 0x15, 0x16, 0x17));
3540 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
3542 return vec_perm(__a, __b,
3543 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3544 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3545 0x14, 0x15, 0x16, 0x17));
3550 static __inline__ vector signed char __ATTRS_o_ai
3551 vec_mergel(vector signed char __a, vector signed char __b) {
3552 return vec_perm(__a, __b,
3553 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3554 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3555 0x0E, 0x1E, 0x0F, 0x1F));
3558 static __inline__ vector unsigned char __ATTRS_o_ai
3559 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
3560 return vec_perm(__a, __b,
3561 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3562 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3563 0x0E, 0x1E, 0x0F, 0x1F));
3566 static __inline__ vector bool char __ATTRS_o_ai
3567 vec_mergel(vector bool char __a, vector bool char __b) {
3568 return vec_perm(__a, __b,
3569 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3570 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3571 0x0E, 0x1E, 0x0F, 0x1F));
3574 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
3576 return vec_perm(__a, __b,
3577 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3578 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3579 0x0E, 0x0F, 0x1E, 0x1F));
3582 static __inline__ vector unsigned short __ATTRS_o_ai
3583 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
3584 return vec_perm(__a, __b,
3585 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3586 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3587 0x0E, 0x0F, 0x1E, 0x1F));
3590 static __inline__ vector bool short __ATTRS_o_ai
3591 vec_mergel(vector bool short __a, vector bool short __b) {
3592 return vec_perm(__a, __b,
3593 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3594 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3595 0x0E, 0x0F, 0x1E, 0x1F));
3598 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
3600 return vec_perm(__a, __b,
3601 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3602 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3603 0x0E, 0x0F, 0x1E, 0x1F));
3606 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
3608 return vec_perm(__a, __b,
3609 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3610 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3611 0x1C, 0x1D, 0x1E, 0x1F));
3614 static __inline__ vector unsigned int __ATTRS_o_ai
3615 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
3616 return vec_perm(__a, __b,
3617 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3618 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3619 0x1C, 0x1D, 0x1E, 0x1F));
3622 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
3623 vector bool int __b) {
3624 return vec_perm(__a, __b,
3625 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3626 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3627 0x1C, 0x1D, 0x1E, 0x1F));
3630 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
3632 return vec_perm(__a, __b,
3633 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3634 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3635 0x1C, 0x1D, 0x1E, 0x1F));
3639 static __inline__ vector signed long long __ATTRS_o_ai
3640 vec_mergel(vector signed long long __a, vector signed long long __b) {
3641 return vec_perm(__a, __b,
3642 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3643 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3644 0x1C, 0x1D, 0x1E, 0x1F));
3646 static __inline__ vector signed long long __ATTRS_o_ai
3647 vec_mergel(vector signed long long __a, vector bool long long __b) {
3648 return vec_perm(__a, (vector signed long long)__b,
3649 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3650 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3651 0x1C, 0x1D, 0x1E, 0x1F));
3653 static __inline__ vector signed long long __ATTRS_o_ai
3654 vec_mergel(vector bool long long __a, vector signed long long __b) {
3655 return vec_perm((vector signed long long)__a, __b,
3656 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3657 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3658 0x1C, 0x1D, 0x1E, 0x1F));
3660 static __inline__ vector unsigned long long __ATTRS_o_ai
3661 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
3662 return vec_perm(__a, __b,
3663 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3664 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3665 0x1C, 0x1D, 0x1E, 0x1F));
3667 static __inline__ vector unsigned long long __ATTRS_o_ai
3668 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
3669 return vec_perm(__a, (vector unsigned long long)__b,
3670 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3671 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3672 0x1C, 0x1D, 0x1E, 0x1F));
3674 static __inline__ vector unsigned long long __ATTRS_o_ai
3675 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
3676 return vec_perm((vector unsigned long long)__a, __b,
3677 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3678 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3679 0x1C, 0x1D, 0x1E, 0x1F));
3681 static __inline__ vector bool long long __ATTRS_o_ai
3682 vec_mergel(vector bool long long __a, vector bool long long __b) {
3683 return vec_perm(__a, __b,
3684 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3685 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3686 0x1C, 0x1D, 0x1E, 0x1F));
3688 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
3689 vector double __b) {
3690 return vec_perm(__a, __b,
3691 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3692 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3693 0x1C, 0x1D, 0x1E, 0x1F));
3695 static __inline__ vector double __ATTRS_o_ai
3696 vec_mergel(vector double __a, vector bool long long __b) {
3697 return vec_perm(__a, (vector double)__b,
3698 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3699 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3700 0x1C, 0x1D, 0x1E, 0x1F));
3702 static __inline__ vector double __ATTRS_o_ai
3703 vec_mergel(vector bool long long __a, vector double __b) {
3704 return vec_perm((vector double)__a, __b,
3705 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3706 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3707 0x1C, 0x1D, 0x1E, 0x1F));
3713 #define __builtin_altivec_vmrglb vec_vmrglb
3715 static __inline__ vector signed char __ATTRS_o_ai
3716 vec_vmrglb(vector signed char __a, vector signed char __b) {
3717 return vec_perm(__a, __b,
3718 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3719 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3720 0x0E, 0x1E, 0x0F, 0x1F));
3723 static __inline__ vector unsigned char __ATTRS_o_ai
3724 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
3725 return vec_perm(__a, __b,
3726 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3727 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3728 0x0E, 0x1E, 0x0F, 0x1F));
3731 static __inline__ vector bool char __ATTRS_o_ai
3732 vec_vmrglb(vector bool char __a, vector bool char __b) {
3733 return vec_perm(__a, __b,
3734 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3735 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3736 0x0E, 0x1E, 0x0F, 0x1F));
3741 #define __builtin_altivec_vmrglh vec_vmrglh
3743 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
3745 return vec_perm(__a, __b,
3746 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3747 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3748 0x0E, 0x0F, 0x1E, 0x1F));
3751 static __inline__ vector unsigned short __ATTRS_o_ai
3752 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
3753 return vec_perm(__a, __b,
3754 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3755 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3756 0x0E, 0x0F, 0x1E, 0x1F));
3759 static __inline__ vector bool short __ATTRS_o_ai
3760 vec_vmrglh(vector bool short __a, vector bool short __b) {
3761 return vec_perm(__a, __b,
3762 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3763 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3764 0x0E, 0x0F, 0x1E, 0x1F));
3767 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
3769 return vec_perm(__a, __b,
3770 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3771 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3772 0x0E, 0x0F, 0x1E, 0x1F));
3777 #define __builtin_altivec_vmrglw vec_vmrglw
3779 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
3781 return vec_perm(__a, __b,
3782 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3783 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3784 0x1C, 0x1D, 0x1E, 0x1F));
3787 static __inline__ vector unsigned int __ATTRS_o_ai
3788 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
3789 return vec_perm(__a, __b,
3790 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3791 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3792 0x1C, 0x1D, 0x1E, 0x1F));
3795 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
3796 vector bool int __b) {
3797 return vec_perm(__a, __b,
3798 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3799 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3800 0x1C, 0x1D, 0x1E, 0x1F));
3803 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
3805 return vec_perm(__a, __b,
3806 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3807 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3808 0x1C, 0x1D, 0x1E, 0x1F));
3811 #ifdef __POWER8_VECTOR__
3814 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
3815 vector bool int __b) {
3816 return vec_perm(__a, __b,
3817 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3818 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3819 0x18, 0x19, 0x1A, 0x1B));
3822 static __inline__ vector signed int __ATTRS_o_ai
3823 vec_mergee(vector signed int __a, vector signed int __b) {
3824 return vec_perm(__a, __b,
3825 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3826 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3827 0x18, 0x19, 0x1A, 0x1B));
3830 static __inline__ vector unsigned int __ATTRS_o_ai
3831 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
3832 return vec_perm(__a, __b,
3833 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3834 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3835 0x18, 0x19, 0x1A, 0x1B));
3840 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
3841 vector bool int __b) {
3842 return vec_perm(__a, __b,
3843 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3844 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3845 0x1C, 0x1D, 0x1E, 0x1F));
3848 static __inline__ vector signed int __ATTRS_o_ai
3849 vec_mergeo(vector signed int __a, vector signed int __b) {
3850 return vec_perm(__a, __b,
3851 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3852 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3853 0x1C, 0x1D, 0x1E, 0x1F));
3856 static __inline__ vector unsigned int __ATTRS_o_ai
3857 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
3858 return vec_perm(__a, __b,
3859 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3860 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3861 0x1C, 0x1D, 0x1E, 0x1F));
3868 static __inline__ vector unsigned short __attribute__((__always_inline__))
3870 return __builtin_altivec_mfvscr();
3875 static __inline__ vector signed char __ATTRS_o_ai
3876 vec_min(vector signed char __a, vector signed char __b) {
3877 return __builtin_altivec_vminsb(__a, __b);
3880 static __inline__ vector signed char __ATTRS_o_ai
3881 vec_min(vector bool char __a, vector signed char __b) {
3882 return __builtin_altivec_vminsb((vector signed char)__a, __b);
3885 static __inline__ vector signed char __ATTRS_o_ai
3886 vec_min(vector signed char __a, vector bool char __b) {
3887 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
3890 static __inline__ vector unsigned char __ATTRS_o_ai
3891 vec_min(vector unsigned char __a, vector unsigned char __b) {
3892 return __builtin_altivec_vminub(__a, __b);
3895 static __inline__ vector unsigned char __ATTRS_o_ai
3896 vec_min(vector bool char __a, vector unsigned char __b) {
3897 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
3900 static __inline__ vector unsigned char __ATTRS_o_ai
3901 vec_min(vector unsigned char __a, vector bool char __b) {
3902 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
3905 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
3907 return __builtin_altivec_vminsh(__a, __b);
3910 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
3912 return __builtin_altivec_vminsh((vector short)__a, __b);
3915 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
3916 vector bool short __b) {
3917 return __builtin_altivec_vminsh(__a, (vector short)__b);
3920 static __inline__ vector unsigned short __ATTRS_o_ai
3921 vec_min(vector unsigned short __a, vector unsigned short __b) {
3922 return __builtin_altivec_vminuh(__a, __b);
3925 static __inline__ vector unsigned short __ATTRS_o_ai
3926 vec_min(vector bool short __a, vector unsigned short __b) {
3927 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
3930 static __inline__ vector unsigned short __ATTRS_o_ai
3931 vec_min(vector unsigned short __a, vector bool short __b) {
3932 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
3935 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
3937 return __builtin_altivec_vminsw(__a, __b);
3940 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
3942 return __builtin_altivec_vminsw((vector int)__a, __b);
3945 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
3946 vector bool int __b) {
3947 return __builtin_altivec_vminsw(__a, (vector int)__b);
3950 static __inline__ vector unsigned int __ATTRS_o_ai
3951 vec_min(vector unsigned int __a, vector unsigned int __b) {
3952 return __builtin_altivec_vminuw(__a, __b);
3955 static __inline__ vector unsigned int __ATTRS_o_ai
3956 vec_min(vector bool int __a, vector unsigned int __b) {
3957 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
3960 static __inline__ vector unsigned int __ATTRS_o_ai
3961 vec_min(vector unsigned int __a, vector bool int __b) {
3962 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
3965 #ifdef __POWER8_VECTOR__
3966 static __inline__ vector signed long long __ATTRS_o_ai
3967 vec_min(vector signed long long __a, vector signed long long __b) {
3968 return __builtin_altivec_vminsd(__a, __b);
3971 static __inline__ vector signed long long __ATTRS_o_ai
3972 vec_min(vector bool long long __a, vector signed long long __b) {
3973 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
3976 static __inline__ vector signed long long __ATTRS_o_ai
3977 vec_min(vector signed long long __a, vector bool long long __b) {
3978 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
3981 static __inline__ vector unsigned long long __ATTRS_o_ai
3982 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
3983 return __builtin_altivec_vminud(__a, __b);
3986 static __inline__ vector unsigned long long __ATTRS_o_ai
3987 vec_min(vector bool long long __a, vector unsigned long long __b) {
3988 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
3991 static __inline__ vector unsigned long long __ATTRS_o_ai
3992 vec_min(vector unsigned long long __a, vector bool long long __b) {
3993 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
3997 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
4000 return __builtin_vsx_xvminsp(__a, __b);
4002 return __builtin_altivec_vminfp(__a, __b);
4007 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
4008 vector double __b) {
4009 return __builtin_vsx_xvmindp(__a, __b);
4015 static __inline__ vector signed char __ATTRS_o_ai
4016 vec_vminsb(vector signed char __a, vector signed char __b) {
4017 return __builtin_altivec_vminsb(__a, __b);
4020 static __inline__ vector signed char __ATTRS_o_ai
4021 vec_vminsb(vector bool char __a, vector signed char __b) {
4022 return __builtin_altivec_vminsb((vector signed char)__a, __b);
4025 static __inline__ vector signed char __ATTRS_o_ai
4026 vec_vminsb(vector signed char __a, vector bool char __b) {
4027 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
4032 static __inline__ vector unsigned char __ATTRS_o_ai
4033 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
4034 return __builtin_altivec_vminub(__a, __b);
4037 static __inline__ vector unsigned char __ATTRS_o_ai
4038 vec_vminub(vector bool char __a, vector unsigned char __b) {
4039 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
4042 static __inline__ vector unsigned char __ATTRS_o_ai
4043 vec_vminub(vector unsigned char __a, vector bool char __b) {
4044 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
4049 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
4051 return __builtin_altivec_vminsh(__a, __b);
4054 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
4056 return __builtin_altivec_vminsh((vector short)__a, __b);
4059 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
4060 vector bool short __b) {
4061 return __builtin_altivec_vminsh(__a, (vector short)__b);
4066 static __inline__ vector unsigned short __ATTRS_o_ai
4067 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
4068 return __builtin_altivec_vminuh(__a, __b);
4071 static __inline__ vector unsigned short __ATTRS_o_ai
4072 vec_vminuh(vector bool short __a, vector unsigned short __b) {
4073 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
4076 static __inline__ vector unsigned short __ATTRS_o_ai
4077 vec_vminuh(vector unsigned short __a, vector bool short __b) {
4078 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
4083 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
4085 return __builtin_altivec_vminsw(__a, __b);
4088 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
4090 return __builtin_altivec_vminsw((vector int)__a, __b);
4093 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
4094 vector bool int __b) {
4095 return __builtin_altivec_vminsw(__a, (vector int)__b);
4100 static __inline__ vector unsigned int __ATTRS_o_ai
4101 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
4102 return __builtin_altivec_vminuw(__a, __b);
4105 static __inline__ vector unsigned int __ATTRS_o_ai
4106 vec_vminuw(vector bool int __a, vector unsigned int __b) {
4107 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
4110 static __inline__ vector unsigned int __ATTRS_o_ai
4111 vec_vminuw(vector unsigned int __a, vector bool int __b) {
4112 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
4117 static __inline__ vector float __attribute__((__always_inline__))
4118 vec_vminfp(vector float __a, vector float __b) {
4120 return __builtin_vsx_xvminsp(__a, __b);
4122 return __builtin_altivec_vminfp(__a, __b);
4128 #define __builtin_altivec_vmladduhm vec_mladd
4130 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
4133 return __a * __b + __c;
4136 static __inline__ vector short __ATTRS_o_ai vec_mladd(
4137 vector short __a, vector unsigned short __b, vector unsigned short __c) {
4138 return __a * (vector short)__b + (vector short)__c;
4141 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
4144 return (vector short)__a * __b + __c;
4147 static __inline__ vector unsigned short __ATTRS_o_ai
4148 vec_mladd(vector unsigned short __a, vector unsigned short __b,
4149 vector unsigned short __c) {
4150 return __a * __b + __c;
4155 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
4158 return __a * __b + __c;
4161 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
4162 vector short __a, vector unsigned short __b, vector unsigned short __c) {
4163 return __a * (vector short)__b + (vector short)__c;
4166 static __inline__ vector short __ATTRS_o_ai
4167 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
4168 return (vector short)__a * __b + __c;
4171 static __inline__ vector unsigned short __ATTRS_o_ai
4172 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
4173 vector unsigned short __c) {
4174 return __a * __b + __c;
4179 static __inline__ vector short __attribute__((__always_inline__))
4180 vec_mradds(vector short __a, vector short __b, vector short __c) {
4181 return __builtin_altivec_vmhraddshs(__a, __b, __c);
4184 /* vec_vmhraddshs */
4186 static __inline__ vector short __attribute__((__always_inline__))
4187 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
4188 return __builtin_altivec_vmhraddshs(__a, __b, __c);
4193 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
4194 vector unsigned char __b,
4196 return __builtin_altivec_vmsummbm(__a, __b, __c);
4199 static __inline__ vector unsigned int __ATTRS_o_ai
4200 vec_msum(vector unsigned char __a, vector unsigned char __b,
4201 vector unsigned int __c) {
4202 return __builtin_altivec_vmsumubm(__a, __b, __c);
4205 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
4208 return __builtin_altivec_vmsumshm(__a, __b, __c);
4211 static __inline__ vector unsigned int __ATTRS_o_ai
4212 vec_msum(vector unsigned short __a, vector unsigned short __b,
4213 vector unsigned int __c) {
4214 return __builtin_altivec_vmsumuhm(__a, __b, __c);
4219 static __inline__ vector int __attribute__((__always_inline__))
4220 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
4221 return __builtin_altivec_vmsummbm(__a, __b, __c);
4226 static __inline__ vector unsigned int __attribute__((__always_inline__))
4227 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
4228 vector unsigned int __c) {
4229 return __builtin_altivec_vmsumubm(__a, __b, __c);
4234 static __inline__ vector int __attribute__((__always_inline__))
4235 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
4236 return __builtin_altivec_vmsumshm(__a, __b, __c);
4241 static __inline__ vector unsigned int __attribute__((__always_inline__))
4242 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
4243 vector unsigned int __c) {
4244 return __builtin_altivec_vmsumuhm(__a, __b, __c);
4249 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
4252 return __builtin_altivec_vmsumshs(__a, __b, __c);
4255 static __inline__ vector unsigned int __ATTRS_o_ai
4256 vec_msums(vector unsigned short __a, vector unsigned short __b,
4257 vector unsigned int __c) {
4258 return __builtin_altivec_vmsumuhs(__a, __b, __c);
4263 static __inline__ vector int __attribute__((__always_inline__))
4264 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
4265 return __builtin_altivec_vmsumshs(__a, __b, __c);
4270 static __inline__ vector unsigned int __attribute__((__always_inline__))
4271 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
4272 vector unsigned int __c) {
4273 return __builtin_altivec_vmsumuhs(__a, __b, __c);
4278 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
4279 __builtin_altivec_mtvscr((vector int)__a);
4282 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
4283 __builtin_altivec_mtvscr((vector int)__a);
4286 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
4287 __builtin_altivec_mtvscr((vector int)__a);
4290 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
4291 __builtin_altivec_mtvscr((vector int)__a);
4294 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
4295 __builtin_altivec_mtvscr((vector int)__a);
4298 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
4299 __builtin_altivec_mtvscr((vector int)__a);
4302 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
4303 __builtin_altivec_mtvscr((vector int)__a);
4306 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
4307 __builtin_altivec_mtvscr((vector int)__a);
4310 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
4311 __builtin_altivec_mtvscr((vector int)__a);
4314 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
4315 __builtin_altivec_mtvscr((vector int)__a);
4318 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
4319 __builtin_altivec_mtvscr((vector int)__a);
4324 /* Integer vector multiplication will involve multiplication of the odd/even
4325 elements separately, then truncating the results and moving to the
4328 static __inline__ vector signed char __ATTRS_o_ai
4329 vec_mul(vector signed char __a, vector signed char __b) {
4333 static __inline__ vector unsigned char __ATTRS_o_ai
4334 vec_mul(vector unsigned char __a, vector unsigned char __b) {
4338 static __inline__ vector signed short __ATTRS_o_ai
4339 vec_mul(vector signed short __a, vector signed short __b) {
4343 static __inline__ vector unsigned short __ATTRS_o_ai
4344 vec_mul(vector unsigned short __a, vector unsigned short __b) {
4348 static __inline__ vector signed int __ATTRS_o_ai
4349 vec_mul(vector signed int __a, vector signed int __b) {
4353 static __inline__ vector unsigned int __ATTRS_o_ai
4354 vec_mul(vector unsigned int __a, vector unsigned int __b) {
4359 static __inline__ vector signed long long __ATTRS_o_ai
4360 vec_mul(vector signed long long __a, vector signed long long __b) {
4364 static __inline__ vector unsigned long long __ATTRS_o_ai
4365 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
4370 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
4376 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
4377 vector double __b) {
4382 /* The vmulos* and vmules* instructions have a big endian bias, so
4383 we must reverse the meaning of "even" and "odd" for little endian. */
4387 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
4388 vector signed char __b) {
4389 #ifdef __LITTLE_ENDIAN__
4390 return __builtin_altivec_vmulosb(__a, __b);
4392 return __builtin_altivec_vmulesb(__a, __b);
4396 static __inline__ vector unsigned short __ATTRS_o_ai
4397 vec_mule(vector unsigned char __a, vector unsigned char __b) {
4398 #ifdef __LITTLE_ENDIAN__
4399 return __builtin_altivec_vmuloub(__a, __b);
4401 return __builtin_altivec_vmuleub(__a, __b);
4405 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
4407 #ifdef __LITTLE_ENDIAN__
4408 return __builtin_altivec_vmulosh(__a, __b);
4410 return __builtin_altivec_vmulesh(__a, __b);
4414 static __inline__ vector unsigned int __ATTRS_o_ai
4415 vec_mule(vector unsigned short __a, vector unsigned short __b) {
4416 #ifdef __LITTLE_ENDIAN__
4417 return __builtin_altivec_vmulouh(__a, __b);
4419 return __builtin_altivec_vmuleuh(__a, __b);
4423 #ifdef __POWER8_VECTOR__
4424 static __inline__ vector signed long long __ATTRS_o_ai
4425 vec_mule(vector signed int __a, vector signed int __b) {
4426 #ifdef __LITTLE_ENDIAN__
4427 return __builtin_altivec_vmulosw(__a, __b);
4429 return __builtin_altivec_vmulesw(__a, __b);
4433 static __inline__ vector unsigned long long __ATTRS_o_ai
4434 vec_mule(vector unsigned int __a, vector unsigned int __b) {
4435 #ifdef __LITTLE_ENDIAN__
4436 return __builtin_altivec_vmulouw(__a, __b);
4438 return __builtin_altivec_vmuleuw(__a, __b);
4445 static __inline__ vector short __attribute__((__always_inline__))
4446 vec_vmulesb(vector signed char __a, vector signed char __b) {
4447 #ifdef __LITTLE_ENDIAN__
4448 return __builtin_altivec_vmulosb(__a, __b);
4450 return __builtin_altivec_vmulesb(__a, __b);
4456 static __inline__ vector unsigned short __attribute__((__always_inline__))
4457 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
4458 #ifdef __LITTLE_ENDIAN__
4459 return __builtin_altivec_vmuloub(__a, __b);
4461 return __builtin_altivec_vmuleub(__a, __b);
4467 static __inline__ vector int __attribute__((__always_inline__))
4468 vec_vmulesh(vector short __a, vector short __b) {
4469 #ifdef __LITTLE_ENDIAN__
4470 return __builtin_altivec_vmulosh(__a, __b);
4472 return __builtin_altivec_vmulesh(__a, __b);
4478 static __inline__ vector unsigned int __attribute__((__always_inline__))
4479 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
4480 #ifdef __LITTLE_ENDIAN__
4481 return __builtin_altivec_vmulouh(__a, __b);
4483 return __builtin_altivec_vmuleuh(__a, __b);
4489 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
4490 vector signed char __b) {
4491 #ifdef __LITTLE_ENDIAN__
4492 return __builtin_altivec_vmulesb(__a, __b);
4494 return __builtin_altivec_vmulosb(__a, __b);
4498 static __inline__ vector unsigned short __ATTRS_o_ai
4499 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
4500 #ifdef __LITTLE_ENDIAN__
4501 return __builtin_altivec_vmuleub(__a, __b);
4503 return __builtin_altivec_vmuloub(__a, __b);
4507 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
4509 #ifdef __LITTLE_ENDIAN__
4510 return __builtin_altivec_vmulesh(__a, __b);
4512 return __builtin_altivec_vmulosh(__a, __b);
4516 static __inline__ vector unsigned int __ATTRS_o_ai
4517 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
4518 #ifdef __LITTLE_ENDIAN__
4519 return __builtin_altivec_vmuleuh(__a, __b);
4521 return __builtin_altivec_vmulouh(__a, __b);
4525 #ifdef __POWER8_VECTOR__
4526 static __inline__ vector signed long long __ATTRS_o_ai
4527 vec_mulo(vector signed int __a, vector signed int __b) {
4528 #ifdef __LITTLE_ENDIAN__
4529 return __builtin_altivec_vmulesw(__a, __b);
4531 return __builtin_altivec_vmulosw(__a, __b);
4535 static __inline__ vector unsigned long long __ATTRS_o_ai
4536 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
4537 #ifdef __LITTLE_ENDIAN__
4538 return __builtin_altivec_vmuleuw(__a, __b);
4540 return __builtin_altivec_vmulouw(__a, __b);
4547 static __inline__ vector short __attribute__((__always_inline__))
4548 vec_vmulosb(vector signed char __a, vector signed char __b) {
4549 #ifdef __LITTLE_ENDIAN__
4550 return __builtin_altivec_vmulesb(__a, __b);
4552 return __builtin_altivec_vmulosb(__a, __b);
4558 static __inline__ vector unsigned short __attribute__((__always_inline__))
4559 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
4560 #ifdef __LITTLE_ENDIAN__
4561 return __builtin_altivec_vmuleub(__a, __b);
4563 return __builtin_altivec_vmuloub(__a, __b);
4569 static __inline__ vector int __attribute__((__always_inline__))
4570 vec_vmulosh(vector short __a, vector short __b) {
4571 #ifdef __LITTLE_ENDIAN__
4572 return __builtin_altivec_vmulesh(__a, __b);
4574 return __builtin_altivec_vmulosh(__a, __b);
4580 static __inline__ vector unsigned int __attribute__((__always_inline__))
4581 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
4582 #ifdef __LITTLE_ENDIAN__
4583 return __builtin_altivec_vmuleuh(__a, __b);
4585 return __builtin_altivec_vmulouh(__a, __b);
4591 #ifdef __POWER8_VECTOR__
4592 static __inline__ vector signed char __ATTRS_o_ai
4593 vec_nand(vector signed char __a, vector signed char __b) {
4594 return ~(__a & __b);
4597 static __inline__ vector signed char __ATTRS_o_ai
4598 vec_nand(vector signed char __a, vector bool char __b) {
4599 return ~(__a & __b);
4602 static __inline__ vector signed char __ATTRS_o_ai
4603 vec_nand(vector bool char __a, vector signed char __b) {
4604 return ~(__a & __b);
4607 static __inline__ vector unsigned char __ATTRS_o_ai
4608 vec_nand(vector unsigned char __a, vector unsigned char __b) {
4609 return ~(__a & __b);
4612 static __inline__ vector unsigned char __ATTRS_o_ai
4613 vec_nand(vector unsigned char __a, vector bool char __b) {
4614 return ~(__a & __b);
4617 static __inline__ vector unsigned char __ATTRS_o_ai
4618 vec_nand(vector bool char __a, vector unsigned char __b) {
4619 return ~(__a & __b);
4622 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
4623 vector bool char __b) {
4624 return ~(__a & __b);
4627 static __inline__ vector signed short __ATTRS_o_ai
4628 vec_nand(vector signed short __a, vector signed short __b) {
4629 return ~(__a & __b);
4632 static __inline__ vector signed short __ATTRS_o_ai
4633 vec_nand(vector signed short __a, vector bool short __b) {
4634 return ~(__a & __b);
4637 static __inline__ vector signed short __ATTRS_o_ai
4638 vec_nand(vector bool short __a, vector signed short __b) {
4639 return ~(__a & __b);
4642 static __inline__ vector unsigned short __ATTRS_o_ai
4643 vec_nand(vector unsigned short __a, vector unsigned short __b) {
4644 return ~(__a & __b);
4647 static __inline__ vector unsigned short __ATTRS_o_ai
4648 vec_nand(vector unsigned short __a, vector bool short __b) {
4649 return ~(__a & __b);
4652 static __inline__ vector bool short __ATTRS_o_ai
4653 vec_nand(vector bool short __a, vector bool short __b) {
4654 return ~(__a & __b);
4657 static __inline__ vector signed int __ATTRS_o_ai
4658 vec_nand(vector signed int __a, vector signed int __b) {
4659 return ~(__a & __b);
4662 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
4663 vector bool int __b) {
4664 return ~(__a & __b);
4667 static __inline__ vector signed int __ATTRS_o_ai
4668 vec_nand(vector bool int __a, vector signed int __b) {
4669 return ~(__a & __b);
4672 static __inline__ vector unsigned int __ATTRS_o_ai
4673 vec_nand(vector unsigned int __a, vector unsigned int __b) {
4674 return ~(__a & __b);
4677 static __inline__ vector unsigned int __ATTRS_o_ai
4678 vec_nand(vector unsigned int __a, vector bool int __b) {
4679 return ~(__a & __b);
4682 static __inline__ vector unsigned int __ATTRS_o_ai
4683 vec_nand(vector bool int __a, vector unsigned int __b) {
4684 return ~(__a & __b);
4687 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
4688 vector bool int __b) {
4689 return ~(__a & __b);
4692 static __inline__ vector signed long long __ATTRS_o_ai
4693 vec_nand(vector signed long long __a, vector signed long long __b) {
4694 return ~(__a & __b);
4697 static __inline__ vector signed long long __ATTRS_o_ai
4698 vec_nand(vector signed long long __a, vector bool long long __b) {
4699 return ~(__a & __b);
4702 static __inline__ vector signed long long __ATTRS_o_ai
4703 vec_nand(vector bool long long __a, vector signed long long __b) {
4704 return ~(__a & __b);
4707 static __inline__ vector unsigned long long __ATTRS_o_ai
4708 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
4709 return ~(__a & __b);
4712 static __inline__ vector unsigned long long __ATTRS_o_ai
4713 vec_nand(vector unsigned long long __a, vector bool long long __b) {
4714 return ~(__a & __b);
4717 static __inline__ vector unsigned long long __ATTRS_o_ai
4718 vec_nand(vector bool long long __a, vector unsigned long long __b) {
4719 return ~(__a & __b);
4722 static __inline__ vector bool long long __ATTRS_o_ai
4723 vec_nand(vector bool long long __a, vector bool long long __b) {
4724 return ~(__a & __b);
4732 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
4735 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
4738 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
4740 vector double __c) {
4741 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
4747 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
4751 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
4753 return __builtin_altivec_vnmsubfp(__a, __b, __c);
4758 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
4760 vector double __c) {
4761 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
4767 static __inline__ vector float __attribute__((__always_inline__))
4768 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
4769 return __builtin_altivec_vnmsubfp(__a, __b, __c);
4774 #define __builtin_altivec_vnor vec_nor
4776 static __inline__ vector signed char __ATTRS_o_ai
4777 vec_nor(vector signed char __a, vector signed char __b) {
4778 return ~(__a | __b);
4781 static __inline__ vector unsigned char __ATTRS_o_ai
4782 vec_nor(vector unsigned char __a, vector unsigned char __b) {
4783 return ~(__a | __b);
4786 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
4787 vector bool char __b) {
4788 return ~(__a | __b);
4791 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
4793 return ~(__a | __b);
4796 static __inline__ vector unsigned short __ATTRS_o_ai
4797 vec_nor(vector unsigned short __a, vector unsigned short __b) {
4798 return ~(__a | __b);
4801 static __inline__ vector bool short __ATTRS_o_ai
4802 vec_nor(vector bool short __a, vector bool short __b) {
4803 return ~(__a | __b);
4806 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
4808 return ~(__a | __b);
4811 static __inline__ vector unsigned int __ATTRS_o_ai
4812 vec_nor(vector unsigned int __a, vector unsigned int __b) {
4813 return ~(__a | __b);
4816 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
4817 vector bool int __b) {
4818 return ~(__a | __b);
4821 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
4823 vector unsigned int __res =
4824 ~((vector unsigned int)__a | (vector unsigned int)__b);
4825 return (vector float)__res;
4829 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
4830 vector double __b) {
4831 vector unsigned long long __res =
4832 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
4833 return (vector double)__res;
4839 static __inline__ vector signed char __ATTRS_o_ai
4840 vec_vnor(vector signed char __a, vector signed char __b) {
4841 return ~(__a | __b);
4844 static __inline__ vector unsigned char __ATTRS_o_ai
4845 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
4846 return ~(__a | __b);
4849 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
4850 vector bool char __b) {
4851 return ~(__a | __b);
4854 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
4856 return ~(__a | __b);
4859 static __inline__ vector unsigned short __ATTRS_o_ai
4860 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
4861 return ~(__a | __b);
4864 static __inline__ vector bool short __ATTRS_o_ai
4865 vec_vnor(vector bool short __a, vector bool short __b) {
4866 return ~(__a | __b);
4869 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
4871 return ~(__a | __b);
4874 static __inline__ vector unsigned int __ATTRS_o_ai
4875 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
4876 return ~(__a | __b);
4879 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
4880 vector bool int __b) {
4881 return ~(__a | __b);
4884 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
4886 vector unsigned int __res =
4887 ~((vector unsigned int)__a | (vector unsigned int)__b);
4888 return (vector float)__res;
4892 static __inline__ vector signed long long __ATTRS_o_ai
4893 vec_nor(vector signed long long __a, vector signed long long __b) {
4894 return ~(__a | __b);
4897 static __inline__ vector unsigned long long __ATTRS_o_ai
4898 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
4899 return ~(__a | __b);
4902 static __inline__ vector bool long long __ATTRS_o_ai
4903 vec_nor(vector bool long long __a, vector bool long long __b) {
4904 return ~(__a | __b);
4910 #define __builtin_altivec_vor vec_or
4912 static __inline__ vector signed char __ATTRS_o_ai
4913 vec_or(vector signed char __a, vector signed char __b) {
4917 static __inline__ vector signed char __ATTRS_o_ai
4918 vec_or(vector bool char __a, vector signed char __b) {
4919 return (vector signed char)__a | __b;
4922 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
4923 vector bool char __b) {
4924 return __a | (vector signed char)__b;
4927 static __inline__ vector unsigned char __ATTRS_o_ai
4928 vec_or(vector unsigned char __a, vector unsigned char __b) {
4932 static __inline__ vector unsigned char __ATTRS_o_ai
4933 vec_or(vector bool char __a, vector unsigned char __b) {
4934 return (vector unsigned char)__a | __b;
4937 static __inline__ vector unsigned char __ATTRS_o_ai
4938 vec_or(vector unsigned char __a, vector bool char __b) {
4939 return __a | (vector unsigned char)__b;
4942 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
4943 vector bool char __b) {
4947 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
4952 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
4954 return (vector short)__a | __b;
4957 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
4958 vector bool short __b) {
4959 return __a | (vector short)__b;
4962 static __inline__ vector unsigned short __ATTRS_o_ai
4963 vec_or(vector unsigned short __a, vector unsigned short __b) {
4967 static __inline__ vector unsigned short __ATTRS_o_ai
4968 vec_or(vector bool short __a, vector unsigned short __b) {
4969 return (vector unsigned short)__a | __b;
4972 static __inline__ vector unsigned short __ATTRS_o_ai
4973 vec_or(vector unsigned short __a, vector bool short __b) {
4974 return __a | (vector unsigned short)__b;
4977 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
4978 vector bool short __b) {
4982 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
4987 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
4989 return (vector int)__a | __b;
4992 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
4993 vector bool int __b) {
4994 return __a | (vector int)__b;
4997 static __inline__ vector unsigned int __ATTRS_o_ai
4998 vec_or(vector unsigned int __a, vector unsigned int __b) {
5002 static __inline__ vector unsigned int __ATTRS_o_ai
5003 vec_or(vector bool int __a, vector unsigned int __b) {
5004 return (vector unsigned int)__a | __b;
5007 static __inline__ vector unsigned int __ATTRS_o_ai
5008 vec_or(vector unsigned int __a, vector bool int __b) {
5009 return __a | (vector unsigned int)__b;
5012 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
5013 vector bool int __b) {
5017 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
5019 vector unsigned int __res =
5020 (vector unsigned int)__a | (vector unsigned int)__b;
5021 return (vector float)__res;
5024 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
5026 vector unsigned int __res =
5027 (vector unsigned int)__a | (vector unsigned int)__b;
5028 return (vector float)__res;
5031 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
5032 vector bool int __b) {
5033 vector unsigned int __res =
5034 (vector unsigned int)__a | (vector unsigned int)__b;
5035 return (vector float)__res;
5039 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
5040 vector double __b) {
5041 return (vector unsigned long long)__a | (vector unsigned long long)__b;
5044 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
5045 vector bool long long __b) {
5046 return (vector unsigned long long)__a | (vector unsigned long long)__b;
5049 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
5050 vector double __b) {
5051 vector unsigned long long __res =
5052 (vector unsigned long long)__a | (vector unsigned long long)__b;
5053 return (vector double)__res;
5056 static __inline__ vector signed long long __ATTRS_o_ai
5057 vec_or(vector signed long long __a, vector signed long long __b) {
5061 static __inline__ vector signed long long __ATTRS_o_ai
5062 vec_or(vector bool long long __a, vector signed long long __b) {
5063 return (vector signed long long)__a | __b;
5066 static __inline__ vector signed long long __ATTRS_o_ai
5067 vec_or(vector signed long long __a, vector bool long long __b) {
5068 return __a | (vector signed long long)__b;
5071 static __inline__ vector unsigned long long __ATTRS_o_ai
5072 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
5076 static __inline__ vector unsigned long long __ATTRS_o_ai
5077 vec_or(vector bool long long __a, vector unsigned long long __b) {
5078 return (vector unsigned long long)__a | __b;
5081 static __inline__ vector unsigned long long __ATTRS_o_ai
5082 vec_or(vector unsigned long long __a, vector bool long long __b) {
5083 return __a | (vector unsigned long long)__b;
5086 static __inline__ vector bool long long __ATTRS_o_ai
5087 vec_or(vector bool long long __a, vector bool long long __b) {
5092 #ifdef __POWER8_VECTOR__
5093 static __inline__ vector signed char __ATTRS_o_ai
5094 vec_orc(vector signed char __a, vector signed char __b) {
5098 static __inline__ vector signed char __ATTRS_o_ai
5099 vec_orc(vector signed char __a, vector bool char __b) {
5103 static __inline__ vector signed char __ATTRS_o_ai
5104 vec_orc(vector bool char __a, vector signed char __b) {
5108 static __inline__ vector unsigned char __ATTRS_o_ai
5109 vec_orc(vector unsigned char __a, vector unsigned char __b) {
5113 static __inline__ vector unsigned char __ATTRS_o_ai
5114 vec_orc(vector unsigned char __a, vector bool char __b) {
5118 static __inline__ vector unsigned char __ATTRS_o_ai
5119 vec_orc(vector bool char __a, vector unsigned char __b) {
5123 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
5124 vector bool char __b) {
5128 static __inline__ vector signed short __ATTRS_o_ai
5129 vec_orc(vector signed short __a, vector signed short __b) {
5133 static __inline__ vector signed short __ATTRS_o_ai
5134 vec_orc(vector signed short __a, vector bool short __b) {
5138 static __inline__ vector signed short __ATTRS_o_ai
5139 vec_orc(vector bool short __a, vector signed short __b) {
5143 static __inline__ vector unsigned short __ATTRS_o_ai
5144 vec_orc(vector unsigned short __a, vector unsigned short __b) {
5148 static __inline__ vector unsigned short __ATTRS_o_ai
5149 vec_orc(vector unsigned short __a, vector bool short __b) {
5153 static __inline__ vector unsigned short __ATTRS_o_ai
5154 vec_orc(vector bool short __a, vector unsigned short __b) {
5158 static __inline__ vector bool short __ATTRS_o_ai
5159 vec_orc(vector bool short __a, vector bool short __b) {
5163 static __inline__ vector signed int __ATTRS_o_ai
5164 vec_orc(vector signed int __a, vector signed int __b) {
5168 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
5169 vector bool int __b) {
5173 static __inline__ vector signed int __ATTRS_o_ai
5174 vec_orc(vector bool int __a, vector signed int __b) {
5178 static __inline__ vector unsigned int __ATTRS_o_ai
5179 vec_orc(vector unsigned int __a, vector unsigned int __b) {
5183 static __inline__ vector unsigned int __ATTRS_o_ai
5184 vec_orc(vector unsigned int __a, vector bool int __b) {
5188 static __inline__ vector unsigned int __ATTRS_o_ai
5189 vec_orc(vector bool int __a, vector unsigned int __b) {
5193 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
5194 vector bool int __b) {
5198 static __inline__ vector signed long long __ATTRS_o_ai
5199 vec_orc(vector signed long long __a, vector signed long long __b) {
5203 static __inline__ vector signed long long __ATTRS_o_ai
5204 vec_orc(vector signed long long __a, vector bool long long __b) {
5208 static __inline__ vector signed long long __ATTRS_o_ai
5209 vec_orc(vector bool long long __a, vector signed long long __b) {
5213 static __inline__ vector unsigned long long __ATTRS_o_ai
5214 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
5218 static __inline__ vector unsigned long long __ATTRS_o_ai
5219 vec_orc(vector unsigned long long __a, vector bool long long __b) {
5223 static __inline__ vector unsigned long long __ATTRS_o_ai
5224 vec_orc(vector bool long long __a, vector unsigned long long __b) {
5228 static __inline__ vector bool long long __ATTRS_o_ai
5229 vec_orc(vector bool long long __a, vector bool long long __b) {
5236 static __inline__ vector signed char __ATTRS_o_ai
5237 vec_vor(vector signed char __a, vector signed char __b) {
5241 static __inline__ vector signed char __ATTRS_o_ai
5242 vec_vor(vector bool char __a, vector signed char __b) {
5243 return (vector signed char)__a | __b;
5246 static __inline__ vector signed char __ATTRS_o_ai
5247 vec_vor(vector signed char __a, vector bool char __b) {
5248 return __a | (vector signed char)__b;
5251 static __inline__ vector unsigned char __ATTRS_o_ai
5252 vec_vor(vector unsigned char __a, vector unsigned char __b) {
5256 static __inline__ vector unsigned char __ATTRS_o_ai
5257 vec_vor(vector bool char __a, vector unsigned char __b) {
5258 return (vector unsigned char)__a | __b;
5261 static __inline__ vector unsigned char __ATTRS_o_ai
5262 vec_vor(vector unsigned char __a, vector bool char __b) {
5263 return __a | (vector unsigned char)__b;
5266 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
5267 vector bool char __b) {
5271 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
5276 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
5278 return (vector short)__a | __b;
5281 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
5282 vector bool short __b) {
5283 return __a | (vector short)__b;
5286 static __inline__ vector unsigned short __ATTRS_o_ai
5287 vec_vor(vector unsigned short __a, vector unsigned short __b) {
5291 static __inline__ vector unsigned short __ATTRS_o_ai
5292 vec_vor(vector bool short __a, vector unsigned short __b) {
5293 return (vector unsigned short)__a | __b;
5296 static __inline__ vector unsigned short __ATTRS_o_ai
5297 vec_vor(vector unsigned short __a, vector bool short __b) {
5298 return __a | (vector unsigned short)__b;
5301 static __inline__ vector bool short __ATTRS_o_ai
5302 vec_vor(vector bool short __a, vector bool short __b) {
5306 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
5311 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
5313 return (vector int)__a | __b;
5316 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
5317 vector bool int __b) {
5318 return __a | (vector int)__b;
5321 static __inline__ vector unsigned int __ATTRS_o_ai
5322 vec_vor(vector unsigned int __a, vector unsigned int __b) {
5326 static __inline__ vector unsigned int __ATTRS_o_ai
5327 vec_vor(vector bool int __a, vector unsigned int __b) {
5328 return (vector unsigned int)__a | __b;
5331 static __inline__ vector unsigned int __ATTRS_o_ai
5332 vec_vor(vector unsigned int __a, vector bool int __b) {
5333 return __a | (vector unsigned int)__b;
5336 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
5337 vector bool int __b) {
5341 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
5343 vector unsigned int __res =
5344 (vector unsigned int)__a | (vector unsigned int)__b;
5345 return (vector float)__res;
5348 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
5350 vector unsigned int __res =
5351 (vector unsigned int)__a | (vector unsigned int)__b;
5352 return (vector float)__res;
5355 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
5356 vector bool int __b) {
5357 vector unsigned int __res =
5358 (vector unsigned int)__a | (vector unsigned int)__b;
5359 return (vector float)__res;
5363 static __inline__ vector signed long long __ATTRS_o_ai
5364 vec_vor(vector signed long long __a, vector signed long long __b) {
5368 static __inline__ vector signed long long __ATTRS_o_ai
5369 vec_vor(vector bool long long __a, vector signed long long __b) {
5370 return (vector signed long long)__a | __b;
5373 static __inline__ vector signed long long __ATTRS_o_ai
5374 vec_vor(vector signed long long __a, vector bool long long __b) {
5375 return __a | (vector signed long long)__b;
5378 static __inline__ vector unsigned long long __ATTRS_o_ai
5379 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
5383 static __inline__ vector unsigned long long __ATTRS_o_ai
5384 vec_vor(vector bool long long __a, vector unsigned long long __b) {
5385 return (vector unsigned long long)__a | __b;
5388 static __inline__ vector unsigned long long __ATTRS_o_ai
5389 vec_vor(vector unsigned long long __a, vector bool long long __b) {
5390 return __a | (vector unsigned long long)__b;
5393 static __inline__ vector bool long long __ATTRS_o_ai
5394 vec_vor(vector bool long long __a, vector bool long long __b) {
5401 /* The various vector pack instructions have a big-endian bias, so for
5402 little endian we must handle reversed element numbering. */
5404 static __inline__ vector signed char __ATTRS_o_ai
5405 vec_pack(vector signed short __a, vector signed short __b) {
5406 #ifdef __LITTLE_ENDIAN__
5407 return (vector signed char)vec_perm(
5409 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5410 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5412 return (vector signed char)vec_perm(
5414 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5415 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5419 static __inline__ vector unsigned char __ATTRS_o_ai
5420 vec_pack(vector unsigned short __a, vector unsigned short __b) {
5421 #ifdef __LITTLE_ENDIAN__
5422 return (vector unsigned char)vec_perm(
5424 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5425 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5427 return (vector unsigned char)vec_perm(
5429 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5430 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5434 static __inline__ vector bool char __ATTRS_o_ai
5435 vec_pack(vector bool short __a, vector bool short __b) {
5436 #ifdef __LITTLE_ENDIAN__
5437 return (vector bool char)vec_perm(
5439 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5440 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5442 return (vector bool char)vec_perm(
5444 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5445 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5449 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
5451 #ifdef __LITTLE_ENDIAN__
5452 return (vector short)vec_perm(
5454 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5455 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5457 return (vector short)vec_perm(
5459 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5460 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5464 static __inline__ vector unsigned short __ATTRS_o_ai
5465 vec_pack(vector unsigned int __a, vector unsigned int __b) {
5466 #ifdef __LITTLE_ENDIAN__
5467 return (vector unsigned short)vec_perm(
5469 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5470 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5472 return (vector unsigned short)vec_perm(
5474 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5475 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5479 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
5480 vector bool int __b) {
5481 #ifdef __LITTLE_ENDIAN__
5482 return (vector bool short)vec_perm(
5484 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5485 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5487 return (vector bool short)vec_perm(
5489 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5490 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5495 static __inline__ vector signed int __ATTRS_o_ai
5496 vec_pack(vector signed long long __a, vector signed long long __b) {
5497 #ifdef __LITTLE_ENDIAN__
5498 return (vector signed int)vec_perm(
5500 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5501 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5503 return (vector signed int)vec_perm(
5505 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5506 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5509 static __inline__ vector unsigned int __ATTRS_o_ai
5510 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
5511 #ifdef __LITTLE_ENDIAN__
5512 return (vector unsigned int)vec_perm(
5514 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5515 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5517 return (vector unsigned int)vec_perm(
5519 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5520 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5524 static __inline__ vector bool int __ATTRS_o_ai
5525 vec_pack(vector bool long long __a, vector bool long long __b) {
5526 #ifdef __LITTLE_ENDIAN__
5527 return (vector bool int)vec_perm(
5529 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5530 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5532 return (vector bool int)vec_perm(
5534 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5535 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5543 #define __builtin_altivec_vpkuhum vec_vpkuhum
5545 static __inline__ vector signed char __ATTRS_o_ai
5546 vec_vpkuhum(vector signed short __a, vector signed short __b) {
5547 #ifdef __LITTLE_ENDIAN__
5548 return (vector signed char)vec_perm(
5550 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5551 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5553 return (vector signed char)vec_perm(
5555 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5556 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5560 static __inline__ vector unsigned char __ATTRS_o_ai
5561 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
5562 #ifdef __LITTLE_ENDIAN__
5563 return (vector unsigned char)vec_perm(
5565 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5566 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5568 return (vector unsigned char)vec_perm(
5570 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5571 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5575 static __inline__ vector bool char __ATTRS_o_ai
5576 vec_vpkuhum(vector bool short __a, vector bool short __b) {
5577 #ifdef __LITTLE_ENDIAN__
5578 return (vector bool char)vec_perm(
5580 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5581 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5583 return (vector bool char)vec_perm(
5585 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5586 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5592 #define __builtin_altivec_vpkuwum vec_vpkuwum
5594 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
5596 #ifdef __LITTLE_ENDIAN__
5597 return (vector short)vec_perm(
5599 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5600 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5602 return (vector short)vec_perm(
5604 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5605 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5609 static __inline__ vector unsigned short __ATTRS_o_ai
5610 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
5611 #ifdef __LITTLE_ENDIAN__
5612 return (vector unsigned short)vec_perm(
5614 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5615 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5617 return (vector unsigned short)vec_perm(
5619 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5620 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5624 static __inline__ vector bool short __ATTRS_o_ai
5625 vec_vpkuwum(vector bool int __a, vector bool int __b) {
5626 #ifdef __LITTLE_ENDIAN__
5627 return (vector bool short)vec_perm(
5629 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5630 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5632 return (vector bool short)vec_perm(
5634 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5635 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5641 #ifdef __POWER8_VECTOR__
5642 #define __builtin_altivec_vpkudum vec_vpkudum
5644 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
5645 vector long long __b) {
5646 #ifdef __LITTLE_ENDIAN__
5647 return (vector int)vec_perm(
5649 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5650 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5652 return (vector int)vec_perm(
5654 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5655 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5659 static __inline__ vector unsigned int __ATTRS_o_ai
5660 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
5661 #ifdef __LITTLE_ENDIAN__
5662 return (vector unsigned int)vec_perm(
5664 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5665 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5667 return (vector unsigned int)vec_perm(
5669 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5670 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5674 static __inline__ vector bool int __ATTRS_o_ai
5675 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
5676 #ifdef __LITTLE_ENDIAN__
5677 return (vector bool int)vec_perm(
5678 (vector long long)__a, (vector long long)__b,
5679 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5680 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5682 return (vector bool int)vec_perm(
5683 (vector long long)__a, (vector long long)__b,
5684 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5685 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5692 static __inline__ vector pixel __attribute__((__always_inline__))
5693 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
5694 #ifdef __LITTLE_ENDIAN__
5695 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
5697 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
5703 static __inline__ vector pixel __attribute__((__always_inline__))
5704 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
5705 #ifdef __LITTLE_ENDIAN__
5706 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
5708 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
5714 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
5716 #ifdef __LITTLE_ENDIAN__
5717 return __builtin_altivec_vpkshss(__b, __a);
5719 return __builtin_altivec_vpkshss(__a, __b);
5723 static __inline__ vector unsigned char __ATTRS_o_ai
5724 vec_packs(vector unsigned short __a, vector unsigned short __b) {
5725 #ifdef __LITTLE_ENDIAN__
5726 return __builtin_altivec_vpkuhus(__b, __a);
5728 return __builtin_altivec_vpkuhus(__a, __b);
5732 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
5734 #ifdef __LITTLE_ENDIAN__
5735 return __builtin_altivec_vpkswss(__b, __a);
5737 return __builtin_altivec_vpkswss(__a, __b);
5741 static __inline__ vector unsigned short __ATTRS_o_ai
5742 vec_packs(vector unsigned int __a, vector unsigned int __b) {
5743 #ifdef __LITTLE_ENDIAN__
5744 return __builtin_altivec_vpkuwus(__b, __a);
5746 return __builtin_altivec_vpkuwus(__a, __b);
5750 #ifdef __POWER8_VECTOR__
5751 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
5752 vector long long __b) {
5753 #ifdef __LITTLE_ENDIAN__
5754 return __builtin_altivec_vpksdss(__b, __a);
5756 return __builtin_altivec_vpksdss(__a, __b);
5760 static __inline__ vector unsigned int __ATTRS_o_ai
5761 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
5762 #ifdef __LITTLE_ENDIAN__
5763 return __builtin_altivec_vpkudus(__b, __a);
5765 return __builtin_altivec_vpkudus(__a, __b);
5772 static __inline__ vector signed char __attribute__((__always_inline__))
5773 vec_vpkshss(vector short __a, vector short __b) {
5774 #ifdef __LITTLE_ENDIAN__
5775 return __builtin_altivec_vpkshss(__b, __a);
5777 return __builtin_altivec_vpkshss(__a, __b);
5783 #ifdef __POWER8_VECTOR__
5784 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
5785 vector long long __b) {
5786 #ifdef __LITTLE_ENDIAN__
5787 return __builtin_altivec_vpksdss(__b, __a);
5789 return __builtin_altivec_vpksdss(__a, __b);
5796 static __inline__ vector unsigned char __attribute__((__always_inline__))
5797 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
5798 #ifdef __LITTLE_ENDIAN__
5799 return __builtin_altivec_vpkuhus(__b, __a);
5801 return __builtin_altivec_vpkuhus(__a, __b);
5807 #ifdef __POWER8_VECTOR__
5808 static __inline__ vector unsigned int __attribute__((__always_inline__))
5809 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
5810 #ifdef __LITTLE_ENDIAN__
5811 return __builtin_altivec_vpkudus(__b, __a);
5813 return __builtin_altivec_vpkudus(__a, __b);
5820 static __inline__ vector signed short __attribute__((__always_inline__))
5821 vec_vpkswss(vector int __a, vector int __b) {
5822 #ifdef __LITTLE_ENDIAN__
5823 return __builtin_altivec_vpkswss(__b, __a);
5825 return __builtin_altivec_vpkswss(__a, __b);
5831 static __inline__ vector unsigned short __attribute__((__always_inline__))
5832 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
5833 #ifdef __LITTLE_ENDIAN__
5834 return __builtin_altivec_vpkuwus(__b, __a);
5836 return __builtin_altivec_vpkuwus(__a, __b);
5842 static __inline__ vector unsigned char __ATTRS_o_ai
5843 vec_packsu(vector short __a, vector short __b) {
5844 #ifdef __LITTLE_ENDIAN__
5845 return __builtin_altivec_vpkshus(__b, __a);
5847 return __builtin_altivec_vpkshus(__a, __b);
5851 static __inline__ vector unsigned char __ATTRS_o_ai
5852 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
5853 #ifdef __LITTLE_ENDIAN__
5854 return __builtin_altivec_vpkuhus(__b, __a);
5856 return __builtin_altivec_vpkuhus(__a, __b);
5860 static __inline__ vector unsigned short __ATTRS_o_ai
5861 vec_packsu(vector int __a, vector int __b) {
5862 #ifdef __LITTLE_ENDIAN__
5863 return __builtin_altivec_vpkswus(__b, __a);
5865 return __builtin_altivec_vpkswus(__a, __b);
5869 static __inline__ vector unsigned short __ATTRS_o_ai
5870 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
5871 #ifdef __LITTLE_ENDIAN__
5872 return __builtin_altivec_vpkuwus(__b, __a);
5874 return __builtin_altivec_vpkuwus(__a, __b);
5878 #ifdef __POWER8_VECTOR__
5879 static __inline__ vector unsigned int __ATTRS_o_ai
5880 vec_packsu(vector long long __a, vector long long __b) {
5881 #ifdef __LITTLE_ENDIAN__
5882 return __builtin_altivec_vpksdus(__b, __a);
5884 return __builtin_altivec_vpksdus(__a, __b);
5888 static __inline__ vector unsigned int __ATTRS_o_ai
5889 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
5890 #ifdef __LITTLE_ENDIAN__
5891 return __builtin_altivec_vpkudus(__b, __a);
5893 return __builtin_altivec_vpkudus(__a, __b);
5900 static __inline__ vector unsigned char __ATTRS_o_ai
5901 vec_vpkshus(vector short __a, vector short __b) {
5902 #ifdef __LITTLE_ENDIAN__
5903 return __builtin_altivec_vpkshus(__b, __a);
5905 return __builtin_altivec_vpkshus(__a, __b);
5909 static __inline__ vector unsigned char __ATTRS_o_ai
5910 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
5911 #ifdef __LITTLE_ENDIAN__
5912 return __builtin_altivec_vpkuhus(__b, __a);
5914 return __builtin_altivec_vpkuhus(__a, __b);
5920 static __inline__ vector unsigned short __ATTRS_o_ai
5921 vec_vpkswus(vector int __a, vector int __b) {
5922 #ifdef __LITTLE_ENDIAN__
5923 return __builtin_altivec_vpkswus(__b, __a);
5925 return __builtin_altivec_vpkswus(__a, __b);
5929 static __inline__ vector unsigned short __ATTRS_o_ai
5930 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
5931 #ifdef __LITTLE_ENDIAN__
5932 return __builtin_altivec_vpkuwus(__b, __a);
5934 return __builtin_altivec_vpkuwus(__a, __b);
5940 #ifdef __POWER8_VECTOR__
5941 static __inline__ vector unsigned int __ATTRS_o_ai
5942 vec_vpksdus(vector long long __a, vector long long __b) {
5943 #ifdef __LITTLE_ENDIAN__
5944 return __builtin_altivec_vpksdus(__b, __a);
5946 return __builtin_altivec_vpksdus(__a, __b);
5953 // The vperm instruction is defined architecturally with a big-endian bias.
5954 // For little endian, we swap the input operands and invert the permute
5955 // control vector. Only the rightmost 5 bits matter, so we could use
5956 // a vector of all 31s instead of all 255s to perform the inversion.
5957 // However, when the PCV is not a constant, using 255 has an advantage
5958 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
5959 // later, possibly a vec_nand).
5961 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
5962 vector signed char __a, vector signed char __b, vector unsigned char __c) {
5963 #ifdef __LITTLE_ENDIAN__
5964 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
5965 255, 255, 255, 255, 255, 255, 255, 255};
5966 __d = vec_xor(__c, __d);
5967 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
5968 (vector int)__a, __d);
5970 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
5971 (vector int)__b, __c);
5975 static __inline__ vector unsigned char __ATTRS_o_ai
5976 vec_perm(vector unsigned char __a, vector unsigned char __b,
5977 vector unsigned char __c) {
5978 #ifdef __LITTLE_ENDIAN__
5979 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
5980 255, 255, 255, 255, 255, 255, 255, 255};
5981 __d = vec_xor(__c, __d);
5982 return (vector unsigned char)__builtin_altivec_vperm_4si(
5983 (vector int)__b, (vector int)__a, __d);
5985 return (vector unsigned char)__builtin_altivec_vperm_4si(
5986 (vector int)__a, (vector int)__b, __c);
5990 static __inline__ vector bool char __ATTRS_o_ai
5991 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
5992 #ifdef __LITTLE_ENDIAN__
5993 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
5994 255, 255, 255, 255, 255, 255, 255, 255};
5995 __d = vec_xor(__c, __d);
5996 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
5997 (vector int)__a, __d);
5999 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
6000 (vector int)__b, __c);
6004 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
6005 vector signed short __b,
6006 vector unsigned char __c) {
6007 #ifdef __LITTLE_ENDIAN__
6008 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6009 255, 255, 255, 255, 255, 255, 255, 255};
6010 __d = vec_xor(__c, __d);
6011 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
6012 (vector int)__a, __d);
6014 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
6015 (vector int)__b, __c);
6019 static __inline__ vector unsigned short __ATTRS_o_ai
6020 vec_perm(vector unsigned short __a, vector unsigned short __b,
6021 vector unsigned char __c) {
6022 #ifdef __LITTLE_ENDIAN__
6023 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6024 255, 255, 255, 255, 255, 255, 255, 255};
6025 __d = vec_xor(__c, __d);
6026 return (vector unsigned short)__builtin_altivec_vperm_4si(
6027 (vector int)__b, (vector int)__a, __d);
6029 return (vector unsigned short)__builtin_altivec_vperm_4si(
6030 (vector int)__a, (vector int)__b, __c);
6034 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
6035 vector bool short __a, vector bool short __b, vector unsigned char __c) {
6036 #ifdef __LITTLE_ENDIAN__
6037 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6038 255, 255, 255, 255, 255, 255, 255, 255};
6039 __d = vec_xor(__c, __d);
6040 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
6041 (vector int)__a, __d);
6043 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
6044 (vector int)__b, __c);
6048 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
6050 vector unsigned char __c) {
6051 #ifdef __LITTLE_ENDIAN__
6052 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6053 255, 255, 255, 255, 255, 255, 255, 255};
6054 __d = vec_xor(__c, __d);
6055 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
6056 (vector int)__a, __d);
6058 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
6059 (vector int)__b, __c);
6063 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
6064 vector signed int __b,
6065 vector unsigned char __c) {
6066 #ifdef __LITTLE_ENDIAN__
6067 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6068 255, 255, 255, 255, 255, 255, 255, 255};
6069 __d = vec_xor(__c, __d);
6070 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
6072 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
6076 static __inline__ vector unsigned int __ATTRS_o_ai
6077 vec_perm(vector unsigned int __a, vector unsigned int __b,
6078 vector unsigned char __c) {
6079 #ifdef __LITTLE_ENDIAN__
6080 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6081 255, 255, 255, 255, 255, 255, 255, 255};
6082 __d = vec_xor(__c, __d);
6083 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
6084 (vector int)__a, __d);
6086 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
6087 (vector int)__b, __c);
6091 static __inline__ vector bool int __ATTRS_o_ai
6092 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
6093 #ifdef __LITTLE_ENDIAN__
6094 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6095 255, 255, 255, 255, 255, 255, 255, 255};
6096 __d = vec_xor(__c, __d);
6097 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
6098 (vector int)__a, __d);
6100 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
6101 (vector int)__b, __c);
6105 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
6107 vector unsigned char __c) {
6108 #ifdef __LITTLE_ENDIAN__
6109 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6110 255, 255, 255, 255, 255, 255, 255, 255};
6111 __d = vec_xor(__c, __d);
6112 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
6113 (vector int)__a, __d);
6115 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
6116 (vector int)__b, __c);
6121 static __inline__ vector long long __ATTRS_o_ai
6122 vec_perm(vector signed long long __a, vector signed long long __b,
6123 vector unsigned char __c) {
6124 #ifdef __LITTLE_ENDIAN__
6125 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6126 255, 255, 255, 255, 255, 255, 255, 255};
6127 __d = vec_xor(__c, __d);
6128 return (vector signed long long)__builtin_altivec_vperm_4si(
6129 (vector int)__b, (vector int)__a, __d);
6131 return (vector signed long long)__builtin_altivec_vperm_4si(
6132 (vector int)__a, (vector int)__b, __c);
6136 static __inline__ vector unsigned long long __ATTRS_o_ai
6137 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
6138 vector unsigned char __c) {
6139 #ifdef __LITTLE_ENDIAN__
6140 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6141 255, 255, 255, 255, 255, 255, 255, 255};
6142 __d = vec_xor(__c, __d);
6143 return (vector unsigned long long)__builtin_altivec_vperm_4si(
6144 (vector int)__b, (vector int)__a, __d);
6146 return (vector unsigned long long)__builtin_altivec_vperm_4si(
6147 (vector int)__a, (vector int)__b, __c);
6151 static __inline__ vector bool long long __ATTRS_o_ai
6152 vec_perm(vector bool long long __a, vector bool long long __b,
6153 vector unsigned char __c) {
6154 #ifdef __LITTLE_ENDIAN__
6155 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6156 255, 255, 255, 255, 255, 255, 255, 255};
6157 __d = vec_xor(__c, __d);
6158 return (vector bool long long)__builtin_altivec_vperm_4si(
6159 (vector int)__b, (vector int)__a, __d);
6161 return (vector bool long long)__builtin_altivec_vperm_4si(
6162 (vector int)__a, (vector int)__b, __c);
6166 static __inline__ vector double __ATTRS_o_ai
6167 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
6168 #ifdef __LITTLE_ENDIAN__
6169 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6170 255, 255, 255, 255, 255, 255, 255, 255};
6171 __d = vec_xor(__c, __d);
6172 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
6173 (vector int)__a, __d);
6175 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
6176 (vector int)__b, __c);
6183 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
6184 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6185 return vec_perm(__a, __b, __c);
6188 static __inline__ vector unsigned char __ATTRS_o_ai
6189 vec_vperm(vector unsigned char __a, vector unsigned char __b,
6190 vector unsigned char __c) {
6191 return vec_perm(__a, __b, __c);
6194 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
6195 vector bool char __a, vector bool char __b, vector unsigned char __c) {
6196 return vec_perm(__a, __b, __c);
6199 static __inline__ vector short __ATTRS_o_ai
6200 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
6201 return vec_perm(__a, __b, __c);
6204 static __inline__ vector unsigned short __ATTRS_o_ai
6205 vec_vperm(vector unsigned short __a, vector unsigned short __b,
6206 vector unsigned char __c) {
6207 return vec_perm(__a, __b, __c);
6210 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
6211 vector bool short __a, vector bool short __b, vector unsigned char __c) {
6212 return vec_perm(__a, __b, __c);
6215 static __inline__ vector pixel __ATTRS_o_ai
6216 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
6217 return vec_perm(__a, __b, __c);
6220 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
6222 vector unsigned char __c) {
6223 return vec_perm(__a, __b, __c);
6226 static __inline__ vector unsigned int __ATTRS_o_ai
6227 vec_vperm(vector unsigned int __a, vector unsigned int __b,
6228 vector unsigned char __c) {
6229 return vec_perm(__a, __b, __c);
6232 static __inline__ vector bool int __ATTRS_o_ai
6233 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
6234 return vec_perm(__a, __b, __c);
6237 static __inline__ vector float __ATTRS_o_ai
6238 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
6239 return vec_perm(__a, __b, __c);
6243 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
6244 vector long long __a, vector long long __b, vector unsigned char __c) {
6245 return vec_perm(__a, __b, __c);
6248 static __inline__ vector unsigned long long __ATTRS_o_ai
6249 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
6250 vector unsigned char __c) {
6251 return vec_perm(__a, __b, __c);
6254 static __inline__ vector double __ATTRS_o_ai
6255 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
6256 return vec_perm(__a, __b, __c);
6262 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
6264 return __builtin_vsx_xvresp(__a);
6266 return __builtin_altivec_vrefp(__a);
6271 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
6272 return __builtin_vsx_xvredp(__a);
6278 static __inline__ vector float __attribute__((__always_inline__))
6279 vec_vrefp(vector float __a) {
6280 return __builtin_altivec_vrefp(__a);
6285 static __inline__ vector signed char __ATTRS_o_ai
6286 vec_rl(vector signed char __a, vector unsigned char __b) {
6287 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
6290 static __inline__ vector unsigned char __ATTRS_o_ai
6291 vec_rl(vector unsigned char __a, vector unsigned char __b) {
6292 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
6295 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
6296 vector unsigned short __b) {
6297 return __builtin_altivec_vrlh(__a, __b);
6300 static __inline__ vector unsigned short __ATTRS_o_ai
6301 vec_rl(vector unsigned short __a, vector unsigned short __b) {
6302 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
6305 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
6306 vector unsigned int __b) {
6307 return __builtin_altivec_vrlw(__a, __b);
6310 static __inline__ vector unsigned int __ATTRS_o_ai
6311 vec_rl(vector unsigned int __a, vector unsigned int __b) {
6312 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
6315 #ifdef __POWER8_VECTOR__
6316 static __inline__ vector signed long long __ATTRS_o_ai
6317 vec_rl(vector signed long long __a, vector unsigned long long __b) {
6318 return __builtin_altivec_vrld(__a, __b);
6321 static __inline__ vector unsigned long long __ATTRS_o_ai
6322 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
6323 return __builtin_altivec_vrld(__a, __b);
6329 static __inline__ vector signed char __ATTRS_o_ai
6330 vec_vrlb(vector signed char __a, vector unsigned char __b) {
6331 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
6334 static __inline__ vector unsigned char __ATTRS_o_ai
6335 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
6336 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
6341 static __inline__ vector short __ATTRS_o_ai
6342 vec_vrlh(vector short __a, vector unsigned short __b) {
6343 return __builtin_altivec_vrlh(__a, __b);
6346 static __inline__ vector unsigned short __ATTRS_o_ai
6347 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
6348 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
6353 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
6354 vector unsigned int __b) {
6355 return __builtin_altivec_vrlw(__a, __b);
6358 static __inline__ vector unsigned int __ATTRS_o_ai
6359 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
6360 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
6365 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
6367 return __builtin_vsx_xvrspi(__a);
6369 return __builtin_altivec_vrfin(__a);
6374 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
6375 return __builtin_vsx_xvrdpi(__a);
6380 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
6381 return __builtin_vsx_xvrspic(__a);
6384 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
6385 return __builtin_vsx_xvrdpic(__a);
6390 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
6391 return __builtin_vsx_xvrspi(__a);
6394 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
6395 return __builtin_vsx_xvrdpi(__a);
6401 static __inline__ vector float __attribute__((__always_inline__))
6402 vec_vrfin(vector float __a) {
6403 return __builtin_altivec_vrfin(__a);
6409 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
6410 return __builtin_vsx_xvsqrtsp(__a);
6413 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
6414 return __builtin_vsx_xvsqrtdp(__a);
6420 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
6422 return __builtin_vsx_xvrsqrtesp(__a);
6424 return __builtin_altivec_vrsqrtefp(__a);
6429 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
6430 return __builtin_vsx_xvrsqrtedp(__a);
6436 static __inline__ __vector float __attribute__((__always_inline__))
6437 vec_vrsqrtefp(vector float __a) {
6438 return __builtin_altivec_vrsqrtefp(__a);
6443 #define __builtin_altivec_vsel_4si vec_sel
6445 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
6446 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6447 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6450 static __inline__ vector signed char __ATTRS_o_ai
6451 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
6452 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6455 static __inline__ vector unsigned char __ATTRS_o_ai
6456 vec_sel(vector unsigned char __a, vector unsigned char __b,
6457 vector unsigned char __c) {
6458 return (__a & ~__c) | (__b & __c);
6461 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
6462 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
6463 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
6466 static __inline__ vector bool char __ATTRS_o_ai
6467 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
6468 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
6471 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
6472 vector bool char __b,
6473 vector bool char __c) {
6474 return (__a & ~__c) | (__b & __c);
6477 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
6479 vector unsigned short __c) {
6480 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6483 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
6485 vector bool short __c) {
6486 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6489 static __inline__ vector unsigned short __ATTRS_o_ai
6490 vec_sel(vector unsigned short __a, vector unsigned short __b,
6491 vector unsigned short __c) {
6492 return (__a & ~__c) | (__b & __c);
6495 static __inline__ vector unsigned short __ATTRS_o_ai
6496 vec_sel(vector unsigned short __a, vector unsigned short __b,
6497 vector bool short __c) {
6498 return (__a & ~(vector unsigned short)__c) |
6499 (__b & (vector unsigned short)__c);
6502 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
6503 vector bool short __a, vector bool short __b, vector unsigned short __c) {
6504 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
6507 static __inline__ vector bool short __ATTRS_o_ai
6508 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
6509 return (__a & ~__c) | (__b & __c);
6512 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
6514 vector unsigned int __c) {
6515 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6518 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
6520 vector bool int __c) {
6521 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6524 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
6525 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
6526 return (__a & ~__c) | (__b & __c);
6529 static __inline__ vector unsigned int __ATTRS_o_ai
6530 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
6531 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
6534 static __inline__ vector bool int __ATTRS_o_ai
6535 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
6536 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
6539 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
6540 vector bool int __b,
6541 vector bool int __c) {
6542 return (__a & ~__c) | (__b & __c);
6545 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
6547 vector unsigned int __c) {
6548 vector int __res = ((vector int)__a & ~(vector int)__c) |
6549 ((vector int)__b & (vector int)__c);
6550 return (vector float)__res;
6553 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
6555 vector bool int __c) {
6556 vector int __res = ((vector int)__a & ~(vector int)__c) |
6557 ((vector int)__b & (vector int)__c);
6558 return (vector float)__res;
6562 static __inline__ vector double __ATTRS_o_ai
6563 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
6564 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
6565 ((vector long long)__b & (vector long long)__c);
6566 return (vector double)__res;
6569 static __inline__ vector double __ATTRS_o_ai
6570 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
6571 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
6572 ((vector long long)__b & (vector long long)__c);
6573 return (vector double)__res;
6579 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
6580 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6581 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6584 static __inline__ vector signed char __ATTRS_o_ai
6585 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
6586 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6589 static __inline__ vector unsigned char __ATTRS_o_ai
6590 vec_vsel(vector unsigned char __a, vector unsigned char __b,
6591 vector unsigned char __c) {
6592 return (__a & ~__c) | (__b & __c);
6595 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
6596 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
6597 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
6600 static __inline__ vector bool char __ATTRS_o_ai
6601 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
6602 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
6605 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
6606 vector bool char __b,
6607 vector bool char __c) {
6608 return (__a & ~__c) | (__b & __c);
6611 static __inline__ vector short __ATTRS_o_ai
6612 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
6613 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6616 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
6618 vector bool short __c) {
6619 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6622 static __inline__ vector unsigned short __ATTRS_o_ai
6623 vec_vsel(vector unsigned short __a, vector unsigned short __b,
6624 vector unsigned short __c) {
6625 return (__a & ~__c) | (__b & __c);
6628 static __inline__ vector unsigned short __ATTRS_o_ai
6629 vec_vsel(vector unsigned short __a, vector unsigned short __b,
6630 vector bool short __c) {
6631 return (__a & ~(vector unsigned short)__c) |
6632 (__b & (vector unsigned short)__c);
6635 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
6636 vector bool short __a, vector bool short __b, vector unsigned short __c) {
6637 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
6640 static __inline__ vector bool short __ATTRS_o_ai
6641 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
6642 return (__a & ~__c) | (__b & __c);
6645 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
6647 vector unsigned int __c) {
6648 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6651 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
6653 vector bool int __c) {
6654 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6657 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
6658 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
6659 return (__a & ~__c) | (__b & __c);
6662 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
6663 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
6664 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
6667 static __inline__ vector bool int __ATTRS_o_ai
6668 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
6669 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
6672 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
6673 vector bool int __b,
6674 vector bool int __c) {
6675 return (__a & ~__c) | (__b & __c);
6678 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
6680 vector unsigned int __c) {
6681 vector int __res = ((vector int)__a & ~(vector int)__c) |
6682 ((vector int)__b & (vector int)__c);
6683 return (vector float)__res;
6686 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
6688 vector bool int __c) {
6689 vector int __res = ((vector int)__a & ~(vector int)__c) |
6690 ((vector int)__b & (vector int)__c);
6691 return (vector float)__res;
6696 static __inline__ vector signed char __ATTRS_o_ai
6697 vec_sl(vector signed char __a, vector unsigned char __b) {
6698 return __a << (vector signed char)__b;
6701 static __inline__ vector unsigned char __ATTRS_o_ai
6702 vec_sl(vector unsigned char __a, vector unsigned char __b) {
6706 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
6707 vector unsigned short __b) {
6708 return __a << (vector short)__b;
6711 static __inline__ vector unsigned short __ATTRS_o_ai
6712 vec_sl(vector unsigned short __a, vector unsigned short __b) {
6716 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
6717 vector unsigned int __b) {
6718 return __a << (vector int)__b;
6721 static __inline__ vector unsigned int __ATTRS_o_ai
6722 vec_sl(vector unsigned int __a, vector unsigned int __b) {
6726 #ifdef __POWER8_VECTOR__
6727 static __inline__ vector signed long long __ATTRS_o_ai
6728 vec_sl(vector signed long long __a, vector unsigned long long __b) {
6729 return __a << (vector long long)__b;
6732 static __inline__ vector unsigned long long __ATTRS_o_ai
6733 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
6740 #define __builtin_altivec_vslb vec_vslb
6742 static __inline__ vector signed char __ATTRS_o_ai
6743 vec_vslb(vector signed char __a, vector unsigned char __b) {
6744 return vec_sl(__a, __b);
6747 static __inline__ vector unsigned char __ATTRS_o_ai
6748 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
6749 return vec_sl(__a, __b);
6754 #define __builtin_altivec_vslh vec_vslh
6756 static __inline__ vector short __ATTRS_o_ai
6757 vec_vslh(vector short __a, vector unsigned short __b) {
6758 return vec_sl(__a, __b);
6761 static __inline__ vector unsigned short __ATTRS_o_ai
6762 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
6763 return vec_sl(__a, __b);
6768 #define __builtin_altivec_vslw vec_vslw
6770 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
6771 vector unsigned int __b) {
6772 return vec_sl(__a, __b);
6775 static __inline__ vector unsigned int __ATTRS_o_ai
6776 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
6777 return vec_sl(__a, __b);
6782 #define __builtin_altivec_vsldoi_4si vec_sld
6784 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
6785 vector signed char __a, vector signed char __b, unsigned const int __c) {
6786 unsigned char __d = __c & 0x0F;
6787 #ifdef __LITTLE_ENDIAN__
6789 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6790 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6791 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6792 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6796 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6797 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6798 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6802 static __inline__ vector unsigned char __ATTRS_o_ai
6803 vec_sld(vector unsigned char __a, vector unsigned char __b,
6804 unsigned const int __c) {
6805 unsigned char __d = __c & 0x0F;
6806 #ifdef __LITTLE_ENDIAN__
6808 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6809 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6810 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6811 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6815 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6816 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6817 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6821 static __inline__ vector bool char __ATTRS_o_ai
6822 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
6823 unsigned char __d = __c & 0x0F;
6824 #ifdef __LITTLE_ENDIAN__
6826 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6827 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6828 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6829 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6833 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6834 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6835 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6839 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
6840 vector signed short __a, vector signed short __b, unsigned const int __c) {
6841 unsigned char __d = __c & 0x0F;
6842 #ifdef __LITTLE_ENDIAN__
6844 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6845 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6846 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6847 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6851 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6852 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6853 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6857 static __inline__ vector unsigned short __ATTRS_o_ai
6858 vec_sld(vector unsigned short __a, vector unsigned short __b,
6859 unsigned const int __c) {
6860 unsigned char __d = __c & 0x0F;
6861 #ifdef __LITTLE_ENDIAN__
6863 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6864 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6865 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6866 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6870 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6871 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6872 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6876 static __inline__ vector bool short __ATTRS_o_ai
6877 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
6878 unsigned char __d = __c & 0x0F;
6879 #ifdef __LITTLE_ENDIAN__
6881 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6882 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6883 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6884 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6888 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6889 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6890 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6894 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
6896 unsigned const int __c) {
6897 unsigned char __d = __c & 0x0F;
6898 #ifdef __LITTLE_ENDIAN__
6900 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6901 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6902 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6903 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6907 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6908 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6909 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6913 static __inline__ vector signed int __ATTRS_o_ai
6914 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
6915 unsigned char __d = __c & 0x0F;
6916 #ifdef __LITTLE_ENDIAN__
6918 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6919 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6920 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6921 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6925 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6926 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6927 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6931 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
6932 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
6933 unsigned char __d = __c & 0x0F;
6934 #ifdef __LITTLE_ENDIAN__
6936 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6937 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6938 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6939 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6943 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6944 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6945 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6949 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
6950 vector bool int __b,
6951 unsigned const int __c) {
6952 unsigned char __d = __c & 0x0F;
6953 #ifdef __LITTLE_ENDIAN__
6955 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6956 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6957 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6958 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6962 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6963 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6964 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6968 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
6970 unsigned const int __c) {
6971 unsigned char __d = __c & 0x0F;
6972 #ifdef __LITTLE_ENDIAN__
6974 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6975 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6976 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6977 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6981 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6982 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6983 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6989 static __inline__ vector signed char __ATTRS_o_ai
6990 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
6991 unsigned char __d = __c & 0x0F;
6992 #ifdef __LITTLE_ENDIAN__
6994 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6995 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6996 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6997 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7001 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7002 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7003 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7007 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
7008 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
7009 unsigned char __d = __c & 0x0F;
7010 #ifdef __LITTLE_ENDIAN__
7012 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7013 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7014 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7015 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7019 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7020 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7021 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7025 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
7027 unsigned char __c) {
7028 unsigned char __d = __c & 0x0F;
7029 #ifdef __LITTLE_ENDIAN__
7031 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7032 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7033 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7034 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7038 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7039 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7040 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7044 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
7045 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
7046 unsigned char __d = __c & 0x0F;
7047 #ifdef __LITTLE_ENDIAN__
7049 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7050 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7051 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7052 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7056 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7057 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7058 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7062 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
7064 unsigned char __c) {
7065 unsigned char __d = __c & 0x0F;
7066 #ifdef __LITTLE_ENDIAN__
7068 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7069 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7070 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7071 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7075 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7076 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7077 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7081 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
7083 unsigned char __c) {
7084 unsigned char __d = __c & 0x0F;
7085 #ifdef __LITTLE_ENDIAN__
7087 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7088 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7089 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7090 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7094 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7095 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7096 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7100 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
7101 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
7102 unsigned char __d = __c & 0x0F;
7103 #ifdef __LITTLE_ENDIAN__
7105 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7106 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7107 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7108 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7112 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7113 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7114 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7118 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
7120 unsigned char __c) {
7121 unsigned char __d = __c & 0x0F;
7122 #ifdef __LITTLE_ENDIAN__
7124 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7125 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7126 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7127 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7131 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7132 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7133 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7139 static __inline__ vector signed char __ATTRS_o_ai
7140 vec_sll(vector signed char __a, vector unsigned char __b) {
7141 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7145 static __inline__ vector signed char __ATTRS_o_ai
7146 vec_sll(vector signed char __a, vector unsigned short __b) {
7147 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7151 static __inline__ vector signed char __ATTRS_o_ai
7152 vec_sll(vector signed char __a, vector unsigned int __b) {
7153 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7157 static __inline__ vector unsigned char __ATTRS_o_ai
7158 vec_sll(vector unsigned char __a, vector unsigned char __b) {
7159 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7163 static __inline__ vector unsigned char __ATTRS_o_ai
7164 vec_sll(vector unsigned char __a, vector unsigned short __b) {
7165 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7169 static __inline__ vector unsigned char __ATTRS_o_ai
7170 vec_sll(vector unsigned char __a, vector unsigned int __b) {
7171 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7175 static __inline__ vector bool char __ATTRS_o_ai
7176 vec_sll(vector bool char __a, vector unsigned char __b) {
7177 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7181 static __inline__ vector bool char __ATTRS_o_ai
7182 vec_sll(vector bool char __a, vector unsigned short __b) {
7183 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7187 static __inline__ vector bool char __ATTRS_o_ai
7188 vec_sll(vector bool char __a, vector unsigned int __b) {
7189 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7193 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7194 vector unsigned char __b) {
7195 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7198 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7199 vector unsigned short __b) {
7200 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7203 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7204 vector unsigned int __b) {
7205 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7208 static __inline__ vector unsigned short __ATTRS_o_ai
7209 vec_sll(vector unsigned short __a, vector unsigned char __b) {
7210 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7214 static __inline__ vector unsigned short __ATTRS_o_ai
7215 vec_sll(vector unsigned short __a, vector unsigned short __b) {
7216 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7220 static __inline__ vector unsigned short __ATTRS_o_ai
7221 vec_sll(vector unsigned short __a, vector unsigned int __b) {
7222 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7226 static __inline__ vector bool short __ATTRS_o_ai
7227 vec_sll(vector bool short __a, vector unsigned char __b) {
7228 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7232 static __inline__ vector bool short __ATTRS_o_ai
7233 vec_sll(vector bool short __a, vector unsigned short __b) {
7234 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7238 static __inline__ vector bool short __ATTRS_o_ai
7239 vec_sll(vector bool short __a, vector unsigned int __b) {
7240 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7244 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7245 vector unsigned char __b) {
7246 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7249 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7250 vector unsigned short __b) {
7251 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7254 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7255 vector unsigned int __b) {
7256 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7259 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7260 vector unsigned char __b) {
7261 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7264 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7265 vector unsigned short __b) {
7266 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7269 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7270 vector unsigned int __b) {
7271 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7274 static __inline__ vector unsigned int __ATTRS_o_ai
7275 vec_sll(vector unsigned int __a, vector unsigned char __b) {
7276 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7280 static __inline__ vector unsigned int __ATTRS_o_ai
7281 vec_sll(vector unsigned int __a, vector unsigned short __b) {
7282 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7286 static __inline__ vector unsigned int __ATTRS_o_ai
7287 vec_sll(vector unsigned int __a, vector unsigned int __b) {
7288 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7292 static __inline__ vector bool int __ATTRS_o_ai
7293 vec_sll(vector bool int __a, vector unsigned char __b) {
7294 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7298 static __inline__ vector bool int __ATTRS_o_ai
7299 vec_sll(vector bool int __a, vector unsigned short __b) {
7300 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7304 static __inline__ vector bool int __ATTRS_o_ai
7305 vec_sll(vector bool int __a, vector unsigned int __b) {
7306 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7312 static __inline__ vector signed char __ATTRS_o_ai
7313 vec_vsl(vector signed char __a, vector unsigned char __b) {
7314 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7318 static __inline__ vector signed char __ATTRS_o_ai
7319 vec_vsl(vector signed char __a, vector unsigned short __b) {
7320 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7324 static __inline__ vector signed char __ATTRS_o_ai
7325 vec_vsl(vector signed char __a, vector unsigned int __b) {
7326 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7330 static __inline__ vector unsigned char __ATTRS_o_ai
7331 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
7332 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7336 static __inline__ vector unsigned char __ATTRS_o_ai
7337 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
7338 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7342 static __inline__ vector unsigned char __ATTRS_o_ai
7343 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
7344 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7348 static __inline__ vector bool char __ATTRS_o_ai
7349 vec_vsl(vector bool char __a, vector unsigned char __b) {
7350 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7354 static __inline__ vector bool char __ATTRS_o_ai
7355 vec_vsl(vector bool char __a, vector unsigned short __b) {
7356 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7360 static __inline__ vector bool char __ATTRS_o_ai
7361 vec_vsl(vector bool char __a, vector unsigned int __b) {
7362 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7366 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7367 vector unsigned char __b) {
7368 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7371 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7372 vector unsigned short __b) {
7373 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7376 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7377 vector unsigned int __b) {
7378 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7381 static __inline__ vector unsigned short __ATTRS_o_ai
7382 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
7383 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7387 static __inline__ vector unsigned short __ATTRS_o_ai
7388 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
7389 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7393 static __inline__ vector unsigned short __ATTRS_o_ai
7394 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
7395 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7399 static __inline__ vector bool short __ATTRS_o_ai
7400 vec_vsl(vector bool short __a, vector unsigned char __b) {
7401 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7405 static __inline__ vector bool short __ATTRS_o_ai
7406 vec_vsl(vector bool short __a, vector unsigned short __b) {
7407 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7411 static __inline__ vector bool short __ATTRS_o_ai
7412 vec_vsl(vector bool short __a, vector unsigned int __b) {
7413 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7417 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7418 vector unsigned char __b) {
7419 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7422 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7423 vector unsigned short __b) {
7424 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7427 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7428 vector unsigned int __b) {
7429 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7432 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7433 vector unsigned char __b) {
7434 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7437 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7438 vector unsigned short __b) {
7439 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7442 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7443 vector unsigned int __b) {
7444 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7447 static __inline__ vector unsigned int __ATTRS_o_ai
7448 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
7449 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7453 static __inline__ vector unsigned int __ATTRS_o_ai
7454 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
7455 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7459 static __inline__ vector unsigned int __ATTRS_o_ai
7460 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
7461 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7465 static __inline__ vector bool int __ATTRS_o_ai
7466 vec_vsl(vector bool int __a, vector unsigned char __b) {
7467 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7471 static __inline__ vector bool int __ATTRS_o_ai
7472 vec_vsl(vector bool int __a, vector unsigned short __b) {
7473 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7477 static __inline__ vector bool int __ATTRS_o_ai
7478 vec_vsl(vector bool int __a, vector unsigned int __b) {
7479 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7485 static __inline__ vector signed char __ATTRS_o_ai
7486 vec_slo(vector signed char __a, vector signed char __b) {
7487 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7491 static __inline__ vector signed char __ATTRS_o_ai
7492 vec_slo(vector signed char __a, vector unsigned char __b) {
7493 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7497 static __inline__ vector unsigned char __ATTRS_o_ai
7498 vec_slo(vector unsigned char __a, vector signed char __b) {
7499 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7503 static __inline__ vector unsigned char __ATTRS_o_ai
7504 vec_slo(vector unsigned char __a, vector unsigned char __b) {
7505 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7509 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
7510 vector signed char __b) {
7511 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7514 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
7515 vector unsigned char __b) {
7516 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7519 static __inline__ vector unsigned short __ATTRS_o_ai
7520 vec_slo(vector unsigned short __a, vector signed char __b) {
7521 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7525 static __inline__ vector unsigned short __ATTRS_o_ai
7526 vec_slo(vector unsigned short __a, vector unsigned char __b) {
7527 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7531 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
7532 vector signed char __b) {
7533 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7536 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
7537 vector unsigned char __b) {
7538 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7541 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
7542 vector signed char __b) {
7543 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7546 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
7547 vector unsigned char __b) {
7548 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7551 static __inline__ vector unsigned int __ATTRS_o_ai
7552 vec_slo(vector unsigned int __a, vector signed char __b) {
7553 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7557 static __inline__ vector unsigned int __ATTRS_o_ai
7558 vec_slo(vector unsigned int __a, vector unsigned char __b) {
7559 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7563 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
7564 vector signed char __b) {
7565 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7568 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
7569 vector unsigned char __b) {
7570 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7575 static __inline__ vector signed char __ATTRS_o_ai
7576 vec_vslo(vector signed char __a, vector signed char __b) {
7577 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7581 static __inline__ vector signed char __ATTRS_o_ai
7582 vec_vslo(vector signed char __a, vector unsigned char __b) {
7583 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7587 static __inline__ vector unsigned char __ATTRS_o_ai
7588 vec_vslo(vector unsigned char __a, vector signed char __b) {
7589 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7593 static __inline__ vector unsigned char __ATTRS_o_ai
7594 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
7595 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7599 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
7600 vector signed char __b) {
7601 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7604 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
7605 vector unsigned char __b) {
7606 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7609 static __inline__ vector unsigned short __ATTRS_o_ai
7610 vec_vslo(vector unsigned short __a, vector signed char __b) {
7611 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7615 static __inline__ vector unsigned short __ATTRS_o_ai
7616 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
7617 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7621 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
7622 vector signed char __b) {
7623 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7626 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
7627 vector unsigned char __b) {
7628 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7631 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
7632 vector signed char __b) {
7633 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7636 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
7637 vector unsigned char __b) {
7638 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7641 static __inline__ vector unsigned int __ATTRS_o_ai
7642 vec_vslo(vector unsigned int __a, vector signed char __b) {
7643 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7647 static __inline__ vector unsigned int __ATTRS_o_ai
7648 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
7649 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7653 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
7654 vector signed char __b) {
7655 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7658 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
7659 vector unsigned char __b) {
7660 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7665 static __inline__ vector signed char __ATTRS_o_ai
7666 vec_splat(vector signed char __a, unsigned const int __b) {
7667 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7670 static __inline__ vector unsigned char __ATTRS_o_ai
7671 vec_splat(vector unsigned char __a, unsigned const int __b) {
7672 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7675 static __inline__ vector bool char __ATTRS_o_ai
7676 vec_splat(vector bool char __a, unsigned const int __b) {
7677 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7680 static __inline__ vector signed short __ATTRS_o_ai
7681 vec_splat(vector signed short __a, unsigned const int __b) {
7682 unsigned char b0 = (__b & 0x07) * 2;
7683 unsigned char b1 = b0 + 1;
7684 return vec_perm(__a, __a,
7685 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7686 b0, b1, b0, b1, b0, b1));
7689 static __inline__ vector unsigned short __ATTRS_o_ai
7690 vec_splat(vector unsigned short __a, unsigned const int __b) {
7691 unsigned char b0 = (__b & 0x07) * 2;
7692 unsigned char b1 = b0 + 1;
7693 return vec_perm(__a, __a,
7694 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7695 b0, b1, b0, b1, b0, b1));
7698 static __inline__ vector bool short __ATTRS_o_ai
7699 vec_splat(vector bool short __a, unsigned const int __b) {
7700 unsigned char b0 = (__b & 0x07) * 2;
7701 unsigned char b1 = b0 + 1;
7702 return vec_perm(__a, __a,
7703 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7704 b0, b1, b0, b1, b0, b1));
7707 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
7708 unsigned const int __b) {
7709 unsigned char b0 = (__b & 0x07) * 2;
7710 unsigned char b1 = b0 + 1;
7711 return vec_perm(__a, __a,
7712 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7713 b0, b1, b0, b1, b0, b1));
7716 static __inline__ vector signed int __ATTRS_o_ai
7717 vec_splat(vector signed int __a, unsigned const int __b) {
7718 unsigned char b0 = (__b & 0x03) * 4;
7719 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7720 return vec_perm(__a, __a,
7721 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7722 b2, b3, b0, b1, b2, b3));
7725 static __inline__ vector unsigned int __ATTRS_o_ai
7726 vec_splat(vector unsigned int __a, unsigned const int __b) {
7727 unsigned char b0 = (__b & 0x03) * 4;
7728 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7729 return vec_perm(__a, __a,
7730 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7731 b2, b3, b0, b1, b2, b3));
7734 static __inline__ vector bool int __ATTRS_o_ai
7735 vec_splat(vector bool int __a, unsigned const int __b) {
7736 unsigned char b0 = (__b & 0x03) * 4;
7737 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7738 return vec_perm(__a, __a,
7739 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7740 b2, b3, b0, b1, b2, b3));
7743 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
7744 unsigned const int __b) {
7745 unsigned char b0 = (__b & 0x03) * 4;
7746 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7747 return vec_perm(__a, __a,
7748 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7749 b2, b3, b0, b1, b2, b3));
7753 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
7754 unsigned const int __b) {
7755 unsigned char b0 = (__b & 0x01) * 8;
7756 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7757 b6 = b0 + 6, b7 = b0 + 7;
7758 return vec_perm(__a, __a,
7759 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7760 b2, b3, b4, b5, b6, b7));
7762 static __inline__ vector bool long long __ATTRS_o_ai
7763 vec_splat(vector bool long long __a, unsigned const int __b) {
7764 unsigned char b0 = (__b & 0x01) * 8;
7765 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7766 b6 = b0 + 6, b7 = b0 + 7;
7767 return vec_perm(__a, __a,
7768 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7769 b2, b3, b4, b5, b6, b7));
7771 static __inline__ vector signed long long __ATTRS_o_ai
7772 vec_splat(vector signed long long __a, unsigned const int __b) {
7773 unsigned char b0 = (__b & 0x01) * 8;
7774 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7775 b6 = b0 + 6, b7 = b0 + 7;
7776 return vec_perm(__a, __a,
7777 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7778 b2, b3, b4, b5, b6, b7));
7780 static __inline__ vector unsigned long long __ATTRS_o_ai
7781 vec_splat(vector unsigned long long __a, unsigned const int __b) {
7782 unsigned char b0 = (__b & 0x01) * 8;
7783 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7784 b6 = b0 + 6, b7 = b0 + 7;
7785 return vec_perm(__a, __a,
7786 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7787 b2, b3, b4, b5, b6, b7));
7793 #define __builtin_altivec_vspltb vec_vspltb
7795 static __inline__ vector signed char __ATTRS_o_ai
7796 vec_vspltb(vector signed char __a, unsigned char __b) {
7797 return vec_perm(__a, __a, (vector unsigned char)(__b));
7800 static __inline__ vector unsigned char __ATTRS_o_ai
7801 vec_vspltb(vector unsigned char __a, unsigned char __b) {
7802 return vec_perm(__a, __a, (vector unsigned char)(__b));
7805 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
7806 unsigned char __b) {
7807 return vec_perm(__a, __a, (vector unsigned char)(__b));
7812 #define __builtin_altivec_vsplth vec_vsplth
7814 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
7815 unsigned char __b) {
7817 unsigned char b1 = __b + 1;
7818 return vec_perm(__a, __a,
7819 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7820 __b, b1, __b, b1, __b, b1, __b, b1));
7823 static __inline__ vector unsigned short __ATTRS_o_ai
7824 vec_vsplth(vector unsigned short __a, unsigned char __b) {
7826 unsigned char b1 = __b + 1;
7827 return vec_perm(__a, __a,
7828 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7829 __b, b1, __b, b1, __b, b1, __b, b1));
7832 static __inline__ vector bool short __ATTRS_o_ai
7833 vec_vsplth(vector bool short __a, unsigned char __b) {
7835 unsigned char b1 = __b + 1;
7836 return vec_perm(__a, __a,
7837 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7838 __b, b1, __b, b1, __b, b1, __b, b1));
7841 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
7842 unsigned char __b) {
7844 unsigned char b1 = __b + 1;
7845 return vec_perm(__a, __a,
7846 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7847 __b, b1, __b, b1, __b, b1, __b, b1));
7852 #define __builtin_altivec_vspltw vec_vspltw
7854 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
7855 unsigned char __b) {
7857 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7858 return vec_perm(__a, __a,
7859 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7860 b1, b2, b3, __b, b1, b2, b3));
7863 static __inline__ vector unsigned int __ATTRS_o_ai
7864 vec_vspltw(vector unsigned int __a, unsigned char __b) {
7866 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7867 return vec_perm(__a, __a,
7868 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7869 b1, b2, b3, __b, b1, b2, b3));
7872 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
7873 unsigned char __b) {
7875 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7876 return vec_perm(__a, __a,
7877 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7878 b1, b2, b3, __b, b1, b2, b3));
7881 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
7882 unsigned char __b) {
7884 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7885 return vec_perm(__a, __a,
7886 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7887 b1, b2, b3, __b, b1, b2, b3));
7892 #define __builtin_altivec_vspltisb vec_splat_s8
7894 // FIXME: parameter should be treated as 5-bit signed literal
7895 static __inline__ vector signed char __ATTRS_o_ai
7896 vec_splat_s8(signed char __a) {
7897 return (vector signed char)(__a);
7902 // FIXME: parameter should be treated as 5-bit signed literal
7903 static __inline__ vector signed char __ATTRS_o_ai
7904 vec_vspltisb(signed char __a) {
7905 return (vector signed char)(__a);
7910 #define __builtin_altivec_vspltish vec_splat_s16
7912 // FIXME: parameter should be treated as 5-bit signed literal
7913 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
7914 return (vector short)(__a);
7919 // FIXME: parameter should be treated as 5-bit signed literal
7920 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
7921 return (vector short)(__a);
7926 #define __builtin_altivec_vspltisw vec_splat_s32
7928 // FIXME: parameter should be treated as 5-bit signed literal
7929 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
7930 return (vector int)(__a);
7935 // FIXME: parameter should be treated as 5-bit signed literal
7936 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
7937 return (vector int)(__a);
7942 // FIXME: parameter should be treated as 5-bit signed literal
7943 static __inline__ vector unsigned char __ATTRS_o_ai
7944 vec_splat_u8(unsigned char __a) {
7945 return (vector unsigned char)(__a);
7950 // FIXME: parameter should be treated as 5-bit signed literal
7951 static __inline__ vector unsigned short __ATTRS_o_ai
7952 vec_splat_u16(signed char __a) {
7953 return (vector unsigned short)(__a);
7958 // FIXME: parameter should be treated as 5-bit signed literal
7959 static __inline__ vector unsigned int __ATTRS_o_ai
7960 vec_splat_u32(signed char __a) {
7961 return (vector unsigned int)(__a);
7966 static __inline__ vector signed char __ATTRS_o_ai
7967 vec_sr(vector signed char __a, vector unsigned char __b) {
7968 vector unsigned char __res = (vector unsigned char)__a >> __b;
7969 return (vector signed char)__res;
7972 static __inline__ vector unsigned char __ATTRS_o_ai
7973 vec_sr(vector unsigned char __a, vector unsigned char __b) {
7977 static __inline__ vector signed short __ATTRS_o_ai
7978 vec_sr(vector signed short __a, vector unsigned short __b) {
7979 vector unsigned short __res = (vector unsigned short)__a >> __b;
7980 return (vector signed short)__res;
7983 static __inline__ vector unsigned short __ATTRS_o_ai
7984 vec_sr(vector unsigned short __a, vector unsigned short __b) {
7988 static __inline__ vector signed int __ATTRS_o_ai
7989 vec_sr(vector signed int __a, vector unsigned int __b) {
7990 vector unsigned int __res = (vector unsigned int)__a >> __b;
7991 return (vector signed int)__res;
7994 static __inline__ vector unsigned int __ATTRS_o_ai
7995 vec_sr(vector unsigned int __a, vector unsigned int __b) {
7999 #ifdef __POWER8_VECTOR__
8000 static __inline__ vector signed long long __ATTRS_o_ai
8001 vec_sr(vector signed long long __a, vector unsigned long long __b) {
8002 vector unsigned long long __res = (vector unsigned long long)__a >> __b;
8003 return (vector signed long long)__res;
8006 static __inline__ vector unsigned long long __ATTRS_o_ai
8007 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
8014 #define __builtin_altivec_vsrb vec_vsrb
8016 static __inline__ vector signed char __ATTRS_o_ai
8017 vec_vsrb(vector signed char __a, vector unsigned char __b) {
8018 return __a >> (vector signed char)__b;
8021 static __inline__ vector unsigned char __ATTRS_o_ai
8022 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
8028 #define __builtin_altivec_vsrh vec_vsrh
8030 static __inline__ vector short __ATTRS_o_ai
8031 vec_vsrh(vector short __a, vector unsigned short __b) {
8032 return __a >> (vector short)__b;
8035 static __inline__ vector unsigned short __ATTRS_o_ai
8036 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
8042 #define __builtin_altivec_vsrw vec_vsrw
8044 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
8045 vector unsigned int __b) {
8046 return __a >> (vector int)__b;
8049 static __inline__ vector unsigned int __ATTRS_o_ai
8050 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
8056 static __inline__ vector signed char __ATTRS_o_ai
8057 vec_sra(vector signed char __a, vector unsigned char __b) {
8058 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
8061 static __inline__ vector unsigned char __ATTRS_o_ai
8062 vec_sra(vector unsigned char __a, vector unsigned char __b) {
8063 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
8066 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
8067 vector unsigned short __b) {
8068 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
8071 static __inline__ vector unsigned short __ATTRS_o_ai
8072 vec_sra(vector unsigned short __a, vector unsigned short __b) {
8073 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
8076 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
8077 vector unsigned int __b) {
8078 return __builtin_altivec_vsraw(__a, __b);
8081 static __inline__ vector unsigned int __ATTRS_o_ai
8082 vec_sra(vector unsigned int __a, vector unsigned int __b) {
8083 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
8086 #ifdef __POWER8_VECTOR__
8087 static __inline__ vector signed long long __ATTRS_o_ai
8088 vec_sra(vector signed long long __a, vector unsigned long long __b) {
8092 static __inline__ vector unsigned long long __ATTRS_o_ai
8093 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
8094 return (vector unsigned long long)((vector signed long long)__a >> __b);
8100 static __inline__ vector signed char __ATTRS_o_ai
8101 vec_vsrab(vector signed char __a, vector unsigned char __b) {
8102 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
8105 static __inline__ vector unsigned char __ATTRS_o_ai
8106 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
8107 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
8112 static __inline__ vector short __ATTRS_o_ai
8113 vec_vsrah(vector short __a, vector unsigned short __b) {
8114 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
8117 static __inline__ vector unsigned short __ATTRS_o_ai
8118 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
8119 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
8124 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
8125 vector unsigned int __b) {
8126 return __builtin_altivec_vsraw(__a, __b);
8129 static __inline__ vector unsigned int __ATTRS_o_ai
8130 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
8131 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
8136 static __inline__ vector signed char __ATTRS_o_ai
8137 vec_srl(vector signed char __a, vector unsigned char __b) {
8138 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8142 static __inline__ vector signed char __ATTRS_o_ai
8143 vec_srl(vector signed char __a, vector unsigned short __b) {
8144 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8148 static __inline__ vector signed char __ATTRS_o_ai
8149 vec_srl(vector signed char __a, vector unsigned int __b) {
8150 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8154 static __inline__ vector unsigned char __ATTRS_o_ai
8155 vec_srl(vector unsigned char __a, vector unsigned char __b) {
8156 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8160 static __inline__ vector unsigned char __ATTRS_o_ai
8161 vec_srl(vector unsigned char __a, vector unsigned short __b) {
8162 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8166 static __inline__ vector unsigned char __ATTRS_o_ai
8167 vec_srl(vector unsigned char __a, vector unsigned int __b) {
8168 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8172 static __inline__ vector bool char __ATTRS_o_ai
8173 vec_srl(vector bool char __a, vector unsigned char __b) {
8174 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8178 static __inline__ vector bool char __ATTRS_o_ai
8179 vec_srl(vector bool char __a, vector unsigned short __b) {
8180 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8184 static __inline__ vector bool char __ATTRS_o_ai
8185 vec_srl(vector bool char __a, vector unsigned int __b) {
8186 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8190 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8191 vector unsigned char __b) {
8192 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8195 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8196 vector unsigned short __b) {
8197 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8200 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8201 vector unsigned int __b) {
8202 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8205 static __inline__ vector unsigned short __ATTRS_o_ai
8206 vec_srl(vector unsigned short __a, vector unsigned char __b) {
8207 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8211 static __inline__ vector unsigned short __ATTRS_o_ai
8212 vec_srl(vector unsigned short __a, vector unsigned short __b) {
8213 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8217 static __inline__ vector unsigned short __ATTRS_o_ai
8218 vec_srl(vector unsigned short __a, vector unsigned int __b) {
8219 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8223 static __inline__ vector bool short __ATTRS_o_ai
8224 vec_srl(vector bool short __a, vector unsigned char __b) {
8225 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8229 static __inline__ vector bool short __ATTRS_o_ai
8230 vec_srl(vector bool short __a, vector unsigned short __b) {
8231 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8235 static __inline__ vector bool short __ATTRS_o_ai
8236 vec_srl(vector bool short __a, vector unsigned int __b) {
8237 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8241 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8242 vector unsigned char __b) {
8243 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8246 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8247 vector unsigned short __b) {
8248 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8251 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8252 vector unsigned int __b) {
8253 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8256 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8257 vector unsigned char __b) {
8258 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8261 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8262 vector unsigned short __b) {
8263 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8266 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8267 vector unsigned int __b) {
8268 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8271 static __inline__ vector unsigned int __ATTRS_o_ai
8272 vec_srl(vector unsigned int __a, vector unsigned char __b) {
8273 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8277 static __inline__ vector unsigned int __ATTRS_o_ai
8278 vec_srl(vector unsigned int __a, vector unsigned short __b) {
8279 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8283 static __inline__ vector unsigned int __ATTRS_o_ai
8284 vec_srl(vector unsigned int __a, vector unsigned int __b) {
8285 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8289 static __inline__ vector bool int __ATTRS_o_ai
8290 vec_srl(vector bool int __a, vector unsigned char __b) {
8291 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8295 static __inline__ vector bool int __ATTRS_o_ai
8296 vec_srl(vector bool int __a, vector unsigned short __b) {
8297 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8301 static __inline__ vector bool int __ATTRS_o_ai
8302 vec_srl(vector bool int __a, vector unsigned int __b) {
8303 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8309 static __inline__ vector signed char __ATTRS_o_ai
8310 vec_vsr(vector signed char __a, vector unsigned char __b) {
8311 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8315 static __inline__ vector signed char __ATTRS_o_ai
8316 vec_vsr(vector signed char __a, vector unsigned short __b) {
8317 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8321 static __inline__ vector signed char __ATTRS_o_ai
8322 vec_vsr(vector signed char __a, vector unsigned int __b) {
8323 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8327 static __inline__ vector unsigned char __ATTRS_o_ai
8328 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
8329 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8333 static __inline__ vector unsigned char __ATTRS_o_ai
8334 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
8335 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8339 static __inline__ vector unsigned char __ATTRS_o_ai
8340 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
8341 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8345 static __inline__ vector bool char __ATTRS_o_ai
8346 vec_vsr(vector bool char __a, vector unsigned char __b) {
8347 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8351 static __inline__ vector bool char __ATTRS_o_ai
8352 vec_vsr(vector bool char __a, vector unsigned short __b) {
8353 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8357 static __inline__ vector bool char __ATTRS_o_ai
8358 vec_vsr(vector bool char __a, vector unsigned int __b) {
8359 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8363 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8364 vector unsigned char __b) {
8365 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8368 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8369 vector unsigned short __b) {
8370 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8373 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8374 vector unsigned int __b) {
8375 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8378 static __inline__ vector unsigned short __ATTRS_o_ai
8379 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
8380 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8384 static __inline__ vector unsigned short __ATTRS_o_ai
8385 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
8386 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8390 static __inline__ vector unsigned short __ATTRS_o_ai
8391 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
8392 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8396 static __inline__ vector bool short __ATTRS_o_ai
8397 vec_vsr(vector bool short __a, vector unsigned char __b) {
8398 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8402 static __inline__ vector bool short __ATTRS_o_ai
8403 vec_vsr(vector bool short __a, vector unsigned short __b) {
8404 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8408 static __inline__ vector bool short __ATTRS_o_ai
8409 vec_vsr(vector bool short __a, vector unsigned int __b) {
8410 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8414 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8415 vector unsigned char __b) {
8416 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8419 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8420 vector unsigned short __b) {
8421 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8424 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8425 vector unsigned int __b) {
8426 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8429 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8430 vector unsigned char __b) {
8431 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8434 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8435 vector unsigned short __b) {
8436 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8439 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8440 vector unsigned int __b) {
8441 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8444 static __inline__ vector unsigned int __ATTRS_o_ai
8445 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
8446 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8450 static __inline__ vector unsigned int __ATTRS_o_ai
8451 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
8452 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8456 static __inline__ vector unsigned int __ATTRS_o_ai
8457 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
8458 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8462 static __inline__ vector bool int __ATTRS_o_ai
8463 vec_vsr(vector bool int __a, vector unsigned char __b) {
8464 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8468 static __inline__ vector bool int __ATTRS_o_ai
8469 vec_vsr(vector bool int __a, vector unsigned short __b) {
8470 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8474 static __inline__ vector bool int __ATTRS_o_ai
8475 vec_vsr(vector bool int __a, vector unsigned int __b) {
8476 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8482 static __inline__ vector signed char __ATTRS_o_ai
8483 vec_sro(vector signed char __a, vector signed char __b) {
8484 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8488 static __inline__ vector signed char __ATTRS_o_ai
8489 vec_sro(vector signed char __a, vector unsigned char __b) {
8490 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8494 static __inline__ vector unsigned char __ATTRS_o_ai
8495 vec_sro(vector unsigned char __a, vector signed char __b) {
8496 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8500 static __inline__ vector unsigned char __ATTRS_o_ai
8501 vec_sro(vector unsigned char __a, vector unsigned char __b) {
8502 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8506 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
8507 vector signed char __b) {
8508 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8511 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
8512 vector unsigned char __b) {
8513 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8516 static __inline__ vector unsigned short __ATTRS_o_ai
8517 vec_sro(vector unsigned short __a, vector signed char __b) {
8518 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8522 static __inline__ vector unsigned short __ATTRS_o_ai
8523 vec_sro(vector unsigned short __a, vector unsigned char __b) {
8524 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8528 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
8529 vector signed char __b) {
8530 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8533 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
8534 vector unsigned char __b) {
8535 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8538 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
8539 vector signed char __b) {
8540 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8543 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
8544 vector unsigned char __b) {
8545 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8548 static __inline__ vector unsigned int __ATTRS_o_ai
8549 vec_sro(vector unsigned int __a, vector signed char __b) {
8550 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8554 static __inline__ vector unsigned int __ATTRS_o_ai
8555 vec_sro(vector unsigned int __a, vector unsigned char __b) {
8556 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8560 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
8561 vector signed char __b) {
8562 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8565 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
8566 vector unsigned char __b) {
8567 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8572 static __inline__ vector signed char __ATTRS_o_ai
8573 vec_vsro(vector signed char __a, vector signed char __b) {
8574 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8578 static __inline__ vector signed char __ATTRS_o_ai
8579 vec_vsro(vector signed char __a, vector unsigned char __b) {
8580 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8584 static __inline__ vector unsigned char __ATTRS_o_ai
8585 vec_vsro(vector unsigned char __a, vector signed char __b) {
8586 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8590 static __inline__ vector unsigned char __ATTRS_o_ai
8591 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
8592 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8596 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
8597 vector signed char __b) {
8598 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8601 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
8602 vector unsigned char __b) {
8603 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8606 static __inline__ vector unsigned short __ATTRS_o_ai
8607 vec_vsro(vector unsigned short __a, vector signed char __b) {
8608 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8612 static __inline__ vector unsigned short __ATTRS_o_ai
8613 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
8614 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8618 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
8619 vector signed char __b) {
8620 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8623 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
8624 vector unsigned char __b) {
8625 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8628 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
8629 vector signed char __b) {
8630 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8633 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
8634 vector unsigned char __b) {
8635 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8638 static __inline__ vector unsigned int __ATTRS_o_ai
8639 vec_vsro(vector unsigned int __a, vector signed char __b) {
8640 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8644 static __inline__ vector unsigned int __ATTRS_o_ai
8645 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
8646 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8650 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
8651 vector signed char __b) {
8652 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8655 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
8656 vector unsigned char __b) {
8657 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8662 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
8663 vector signed char *__c) {
8664 __builtin_altivec_stvx((vector int)__a, __b, __c);
8667 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
8669 __builtin_altivec_stvx((vector int)__a, __b, __c);
8672 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
8673 vector unsigned char *__c) {
8674 __builtin_altivec_stvx((vector int)__a, __b, __c);
8677 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
8678 unsigned char *__c) {
8679 __builtin_altivec_stvx((vector int)__a, __b, __c);
8682 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8684 __builtin_altivec_stvx((vector int)__a, __b, __c);
8687 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8688 unsigned char *__c) {
8689 __builtin_altivec_stvx((vector int)__a, __b, __c);
8692 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8693 vector bool char *__c) {
8694 __builtin_altivec_stvx((vector int)__a, __b, __c);
8697 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
8698 vector short *__c) {
8699 __builtin_altivec_stvx((vector int)__a, __b, __c);
8702 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
8704 __builtin_altivec_stvx((vector int)__a, __b, __c);
8707 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
8708 vector unsigned short *__c) {
8709 __builtin_altivec_stvx((vector int)__a, __b, __c);
8712 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
8713 unsigned short *__c) {
8714 __builtin_altivec_stvx((vector int)__a, __b, __c);
8717 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8719 __builtin_altivec_stvx((vector int)__a, __b, __c);
8722 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8723 unsigned short *__c) {
8724 __builtin_altivec_stvx((vector int)__a, __b, __c);
8727 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8728 vector bool short *__c) {
8729 __builtin_altivec_stvx((vector int)__a, __b, __c);
8732 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8734 __builtin_altivec_stvx((vector int)__a, __b, __c);
8737 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8738 unsigned short *__c) {
8739 __builtin_altivec_stvx((vector int)__a, __b, __c);
8742 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8743 vector pixel *__c) {
8744 __builtin_altivec_stvx((vector int)__a, __b, __c);
8747 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
8749 __builtin_altivec_stvx(__a, __b, __c);
8752 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
8753 __builtin_altivec_stvx(__a, __b, __c);
8756 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
8757 vector unsigned int *__c) {
8758 __builtin_altivec_stvx((vector int)__a, __b, __c);
8761 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
8762 unsigned int *__c) {
8763 __builtin_altivec_stvx((vector int)__a, __b, __c);
8766 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8768 __builtin_altivec_stvx((vector int)__a, __b, __c);
8771 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8772 unsigned int *__c) {
8773 __builtin_altivec_stvx((vector int)__a, __b, __c);
8776 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8777 vector bool int *__c) {
8778 __builtin_altivec_stvx((vector int)__a, __b, __c);
8781 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
8782 vector float *__c) {
8783 __builtin_altivec_stvx((vector int)__a, __b, __c);
8786 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
8788 __builtin_altivec_stvx((vector int)__a, __b, __c);
8793 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
8794 vector signed char *__c) {
8795 __builtin_altivec_stvx((vector int)__a, __b, __c);
8798 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
8800 __builtin_altivec_stvx((vector int)__a, __b, __c);
8803 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
8804 vector unsigned char *__c) {
8805 __builtin_altivec_stvx((vector int)__a, __b, __c);
8808 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
8809 unsigned char *__c) {
8810 __builtin_altivec_stvx((vector int)__a, __b, __c);
8813 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8815 __builtin_altivec_stvx((vector int)__a, __b, __c);
8818 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8819 unsigned char *__c) {
8820 __builtin_altivec_stvx((vector int)__a, __b, __c);
8823 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8824 vector bool char *__c) {
8825 __builtin_altivec_stvx((vector int)__a, __b, __c);
8828 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
8829 vector short *__c) {
8830 __builtin_altivec_stvx((vector int)__a, __b, __c);
8833 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
8835 __builtin_altivec_stvx((vector int)__a, __b, __c);
8838 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
8839 vector unsigned short *__c) {
8840 __builtin_altivec_stvx((vector int)__a, __b, __c);
8843 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
8844 unsigned short *__c) {
8845 __builtin_altivec_stvx((vector int)__a, __b, __c);
8848 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8850 __builtin_altivec_stvx((vector int)__a, __b, __c);
8853 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8854 unsigned short *__c) {
8855 __builtin_altivec_stvx((vector int)__a, __b, __c);
8858 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8859 vector bool short *__c) {
8860 __builtin_altivec_stvx((vector int)__a, __b, __c);
8863 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8865 __builtin_altivec_stvx((vector int)__a, __b, __c);
8868 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8869 unsigned short *__c) {
8870 __builtin_altivec_stvx((vector int)__a, __b, __c);
8873 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8874 vector pixel *__c) {
8875 __builtin_altivec_stvx((vector int)__a, __b, __c);
8878 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
8880 __builtin_altivec_stvx(__a, __b, __c);
8883 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
8885 __builtin_altivec_stvx(__a, __b, __c);
8888 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
8889 vector unsigned int *__c) {
8890 __builtin_altivec_stvx((vector int)__a, __b, __c);
8893 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
8894 unsigned int *__c) {
8895 __builtin_altivec_stvx((vector int)__a, __b, __c);
8898 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8900 __builtin_altivec_stvx((vector int)__a, __b, __c);
8903 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8904 unsigned int *__c) {
8905 __builtin_altivec_stvx((vector int)__a, __b, __c);
8908 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8909 vector bool int *__c) {
8910 __builtin_altivec_stvx((vector int)__a, __b, __c);
8913 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
8914 vector float *__c) {
8915 __builtin_altivec_stvx((vector int)__a, __b, __c);
8918 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
8920 __builtin_altivec_stvx((vector int)__a, __b, __c);
8925 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
8927 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8930 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
8931 unsigned char *__c) {
8932 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8935 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
8937 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8940 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
8941 unsigned char *__c) {
8942 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8945 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
8947 __builtin_altivec_stvehx(__a, __b, __c);
8950 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
8951 unsigned short *__c) {
8952 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8955 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
8957 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8960 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
8961 unsigned short *__c) {
8962 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8965 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
8967 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8970 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
8971 unsigned short *__c) {
8972 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8975 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
8976 __builtin_altivec_stvewx(__a, __b, __c);
8979 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
8980 unsigned int *__c) {
8981 __builtin_altivec_stvewx((vector int)__a, __b, __c);
8984 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
8986 __builtin_altivec_stvewx((vector int)__a, __b, __c);
8989 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
8990 unsigned int *__c) {
8991 __builtin_altivec_stvewx((vector int)__a, __b, __c);
8994 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
8996 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9001 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
9003 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9006 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
9007 int __b, unsigned char *__c) {
9008 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9011 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
9013 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9016 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
9017 unsigned char *__c) {
9018 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9023 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
9025 __builtin_altivec_stvehx(__a, __b, __c);
9028 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
9029 int __b, unsigned short *__c) {
9030 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9033 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
9035 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9038 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
9039 unsigned short *__c) {
9040 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9043 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
9045 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9048 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
9049 unsigned short *__c) {
9050 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9055 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
9057 __builtin_altivec_stvewx(__a, __b, __c);
9060 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
9061 unsigned int *__c) {
9062 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9065 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
9067 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9070 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
9071 unsigned int *__c) {
9072 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9075 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
9077 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9082 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
9083 vector signed char *__c) {
9084 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9087 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
9089 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9092 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
9093 vector unsigned char *__c) {
9094 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9097 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
9098 unsigned char *__c) {
9099 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9102 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9104 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9107 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9108 unsigned char *__c) {
9109 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9112 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9113 vector bool char *__c) {
9114 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9117 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
9118 vector short *__c) {
9119 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9122 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
9124 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9127 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
9128 vector unsigned short *__c) {
9129 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9132 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
9133 unsigned short *__c) {
9134 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9137 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9139 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9142 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9143 unsigned short *__c) {
9144 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9147 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9148 vector bool short *__c) {
9149 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9152 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9154 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9157 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9158 unsigned short *__c) {
9159 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9162 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9163 vector pixel *__c) {
9164 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9167 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
9169 __builtin_altivec_stvxl(__a, __b, __c);
9172 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
9173 __builtin_altivec_stvxl(__a, __b, __c);
9176 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
9177 vector unsigned int *__c) {
9178 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9181 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
9182 unsigned int *__c) {
9183 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9186 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9188 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9191 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9192 unsigned int *__c) {
9193 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9196 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9197 vector bool int *__c) {
9198 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9201 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
9202 vector float *__c) {
9203 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9206 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
9208 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9213 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
9214 vector signed char *__c) {
9215 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9218 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
9220 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9223 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
9224 vector unsigned char *__c) {
9225 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9228 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
9229 unsigned char *__c) {
9230 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9233 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9235 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9238 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9239 unsigned char *__c) {
9240 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9243 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9244 vector bool char *__c) {
9245 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9248 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
9249 vector short *__c) {
9250 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9253 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
9255 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9258 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
9260 vector unsigned short *__c) {
9261 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9264 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
9265 int __b, unsigned short *__c) {
9266 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9269 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9271 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9274 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9275 unsigned short *__c) {
9276 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9279 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9280 vector bool short *__c) {
9281 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9284 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9286 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9289 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9290 unsigned short *__c) {
9291 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9294 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9295 vector pixel *__c) {
9296 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9299 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
9301 __builtin_altivec_stvxl(__a, __b, __c);
9304 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
9306 __builtin_altivec_stvxl(__a, __b, __c);
9309 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
9310 vector unsigned int *__c) {
9311 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9314 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
9315 unsigned int *__c) {
9316 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9319 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9321 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9324 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9325 unsigned int *__c) {
9326 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9329 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9330 vector bool int *__c) {
9331 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9334 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
9335 vector float *__c) {
9336 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9339 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
9341 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9346 static __inline__ vector signed char __ATTRS_o_ai
9347 vec_sub(vector signed char __a, vector signed char __b) {
9351 static __inline__ vector signed char __ATTRS_o_ai
9352 vec_sub(vector bool char __a, vector signed char __b) {
9353 return (vector signed char)__a - __b;
9356 static __inline__ vector signed char __ATTRS_o_ai
9357 vec_sub(vector signed char __a, vector bool char __b) {
9358 return __a - (vector signed char)__b;
9361 static __inline__ vector unsigned char __ATTRS_o_ai
9362 vec_sub(vector unsigned char __a, vector unsigned char __b) {
9366 static __inline__ vector unsigned char __ATTRS_o_ai
9367 vec_sub(vector bool char __a, vector unsigned char __b) {
9368 return (vector unsigned char)__a - __b;
9371 static __inline__ vector unsigned char __ATTRS_o_ai
9372 vec_sub(vector unsigned char __a, vector bool char __b) {
9373 return __a - (vector unsigned char)__b;
9376 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
9381 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
9383 return (vector short)__a - __b;
9386 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
9387 vector bool short __b) {
9388 return __a - (vector short)__b;
9391 static __inline__ vector unsigned short __ATTRS_o_ai
9392 vec_sub(vector unsigned short __a, vector unsigned short __b) {
9396 static __inline__ vector unsigned short __ATTRS_o_ai
9397 vec_sub(vector bool short __a, vector unsigned short __b) {
9398 return (vector unsigned short)__a - __b;
9401 static __inline__ vector unsigned short __ATTRS_o_ai
9402 vec_sub(vector unsigned short __a, vector bool short __b) {
9403 return __a - (vector unsigned short)__b;
9406 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
9411 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
9413 return (vector int)__a - __b;
9416 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
9417 vector bool int __b) {
9418 return __a - (vector int)__b;
9421 static __inline__ vector unsigned int __ATTRS_o_ai
9422 vec_sub(vector unsigned int __a, vector unsigned int __b) {
9426 static __inline__ vector unsigned int __ATTRS_o_ai
9427 vec_sub(vector bool int __a, vector unsigned int __b) {
9428 return (vector unsigned int)__a - __b;
9431 static __inline__ vector unsigned int __ATTRS_o_ai
9432 vec_sub(vector unsigned int __a, vector bool int __b) {
9433 return __a - (vector unsigned int)__b;
9436 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9437 static __inline__ vector signed __int128 __ATTRS_o_ai
9438 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
9442 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9443 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9446 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9449 static __inline__ vector signed long long __ATTRS_o_ai
9450 vec_sub(vector signed long long __a, vector signed long long __b) {
9454 static __inline__ vector unsigned long long __ATTRS_o_ai
9455 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
9459 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
9460 vector double __b) {
9465 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
9472 #define __builtin_altivec_vsububm vec_vsububm
9474 static __inline__ vector signed char __ATTRS_o_ai
9475 vec_vsububm(vector signed char __a, vector signed char __b) {
9479 static __inline__ vector signed char __ATTRS_o_ai
9480 vec_vsububm(vector bool char __a, vector signed char __b) {
9481 return (vector signed char)__a - __b;
9484 static __inline__ vector signed char __ATTRS_o_ai
9485 vec_vsububm(vector signed char __a, vector bool char __b) {
9486 return __a - (vector signed char)__b;
9489 static __inline__ vector unsigned char __ATTRS_o_ai
9490 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
9494 static __inline__ vector unsigned char __ATTRS_o_ai
9495 vec_vsububm(vector bool char __a, vector unsigned char __b) {
9496 return (vector unsigned char)__a - __b;
9499 static __inline__ vector unsigned char __ATTRS_o_ai
9500 vec_vsububm(vector unsigned char __a, vector bool char __b) {
9501 return __a - (vector unsigned char)__b;
9506 #define __builtin_altivec_vsubuhm vec_vsubuhm
9508 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
9513 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
9515 return (vector short)__a - __b;
9518 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
9519 vector bool short __b) {
9520 return __a - (vector short)__b;
9523 static __inline__ vector unsigned short __ATTRS_o_ai
9524 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
9528 static __inline__ vector unsigned short __ATTRS_o_ai
9529 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
9530 return (vector unsigned short)__a - __b;
9533 static __inline__ vector unsigned short __ATTRS_o_ai
9534 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
9535 return __a - (vector unsigned short)__b;
9540 #define __builtin_altivec_vsubuwm vec_vsubuwm
9542 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
9547 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
9549 return (vector int)__a - __b;
9552 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
9553 vector bool int __b) {
9554 return __a - (vector int)__b;
9557 static __inline__ vector unsigned int __ATTRS_o_ai
9558 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
9562 static __inline__ vector unsigned int __ATTRS_o_ai
9563 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
9564 return (vector unsigned int)__a - __b;
9567 static __inline__ vector unsigned int __ATTRS_o_ai
9568 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
9569 return __a - (vector unsigned int)__b;
9574 #define __builtin_altivec_vsubfp vec_vsubfp
9576 static __inline__ vector float __attribute__((__always_inline__))
9577 vec_vsubfp(vector float __a, vector float __b) {
9583 static __inline__ vector unsigned int __ATTRS_o_ai
9584 vec_subc(vector unsigned int __a, vector unsigned int __b) {
9585 return __builtin_altivec_vsubcuw(__a, __b);
9588 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9589 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9590 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9591 return __builtin_altivec_vsubcuq(__a, __b);
9594 static __inline__ vector signed __int128 __ATTRS_o_ai
9595 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
9596 return __builtin_altivec_vsubcuq(__a, __b);
9598 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9602 static __inline__ vector unsigned int __attribute__((__always_inline__))
9603 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
9604 return __builtin_altivec_vsubcuw(__a, __b);
9609 static __inline__ vector signed char __ATTRS_o_ai
9610 vec_subs(vector signed char __a, vector signed char __b) {
9611 return __builtin_altivec_vsubsbs(__a, __b);
9614 static __inline__ vector signed char __ATTRS_o_ai
9615 vec_subs(vector bool char __a, vector signed char __b) {
9616 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
9619 static __inline__ vector signed char __ATTRS_o_ai
9620 vec_subs(vector signed char __a, vector bool char __b) {
9621 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
9624 static __inline__ vector unsigned char __ATTRS_o_ai
9625 vec_subs(vector unsigned char __a, vector unsigned char __b) {
9626 return __builtin_altivec_vsububs(__a, __b);
9629 static __inline__ vector unsigned char __ATTRS_o_ai
9630 vec_subs(vector bool char __a, vector unsigned char __b) {
9631 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
9634 static __inline__ vector unsigned char __ATTRS_o_ai
9635 vec_subs(vector unsigned char __a, vector bool char __b) {
9636 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
9639 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
9641 return __builtin_altivec_vsubshs(__a, __b);
9644 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
9646 return __builtin_altivec_vsubshs((vector short)__a, __b);
9649 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
9650 vector bool short __b) {
9651 return __builtin_altivec_vsubshs(__a, (vector short)__b);
9654 static __inline__ vector unsigned short __ATTRS_o_ai
9655 vec_subs(vector unsigned short __a, vector unsigned short __b) {
9656 return __builtin_altivec_vsubuhs(__a, __b);
9659 static __inline__ vector unsigned short __ATTRS_o_ai
9660 vec_subs(vector bool short __a, vector unsigned short __b) {
9661 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
9664 static __inline__ vector unsigned short __ATTRS_o_ai
9665 vec_subs(vector unsigned short __a, vector bool short __b) {
9666 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
9669 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
9671 return __builtin_altivec_vsubsws(__a, __b);
9674 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
9676 return __builtin_altivec_vsubsws((vector int)__a, __b);
9679 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
9680 vector bool int __b) {
9681 return __builtin_altivec_vsubsws(__a, (vector int)__b);
9684 static __inline__ vector unsigned int __ATTRS_o_ai
9685 vec_subs(vector unsigned int __a, vector unsigned int __b) {
9686 return __builtin_altivec_vsubuws(__a, __b);
9689 static __inline__ vector unsigned int __ATTRS_o_ai
9690 vec_subs(vector bool int __a, vector unsigned int __b) {
9691 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
9694 static __inline__ vector unsigned int __ATTRS_o_ai
9695 vec_subs(vector unsigned int __a, vector bool int __b) {
9696 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
9701 static __inline__ vector signed char __ATTRS_o_ai
9702 vec_vsubsbs(vector signed char __a, vector signed char __b) {
9703 return __builtin_altivec_vsubsbs(__a, __b);
9706 static __inline__ vector signed char __ATTRS_o_ai
9707 vec_vsubsbs(vector bool char __a, vector signed char __b) {
9708 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
9711 static __inline__ vector signed char __ATTRS_o_ai
9712 vec_vsubsbs(vector signed char __a, vector bool char __b) {
9713 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
9718 static __inline__ vector unsigned char __ATTRS_o_ai
9719 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
9720 return __builtin_altivec_vsububs(__a, __b);
9723 static __inline__ vector unsigned char __ATTRS_o_ai
9724 vec_vsububs(vector bool char __a, vector unsigned char __b) {
9725 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
9728 static __inline__ vector unsigned char __ATTRS_o_ai
9729 vec_vsububs(vector unsigned char __a, vector bool char __b) {
9730 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
9735 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
9737 return __builtin_altivec_vsubshs(__a, __b);
9740 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
9742 return __builtin_altivec_vsubshs((vector short)__a, __b);
9745 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
9746 vector bool short __b) {
9747 return __builtin_altivec_vsubshs(__a, (vector short)__b);
9752 static __inline__ vector unsigned short __ATTRS_o_ai
9753 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
9754 return __builtin_altivec_vsubuhs(__a, __b);
9757 static __inline__ vector unsigned short __ATTRS_o_ai
9758 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
9759 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
9762 static __inline__ vector unsigned short __ATTRS_o_ai
9763 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
9764 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
9769 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
9771 return __builtin_altivec_vsubsws(__a, __b);
9774 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
9776 return __builtin_altivec_vsubsws((vector int)__a, __b);
9779 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
9780 vector bool int __b) {
9781 return __builtin_altivec_vsubsws(__a, (vector int)__b);
9786 static __inline__ vector unsigned int __ATTRS_o_ai
9787 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
9788 return __builtin_altivec_vsubuws(__a, __b);
9791 static __inline__ vector unsigned int __ATTRS_o_ai
9792 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
9793 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
9796 static __inline__ vector unsigned int __ATTRS_o_ai
9797 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
9798 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
9801 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9804 static __inline__ vector signed __int128 __ATTRS_o_ai
9805 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
9809 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9810 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9816 static __inline__ vector signed __int128 __ATTRS_o_ai
9817 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
9818 vector signed __int128 __c) {
9819 return __builtin_altivec_vsubeuqm(__a, __b, __c);
9822 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9823 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
9824 vector unsigned __int128 __c) {
9825 return __builtin_altivec_vsubeuqm(__a, __b, __c);
9830 static __inline__ vector signed __int128 __ATTRS_o_ai
9831 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
9832 return __builtin_altivec_vsubcuq(__a, __b);
9835 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9836 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9837 return __builtin_altivec_vsubcuq(__a, __b);
9842 static __inline__ vector signed __int128 __ATTRS_o_ai
9843 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
9844 vector signed __int128 __c) {
9845 return __builtin_altivec_vsubecuq(__a, __b, __c);
9848 static __inline__ vector unsigned __int128 __ATTRS_o_ai
9849 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
9850 vector unsigned __int128 __c) {
9851 return __builtin_altivec_vsubecuq(__a, __b, __c);
9853 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9857 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
9859 return __builtin_altivec_vsum4sbs(__a, __b);
9862 static __inline__ vector unsigned int __ATTRS_o_ai
9863 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
9864 return __builtin_altivec_vsum4ubs(__a, __b);
9867 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
9869 return __builtin_altivec_vsum4shs(__a, __b);
9874 static __inline__ vector int __attribute__((__always_inline__))
9875 vec_vsum4sbs(vector signed char __a, vector int __b) {
9876 return __builtin_altivec_vsum4sbs(__a, __b);
9881 static __inline__ vector unsigned int __attribute__((__always_inline__))
9882 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
9883 return __builtin_altivec_vsum4ubs(__a, __b);
9888 static __inline__ vector int __attribute__((__always_inline__))
9889 vec_vsum4shs(vector signed short __a, vector int __b) {
9890 return __builtin_altivec_vsum4shs(__a, __b);
9895 /* The vsum2sws instruction has a big-endian bias, so that the second
9896 input vector and the result always reference big-endian elements
9897 1 and 3 (little-endian element 0 and 2). For ease of porting the
9898 programmer wants elements 1 and 3 in both cases, so for little
9899 endian we must perform some permutes. */
9901 static __inline__ vector signed int __attribute__((__always_inline__))
9902 vec_sum2s(vector int __a, vector int __b) {
9903 #ifdef __LITTLE_ENDIAN__
9904 vector int __c = (vector signed int)vec_perm(
9905 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9907 __c = __builtin_altivec_vsum2sws(__a, __c);
9908 return (vector signed int)vec_perm(
9909 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9912 return __builtin_altivec_vsum2sws(__a, __b);
9918 static __inline__ vector signed int __attribute__((__always_inline__))
9919 vec_vsum2sws(vector int __a, vector int __b) {
9920 #ifdef __LITTLE_ENDIAN__
9921 vector int __c = (vector signed int)vec_perm(
9922 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9924 __c = __builtin_altivec_vsum2sws(__a, __c);
9925 return (vector signed int)vec_perm(
9926 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9929 return __builtin_altivec_vsum2sws(__a, __b);
9935 /* The vsumsws instruction has a big-endian bias, so that the second
9936 input vector and the result always reference big-endian element 3
9937 (little-endian element 0). For ease of porting the programmer
9938 wants element 3 in both cases, so for little endian we must perform
9941 static __inline__ vector signed int __attribute__((__always_inline__))
9942 vec_sums(vector signed int __a, vector signed int __b) {
9943 #ifdef __LITTLE_ENDIAN__
9944 __b = (vector signed int)vec_splat(__b, 3);
9945 __b = __builtin_altivec_vsumsws(__a, __b);
9946 return (vector signed int)(0, 0, 0, __b[0]);
9948 return __builtin_altivec_vsumsws(__a, __b);
9954 static __inline__ vector signed int __attribute__((__always_inline__))
9955 vec_vsumsws(vector signed int __a, vector signed int __b) {
9956 #ifdef __LITTLE_ENDIAN__
9957 __b = (vector signed int)vec_splat(__b, 3);
9958 __b = __builtin_altivec_vsumsws(__a, __b);
9959 return (vector signed int)(0, 0, 0, __b[0]);
9961 return __builtin_altivec_vsumsws(__a, __b);
9967 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
9969 return __builtin_vsx_xvrspiz(__a);
9971 return __builtin_altivec_vrfiz(__a);
9976 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
9977 return __builtin_vsx_xvrdpiz(__a);
9983 static __inline__ vector float __attribute__((__always_inline__))
9984 vec_vrfiz(vector float __a) {
9985 return __builtin_altivec_vrfiz(__a);
9990 /* The vector unpack instructions all have a big-endian bias, so for
9991 little endian we must reverse the meanings of "high" and "low." */
9993 static __inline__ vector short __ATTRS_o_ai
9994 vec_unpackh(vector signed char __a) {
9995 #ifdef __LITTLE_ENDIAN__
9996 return __builtin_altivec_vupklsb((vector char)__a);
9998 return __builtin_altivec_vupkhsb((vector char)__a);
10002 static __inline__ vector bool short __ATTRS_o_ai
10003 vec_unpackh(vector bool char __a) {
10004 #ifdef __LITTLE_ENDIAN__
10005 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10007 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10011 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
10012 #ifdef __LITTLE_ENDIAN__
10013 return __builtin_altivec_vupklsh(__a);
10015 return __builtin_altivec_vupkhsh(__a);
10019 static __inline__ vector bool int __ATTRS_o_ai
10020 vec_unpackh(vector bool short __a) {
10021 #ifdef __LITTLE_ENDIAN__
10022 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10024 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10028 static __inline__ vector unsigned int __ATTRS_o_ai
10029 vec_unpackh(vector pixel __a) {
10030 #ifdef __LITTLE_ENDIAN__
10031 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10033 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10037 #ifdef __POWER8_VECTOR__
10038 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
10039 #ifdef __LITTLE_ENDIAN__
10040 return __builtin_altivec_vupklsw(__a);
10042 return __builtin_altivec_vupkhsw(__a);
10046 static __inline__ vector bool long long __ATTRS_o_ai
10047 vec_unpackh(vector bool int __a) {
10048 #ifdef __LITTLE_ENDIAN__
10049 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10051 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10058 static __inline__ vector short __ATTRS_o_ai
10059 vec_vupkhsb(vector signed char __a) {
10060 #ifdef __LITTLE_ENDIAN__
10061 return __builtin_altivec_vupklsb((vector char)__a);
10063 return __builtin_altivec_vupkhsb((vector char)__a);
10067 static __inline__ vector bool short __ATTRS_o_ai
10068 vec_vupkhsb(vector bool char __a) {
10069 #ifdef __LITTLE_ENDIAN__
10070 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10072 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10078 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
10079 #ifdef __LITTLE_ENDIAN__
10080 return __builtin_altivec_vupklsh(__a);
10082 return __builtin_altivec_vupkhsh(__a);
10086 static __inline__ vector bool int __ATTRS_o_ai
10087 vec_vupkhsh(vector bool short __a) {
10088 #ifdef __LITTLE_ENDIAN__
10089 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10091 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10095 static __inline__ vector unsigned int __ATTRS_o_ai
10096 vec_vupkhsh(vector pixel __a) {
10097 #ifdef __LITTLE_ENDIAN__
10098 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10100 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10106 #ifdef __POWER8_VECTOR__
10107 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
10108 #ifdef __LITTLE_ENDIAN__
10109 return __builtin_altivec_vupklsw(__a);
10111 return __builtin_altivec_vupkhsw(__a);
10115 static __inline__ vector bool long long __ATTRS_o_ai
10116 vec_vupkhsw(vector bool int __a) {
10117 #ifdef __LITTLE_ENDIAN__
10118 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10120 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10127 static __inline__ vector short __ATTRS_o_ai
10128 vec_unpackl(vector signed char __a) {
10129 #ifdef __LITTLE_ENDIAN__
10130 return __builtin_altivec_vupkhsb((vector char)__a);
10132 return __builtin_altivec_vupklsb((vector char)__a);
10136 static __inline__ vector bool short __ATTRS_o_ai
10137 vec_unpackl(vector bool char __a) {
10138 #ifdef __LITTLE_ENDIAN__
10139 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10141 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10145 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
10146 #ifdef __LITTLE_ENDIAN__
10147 return __builtin_altivec_vupkhsh(__a);
10149 return __builtin_altivec_vupklsh(__a);
10153 static __inline__ vector bool int __ATTRS_o_ai
10154 vec_unpackl(vector bool short __a) {
10155 #ifdef __LITTLE_ENDIAN__
10156 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10158 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10162 static __inline__ vector unsigned int __ATTRS_o_ai
10163 vec_unpackl(vector pixel __a) {
10164 #ifdef __LITTLE_ENDIAN__
10165 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10167 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10171 #ifdef __POWER8_VECTOR__
10172 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
10173 #ifdef __LITTLE_ENDIAN__
10174 return __builtin_altivec_vupkhsw(__a);
10176 return __builtin_altivec_vupklsw(__a);
10180 static __inline__ vector bool long long __ATTRS_o_ai
10181 vec_unpackl(vector bool int __a) {
10182 #ifdef __LITTLE_ENDIAN__
10183 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10185 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10192 static __inline__ vector short __ATTRS_o_ai
10193 vec_vupklsb(vector signed char __a) {
10194 #ifdef __LITTLE_ENDIAN__
10195 return __builtin_altivec_vupkhsb((vector char)__a);
10197 return __builtin_altivec_vupklsb((vector char)__a);
10201 static __inline__ vector bool short __ATTRS_o_ai
10202 vec_vupklsb(vector bool char __a) {
10203 #ifdef __LITTLE_ENDIAN__
10204 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10206 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10212 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
10213 #ifdef __LITTLE_ENDIAN__
10214 return __builtin_altivec_vupkhsh(__a);
10216 return __builtin_altivec_vupklsh(__a);
10220 static __inline__ vector bool int __ATTRS_o_ai
10221 vec_vupklsh(vector bool short __a) {
10222 #ifdef __LITTLE_ENDIAN__
10223 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10225 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10229 static __inline__ vector unsigned int __ATTRS_o_ai
10230 vec_vupklsh(vector pixel __a) {
10231 #ifdef __LITTLE_ENDIAN__
10232 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10234 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10240 #ifdef __POWER8_VECTOR__
10241 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
10242 #ifdef __LITTLE_ENDIAN__
10243 return __builtin_altivec_vupkhsw(__a);
10245 return __builtin_altivec_vupklsw(__a);
10249 static __inline__ vector bool long long __ATTRS_o_ai
10250 vec_vupklsw(vector bool int __a) {
10251 #ifdef __LITTLE_ENDIAN__
10252 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10254 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10263 static __inline__ vector bool int __ATTRS_o_ai
10264 vec_vsx_ld(int __a, const vector bool int *__b) {
10265 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
10268 static __inline__ vector signed int __ATTRS_o_ai
10269 vec_vsx_ld(int __a, const vector signed int *__b) {
10270 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
10273 static __inline__ vector signed int __ATTRS_o_ai
10274 vec_vsx_ld(int __a, const signed int *__b) {
10275 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
10278 static __inline__ vector unsigned int __ATTRS_o_ai
10279 vec_vsx_ld(int __a, const vector unsigned int *__b) {
10280 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
10283 static __inline__ vector unsigned int __ATTRS_o_ai
10284 vec_vsx_ld(int __a, const unsigned int *__b) {
10285 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
10288 static __inline__ vector float __ATTRS_o_ai
10289 vec_vsx_ld(int __a, const vector float *__b) {
10290 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
10293 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
10294 const float *__b) {
10295 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
10298 static __inline__ vector signed long long __ATTRS_o_ai
10299 vec_vsx_ld(int __a, const vector signed long long *__b) {
10300 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
10303 static __inline__ vector unsigned long long __ATTRS_o_ai
10304 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
10305 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
10308 static __inline__ vector double __ATTRS_o_ai
10309 vec_vsx_ld(int __a, const vector double *__b) {
10310 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
10313 static __inline__ vector double __ATTRS_o_ai
10314 vec_vsx_ld(int __a, const double *__b) {
10315 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
10318 static __inline__ vector bool short __ATTRS_o_ai
10319 vec_vsx_ld(int __a, const vector bool short *__b) {
10320 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
10323 static __inline__ vector signed short __ATTRS_o_ai
10324 vec_vsx_ld(int __a, const vector signed short *__b) {
10325 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
10328 static __inline__ vector signed short __ATTRS_o_ai
10329 vec_vsx_ld(int __a, const signed short *__b) {
10330 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
10333 static __inline__ vector unsigned short __ATTRS_o_ai
10334 vec_vsx_ld(int __a, const vector unsigned short *__b) {
10335 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
10338 static __inline__ vector unsigned short __ATTRS_o_ai
10339 vec_vsx_ld(int __a, const unsigned short *__b) {
10340 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
10343 static __inline__ vector bool char __ATTRS_o_ai
10344 vec_vsx_ld(int __a, const vector bool char *__b) {
10345 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
10348 static __inline__ vector signed char __ATTRS_o_ai
10349 vec_vsx_ld(int __a, const vector signed char *__b) {
10350 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
10353 static __inline__ vector signed char __ATTRS_o_ai
10354 vec_vsx_ld(int __a, const signed char *__b) {
10355 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
10358 static __inline__ vector unsigned char __ATTRS_o_ai
10359 vec_vsx_ld(int __a, const vector unsigned char *__b) {
10360 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
10363 static __inline__ vector unsigned char __ATTRS_o_ai
10364 vec_vsx_ld(int __a, const unsigned char *__b) {
10365 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
10374 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10375 vector bool int *__c) {
10376 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10379 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10381 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10384 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10385 unsigned int *__c) {
10386 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10389 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
10390 vector signed int *__c) {
10391 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10394 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
10396 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10399 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
10400 vector unsigned int *__c) {
10401 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10404 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
10405 unsigned int *__c) {
10406 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10409 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
10410 vector float *__c) {
10411 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10414 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
10416 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10419 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
10421 vector signed long long *__c) {
10422 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10425 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
10427 vector unsigned long long *__c) {
10428 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10431 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
10432 vector double *__c) {
10433 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10436 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
10438 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10441 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10442 vector bool short *__c) {
10443 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10446 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10447 signed short *__c) {
10448 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10451 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10452 unsigned short *__c) {
10453 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10455 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
10456 vector signed short *__c) {
10457 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10460 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
10461 signed short *__c) {
10462 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10465 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
10467 vector unsigned short *__c) {
10468 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10471 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
10472 int __b, unsigned short *__c) {
10473 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10476 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10477 vector bool char *__c) {
10478 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10481 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10482 signed char *__c) {
10483 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10486 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10487 unsigned char *__c) {
10488 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10491 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
10492 vector signed char *__c) {
10493 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10496 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
10497 signed char *__c) {
10498 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10501 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
10503 vector unsigned char *__c) {
10504 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10507 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
10508 int __b, unsigned char *__c) {
10509 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10516 #define __builtin_altivec_vxor vec_xor
10518 static __inline__ vector signed char __ATTRS_o_ai
10519 vec_xor(vector signed char __a, vector signed char __b) {
10523 static __inline__ vector signed char __ATTRS_o_ai
10524 vec_xor(vector bool char __a, vector signed char __b) {
10525 return (vector signed char)__a ^ __b;
10528 static __inline__ vector signed char __ATTRS_o_ai
10529 vec_xor(vector signed char __a, vector bool char __b) {
10530 return __a ^ (vector signed char)__b;
10533 static __inline__ vector unsigned char __ATTRS_o_ai
10534 vec_xor(vector unsigned char __a, vector unsigned char __b) {
10538 static __inline__ vector unsigned char __ATTRS_o_ai
10539 vec_xor(vector bool char __a, vector unsigned char __b) {
10540 return (vector unsigned char)__a ^ __b;
10543 static __inline__ vector unsigned char __ATTRS_o_ai
10544 vec_xor(vector unsigned char __a, vector bool char __b) {
10545 return __a ^ (vector unsigned char)__b;
10548 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
10549 vector bool char __b) {
10553 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
10554 vector short __b) {
10558 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
10559 vector short __b) {
10560 return (vector short)__a ^ __b;
10563 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
10564 vector bool short __b) {
10565 return __a ^ (vector short)__b;
10568 static __inline__ vector unsigned short __ATTRS_o_ai
10569 vec_xor(vector unsigned short __a, vector unsigned short __b) {
10573 static __inline__ vector unsigned short __ATTRS_o_ai
10574 vec_xor(vector bool short __a, vector unsigned short __b) {
10575 return (vector unsigned short)__a ^ __b;
10578 static __inline__ vector unsigned short __ATTRS_o_ai
10579 vec_xor(vector unsigned short __a, vector bool short __b) {
10580 return __a ^ (vector unsigned short)__b;
10583 static __inline__ vector bool short __ATTRS_o_ai
10584 vec_xor(vector bool short __a, vector bool short __b) {
10588 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
10593 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
10595 return (vector int)__a ^ __b;
10598 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
10599 vector bool int __b) {
10600 return __a ^ (vector int)__b;
10603 static __inline__ vector unsigned int __ATTRS_o_ai
10604 vec_xor(vector unsigned int __a, vector unsigned int __b) {
10608 static __inline__ vector unsigned int __ATTRS_o_ai
10609 vec_xor(vector bool int __a, vector unsigned int __b) {
10610 return (vector unsigned int)__a ^ __b;
10613 static __inline__ vector unsigned int __ATTRS_o_ai
10614 vec_xor(vector unsigned int __a, vector bool int __b) {
10615 return __a ^ (vector unsigned int)__b;
10618 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
10619 vector bool int __b) {
10623 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
10624 vector float __b) {
10625 vector unsigned int __res =
10626 (vector unsigned int)__a ^ (vector unsigned int)__b;
10627 return (vector float)__res;
10630 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
10631 vector float __b) {
10632 vector unsigned int __res =
10633 (vector unsigned int)__a ^ (vector unsigned int)__b;
10634 return (vector float)__res;
10637 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
10638 vector bool int __b) {
10639 vector unsigned int __res =
10640 (vector unsigned int)__a ^ (vector unsigned int)__b;
10641 return (vector float)__res;
10645 static __inline__ vector signed long long __ATTRS_o_ai
10646 vec_xor(vector signed long long __a, vector signed long long __b) {
10650 static __inline__ vector signed long long __ATTRS_o_ai
10651 vec_xor(vector bool long long __a, vector signed long long __b) {
10652 return (vector signed long long)__a ^ __b;
10655 static __inline__ vector signed long long __ATTRS_o_ai
10656 vec_xor(vector signed long long __a, vector bool long long __b) {
10657 return __a ^ (vector signed long long)__b;
10660 static __inline__ vector unsigned long long __ATTRS_o_ai
10661 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
10665 static __inline__ vector unsigned long long __ATTRS_o_ai
10666 vec_xor(vector bool long long __a, vector unsigned long long __b) {
10667 return (vector unsigned long long)__a ^ __b;
10670 static __inline__ vector unsigned long long __ATTRS_o_ai
10671 vec_xor(vector unsigned long long __a, vector bool long long __b) {
10672 return __a ^ (vector unsigned long long)__b;
10675 static __inline__ vector bool long long __ATTRS_o_ai
10676 vec_xor(vector bool long long __a, vector bool long long __b) {
10680 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
10681 vector double __b) {
10682 return (vector double)((vector unsigned long long)__a ^
10683 (vector unsigned long long)__b);
10686 static __inline__ vector double __ATTRS_o_ai
10687 vec_xor(vector double __a, vector bool long long __b) {
10688 return (vector double)((vector unsigned long long)__a ^
10689 (vector unsigned long long)__b);
10692 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
10693 vector double __b) {
10694 return (vector double)((vector unsigned long long)__a ^
10695 (vector unsigned long long)__b);
10701 static __inline__ vector signed char __ATTRS_o_ai
10702 vec_vxor(vector signed char __a, vector signed char __b) {
10706 static __inline__ vector signed char __ATTRS_o_ai
10707 vec_vxor(vector bool char __a, vector signed char __b) {
10708 return (vector signed char)__a ^ __b;
10711 static __inline__ vector signed char __ATTRS_o_ai
10712 vec_vxor(vector signed char __a, vector bool char __b) {
10713 return __a ^ (vector signed char)__b;
10716 static __inline__ vector unsigned char __ATTRS_o_ai
10717 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
10721 static __inline__ vector unsigned char __ATTRS_o_ai
10722 vec_vxor(vector bool char __a, vector unsigned char __b) {
10723 return (vector unsigned char)__a ^ __b;
10726 static __inline__ vector unsigned char __ATTRS_o_ai
10727 vec_vxor(vector unsigned char __a, vector bool char __b) {
10728 return __a ^ (vector unsigned char)__b;
10731 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
10732 vector bool char __b) {
10736 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
10737 vector short __b) {
10741 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
10742 vector short __b) {
10743 return (vector short)__a ^ __b;
10746 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
10747 vector bool short __b) {
10748 return __a ^ (vector short)__b;
10751 static __inline__ vector unsigned short __ATTRS_o_ai
10752 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
10756 static __inline__ vector unsigned short __ATTRS_o_ai
10757 vec_vxor(vector bool short __a, vector unsigned short __b) {
10758 return (vector unsigned short)__a ^ __b;
10761 static __inline__ vector unsigned short __ATTRS_o_ai
10762 vec_vxor(vector unsigned short __a, vector bool short __b) {
10763 return __a ^ (vector unsigned short)__b;
10766 static __inline__ vector bool short __ATTRS_o_ai
10767 vec_vxor(vector bool short __a, vector bool short __b) {
10771 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
10776 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
10778 return (vector int)__a ^ __b;
10781 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
10782 vector bool int __b) {
10783 return __a ^ (vector int)__b;
10786 static __inline__ vector unsigned int __ATTRS_o_ai
10787 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
10791 static __inline__ vector unsigned int __ATTRS_o_ai
10792 vec_vxor(vector bool int __a, vector unsigned int __b) {
10793 return (vector unsigned int)__a ^ __b;
10796 static __inline__ vector unsigned int __ATTRS_o_ai
10797 vec_vxor(vector unsigned int __a, vector bool int __b) {
10798 return __a ^ (vector unsigned int)__b;
10801 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
10802 vector bool int __b) {
10806 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
10807 vector float __b) {
10808 vector unsigned int __res =
10809 (vector unsigned int)__a ^ (vector unsigned int)__b;
10810 return (vector float)__res;
10813 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
10814 vector float __b) {
10815 vector unsigned int __res =
10816 (vector unsigned int)__a ^ (vector unsigned int)__b;
10817 return (vector float)__res;
10820 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
10821 vector bool int __b) {
10822 vector unsigned int __res =
10823 (vector unsigned int)__a ^ (vector unsigned int)__b;
10824 return (vector float)__res;
10828 static __inline__ vector signed long long __ATTRS_o_ai
10829 vec_vxor(vector signed long long __a, vector signed long long __b) {
10833 static __inline__ vector signed long long __ATTRS_o_ai
10834 vec_vxor(vector bool long long __a, vector signed long long __b) {
10835 return (vector signed long long)__a ^ __b;
10838 static __inline__ vector signed long long __ATTRS_o_ai
10839 vec_vxor(vector signed long long __a, vector bool long long __b) {
10840 return __a ^ (vector signed long long)__b;
10843 static __inline__ vector unsigned long long __ATTRS_o_ai
10844 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
10848 static __inline__ vector unsigned long long __ATTRS_o_ai
10849 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
10850 return (vector unsigned long long)__a ^ __b;
10853 static __inline__ vector unsigned long long __ATTRS_o_ai
10854 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
10855 return __a ^ (vector unsigned long long)__b;
10858 static __inline__ vector bool long long __ATTRS_o_ai
10859 vec_vxor(vector bool long long __a, vector bool long long __b) {
10864 /* ------------------------ extensions for CBEA ----------------------------- */
10868 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
10873 static __inline__ unsigned char __ATTRS_o_ai
10874 vec_extract(vector unsigned char __a, int __b) {
10878 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
10883 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
10888 static __inline__ unsigned short __ATTRS_o_ai
10889 vec_extract(vector unsigned short __a, int __b) {
10893 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
10898 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
10903 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
10908 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
10914 static __inline__ signed long long __ATTRS_o_ai
10915 vec_extract(vector signed long long __a, int __b) {
10919 static __inline__ unsigned long long __ATTRS_o_ai
10920 vec_extract(vector unsigned long long __a, int __b) {
10924 static __inline__ unsigned long long __ATTRS_o_ai
10925 vec_extract(vector bool long long __a, int __b) {
10929 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
10934 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
10940 static __inline__ vector signed char __ATTRS_o_ai
10941 vec_insert(signed char __a, vector signed char __b, int __c) {
10946 static __inline__ vector unsigned char __ATTRS_o_ai
10947 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
10952 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
10953 vector bool char __b,
10959 static __inline__ vector signed short __ATTRS_o_ai
10960 vec_insert(signed short __a, vector signed short __b, int __c) {
10965 static __inline__ vector unsigned short __ATTRS_o_ai
10966 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
10971 static __inline__ vector bool short __ATTRS_o_ai
10972 vec_insert(unsigned short __a, vector bool short __b, int __c) {
10977 static __inline__ vector signed int __ATTRS_o_ai
10978 vec_insert(signed int __a, vector signed int __b, int __c) {
10983 static __inline__ vector unsigned int __ATTRS_o_ai
10984 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
10989 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
10990 vector bool int __b,
10997 static __inline__ vector signed long long __ATTRS_o_ai
10998 vec_insert(signed long long __a, vector signed long long __b, int __c) {
11003 static __inline__ vector unsigned long long __ATTRS_o_ai
11004 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
11009 static __inline__ vector bool long long __ATTRS_o_ai
11010 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
11014 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
11022 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
11031 static __inline__ vector signed char __ATTRS_o_ai
11032 vec_lvlx(int __a, const signed char *__b) {
11033 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
11034 vec_lvsl(__a, __b));
11037 static __inline__ vector signed char __ATTRS_o_ai
11038 vec_lvlx(int __a, const vector signed char *__b) {
11039 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
11040 vec_lvsl(__a, (unsigned char *)__b));
11043 static __inline__ vector unsigned char __ATTRS_o_ai
11044 vec_lvlx(int __a, const unsigned char *__b) {
11045 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
11046 vec_lvsl(__a, __b));
11049 static __inline__ vector unsigned char __ATTRS_o_ai
11050 vec_lvlx(int __a, const vector unsigned char *__b) {
11051 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
11052 vec_lvsl(__a, (unsigned char *)__b));
11055 static __inline__ vector bool char __ATTRS_o_ai
11056 vec_lvlx(int __a, const vector bool char *__b) {
11057 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
11058 vec_lvsl(__a, (unsigned char *)__b));
11061 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
11062 const short *__b) {
11063 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
11066 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
11067 const vector short *__b) {
11068 return vec_perm(vec_ld(__a, __b), (vector short)(0),
11069 vec_lvsl(__a, (unsigned char *)__b));
11072 static __inline__ vector unsigned short __ATTRS_o_ai
11073 vec_lvlx(int __a, const unsigned short *__b) {
11074 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
11075 vec_lvsl(__a, __b));
11078 static __inline__ vector unsigned short __ATTRS_o_ai
11079 vec_lvlx(int __a, const vector unsigned short *__b) {
11080 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
11081 vec_lvsl(__a, (unsigned char *)__b));
11084 static __inline__ vector bool short __ATTRS_o_ai
11085 vec_lvlx(int __a, const vector bool short *__b) {
11086 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
11087 vec_lvsl(__a, (unsigned char *)__b));
11090 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
11091 const vector pixel *__b) {
11092 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
11093 vec_lvsl(__a, (unsigned char *)__b));
11096 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
11097 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
11100 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
11101 const vector int *__b) {
11102 return vec_perm(vec_ld(__a, __b), (vector int)(0),
11103 vec_lvsl(__a, (unsigned char *)__b));
11106 static __inline__ vector unsigned int __ATTRS_o_ai
11107 vec_lvlx(int __a, const unsigned int *__b) {
11108 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
11109 vec_lvsl(__a, __b));
11112 static __inline__ vector unsigned int __ATTRS_o_ai
11113 vec_lvlx(int __a, const vector unsigned int *__b) {
11114 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
11115 vec_lvsl(__a, (unsigned char *)__b));
11118 static __inline__ vector bool int __ATTRS_o_ai
11119 vec_lvlx(int __a, const vector bool int *__b) {
11120 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
11121 vec_lvsl(__a, (unsigned char *)__b));
11124 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
11125 const float *__b) {
11126 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
11129 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
11130 const vector float *__b) {
11131 return vec_perm(vec_ld(__a, __b), (vector float)(0),
11132 vec_lvsl(__a, (unsigned char *)__b));
11137 static __inline__ vector signed char __ATTRS_o_ai
11138 vec_lvlxl(int __a, const signed char *__b) {
11139 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
11140 vec_lvsl(__a, __b));
11143 static __inline__ vector signed char __ATTRS_o_ai
11144 vec_lvlxl(int __a, const vector signed char *__b) {
11145 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
11146 vec_lvsl(__a, (unsigned char *)__b));
11149 static __inline__ vector unsigned char __ATTRS_o_ai
11150 vec_lvlxl(int __a, const unsigned char *__b) {
11151 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
11152 vec_lvsl(__a, __b));
11155 static __inline__ vector unsigned char __ATTRS_o_ai
11156 vec_lvlxl(int __a, const vector unsigned char *__b) {
11157 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
11158 vec_lvsl(__a, (unsigned char *)__b));
11161 static __inline__ vector bool char __ATTRS_o_ai
11162 vec_lvlxl(int __a, const vector bool char *__b) {
11163 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
11164 vec_lvsl(__a, (unsigned char *)__b));
11167 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
11168 const short *__b) {
11169 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
11172 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
11173 const vector short *__b) {
11174 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
11175 vec_lvsl(__a, (unsigned char *)__b));
11178 static __inline__ vector unsigned short __ATTRS_o_ai
11179 vec_lvlxl(int __a, const unsigned short *__b) {
11180 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
11181 vec_lvsl(__a, __b));
11184 static __inline__ vector unsigned short __ATTRS_o_ai
11185 vec_lvlxl(int __a, const vector unsigned short *__b) {
11186 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
11187 vec_lvsl(__a, (unsigned char *)__b));
11190 static __inline__ vector bool short __ATTRS_o_ai
11191 vec_lvlxl(int __a, const vector bool short *__b) {
11192 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
11193 vec_lvsl(__a, (unsigned char *)__b));
11196 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
11197 const vector pixel *__b) {
11198 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
11199 vec_lvsl(__a, (unsigned char *)__b));
11202 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
11203 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
11206 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
11207 const vector int *__b) {
11208 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
11209 vec_lvsl(__a, (unsigned char *)__b));
11212 static __inline__ vector unsigned int __ATTRS_o_ai
11213 vec_lvlxl(int __a, const unsigned int *__b) {
11214 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
11215 vec_lvsl(__a, __b));
11218 static __inline__ vector unsigned int __ATTRS_o_ai
11219 vec_lvlxl(int __a, const vector unsigned int *__b) {
11220 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
11221 vec_lvsl(__a, (unsigned char *)__b));
11224 static __inline__ vector bool int __ATTRS_o_ai
11225 vec_lvlxl(int __a, const vector bool int *__b) {
11226 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
11227 vec_lvsl(__a, (unsigned char *)__b));
11230 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
11231 const float *__b) {
11232 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
11235 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
11236 vector float *__b) {
11237 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
11238 vec_lvsl(__a, (unsigned char *)__b));
11243 static __inline__ vector signed char __ATTRS_o_ai
11244 vec_lvrx(int __a, const signed char *__b) {
11245 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
11246 vec_lvsl(__a, __b));
11249 static __inline__ vector signed char __ATTRS_o_ai
11250 vec_lvrx(int __a, const vector signed char *__b) {
11251 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
11252 vec_lvsl(__a, (unsigned char *)__b));
11255 static __inline__ vector unsigned char __ATTRS_o_ai
11256 vec_lvrx(int __a, const unsigned char *__b) {
11257 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
11258 vec_lvsl(__a, __b));
11261 static __inline__ vector unsigned char __ATTRS_o_ai
11262 vec_lvrx(int __a, const vector unsigned char *__b) {
11263 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
11264 vec_lvsl(__a, (unsigned char *)__b));
11267 static __inline__ vector bool char __ATTRS_o_ai
11268 vec_lvrx(int __a, const vector bool char *__b) {
11269 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
11270 vec_lvsl(__a, (unsigned char *)__b));
11273 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
11274 const short *__b) {
11275 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11278 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
11279 const vector short *__b) {
11280 return vec_perm((vector short)(0), vec_ld(__a, __b),
11281 vec_lvsl(__a, (unsigned char *)__b));
11284 static __inline__ vector unsigned short __ATTRS_o_ai
11285 vec_lvrx(int __a, const unsigned short *__b) {
11286 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
11287 vec_lvsl(__a, __b));
11290 static __inline__ vector unsigned short __ATTRS_o_ai
11291 vec_lvrx(int __a, const vector unsigned short *__b) {
11292 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
11293 vec_lvsl(__a, (unsigned char *)__b));
11296 static __inline__ vector bool short __ATTRS_o_ai
11297 vec_lvrx(int __a, const vector bool short *__b) {
11298 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
11299 vec_lvsl(__a, (unsigned char *)__b));
11302 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
11303 const vector pixel *__b) {
11304 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
11305 vec_lvsl(__a, (unsigned char *)__b));
11308 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
11309 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11312 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
11313 const vector int *__b) {
11314 return vec_perm((vector int)(0), vec_ld(__a, __b),
11315 vec_lvsl(__a, (unsigned char *)__b));
11318 static __inline__ vector unsigned int __ATTRS_o_ai
11319 vec_lvrx(int __a, const unsigned int *__b) {
11320 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
11321 vec_lvsl(__a, __b));
11324 static __inline__ vector unsigned int __ATTRS_o_ai
11325 vec_lvrx(int __a, const vector unsigned int *__b) {
11326 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
11327 vec_lvsl(__a, (unsigned char *)__b));
11330 static __inline__ vector bool int __ATTRS_o_ai
11331 vec_lvrx(int __a, const vector bool int *__b) {
11332 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
11333 vec_lvsl(__a, (unsigned char *)__b));
11336 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
11337 const float *__b) {
11338 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11341 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
11342 const vector float *__b) {
11343 return vec_perm((vector float)(0), vec_ld(__a, __b),
11344 vec_lvsl(__a, (unsigned char *)__b));
11349 static __inline__ vector signed char __ATTRS_o_ai
11350 vec_lvrxl(int __a, const signed char *__b) {
11351 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
11352 vec_lvsl(__a, __b));
11355 static __inline__ vector signed char __ATTRS_o_ai
11356 vec_lvrxl(int __a, const vector signed char *__b) {
11357 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
11358 vec_lvsl(__a, (unsigned char *)__b));
11361 static __inline__ vector unsigned char __ATTRS_o_ai
11362 vec_lvrxl(int __a, const unsigned char *__b) {
11363 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
11364 vec_lvsl(__a, __b));
11367 static __inline__ vector unsigned char __ATTRS_o_ai
11368 vec_lvrxl(int __a, const vector unsigned char *__b) {
11369 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
11370 vec_lvsl(__a, (unsigned char *)__b));
11373 static __inline__ vector bool char __ATTRS_o_ai
11374 vec_lvrxl(int __a, const vector bool char *__b) {
11375 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
11376 vec_lvsl(__a, (unsigned char *)__b));
11379 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
11380 const short *__b) {
11381 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11384 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
11385 const vector short *__b) {
11386 return vec_perm((vector short)(0), vec_ldl(__a, __b),
11387 vec_lvsl(__a, (unsigned char *)__b));
11390 static __inline__ vector unsigned short __ATTRS_o_ai
11391 vec_lvrxl(int __a, const unsigned short *__b) {
11392 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
11393 vec_lvsl(__a, __b));
11396 static __inline__ vector unsigned short __ATTRS_o_ai
11397 vec_lvrxl(int __a, const vector unsigned short *__b) {
11398 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
11399 vec_lvsl(__a, (unsigned char *)__b));
11402 static __inline__ vector bool short __ATTRS_o_ai
11403 vec_lvrxl(int __a, const vector bool short *__b) {
11404 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
11405 vec_lvsl(__a, (unsigned char *)__b));
11408 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
11409 const vector pixel *__b) {
11410 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
11411 vec_lvsl(__a, (unsigned char *)__b));
11414 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
11415 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11418 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
11419 const vector int *__b) {
11420 return vec_perm((vector int)(0), vec_ldl(__a, __b),
11421 vec_lvsl(__a, (unsigned char *)__b));
11424 static __inline__ vector unsigned int __ATTRS_o_ai
11425 vec_lvrxl(int __a, const unsigned int *__b) {
11426 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
11427 vec_lvsl(__a, __b));
11430 static __inline__ vector unsigned int __ATTRS_o_ai
11431 vec_lvrxl(int __a, const vector unsigned int *__b) {
11432 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
11433 vec_lvsl(__a, (unsigned char *)__b));
11436 static __inline__ vector bool int __ATTRS_o_ai
11437 vec_lvrxl(int __a, const vector bool int *__b) {
11438 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
11439 vec_lvsl(__a, (unsigned char *)__b));
11442 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
11443 const float *__b) {
11444 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11447 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
11448 const vector float *__b) {
11449 return vec_perm((vector float)(0), vec_ldl(__a, __b),
11450 vec_lvsl(__a, (unsigned char *)__b));
11455 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
11456 signed char *__c) {
11457 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11461 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
11462 vector signed char *__c) {
11464 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11468 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
11469 unsigned char *__c) {
11470 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11474 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
11475 vector unsigned char *__c) {
11477 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11481 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
11482 vector bool char *__c) {
11484 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11488 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
11490 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11494 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
11495 vector short *__c) {
11497 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11501 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
11502 int __b, unsigned short *__c) {
11503 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11507 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
11509 vector unsigned short *__c) {
11511 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11515 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
11516 vector bool short *__c) {
11518 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11522 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
11523 vector pixel *__c) {
11525 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11529 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
11531 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11535 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
11538 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11542 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
11543 unsigned int *__c) {
11544 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11548 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
11549 vector unsigned int *__c) {
11551 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11555 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
11556 vector bool int *__c) {
11558 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11562 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
11563 vector float *__c) {
11565 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11571 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
11572 signed char *__c) {
11573 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11577 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
11578 vector signed char *__c) {
11580 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11584 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
11585 int __b, unsigned char *__c) {
11586 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11590 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
11592 vector unsigned char *__c) {
11594 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11598 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
11599 vector bool char *__c) {
11601 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11605 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
11607 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11611 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
11612 vector short *__c) {
11614 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11618 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
11619 int __b, unsigned short *__c) {
11620 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11624 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
11626 vector unsigned short *__c) {
11628 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11632 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
11633 vector bool short *__c) {
11635 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11639 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
11640 vector pixel *__c) {
11642 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11646 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
11648 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11652 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
11655 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11659 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
11660 unsigned int *__c) {
11661 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11665 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
11666 vector unsigned int *__c) {
11668 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11672 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
11673 vector bool int *__c) {
11675 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11679 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
11680 vector float *__c) {
11682 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11688 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
11689 signed char *__c) {
11690 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11694 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
11695 vector signed char *__c) {
11697 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11701 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
11702 unsigned char *__c) {
11703 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11707 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
11708 vector unsigned char *__c) {
11710 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11714 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
11715 vector bool char *__c) {
11717 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11721 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
11723 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11727 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
11728 vector short *__c) {
11730 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11734 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
11735 int __b, unsigned short *__c) {
11736 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11740 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
11742 vector unsigned short *__c) {
11744 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11748 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
11749 vector bool short *__c) {
11751 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11755 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
11756 vector pixel *__c) {
11758 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11762 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
11764 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11768 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
11771 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11775 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
11776 unsigned int *__c) {
11777 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11781 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
11782 vector unsigned int *__c) {
11784 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11788 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
11789 vector bool int *__c) {
11791 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11795 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
11796 vector float *__c) {
11798 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11804 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
11805 signed char *__c) {
11806 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11810 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
11811 vector signed char *__c) {
11813 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11817 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
11818 int __b, unsigned char *__c) {
11819 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11823 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
11825 vector unsigned char *__c) {
11827 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11831 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
11832 vector bool char *__c) {
11834 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11838 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
11840 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11844 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
11845 vector short *__c) {
11847 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11851 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
11852 int __b, unsigned short *__c) {
11853 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11857 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
11859 vector unsigned short *__c) {
11861 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11865 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
11866 vector bool short *__c) {
11868 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11872 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
11873 vector pixel *__c) {
11875 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11879 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
11881 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11885 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
11888 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11892 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
11893 unsigned int *__c) {
11894 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11898 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
11899 vector unsigned int *__c) {
11901 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11905 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
11906 vector bool int *__c) {
11908 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11912 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
11913 vector float *__c) {
11915 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11921 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
11923 vector signed char __res = (vector signed char)(0);
11928 static __inline__ vector unsigned char __ATTRS_o_ai
11929 vec_promote(unsigned char __a, int __b) {
11930 vector unsigned char __res = (vector unsigned char)(0);
11935 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
11936 vector short __res = (vector short)(0);
11941 static __inline__ vector unsigned short __ATTRS_o_ai
11942 vec_promote(unsigned short __a, int __b) {
11943 vector unsigned short __res = (vector unsigned short)(0);
11948 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
11949 vector int __res = (vector int)(0);
11954 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
11956 vector unsigned int __res = (vector unsigned int)(0);
11961 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
11962 vector float __res = (vector float)(0);
11969 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
11970 return (vector signed char)(__a);
11973 static __inline__ vector unsigned char __ATTRS_o_ai
11974 vec_splats(unsigned char __a) {
11975 return (vector unsigned char)(__a);
11978 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
11979 return (vector short)(__a);
11982 static __inline__ vector unsigned short __ATTRS_o_ai
11983 vec_splats(unsigned short __a) {
11984 return (vector unsigned short)(__a);
11987 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
11988 return (vector int)(__a);
11991 static __inline__ vector unsigned int __ATTRS_o_ai
11992 vec_splats(unsigned int __a) {
11993 return (vector unsigned int)(__a);
11997 static __inline__ vector signed long long __ATTRS_o_ai
11998 vec_splats(signed long long __a) {
11999 return (vector signed long long)(__a);
12002 static __inline__ vector unsigned long long __ATTRS_o_ai
12003 vec_splats(unsigned long long __a) {
12004 return (vector unsigned long long)(__a);
12007 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12008 static __inline__ vector signed __int128 __ATTRS_o_ai
12009 vec_splats(signed __int128 __a) {
12010 return (vector signed __int128)(__a);
12013 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12014 vec_splats(unsigned __int128 __a) {
12015 return (vector unsigned __int128)(__a);
12020 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
12021 return (vector double)(__a);
12025 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
12026 return (vector float)(__a);
12029 /* ----------------------------- predicates --------------------------------- */
12033 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
12034 vector signed char __b) {
12035 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12039 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
12040 vector bool char __b) {
12041 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12045 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
12046 vector unsigned char __b) {
12047 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12051 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
12052 vector bool char __b) {
12053 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12057 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12058 vector signed char __b) {
12059 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12063 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12064 vector unsigned char __b) {
12065 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12069 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12070 vector bool char __b) {
12071 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12075 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
12076 vector short __b) {
12077 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
12080 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
12081 vector bool short __b) {
12082 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
12085 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
12086 vector unsigned short __b) {
12087 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12088 (vector short)__b);
12091 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
12092 vector bool short __b) {
12093 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12094 (vector short)__b);
12097 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12098 vector short __b) {
12099 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12100 (vector short)__b);
12103 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12104 vector unsigned short __b) {
12105 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12106 (vector short)__b);
12109 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12110 vector bool short __b) {
12111 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12112 (vector short)__b);
12115 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
12116 vector pixel __b) {
12117 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12118 (vector short)__b);
12121 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
12122 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
12125 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
12126 vector bool int __b) {
12127 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
12130 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
12131 vector unsigned int __b) {
12132 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12136 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
12137 vector bool int __b) {
12138 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12142 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12144 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12148 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12149 vector unsigned int __b) {
12150 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12154 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12155 vector bool int __b) {
12156 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12160 #ifdef __POWER8_VECTOR__
12161 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
12162 vector signed long long __b) {
12163 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
12166 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
12167 vector bool long long __b) {
12168 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
12171 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
12172 vector unsigned long long __b) {
12173 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12174 (vector long long)__b);
12177 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
12178 vector bool long long __b) {
12179 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12180 (vector long long)__b);
12183 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12184 vector long long __b) {
12185 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12186 (vector long long)__b);
12189 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12190 vector unsigned long long __b) {
12191 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12192 (vector long long)__b);
12195 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12196 vector bool long long __b) {
12197 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12198 (vector long long)__b);
12202 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
12203 vector float __b) {
12205 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
12207 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
12212 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
12213 vector double __b) {
12214 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
12220 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
12221 vector signed char __b) {
12222 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
12225 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
12226 vector bool char __b) {
12227 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
12230 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
12231 vector unsigned char __b) {
12232 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
12235 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
12236 vector bool char __b) {
12237 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
12240 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12241 vector signed char __b) {
12242 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
12243 (vector unsigned char)__a);
12246 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12247 vector unsigned char __b) {
12248 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
12251 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12252 vector bool char __b) {
12253 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
12254 (vector unsigned char)__a);
12257 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
12258 vector short __b) {
12259 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
12262 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
12263 vector bool short __b) {
12264 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
12267 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
12268 vector unsigned short __b) {
12269 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
12272 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
12273 vector bool short __b) {
12274 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12278 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12279 vector short __b) {
12280 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12281 (vector unsigned short)__a);
12284 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12285 vector unsigned short __b) {
12286 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
12287 (vector unsigned short)__a);
12290 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12291 vector bool short __b) {
12292 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12293 (vector unsigned short)__a);
12296 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
12297 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
12300 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
12301 vector bool int __b) {
12302 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
12305 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
12306 vector unsigned int __b) {
12307 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
12310 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
12311 vector bool int __b) {
12312 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
12315 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12317 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
12318 (vector unsigned int)__a);
12321 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12322 vector unsigned int __b) {
12323 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
12326 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12327 vector bool int __b) {
12328 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
12329 (vector unsigned int)__a);
12332 #ifdef __POWER8_VECTOR__
12333 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
12334 vector signed long long __b) {
12335 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
12337 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
12338 vector bool long long __b) {
12339 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
12343 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
12344 vector unsigned long long __b) {
12345 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
12348 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
12349 vector bool long long __b) {
12350 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12354 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12355 vector signed long long __b) {
12356 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12357 (vector unsigned long long)__a);
12360 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12361 vector unsigned long long __b) {
12362 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
12363 (vector unsigned long long)__a);
12366 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12367 vector bool long long __b) {
12368 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12369 (vector unsigned long long)__a);
12373 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
12374 vector float __b) {
12376 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
12378 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
12383 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
12384 vector double __b) {
12385 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
12391 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
12392 vector signed char __b) {
12393 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
12396 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
12397 vector bool char __b) {
12398 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
12401 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
12402 vector unsigned char __b) {
12403 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
12406 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
12407 vector bool char __b) {
12408 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
12411 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12412 vector signed char __b) {
12413 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
12414 (vector unsigned char)__b);
12417 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12418 vector unsigned char __b) {
12419 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
12422 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12423 vector bool char __b) {
12424 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
12425 (vector unsigned char)__b);
12428 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
12429 vector short __b) {
12430 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
12433 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
12434 vector bool short __b) {
12435 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
12438 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
12439 vector unsigned short __b) {
12440 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
12443 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
12444 vector bool short __b) {
12445 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
12446 (vector unsigned short)__b);
12449 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12450 vector short __b) {
12451 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12452 (vector unsigned short)__b);
12455 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12456 vector unsigned short __b) {
12457 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12461 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12462 vector bool short __b) {
12463 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12464 (vector unsigned short)__b);
12467 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
12468 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
12471 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
12472 vector bool int __b) {
12473 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
12476 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
12477 vector unsigned int __b) {
12478 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
12481 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
12482 vector bool int __b) {
12483 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
12486 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12488 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
12489 (vector unsigned int)__b);
12492 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12493 vector unsigned int __b) {
12494 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
12497 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12498 vector bool int __b) {
12499 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
12500 (vector unsigned int)__b);
12503 #ifdef __POWER8_VECTOR__
12504 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
12505 vector signed long long __b) {
12506 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
12508 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
12509 vector bool long long __b) {
12510 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
12511 (vector signed long long)__b);
12514 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
12515 vector unsigned long long __b) {
12516 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
12519 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
12520 vector bool long long __b) {
12521 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
12522 (vector unsigned long long)__b);
12525 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12526 vector signed long long __b) {
12527 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12528 (vector unsigned long long)__b);
12531 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12532 vector unsigned long long __b) {
12533 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12537 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12538 vector bool long long __b) {
12539 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12540 (vector unsigned long long)__b);
12544 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
12545 vector float __b) {
12547 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
12549 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
12554 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
12555 vector double __b) {
12556 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
12562 static __inline__ int __attribute__((__always_inline__))
12563 vec_all_in(vector float __a, vector float __b) {
12564 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
12569 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
12570 vector signed char __b) {
12571 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
12574 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
12575 vector bool char __b) {
12576 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
12579 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
12580 vector unsigned char __b) {
12581 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
12584 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
12585 vector bool char __b) {
12586 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
12589 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12590 vector signed char __b) {
12591 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
12592 (vector unsigned char)__b);
12595 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12596 vector unsigned char __b) {
12597 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
12600 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12601 vector bool char __b) {
12602 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
12603 (vector unsigned char)__b);
12606 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
12607 vector short __b) {
12608 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
12611 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
12612 vector bool short __b) {
12613 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
12616 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
12617 vector unsigned short __b) {
12618 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
12621 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
12622 vector bool short __b) {
12623 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
12624 (vector unsigned short)__b);
12627 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12628 vector short __b) {
12629 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12630 (vector unsigned short)__b);
12633 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12634 vector unsigned short __b) {
12635 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12639 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12640 vector bool short __b) {
12641 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12642 (vector unsigned short)__b);
12645 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
12646 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
12649 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
12650 vector bool int __b) {
12651 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
12654 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
12655 vector unsigned int __b) {
12656 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
12659 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
12660 vector bool int __b) {
12661 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
12664 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12666 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
12667 (vector unsigned int)__b);
12670 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12671 vector unsigned int __b) {
12672 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
12675 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12676 vector bool int __b) {
12677 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
12678 (vector unsigned int)__b);
12681 #ifdef __POWER8_VECTOR__
12682 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
12683 vector signed long long __b) {
12684 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
12687 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
12688 vector unsigned long long __b) {
12689 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
12692 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
12693 vector bool long long __b) {
12694 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
12695 (vector signed long long)__b);
12698 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
12699 vector bool long long __b) {
12700 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
12701 (vector unsigned long long)__b);
12704 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12705 vector signed long long __b) {
12706 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12707 (vector unsigned long long)__b);
12710 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12711 vector unsigned long long __b) {
12712 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12716 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12717 vector bool long long __b) {
12718 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12719 (vector unsigned long long)__b);
12723 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
12724 vector float __b) {
12726 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
12728 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
12733 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
12734 vector double __b) {
12735 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
12741 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
12742 vector signed char __b) {
12743 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
12746 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
12747 vector bool char __b) {
12748 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
12751 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
12752 vector unsigned char __b) {
12753 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
12756 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
12757 vector bool char __b) {
12758 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
12761 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12762 vector signed char __b) {
12763 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
12764 (vector unsigned char)__a);
12767 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12768 vector unsigned char __b) {
12769 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
12772 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12773 vector bool char __b) {
12774 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
12775 (vector unsigned char)__a);
12778 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
12779 vector short __b) {
12780 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
12783 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
12784 vector bool short __b) {
12785 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
12788 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
12789 vector unsigned short __b) {
12790 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
12793 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
12794 vector bool short __b) {
12795 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12799 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12800 vector short __b) {
12801 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12802 (vector unsigned short)__a);
12805 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12806 vector unsigned short __b) {
12807 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
12808 (vector unsigned short)__a);
12811 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12812 vector bool short __b) {
12813 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12814 (vector unsigned short)__a);
12817 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
12818 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
12821 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
12822 vector bool int __b) {
12823 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
12826 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
12827 vector unsigned int __b) {
12828 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
12831 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
12832 vector bool int __b) {
12833 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
12836 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12838 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
12839 (vector unsigned int)__a);
12842 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12843 vector unsigned int __b) {
12844 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
12847 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12848 vector bool int __b) {
12849 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
12850 (vector unsigned int)__a);
12853 #ifdef __POWER8_VECTOR__
12854 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
12855 vector signed long long __b) {
12856 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
12859 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
12860 vector unsigned long long __b) {
12861 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
12864 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
12865 vector bool long long __b) {
12866 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
12870 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
12871 vector bool long long __b) {
12872 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12876 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12877 vector signed long long __b) {
12878 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12879 (vector unsigned long long)__a);
12882 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12883 vector unsigned long long __b) {
12884 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
12885 (vector unsigned long long)__a);
12888 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12889 vector bool long long __b) {
12890 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12891 (vector unsigned long long)__a);
12895 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
12896 vector float __b) {
12898 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
12900 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
12905 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
12906 vector double __b) {
12907 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
12913 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
12915 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
12917 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
12922 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
12923 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
12929 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
12930 vector signed char __b) {
12931 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12935 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
12936 vector bool char __b) {
12937 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12941 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
12942 vector unsigned char __b) {
12943 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12947 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
12948 vector bool char __b) {
12949 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12953 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12954 vector signed char __b) {
12955 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12959 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12960 vector unsigned char __b) {
12961 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12965 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12966 vector bool char __b) {
12967 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12971 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
12972 vector short __b) {
12973 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
12976 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
12977 vector bool short __b) {
12978 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
12981 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
12982 vector unsigned short __b) {
12983 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
12984 (vector short)__b);
12987 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
12988 vector bool short __b) {
12989 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
12990 (vector short)__b);
12993 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
12994 vector short __b) {
12995 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
12996 (vector short)__b);
12999 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
13000 vector unsigned short __b) {
13001 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13002 (vector short)__b);
13005 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
13006 vector bool short __b) {
13007 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13008 (vector short)__b);
13011 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
13012 vector pixel __b) {
13013 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13014 (vector short)__b);
13017 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
13018 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
13021 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
13022 vector bool int __b) {
13023 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
13026 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
13027 vector unsigned int __b) {
13028 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13032 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
13033 vector bool int __b) {
13034 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13038 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13040 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13044 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13045 vector unsigned int __b) {
13046 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13050 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13051 vector bool int __b) {
13052 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13056 #ifdef __POWER8_VECTOR__
13057 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
13058 vector signed long long __b) {
13059 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
13062 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
13063 vector unsigned long long __b) {
13064 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
13065 (vector long long)__b);
13068 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
13069 vector bool long long __b) {
13070 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
13071 (vector signed long long)__b);
13074 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
13075 vector bool long long __b) {
13076 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13077 (vector signed long long)__b);
13080 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13081 vector signed long long __b) {
13082 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13083 (vector signed long long)__b);
13086 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13087 vector unsigned long long __b) {
13088 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13089 (vector signed long long)__b);
13092 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13093 vector bool long long __b) {
13094 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13095 (vector signed long long)__b);
13099 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
13100 vector float __b) {
13102 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
13104 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
13109 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
13110 vector double __b) {
13111 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
13117 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
13118 vector float __b) {
13120 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
13122 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
13127 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
13128 vector double __b) {
13129 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
13135 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
13136 vector float __b) {
13138 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
13140 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
13145 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
13146 vector double __b) {
13147 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
13153 static __inline__ int __attribute__((__always_inline__))
13154 vec_all_nle(vector float __a, vector float __b) {
13155 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
13160 static __inline__ int __attribute__((__always_inline__))
13161 vec_all_nlt(vector float __a, vector float __b) {
13162 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
13165 /* vec_all_numeric */
13167 static __inline__ int __attribute__((__always_inline__))
13168 vec_all_numeric(vector float __a) {
13169 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
13174 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
13175 vector signed char __b) {
13176 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13180 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
13181 vector bool char __b) {
13182 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13186 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
13187 vector unsigned char __b) {
13188 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13192 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
13193 vector bool char __b) {
13194 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13198 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13199 vector signed char __b) {
13200 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13204 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13205 vector unsigned char __b) {
13206 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13210 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13211 vector bool char __b) {
13212 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13216 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
13217 vector short __b) {
13218 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
13221 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
13222 vector bool short __b) {
13223 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
13226 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
13227 vector unsigned short __b) {
13228 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13229 (vector short)__b);
13232 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
13233 vector bool short __b) {
13234 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13235 (vector short)__b);
13238 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13239 vector short __b) {
13240 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13241 (vector short)__b);
13244 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13245 vector unsigned short __b) {
13246 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13247 (vector short)__b);
13250 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13251 vector bool short __b) {
13252 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13253 (vector short)__b);
13256 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
13257 vector pixel __b) {
13258 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13259 (vector short)__b);
13262 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
13263 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
13266 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
13267 vector bool int __b) {
13268 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
13271 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
13272 vector unsigned int __b) {
13273 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13277 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
13278 vector bool int __b) {
13279 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13283 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13285 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13289 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13290 vector unsigned int __b) {
13291 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13295 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13296 vector bool int __b) {
13297 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13301 #ifdef __POWER8_VECTOR__
13302 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
13303 vector signed long long __b) {
13304 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
13307 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
13308 vector unsigned long long __b) {
13309 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
13310 (vector long long)__b);
13313 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
13314 vector bool long long __b) {
13315 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
13316 (vector signed long long)__b);
13319 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
13320 vector bool long long __b) {
13321 return __builtin_altivec_vcmpequd_p(
13322 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13325 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13326 vector signed long long __b) {
13327 return __builtin_altivec_vcmpequd_p(
13328 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13331 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13332 vector unsigned long long __b) {
13333 return __builtin_altivec_vcmpequd_p(
13334 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13337 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13338 vector bool long long __b) {
13339 return __builtin_altivec_vcmpequd_p(
13340 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13344 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
13345 vector float __b) {
13347 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
13349 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
13354 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
13355 vector double __b) {
13356 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
13362 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
13363 vector signed char __b) {
13364 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
13367 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
13368 vector bool char __b) {
13369 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
13373 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
13374 vector unsigned char __b) {
13375 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
13378 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
13379 vector bool char __b) {
13380 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13384 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13385 vector signed char __b) {
13386 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13387 (vector unsigned char)__a);
13390 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13391 vector unsigned char __b) {
13392 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
13393 (vector unsigned char)__a);
13396 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13397 vector bool char __b) {
13398 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13399 (vector unsigned char)__a);
13402 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
13403 vector short __b) {
13404 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
13407 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
13408 vector bool short __b) {
13409 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
13412 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
13413 vector unsigned short __b) {
13414 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
13417 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
13418 vector bool short __b) {
13419 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13423 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13424 vector short __b) {
13425 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13426 (vector unsigned short)__a);
13429 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13430 vector unsigned short __b) {
13431 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
13432 (vector unsigned short)__a);
13435 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13436 vector bool short __b) {
13437 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13438 (vector unsigned short)__a);
13441 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
13442 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
13445 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
13446 vector bool int __b) {
13447 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
13450 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
13451 vector unsigned int __b) {
13452 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
13455 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
13456 vector bool int __b) {
13457 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13461 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13463 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13464 (vector unsigned int)__a);
13467 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13468 vector unsigned int __b) {
13469 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
13470 (vector unsigned int)__a);
13473 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13474 vector bool int __b) {
13475 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13476 (vector unsigned int)__a);
13479 #ifdef __POWER8_VECTOR__
13480 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
13481 vector signed long long __b) {
13482 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
13485 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
13486 vector unsigned long long __b) {
13487 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
13490 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
13491 vector bool long long __b) {
13492 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
13493 (vector signed long long)__b, __a);
13496 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
13497 vector bool long long __b) {
13498 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13499 (vector unsigned long long)__b, __a);
13502 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13503 vector signed long long __b) {
13504 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13505 (vector unsigned long long)__b,
13506 (vector unsigned long long)__a);
13509 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13510 vector unsigned long long __b) {
13511 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
13512 (vector unsigned long long)__a);
13515 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13516 vector bool long long __b) {
13517 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13518 (vector unsigned long long)__b,
13519 (vector unsigned long long)__a);
13523 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
13524 vector float __b) {
13526 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
13528 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
13533 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
13534 vector double __b) {
13535 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
13541 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
13542 vector signed char __b) {
13543 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
13546 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
13547 vector bool char __b) {
13548 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
13549 (vector signed char)__b);
13552 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
13553 vector unsigned char __b) {
13554 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
13557 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
13558 vector bool char __b) {
13559 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
13560 (vector unsigned char)__b);
13563 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13564 vector signed char __b) {
13565 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13566 (vector unsigned char)__b);
13569 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13570 vector unsigned char __b) {
13571 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13575 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13576 vector bool char __b) {
13577 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13578 (vector unsigned char)__b);
13581 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
13582 vector short __b) {
13583 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
13586 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
13587 vector bool short __b) {
13588 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
13591 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
13592 vector unsigned short __b) {
13593 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
13596 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
13597 vector bool short __b) {
13598 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
13599 (vector unsigned short)__b);
13602 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13603 vector short __b) {
13604 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13605 (vector unsigned short)__b);
13608 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13609 vector unsigned short __b) {
13610 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13614 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13615 vector bool short __b) {
13616 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13617 (vector unsigned short)__b);
13620 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
13621 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
13624 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
13625 vector bool int __b) {
13626 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
13629 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
13630 vector unsigned int __b) {
13631 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
13634 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
13635 vector bool int __b) {
13636 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
13637 (vector unsigned int)__b);
13640 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13642 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13643 (vector unsigned int)__b);
13646 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13647 vector unsigned int __b) {
13648 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13652 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13653 vector bool int __b) {
13654 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13655 (vector unsigned int)__b);
13658 #ifdef __POWER8_VECTOR__
13659 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
13660 vector signed long long __b) {
13661 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
13664 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
13665 vector unsigned long long __b) {
13666 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
13669 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
13670 vector bool long long __b) {
13671 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
13672 (vector signed long long)__b);
13675 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
13676 vector bool long long __b) {
13677 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
13678 (vector unsigned long long)__b);
13681 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13682 vector signed long long __b) {
13683 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13684 (vector unsigned long long)__a,
13685 (vector unsigned long long)__b);
13688 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13689 vector unsigned long long __b) {
13690 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13691 (vector unsigned long long)__a, __b);
13694 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13695 vector bool long long __b) {
13696 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13697 (vector unsigned long long)__a,
13698 (vector unsigned long long)__b);
13702 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
13703 vector float __b) {
13705 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
13707 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
13712 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
13713 vector double __b) {
13714 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
13720 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
13721 vector signed char __b) {
13722 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
13725 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
13726 vector bool char __b) {
13727 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
13728 (vector signed char)__b);
13731 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
13732 vector unsigned char __b) {
13733 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
13736 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
13737 vector bool char __b) {
13738 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
13739 (vector unsigned char)__b);
13742 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13743 vector signed char __b) {
13744 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13745 (vector unsigned char)__b);
13748 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13749 vector unsigned char __b) {
13750 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13754 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13755 vector bool char __b) {
13756 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13757 (vector unsigned char)__b);
13760 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
13761 vector short __b) {
13762 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
13765 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
13766 vector bool short __b) {
13767 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
13770 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
13771 vector unsigned short __b) {
13772 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
13775 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
13776 vector bool short __b) {
13777 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
13778 (vector unsigned short)__b);
13781 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13782 vector short __b) {
13783 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13784 (vector unsigned short)__b);
13787 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13788 vector unsigned short __b) {
13789 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13793 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13794 vector bool short __b) {
13795 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13796 (vector unsigned short)__b);
13799 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
13800 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
13803 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
13804 vector bool int __b) {
13805 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
13808 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
13809 vector unsigned int __b) {
13810 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
13813 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
13814 vector bool int __b) {
13815 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
13816 (vector unsigned int)__b);
13819 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13821 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13822 (vector unsigned int)__b);
13825 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13826 vector unsigned int __b) {
13827 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13831 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13832 vector bool int __b) {
13833 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13834 (vector unsigned int)__b);
13837 #ifdef __POWER8_VECTOR__
13838 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
13839 vector signed long long __b) {
13840 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
13843 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
13844 vector unsigned long long __b) {
13845 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
13848 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
13849 vector bool long long __b) {
13850 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
13851 (vector signed long long)__b);
13854 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
13855 vector bool long long __b) {
13856 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
13857 (vector unsigned long long)__b);
13860 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13861 vector signed long long __b) {
13862 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13863 (vector unsigned long long)__a,
13864 (vector unsigned long long)__b);
13867 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13868 vector unsigned long long __b) {
13869 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13870 (vector unsigned long long)__a, __b);
13873 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13874 vector bool long long __b) {
13875 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13876 (vector unsigned long long)__a,
13877 (vector unsigned long long)__b);
13881 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
13882 vector float __b) {
13884 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
13886 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
13891 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
13892 vector double __b) {
13893 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
13899 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
13900 vector signed char __b) {
13901 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
13904 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
13905 vector bool char __b) {
13906 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
13910 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
13911 vector unsigned char __b) {
13912 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
13915 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
13916 vector bool char __b) {
13917 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13921 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13922 vector signed char __b) {
13923 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13924 (vector unsigned char)__a);
13927 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13928 vector unsigned char __b) {
13929 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
13930 (vector unsigned char)__a);
13933 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13934 vector bool char __b) {
13935 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13936 (vector unsigned char)__a);
13939 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
13940 vector short __b) {
13941 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
13944 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
13945 vector bool short __b) {
13946 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
13949 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
13950 vector unsigned short __b) {
13951 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
13954 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
13955 vector bool short __b) {
13956 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13960 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13961 vector short __b) {
13962 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13963 (vector unsigned short)__a);
13966 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13967 vector unsigned short __b) {
13968 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
13969 (vector unsigned short)__a);
13972 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13973 vector bool short __b) {
13974 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13975 (vector unsigned short)__a);
13978 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
13979 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
13982 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
13983 vector bool int __b) {
13984 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
13987 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
13988 vector unsigned int __b) {
13989 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
13992 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
13993 vector bool int __b) {
13994 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
13998 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14000 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
14001 (vector unsigned int)__a);
14004 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14005 vector unsigned int __b) {
14006 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
14007 (vector unsigned int)__a);
14010 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14011 vector bool int __b) {
14012 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
14013 (vector unsigned int)__a);
14016 #ifdef __POWER8_VECTOR__
14017 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
14018 vector signed long long __b) {
14019 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
14022 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
14023 vector unsigned long long __b) {
14024 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
14027 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
14028 vector bool long long __b) {
14029 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
14030 (vector signed long long)__b, __a);
14033 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
14034 vector bool long long __b) {
14035 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14036 (vector unsigned long long)__b, __a);
14039 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14040 vector signed long long __b) {
14041 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14042 (vector unsigned long long)__b,
14043 (vector unsigned long long)__a);
14046 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14047 vector unsigned long long __b) {
14048 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
14049 (vector unsigned long long)__a);
14052 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14053 vector bool long long __b) {
14054 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14055 (vector unsigned long long)__b,
14056 (vector unsigned long long)__a);
14060 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
14061 vector float __b) {
14063 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
14065 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
14070 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
14071 vector double __b) {
14072 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
14078 static __inline__ int __attribute__((__always_inline__))
14079 vec_any_nan(vector float __a) {
14080 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
14085 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
14086 vector signed char __b) {
14087 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14091 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
14092 vector bool char __b) {
14093 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14097 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
14098 vector unsigned char __b) {
14099 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14103 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
14104 vector bool char __b) {
14105 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14109 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14110 vector signed char __b) {
14111 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14115 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14116 vector unsigned char __b) {
14117 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14121 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14122 vector bool char __b) {
14123 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14127 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
14128 vector short __b) {
14129 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
14132 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
14133 vector bool short __b) {
14134 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
14137 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
14138 vector unsigned short __b) {
14139 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14140 (vector short)__b);
14143 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
14144 vector bool short __b) {
14145 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14146 (vector short)__b);
14149 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14150 vector short __b) {
14151 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14152 (vector short)__b);
14155 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14156 vector unsigned short __b) {
14157 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14158 (vector short)__b);
14161 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14162 vector bool short __b) {
14163 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14164 (vector short)__b);
14167 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
14168 vector pixel __b) {
14169 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14170 (vector short)__b);
14173 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
14174 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
14177 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
14178 vector bool int __b) {
14179 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
14182 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
14183 vector unsigned int __b) {
14184 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14188 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
14189 vector bool int __b) {
14190 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14194 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14196 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14200 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14201 vector unsigned int __b) {
14202 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14206 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14207 vector bool int __b) {
14208 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14212 #ifdef __POWER8_VECTOR__
14213 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
14214 vector signed long long __b) {
14215 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
14218 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
14219 vector unsigned long long __b) {
14220 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
14221 (vector long long)__b);
14224 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
14225 vector bool long long __b) {
14226 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
14227 (vector signed long long)__b);
14230 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
14231 vector bool long long __b) {
14232 return __builtin_altivec_vcmpequd_p(
14233 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14236 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14237 vector signed long long __b) {
14238 return __builtin_altivec_vcmpequd_p(
14239 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14242 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14243 vector unsigned long long __b) {
14244 return __builtin_altivec_vcmpequd_p(
14245 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14248 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14249 vector bool long long __b) {
14250 return __builtin_altivec_vcmpequd_p(
14251 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14255 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
14256 vector float __b) {
14258 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
14260 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
14265 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
14266 vector double __b) {
14267 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
14273 static __inline__ int __attribute__((__always_inline__))
14274 vec_any_nge(vector float __a, vector float __b) {
14275 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
14280 static __inline__ int __attribute__((__always_inline__))
14281 vec_any_ngt(vector float __a, vector float __b) {
14282 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
14287 static __inline__ int __attribute__((__always_inline__))
14288 vec_any_nle(vector float __a, vector float __b) {
14289 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
14294 static __inline__ int __attribute__((__always_inline__))
14295 vec_any_nlt(vector float __a, vector float __b) {
14296 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
14299 /* vec_any_numeric */
14301 static __inline__ int __attribute__((__always_inline__))
14302 vec_any_numeric(vector float __a) {
14303 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
14308 static __inline__ int __attribute__((__always_inline__))
14309 vec_any_out(vector float __a, vector float __b) {
14310 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
14313 /* Power 8 Crypto functions
14314 Note: We diverge from the current GCC implementation with regard
14315 to cryptography and related functions as follows:
14316 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
14317 - The remaining ones are only available on Power8 and up so
14318 require -mpower8-vector
14319 The justification for this is that export requirements require that
14320 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
14321 support). As a result, we need to be able to turn off support for those.
14322 The remaining ones (currently controlled by -mcrypto for GCC) still
14323 need to be provided on compliant hardware even if Vector.Crypto is not
14327 #define vec_sbox_be __builtin_altivec_crypto_vsbox
14328 #define vec_cipher_be __builtin_altivec_crypto_vcipher
14329 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
14330 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
14331 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
14333 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14334 __builtin_crypto_vsbox(vector unsigned long long __a) {
14335 return __builtin_altivec_crypto_vsbox(__a);
14338 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14339 __builtin_crypto_vcipher(vector unsigned long long __a,
14340 vector unsigned long long __b) {
14341 return __builtin_altivec_crypto_vcipher(__a, __b);
14344 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14345 __builtin_crypto_vcipherlast(vector unsigned long long __a,
14346 vector unsigned long long __b) {
14347 return __builtin_altivec_crypto_vcipherlast(__a, __b);
14350 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14351 __builtin_crypto_vncipher(vector unsigned long long __a,
14352 vector unsigned long long __b) {
14353 return __builtin_altivec_crypto_vncipher(__a, __b);
14356 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14357 __builtin_crypto_vncipherlast(vector unsigned long long __a,
14358 vector unsigned long long __b) {
14359 return __builtin_altivec_crypto_vncipherlast(__a, __b);
14362 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
14363 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
14365 #define vec_shasigma_be(X, Y, Z) \
14366 _Generic((X), vector unsigned int \
14367 : __builtin_crypto_vshasigmaw, vector unsigned long long \
14368 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
14371 #ifdef __POWER8_VECTOR__
14372 static __inline__ vector unsigned char __ATTRS_o_ai
14373 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
14374 vector unsigned char __c) {
14375 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
14378 static __inline__ vector unsigned short __ATTRS_o_ai
14379 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
14380 vector unsigned short __c) {
14381 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
14382 (vector unsigned char)__a, (vector unsigned char)__b,
14383 (vector unsigned char)__c);
14386 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
14387 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
14388 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
14389 (vector unsigned char)__a, (vector unsigned char)__b,
14390 (vector unsigned char)__c);
14393 static __inline__ vector unsigned long long __ATTRS_o_ai
14394 __builtin_crypto_vpermxor(vector unsigned long long __a,
14395 vector unsigned long long __b,
14396 vector unsigned long long __c) {
14397 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
14398 (vector unsigned char)__a, (vector unsigned char)__b,
14399 (vector unsigned char)__c);
14402 static __inline__ vector unsigned char __ATTRS_o_ai
14403 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
14404 return __builtin_altivec_crypto_vpmsumb(__a, __b);
14407 static __inline__ vector unsigned short __ATTRS_o_ai
14408 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
14409 return __builtin_altivec_crypto_vpmsumh(__a, __b);
14412 static __inline__ vector unsigned int __ATTRS_o_ai
14413 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
14414 return __builtin_altivec_crypto_vpmsumw(__a, __b);
14417 static __inline__ vector unsigned long long __ATTRS_o_ai
14418 __builtin_crypto_vpmsumb(vector unsigned long long __a,
14419 vector unsigned long long __b) {
14420 return __builtin_altivec_crypto_vpmsumd(__a, __b);
14423 static __inline__ vector signed char __ATTRS_o_ai
14424 vec_vgbbd(vector signed char __a) {
14425 return __builtin_altivec_vgbbd((vector unsigned char)__a);
14428 #define vec_pmsum_be __builtin_crypto_vpmsumb
14429 #define vec_gb __builtin_altivec_vgbbd
14431 static __inline__ vector unsigned char __ATTRS_o_ai
14432 vec_vgbbd(vector unsigned char __a) {
14433 return __builtin_altivec_vgbbd(__a);
14436 static __inline__ vector long long __ATTRS_o_ai
14437 vec_vbpermq(vector signed char __a, vector signed char __b) {
14438 return __builtin_altivec_vbpermq((vector unsigned char)__a,
14439 (vector unsigned char)__b);
14442 static __inline__ vector long long __ATTRS_o_ai
14443 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
14444 return __builtin_altivec_vbpermq(__a, __b);
14447 #ifdef __powerpc64__
14448 static __inline__ vector unsigned long long __attribute__((__always_inline__))
14449 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
14450 return __builtin_altivec_vbpermq((vector unsigned char)__a,
14451 (vector unsigned char)__b);
14456 #undef __ATTRS_o_ai
14458 #endif /* __ALTIVEC_H */