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 /* Constants for vec_test_data_class */
38 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
39 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
40 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
41 __VEC_CLASS_FP_SUBNORMAL_N)
42 #define __VEC_CLASS_FP_ZERO_N (1<<2)
43 #define __VEC_CLASS_FP_ZERO_P (1<<3)
44 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
45 __VEC_CLASS_FP_ZERO_N)
46 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
47 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
48 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
49 __VEC_CLASS_FP_INFINITY_N)
50 #define __VEC_CLASS_FP_NAN (1<<6)
51 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
52 __VEC_CLASS_FP_SUBNORMAL | \
53 __VEC_CLASS_FP_ZERO | \
54 __VEC_CLASS_FP_INFINITY)
56 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
58 #ifdef __POWER9_VECTOR__
62 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
63 vector signed char __a, vector signed char __b, vector unsigned char __c);
65 static __inline__ vector unsigned char __ATTRS_o_ai
66 vec_perm(vector unsigned char __a, vector unsigned char __b,
67 vector unsigned char __c);
69 static __inline__ vector bool char __ATTRS_o_ai
70 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
72 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
73 vector signed short __b,
74 vector unsigned char __c);
76 static __inline__ vector unsigned short __ATTRS_o_ai
77 vec_perm(vector unsigned short __a, vector unsigned short __b,
78 vector unsigned char __c);
80 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
81 vector bool short __a, vector bool short __b, vector unsigned char __c);
83 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
85 vector unsigned char __c);
87 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
88 vector signed int __b,
89 vector unsigned char __c);
91 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
92 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
94 static __inline__ vector bool int __ATTRS_o_ai
95 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
97 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
99 vector unsigned char __c);
102 static __inline__ vector long long __ATTRS_o_ai
103 vec_perm(vector signed long long __a, vector signed long long __b,
104 vector unsigned char __c);
106 static __inline__ vector unsigned long long __ATTRS_o_ai
107 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
108 vector unsigned char __c);
110 static __inline__ vector bool long long __ATTRS_o_ai
111 vec_perm(vector bool long long __a, vector bool long long __b,
112 vector unsigned char __c);
114 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
116 vector unsigned char __c);
119 static __inline__ vector unsigned char __ATTRS_o_ai
120 vec_xor(vector unsigned char __a, vector unsigned char __b);
124 #define __builtin_altivec_abs_v16qi vec_abs
125 #define __builtin_altivec_abs_v8hi vec_abs
126 #define __builtin_altivec_abs_v4si vec_abs
128 static __inline__ vector signed char __ATTRS_o_ai
129 vec_abs(vector signed char __a) {
130 return __builtin_altivec_vmaxsb(__a, -__a);
133 static __inline__ vector signed short __ATTRS_o_ai
134 vec_abs(vector signed short __a) {
135 return __builtin_altivec_vmaxsh(__a, -__a);
138 static __inline__ vector signed int __ATTRS_o_ai
139 vec_abs(vector signed int __a) {
140 return __builtin_altivec_vmaxsw(__a, -__a);
143 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
144 static __inline__ vector signed long long __ATTRS_o_ai
145 vec_abs(vector signed long long __a) {
146 return __builtin_altivec_vmaxsd(__a, -__a);
150 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
152 return __builtin_vsx_xvabssp(__a);
154 vector unsigned int __res =
155 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
156 return (vector float)__res;
161 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
162 return __builtin_vsx_xvabsdp(__a);
167 #define __builtin_altivec_abss_v16qi vec_abss
168 #define __builtin_altivec_abss_v8hi vec_abss
169 #define __builtin_altivec_abss_v4si vec_abss
171 static __inline__ vector signed char __ATTRS_o_ai
172 vec_abss(vector signed char __a) {
173 return __builtin_altivec_vmaxsb(
174 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
177 static __inline__ vector signed short __ATTRS_o_ai
178 vec_abss(vector signed short __a) {
179 return __builtin_altivec_vmaxsh(
180 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
183 static __inline__ vector signed int __ATTRS_o_ai
184 vec_abss(vector signed int __a) {
185 return __builtin_altivec_vmaxsw(
186 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
190 #if defined(__POWER9_VECTOR__)
192 static __inline__ vector unsigned char __ATTRS_o_ai
193 vec_absd(vector unsigned char __a, vector unsigned char __b) {
194 return __builtin_altivec_vabsdub(__a, __b);
197 static __inline__ vector unsigned short __ATTRS_o_ai
198 vec_absd(vector unsigned short __a, vector unsigned short __b) {
199 return __builtin_altivec_vabsduh(__a, __b);
202 static __inline__ vector unsigned int __ATTRS_o_ai
203 vec_absd(vector unsigned int __a, vector unsigned int __b) {
204 return __builtin_altivec_vabsduw(__a, __b);
207 #endif /* End __POWER9_VECTOR__ */
211 static __inline__ vector signed char __ATTRS_o_ai
212 vec_add(vector signed char __a, vector signed char __b) {
216 static __inline__ vector signed char __ATTRS_o_ai
217 vec_add(vector bool char __a, vector signed char __b) {
218 return (vector signed char)__a + __b;
221 static __inline__ vector signed char __ATTRS_o_ai
222 vec_add(vector signed char __a, vector bool char __b) {
223 return __a + (vector signed char)__b;
226 static __inline__ vector unsigned char __ATTRS_o_ai
227 vec_add(vector unsigned char __a, vector unsigned char __b) {
231 static __inline__ vector unsigned char __ATTRS_o_ai
232 vec_add(vector bool char __a, vector unsigned char __b) {
233 return (vector unsigned char)__a + __b;
236 static __inline__ vector unsigned char __ATTRS_o_ai
237 vec_add(vector unsigned char __a, vector bool char __b) {
238 return __a + (vector unsigned char)__b;
241 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
246 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
248 return (vector short)__a + __b;
251 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
252 vector bool short __b) {
253 return __a + (vector short)__b;
256 static __inline__ vector unsigned short __ATTRS_o_ai
257 vec_add(vector unsigned short __a, vector unsigned short __b) {
261 static __inline__ vector unsigned short __ATTRS_o_ai
262 vec_add(vector bool short __a, vector unsigned short __b) {
263 return (vector unsigned short)__a + __b;
266 static __inline__ vector unsigned short __ATTRS_o_ai
267 vec_add(vector unsigned short __a, vector bool short __b) {
268 return __a + (vector unsigned short)__b;
271 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
276 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
278 return (vector int)__a + __b;
281 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
282 vector bool int __b) {
283 return __a + (vector int)__b;
286 static __inline__ vector unsigned int __ATTRS_o_ai
287 vec_add(vector unsigned int __a, vector unsigned int __b) {
291 static __inline__ vector unsigned int __ATTRS_o_ai
292 vec_add(vector bool int __a, vector unsigned int __b) {
293 return (vector unsigned int)__a + __b;
296 static __inline__ vector unsigned int __ATTRS_o_ai
297 vec_add(vector unsigned int __a, vector bool int __b) {
298 return __a + (vector unsigned int)__b;
301 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
302 static __inline__ vector signed long long __ATTRS_o_ai
303 vec_add(vector signed long long __a, vector signed long long __b) {
307 static __inline__ vector unsigned long long __ATTRS_o_ai
308 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
312 static __inline__ vector signed __int128 __ATTRS_o_ai
313 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
317 static __inline__ vector unsigned __int128 __ATTRS_o_ai
318 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
321 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
323 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
329 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
337 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
338 static __inline__ vector signed __int128 __ATTRS_o_ai
339 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
340 vector signed __int128 __c) {
341 return __builtin_altivec_vaddeuqm(__a, __b, __c);
344 static __inline__ vector unsigned __int128 __ATTRS_o_ai
345 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
346 vector unsigned __int128 __c) {
347 return __builtin_altivec_vaddeuqm(__a, __b, __c);
351 static __inline__ vector signed int __ATTRS_o_ai
352 vec_adde(vector signed int __a, vector signed int __b,
353 vector signed int __c) {
354 vector signed int __mask = {1, 1, 1, 1};
355 vector signed int __carry = __c & __mask;
356 return vec_add(vec_add(__a, __b), __carry);
359 static __inline__ vector unsigned int __ATTRS_o_ai
360 vec_adde(vector unsigned int __a, vector unsigned int __b,
361 vector unsigned int __c) {
362 vector unsigned int __mask = {1, 1, 1, 1};
363 vector unsigned int __carry = __c & __mask;
364 return vec_add(vec_add(__a, __b), __carry);
369 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
370 static __inline__ vector signed __int128 __ATTRS_o_ai
371 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
372 vector signed __int128 __c) {
373 return __builtin_altivec_vaddecuq(__a, __b, __c);
376 static __inline__ vector unsigned __int128 __ATTRS_o_ai
377 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
378 vector unsigned __int128 __c) {
379 return __builtin_altivec_vaddecuq(__a, __b, __c);
382 static __inline__ vector signed int __ATTRS_o_ai
383 vec_addec(vector signed int __a, vector signed int __b,
384 vector signed int __c) {
386 signed int __result[4];
387 for (int i = 0; i < 4; i++) {
388 unsigned int __tempa = (unsigned int) __a[i];
389 unsigned int __tempb = (unsigned int) __b[i];
390 unsigned int __tempc = (unsigned int) __c[i];
391 __tempc = __tempc & 0x00000001;
392 unsigned long long __longa = (unsigned long long) __tempa;
393 unsigned long long __longb = (unsigned long long) __tempb;
394 unsigned long long __longc = (unsigned long long) __tempc;
395 unsigned long long __sum = __longa + __longb + __longc;
396 unsigned long long __res = (__sum >> 32) & 0x01;
397 unsigned long long __tempres = (unsigned int) __res;
398 __result[i] = (signed int) __tempres;
401 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
405 static __inline__ vector unsigned int __ATTRS_o_ai
406 vec_addec(vector unsigned int __a, vector unsigned int __b,
407 vector unsigned int __c) {
409 unsigned int __result[4];
410 for (int i = 0; i < 4; i++) {
411 unsigned int __tempc = __c[i] & 1;
412 unsigned long long __longa = (unsigned long long) __a[i];
413 unsigned long long __longb = (unsigned long long) __b[i];
414 unsigned long long __longc = (unsigned long long) __tempc;
415 unsigned long long __sum = __longa + __longb + __longc;
416 unsigned long long __res = (__sum >> 32) & 0x01;
417 unsigned long long __tempres = (unsigned int) __res;
418 __result[i] = (signed int) __tempres;
421 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
429 #define __builtin_altivec_vaddubm vec_vaddubm
431 static __inline__ vector signed char __ATTRS_o_ai
432 vec_vaddubm(vector signed char __a, vector signed char __b) {
436 static __inline__ vector signed char __ATTRS_o_ai
437 vec_vaddubm(vector bool char __a, vector signed char __b) {
438 return (vector signed char)__a + __b;
441 static __inline__ vector signed char __ATTRS_o_ai
442 vec_vaddubm(vector signed char __a, vector bool char __b) {
443 return __a + (vector signed char)__b;
446 static __inline__ vector unsigned char __ATTRS_o_ai
447 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
451 static __inline__ vector unsigned char __ATTRS_o_ai
452 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
453 return (vector unsigned char)__a + __b;
456 static __inline__ vector unsigned char __ATTRS_o_ai
457 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
458 return __a + (vector unsigned char)__b;
463 #define __builtin_altivec_vadduhm vec_vadduhm
465 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
470 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
472 return (vector short)__a + __b;
475 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
476 vector bool short __b) {
477 return __a + (vector short)__b;
480 static __inline__ vector unsigned short __ATTRS_o_ai
481 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
485 static __inline__ vector unsigned short __ATTRS_o_ai
486 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
487 return (vector unsigned short)__a + __b;
490 static __inline__ vector unsigned short __ATTRS_o_ai
491 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
492 return __a + (vector unsigned short)__b;
497 #define __builtin_altivec_vadduwm vec_vadduwm
499 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
504 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
506 return (vector int)__a + __b;
509 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
510 vector bool int __b) {
511 return __a + (vector int)__b;
514 static __inline__ vector unsigned int __ATTRS_o_ai
515 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
519 static __inline__ vector unsigned int __ATTRS_o_ai
520 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
521 return (vector unsigned int)__a + __b;
524 static __inline__ vector unsigned int __ATTRS_o_ai
525 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
526 return __a + (vector unsigned int)__b;
531 #define __builtin_altivec_vaddfp vec_vaddfp
533 static __inline__ vector float __attribute__((__always_inline__))
534 vec_vaddfp(vector float __a, vector float __b) {
540 static __inline__ vector signed int __ATTRS_o_ai
541 vec_addc(vector signed int __a, vector signed int __b) {
542 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
543 (vector unsigned int)__b);
546 static __inline__ vector unsigned int __ATTRS_o_ai
547 vec_addc(vector unsigned int __a, vector unsigned int __b) {
548 return __builtin_altivec_vaddcuw(__a, __b);
551 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
552 static __inline__ vector signed __int128 __ATTRS_o_ai
553 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
554 return (vector signed __int128)__builtin_altivec_vaddcuq(
555 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
558 static __inline__ vector unsigned __int128 __ATTRS_o_ai
559 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
560 return __builtin_altivec_vaddcuq(__a, __b);
562 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
566 static __inline__ vector unsigned int __attribute__((__always_inline__))
567 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
568 return __builtin_altivec_vaddcuw(__a, __b);
573 static __inline__ vector signed char __ATTRS_o_ai
574 vec_adds(vector signed char __a, vector signed char __b) {
575 return __builtin_altivec_vaddsbs(__a, __b);
578 static __inline__ vector signed char __ATTRS_o_ai
579 vec_adds(vector bool char __a, vector signed char __b) {
580 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
583 static __inline__ vector signed char __ATTRS_o_ai
584 vec_adds(vector signed char __a, vector bool char __b) {
585 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
588 static __inline__ vector unsigned char __ATTRS_o_ai
589 vec_adds(vector unsigned char __a, vector unsigned char __b) {
590 return __builtin_altivec_vaddubs(__a, __b);
593 static __inline__ vector unsigned char __ATTRS_o_ai
594 vec_adds(vector bool char __a, vector unsigned char __b) {
595 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
598 static __inline__ vector unsigned char __ATTRS_o_ai
599 vec_adds(vector unsigned char __a, vector bool char __b) {
600 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
603 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
605 return __builtin_altivec_vaddshs(__a, __b);
608 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
610 return __builtin_altivec_vaddshs((vector short)__a, __b);
613 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
614 vector bool short __b) {
615 return __builtin_altivec_vaddshs(__a, (vector short)__b);
618 static __inline__ vector unsigned short __ATTRS_o_ai
619 vec_adds(vector unsigned short __a, vector unsigned short __b) {
620 return __builtin_altivec_vadduhs(__a, __b);
623 static __inline__ vector unsigned short __ATTRS_o_ai
624 vec_adds(vector bool short __a, vector unsigned short __b) {
625 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
628 static __inline__ vector unsigned short __ATTRS_o_ai
629 vec_adds(vector unsigned short __a, vector bool short __b) {
630 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
633 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
635 return __builtin_altivec_vaddsws(__a, __b);
638 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
640 return __builtin_altivec_vaddsws((vector int)__a, __b);
643 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
644 vector bool int __b) {
645 return __builtin_altivec_vaddsws(__a, (vector int)__b);
648 static __inline__ vector unsigned int __ATTRS_o_ai
649 vec_adds(vector unsigned int __a, vector unsigned int __b) {
650 return __builtin_altivec_vadduws(__a, __b);
653 static __inline__ vector unsigned int __ATTRS_o_ai
654 vec_adds(vector bool int __a, vector unsigned int __b) {
655 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
658 static __inline__ vector unsigned int __ATTRS_o_ai
659 vec_adds(vector unsigned int __a, vector bool int __b) {
660 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
665 static __inline__ vector signed char __ATTRS_o_ai
666 vec_vaddsbs(vector signed char __a, vector signed char __b) {
667 return __builtin_altivec_vaddsbs(__a, __b);
670 static __inline__ vector signed char __ATTRS_o_ai
671 vec_vaddsbs(vector bool char __a, vector signed char __b) {
672 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
675 static __inline__ vector signed char __ATTRS_o_ai
676 vec_vaddsbs(vector signed char __a, vector bool char __b) {
677 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
682 static __inline__ vector unsigned char __ATTRS_o_ai
683 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
684 return __builtin_altivec_vaddubs(__a, __b);
687 static __inline__ vector unsigned char __ATTRS_o_ai
688 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
689 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
692 static __inline__ vector unsigned char __ATTRS_o_ai
693 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
694 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
699 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
701 return __builtin_altivec_vaddshs(__a, __b);
704 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
706 return __builtin_altivec_vaddshs((vector short)__a, __b);
709 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
710 vector bool short __b) {
711 return __builtin_altivec_vaddshs(__a, (vector short)__b);
716 static __inline__ vector unsigned short __ATTRS_o_ai
717 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
718 return __builtin_altivec_vadduhs(__a, __b);
721 static __inline__ vector unsigned short __ATTRS_o_ai
722 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
723 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
726 static __inline__ vector unsigned short __ATTRS_o_ai
727 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
728 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
733 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
735 return __builtin_altivec_vaddsws(__a, __b);
738 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
740 return __builtin_altivec_vaddsws((vector int)__a, __b);
743 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
744 vector bool int __b) {
745 return __builtin_altivec_vaddsws(__a, (vector int)__b);
750 static __inline__ vector unsigned int __ATTRS_o_ai
751 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
752 return __builtin_altivec_vadduws(__a, __b);
755 static __inline__ vector unsigned int __ATTRS_o_ai
756 vec_vadduws(vector bool int __a, vector unsigned int __b) {
757 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
760 static __inline__ vector unsigned int __ATTRS_o_ai
761 vec_vadduws(vector unsigned int __a, vector bool int __b) {
762 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
765 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
768 static __inline__ vector signed __int128 __ATTRS_o_ai
769 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
773 static __inline__ vector unsigned __int128 __ATTRS_o_ai
774 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
780 static __inline__ vector signed __int128 __ATTRS_o_ai
781 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
782 vector signed __int128 __c) {
783 return __builtin_altivec_vaddeuqm(__a, __b, __c);
786 static __inline__ vector unsigned __int128 __ATTRS_o_ai
787 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
788 vector unsigned __int128 __c) {
789 return __builtin_altivec_vaddeuqm(__a, __b, __c);
794 static __inline__ vector signed __int128 __ATTRS_o_ai
795 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
796 return __builtin_altivec_vaddcuq(__a, __b);
799 static __inline__ vector unsigned __int128 __ATTRS_o_ai
800 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
801 return __builtin_altivec_vaddcuq(__a, __b);
806 static __inline__ vector signed __int128 __ATTRS_o_ai
807 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
808 vector signed __int128 __c) {
809 return __builtin_altivec_vaddecuq(__a, __b, __c);
812 static __inline__ vector unsigned __int128 __ATTRS_o_ai
813 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
814 vector unsigned __int128 __c) {
815 return __builtin_altivec_vaddecuq(__a, __b, __c);
817 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
821 #define __builtin_altivec_vand vec_and
823 static __inline__ vector signed char __ATTRS_o_ai
824 vec_and(vector signed char __a, vector signed char __b) {
828 static __inline__ vector signed char __ATTRS_o_ai
829 vec_and(vector bool char __a, vector signed char __b) {
830 return (vector signed char)__a & __b;
833 static __inline__ vector signed char __ATTRS_o_ai
834 vec_and(vector signed char __a, vector bool char __b) {
835 return __a & (vector signed char)__b;
838 static __inline__ vector unsigned char __ATTRS_o_ai
839 vec_and(vector unsigned char __a, vector unsigned char __b) {
843 static __inline__ vector unsigned char __ATTRS_o_ai
844 vec_and(vector bool char __a, vector unsigned char __b) {
845 return (vector unsigned char)__a & __b;
848 static __inline__ vector unsigned char __ATTRS_o_ai
849 vec_and(vector unsigned char __a, vector bool char __b) {
850 return __a & (vector unsigned char)__b;
853 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
854 vector bool char __b) {
858 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
863 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
865 return (vector short)__a & __b;
868 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
869 vector bool short __b) {
870 return __a & (vector short)__b;
873 static __inline__ vector unsigned short __ATTRS_o_ai
874 vec_and(vector unsigned short __a, vector unsigned short __b) {
878 static __inline__ vector unsigned short __ATTRS_o_ai
879 vec_and(vector bool short __a, vector unsigned short __b) {
880 return (vector unsigned short)__a & __b;
883 static __inline__ vector unsigned short __ATTRS_o_ai
884 vec_and(vector unsigned short __a, vector bool short __b) {
885 return __a & (vector unsigned short)__b;
888 static __inline__ vector bool short __ATTRS_o_ai
889 vec_and(vector bool short __a, vector bool short __b) {
893 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
898 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
900 return (vector int)__a & __b;
903 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
904 vector bool int __b) {
905 return __a & (vector int)__b;
908 static __inline__ vector unsigned int __ATTRS_o_ai
909 vec_and(vector unsigned int __a, vector unsigned int __b) {
913 static __inline__ vector unsigned int __ATTRS_o_ai
914 vec_and(vector bool int __a, vector unsigned int __b) {
915 return (vector unsigned int)__a & __b;
918 static __inline__ vector unsigned int __ATTRS_o_ai
919 vec_and(vector unsigned int __a, vector bool int __b) {
920 return __a & (vector unsigned int)__b;
923 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
924 vector bool int __b) {
928 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
930 vector unsigned int __res =
931 (vector unsigned int)__a & (vector unsigned int)__b;
932 return (vector float)__res;
935 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
937 vector unsigned int __res =
938 (vector unsigned int)__a & (vector unsigned int)__b;
939 return (vector float)__res;
942 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
943 vector bool int __b) {
944 vector unsigned int __res =
945 (vector unsigned int)__a & (vector unsigned int)__b;
946 return (vector float)__res;
950 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
952 vector unsigned long long __res =
953 (vector unsigned long long)__a & (vector unsigned long long)__b;
954 return (vector double)__res;
957 static __inline__ vector double __ATTRS_o_ai
958 vec_and(vector double __a, vector bool long long __b) {
959 vector unsigned long long __res =
960 (vector unsigned long long)__a & (vector unsigned long long)__b;
961 return (vector double)__res;
964 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
966 vector unsigned long long __res =
967 (vector unsigned long long)__a & (vector unsigned long long)__b;
968 return (vector double)__res;
971 static __inline__ vector signed long long __ATTRS_o_ai
972 vec_and(vector signed long long __a, vector signed long long __b) {
976 static __inline__ vector signed long long __ATTRS_o_ai
977 vec_and(vector bool long long __a, vector signed long long __b) {
978 return (vector signed long long)__a & __b;
981 static __inline__ vector signed long long __ATTRS_o_ai
982 vec_and(vector signed long long __a, vector bool long long __b) {
983 return __a & (vector signed long long)__b;
986 static __inline__ vector unsigned long long __ATTRS_o_ai
987 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
991 static __inline__ vector unsigned long long __ATTRS_o_ai
992 vec_and(vector bool long long __a, vector unsigned long long __b) {
993 return (vector unsigned long long)__a & __b;
996 static __inline__ vector unsigned long long __ATTRS_o_ai
997 vec_and(vector unsigned long long __a, vector bool long long __b) {
998 return __a & (vector unsigned long long)__b;
1001 static __inline__ vector bool long long __ATTRS_o_ai
1002 vec_and(vector bool long long __a, vector bool long long __b) {
1009 static __inline__ vector signed char __ATTRS_o_ai
1010 vec_vand(vector signed char __a, vector signed char __b) {
1014 static __inline__ vector signed char __ATTRS_o_ai
1015 vec_vand(vector bool char __a, vector signed char __b) {
1016 return (vector signed char)__a & __b;
1019 static __inline__ vector signed char __ATTRS_o_ai
1020 vec_vand(vector signed char __a, vector bool char __b) {
1021 return __a & (vector signed char)__b;
1024 static __inline__ vector unsigned char __ATTRS_o_ai
1025 vec_vand(vector unsigned char __a, vector unsigned char __b) {
1029 static __inline__ vector unsigned char __ATTRS_o_ai
1030 vec_vand(vector bool char __a, vector unsigned char __b) {
1031 return (vector unsigned char)__a & __b;
1034 static __inline__ vector unsigned char __ATTRS_o_ai
1035 vec_vand(vector unsigned char __a, vector bool char __b) {
1036 return __a & (vector unsigned char)__b;
1039 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1040 vector bool char __b) {
1044 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1049 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1051 return (vector short)__a & __b;
1054 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1055 vector bool short __b) {
1056 return __a & (vector short)__b;
1059 static __inline__ vector unsigned short __ATTRS_o_ai
1060 vec_vand(vector unsigned short __a, vector unsigned short __b) {
1064 static __inline__ vector unsigned short __ATTRS_o_ai
1065 vec_vand(vector bool short __a, vector unsigned short __b) {
1066 return (vector unsigned short)__a & __b;
1069 static __inline__ vector unsigned short __ATTRS_o_ai
1070 vec_vand(vector unsigned short __a, vector bool short __b) {
1071 return __a & (vector unsigned short)__b;
1074 static __inline__ vector bool short __ATTRS_o_ai
1075 vec_vand(vector bool short __a, vector bool short __b) {
1079 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1084 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1086 return (vector int)__a & __b;
1089 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1090 vector bool int __b) {
1091 return __a & (vector int)__b;
1094 static __inline__ vector unsigned int __ATTRS_o_ai
1095 vec_vand(vector unsigned int __a, vector unsigned int __b) {
1099 static __inline__ vector unsigned int __ATTRS_o_ai
1100 vec_vand(vector bool int __a, vector unsigned int __b) {
1101 return (vector unsigned int)__a & __b;
1104 static __inline__ vector unsigned int __ATTRS_o_ai
1105 vec_vand(vector unsigned int __a, vector bool int __b) {
1106 return __a & (vector unsigned int)__b;
1109 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1110 vector bool int __b) {
1114 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1116 vector unsigned int __res =
1117 (vector unsigned int)__a & (vector unsigned int)__b;
1118 return (vector float)__res;
1121 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1123 vector unsigned int __res =
1124 (vector unsigned int)__a & (vector unsigned int)__b;
1125 return (vector float)__res;
1128 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1129 vector bool int __b) {
1130 vector unsigned int __res =
1131 (vector unsigned int)__a & (vector unsigned int)__b;
1132 return (vector float)__res;
1136 static __inline__ vector signed long long __ATTRS_o_ai
1137 vec_vand(vector signed long long __a, vector signed long long __b) {
1141 static __inline__ vector signed long long __ATTRS_o_ai
1142 vec_vand(vector bool long long __a, vector signed long long __b) {
1143 return (vector signed long long)__a & __b;
1146 static __inline__ vector signed long long __ATTRS_o_ai
1147 vec_vand(vector signed long long __a, vector bool long long __b) {
1148 return __a & (vector signed long long)__b;
1151 static __inline__ vector unsigned long long __ATTRS_o_ai
1152 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1156 static __inline__ vector unsigned long long __ATTRS_o_ai
1157 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1158 return (vector unsigned long long)__a & __b;
1161 static __inline__ vector unsigned long long __ATTRS_o_ai
1162 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1163 return __a & (vector unsigned long long)__b;
1166 static __inline__ vector bool long long __ATTRS_o_ai
1167 vec_vand(vector bool long long __a, vector bool long long __b) {
1174 #define __builtin_altivec_vandc vec_andc
1176 static __inline__ vector signed char __ATTRS_o_ai
1177 vec_andc(vector signed char __a, vector signed char __b) {
1181 static __inline__ vector signed char __ATTRS_o_ai
1182 vec_andc(vector bool char __a, vector signed char __b) {
1183 return (vector signed char)__a & ~__b;
1186 static __inline__ vector signed char __ATTRS_o_ai
1187 vec_andc(vector signed char __a, vector bool char __b) {
1188 return __a & ~(vector signed char)__b;
1191 static __inline__ vector unsigned char __ATTRS_o_ai
1192 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1196 static __inline__ vector unsigned char __ATTRS_o_ai
1197 vec_andc(vector bool char __a, vector unsigned char __b) {
1198 return (vector unsigned char)__a & ~__b;
1201 static __inline__ vector unsigned char __ATTRS_o_ai
1202 vec_andc(vector unsigned char __a, vector bool char __b) {
1203 return __a & ~(vector unsigned char)__b;
1206 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1207 vector bool char __b) {
1211 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1216 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1218 return (vector short)__a & ~__b;
1221 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1222 vector bool short __b) {
1223 return __a & ~(vector short)__b;
1226 static __inline__ vector unsigned short __ATTRS_o_ai
1227 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1231 static __inline__ vector unsigned short __ATTRS_o_ai
1232 vec_andc(vector bool short __a, vector unsigned short __b) {
1233 return (vector unsigned short)__a & ~__b;
1236 static __inline__ vector unsigned short __ATTRS_o_ai
1237 vec_andc(vector unsigned short __a, vector bool short __b) {
1238 return __a & ~(vector unsigned short)__b;
1241 static __inline__ vector bool short __ATTRS_o_ai
1242 vec_andc(vector bool short __a, vector bool short __b) {
1246 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1251 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1253 return (vector int)__a & ~__b;
1256 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1257 vector bool int __b) {
1258 return __a & ~(vector int)__b;
1261 static __inline__ vector unsigned int __ATTRS_o_ai
1262 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1266 static __inline__ vector unsigned int __ATTRS_o_ai
1267 vec_andc(vector bool int __a, vector unsigned int __b) {
1268 return (vector unsigned int)__a & ~__b;
1271 static __inline__ vector unsigned int __ATTRS_o_ai
1272 vec_andc(vector unsigned int __a, vector bool int __b) {
1273 return __a & ~(vector unsigned int)__b;
1276 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1277 vector bool int __b) {
1281 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1283 vector unsigned int __res =
1284 (vector unsigned int)__a & ~(vector unsigned int)__b;
1285 return (vector float)__res;
1288 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1290 vector unsigned int __res =
1291 (vector unsigned int)__a & ~(vector unsigned int)__b;
1292 return (vector float)__res;
1295 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1296 vector bool int __b) {
1297 vector unsigned int __res =
1298 (vector unsigned int)__a & ~(vector unsigned int)__b;
1299 return (vector float)__res;
1303 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1304 vector double __b) {
1305 vector unsigned long long __res =
1306 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1307 return (vector double)__res;
1310 static __inline__ vector double __ATTRS_o_ai
1311 vec_andc(vector double __a, vector bool long long __b) {
1312 vector unsigned long long __res =
1313 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1314 return (vector double)__res;
1317 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1318 vector double __b) {
1319 vector unsigned long long __res =
1320 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1321 return (vector double)__res;
1324 static __inline__ vector signed long long __ATTRS_o_ai
1325 vec_andc(vector signed long long __a, vector signed long long __b) {
1329 static __inline__ vector signed long long __ATTRS_o_ai
1330 vec_andc(vector bool long long __a, vector signed long long __b) {
1331 return (vector signed long long)__a & ~__b;
1334 static __inline__ vector signed long long __ATTRS_o_ai
1335 vec_andc(vector signed long long __a, vector bool long long __b) {
1336 return __a & ~(vector signed long long)__b;
1339 static __inline__ vector unsigned long long __ATTRS_o_ai
1340 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1344 static __inline__ vector unsigned long long __ATTRS_o_ai
1345 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1346 return (vector unsigned long long)__a & ~__b;
1349 static __inline__ vector unsigned long long __ATTRS_o_ai
1350 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1351 return __a & ~(vector unsigned long long)__b;
1354 static __inline__ vector bool long long __ATTRS_o_ai
1355 vec_andc(vector bool long long __a, vector bool long long __b) {
1362 static __inline__ vector signed char __ATTRS_o_ai
1363 vec_vandc(vector signed char __a, vector signed char __b) {
1367 static __inline__ vector signed char __ATTRS_o_ai
1368 vec_vandc(vector bool char __a, vector signed char __b) {
1369 return (vector signed char)__a & ~__b;
1372 static __inline__ vector signed char __ATTRS_o_ai
1373 vec_vandc(vector signed char __a, vector bool char __b) {
1374 return __a & ~(vector signed char)__b;
1377 static __inline__ vector unsigned char __ATTRS_o_ai
1378 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1382 static __inline__ vector unsigned char __ATTRS_o_ai
1383 vec_vandc(vector bool char __a, vector unsigned char __b) {
1384 return (vector unsigned char)__a & ~__b;
1387 static __inline__ vector unsigned char __ATTRS_o_ai
1388 vec_vandc(vector unsigned char __a, vector bool char __b) {
1389 return __a & ~(vector unsigned char)__b;
1392 static __inline__ vector bool char __ATTRS_o_ai
1393 vec_vandc(vector bool char __a, vector bool char __b) {
1397 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1402 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1404 return (vector short)__a & ~__b;
1407 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1408 vector bool short __b) {
1409 return __a & ~(vector short)__b;
1412 static __inline__ vector unsigned short __ATTRS_o_ai
1413 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1417 static __inline__ vector unsigned short __ATTRS_o_ai
1418 vec_vandc(vector bool short __a, vector unsigned short __b) {
1419 return (vector unsigned short)__a & ~__b;
1422 static __inline__ vector unsigned short __ATTRS_o_ai
1423 vec_vandc(vector unsigned short __a, vector bool short __b) {
1424 return __a & ~(vector unsigned short)__b;
1427 static __inline__ vector bool short __ATTRS_o_ai
1428 vec_vandc(vector bool short __a, vector bool short __b) {
1432 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1437 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1439 return (vector int)__a & ~__b;
1442 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1443 vector bool int __b) {
1444 return __a & ~(vector int)__b;
1447 static __inline__ vector unsigned int __ATTRS_o_ai
1448 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1452 static __inline__ vector unsigned int __ATTRS_o_ai
1453 vec_vandc(vector bool int __a, vector unsigned int __b) {
1454 return (vector unsigned int)__a & ~__b;
1457 static __inline__ vector unsigned int __ATTRS_o_ai
1458 vec_vandc(vector unsigned int __a, vector bool int __b) {
1459 return __a & ~(vector unsigned int)__b;
1462 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1463 vector bool int __b) {
1467 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1469 vector unsigned int __res =
1470 (vector unsigned int)__a & ~(vector unsigned int)__b;
1471 return (vector float)__res;
1474 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1476 vector unsigned int __res =
1477 (vector unsigned int)__a & ~(vector unsigned int)__b;
1478 return (vector float)__res;
1481 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1482 vector bool int __b) {
1483 vector unsigned int __res =
1484 (vector unsigned int)__a & ~(vector unsigned int)__b;
1485 return (vector float)__res;
1489 static __inline__ vector signed long long __ATTRS_o_ai
1490 vec_vandc(vector signed long long __a, vector signed long long __b) {
1494 static __inline__ vector signed long long __ATTRS_o_ai
1495 vec_vandc(vector bool long long __a, vector signed long long __b) {
1496 return (vector signed long long)__a & ~__b;
1499 static __inline__ vector signed long long __ATTRS_o_ai
1500 vec_vandc(vector signed long long __a, vector bool long long __b) {
1501 return __a & ~(vector signed long long)__b;
1504 static __inline__ vector unsigned long long __ATTRS_o_ai
1505 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1509 static __inline__ vector unsigned long long __ATTRS_o_ai
1510 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1511 return (vector unsigned long long)__a & ~__b;
1514 static __inline__ vector unsigned long long __ATTRS_o_ai
1515 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1516 return __a & ~(vector unsigned long long)__b;
1519 static __inline__ vector bool long long __ATTRS_o_ai
1520 vec_vandc(vector bool long long __a, vector bool long long __b) {
1527 static __inline__ vector signed char __ATTRS_o_ai
1528 vec_avg(vector signed char __a, vector signed char __b) {
1529 return __builtin_altivec_vavgsb(__a, __b);
1532 static __inline__ vector unsigned char __ATTRS_o_ai
1533 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1534 return __builtin_altivec_vavgub(__a, __b);
1537 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1539 return __builtin_altivec_vavgsh(__a, __b);
1542 static __inline__ vector unsigned short __ATTRS_o_ai
1543 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1544 return __builtin_altivec_vavguh(__a, __b);
1547 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1549 return __builtin_altivec_vavgsw(__a, __b);
1552 static __inline__ vector unsigned int __ATTRS_o_ai
1553 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1554 return __builtin_altivec_vavguw(__a, __b);
1559 static __inline__ vector signed char __attribute__((__always_inline__))
1560 vec_vavgsb(vector signed char __a, vector signed char __b) {
1561 return __builtin_altivec_vavgsb(__a, __b);
1566 static __inline__ vector unsigned char __attribute__((__always_inline__))
1567 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1568 return __builtin_altivec_vavgub(__a, __b);
1573 static __inline__ vector short __attribute__((__always_inline__))
1574 vec_vavgsh(vector short __a, vector short __b) {
1575 return __builtin_altivec_vavgsh(__a, __b);
1580 static __inline__ vector unsigned short __attribute__((__always_inline__))
1581 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1582 return __builtin_altivec_vavguh(__a, __b);
1587 static __inline__ vector int __attribute__((__always_inline__))
1588 vec_vavgsw(vector int __a, vector int __b) {
1589 return __builtin_altivec_vavgsw(__a, __b);
1594 static __inline__ vector unsigned int __attribute__((__always_inline__))
1595 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1596 return __builtin_altivec_vavguw(__a, __b);
1601 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1603 return __builtin_vsx_xvrspip(__a);
1605 return __builtin_altivec_vrfip(__a);
1610 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1611 return __builtin_vsx_xvrdpip(__a);
1617 static __inline__ vector float __attribute__((__always_inline__))
1618 vec_vrfip(vector float __a) {
1619 return __builtin_altivec_vrfip(__a);
1624 static __inline__ vector int __attribute__((__always_inline__))
1625 vec_cmpb(vector float __a, vector float __b) {
1626 return __builtin_altivec_vcmpbfp(__a, __b);
1631 static __inline__ vector int __attribute__((__always_inline__))
1632 vec_vcmpbfp(vector float __a, vector float __b) {
1633 return __builtin_altivec_vcmpbfp(__a, __b);
1638 static __inline__ vector bool char __ATTRS_o_ai
1639 vec_cmpeq(vector signed char __a, vector signed char __b) {
1640 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1644 static __inline__ vector bool char __ATTRS_o_ai
1645 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1646 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1650 static __inline__ vector bool char __ATTRS_o_ai
1651 vec_cmpeq(vector bool char __a, vector bool char __b) {
1652 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1656 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1658 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1661 static __inline__ vector bool short __ATTRS_o_ai
1662 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1663 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1667 static __inline__ vector bool short __ATTRS_o_ai
1668 vec_cmpeq(vector bool short __a, vector bool short __b) {
1669 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1673 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1675 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1678 static __inline__ vector bool int __ATTRS_o_ai
1679 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1680 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1684 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1685 vector bool int __b) {
1686 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1690 #ifdef __POWER8_VECTOR__
1691 static __inline__ vector bool long long __ATTRS_o_ai
1692 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1693 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1696 static __inline__ vector bool long long __ATTRS_o_ai
1697 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1698 return (vector bool long long)__builtin_altivec_vcmpequd(
1699 (vector long long)__a, (vector long long)__b);
1702 static __inline__ vector bool long long __ATTRS_o_ai
1703 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1704 return (vector bool long long)__builtin_altivec_vcmpequd(
1705 (vector long long)__a, (vector long long)__b);
1710 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1713 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1715 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1720 static __inline__ vector bool long long __ATTRS_o_ai
1721 vec_cmpeq(vector double __a, vector double __b) {
1722 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1726 #ifdef __POWER9_VECTOR__
1729 static __inline__ vector bool char __ATTRS_o_ai
1730 vec_cmpne(vector bool char __a, vector bool char __b) {
1731 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1735 static __inline__ vector bool char __ATTRS_o_ai
1736 vec_cmpne(vector signed char __a, vector signed char __b) {
1737 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1741 static __inline__ vector bool char __ATTRS_o_ai
1742 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1743 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1747 static __inline__ vector bool short __ATTRS_o_ai
1748 vec_cmpne(vector bool short __a, vector bool short __b) {
1749 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1753 static __inline__ vector bool short __ATTRS_o_ai
1754 vec_cmpne(vector signed short __a, vector signed short __b) {
1755 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1759 static __inline__ vector bool short __ATTRS_o_ai
1760 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1761 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1765 static __inline__ vector bool int __ATTRS_o_ai
1766 vec_cmpne(vector bool int __a, vector bool int __b) {
1767 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1771 static __inline__ vector bool int __ATTRS_o_ai
1772 vec_cmpne(vector signed int __a, vector signed int __b) {
1773 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1777 static __inline__ vector bool int __ATTRS_o_ai
1778 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1779 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1783 static __inline__ vector bool long long __ATTRS_o_ai
1784 vec_cmpne(vector bool long long __a, vector bool long long __b) {
1785 return (vector bool long long)
1786 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1789 static __inline__ vector bool long long __ATTRS_o_ai
1790 vec_cmpne(vector signed long long __a, vector signed long long __b) {
1791 return (vector bool long long)
1792 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1795 static __inline__ vector bool long long __ATTRS_o_ai
1796 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1797 return (vector bool long long)
1798 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1801 static __inline__ vector bool int __ATTRS_o_ai
1802 vec_cmpne(vector float __a, vector float __b) {
1803 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1807 static __inline__ vector bool long long __ATTRS_o_ai
1808 vec_cmpne(vector double __a, vector double __b) {
1809 return (vector bool long long)
1810 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1815 static __inline__ vector bool char __ATTRS_o_ai
1816 vec_cmpnez(vector signed char __a, vector signed char __b) {
1817 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1821 static __inline__ vector bool char __ATTRS_o_ai
1822 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1823 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1827 static __inline__ vector bool short __ATTRS_o_ai
1828 vec_cmpnez(vector signed short __a, vector signed short __b) {
1829 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1833 static __inline__ vector bool short __ATTRS_o_ai
1834 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1835 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1839 static __inline__ vector bool int __ATTRS_o_ai
1840 vec_cmpnez(vector signed int __a, vector signed int __b) {
1841 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1845 static __inline__ vector bool int __ATTRS_o_ai
1846 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1847 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1851 static __inline__ signed int __ATTRS_o_ai
1852 vec_cntlz_lsbb(vector signed char __a) {
1853 #ifdef __LITTLE_ENDIAN__
1854 return __builtin_altivec_vctzlsbb(__a);
1856 return __builtin_altivec_vclzlsbb(__a);
1860 static __inline__ signed int __ATTRS_o_ai
1861 vec_cntlz_lsbb(vector unsigned char __a) {
1862 #ifdef __LITTLE_ENDIAN__
1863 return __builtin_altivec_vctzlsbb(__a);
1865 return __builtin_altivec_vclzlsbb(__a);
1869 static __inline__ signed int __ATTRS_o_ai
1870 vec_cnttz_lsbb(vector signed char __a) {
1871 #ifdef __LITTLE_ENDIAN__
1872 return __builtin_altivec_vclzlsbb(__a);
1874 return __builtin_altivec_vctzlsbb(__a);
1878 static __inline__ signed int __ATTRS_o_ai
1879 vec_cnttz_lsbb(vector unsigned char __a) {
1880 #ifdef __LITTLE_ENDIAN__
1881 return __builtin_altivec_vclzlsbb(__a);
1883 return __builtin_altivec_vctzlsbb(__a);
1887 static __inline__ vector unsigned int __ATTRS_o_ai
1888 vec_parity_lsbb(vector unsigned int __a) {
1889 return __builtin_altivec_vprtybw(__a);
1892 static __inline__ vector unsigned int __ATTRS_o_ai
1893 vec_parity_lsbb(vector signed int __a) {
1894 return __builtin_altivec_vprtybw(__a);
1897 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1898 vec_parity_lsbb(vector unsigned __int128 __a) {
1899 return __builtin_altivec_vprtybq(__a);
1902 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1903 vec_parity_lsbb(vector signed __int128 __a) {
1904 return __builtin_altivec_vprtybq(__a);
1907 static __inline__ vector unsigned long long __ATTRS_o_ai
1908 vec_parity_lsbb(vector unsigned long long __a) {
1909 return __builtin_altivec_vprtybd(__a);
1912 static __inline__ vector unsigned long long __ATTRS_o_ai
1913 vec_parity_lsbb(vector signed long long __a) {
1914 return __builtin_altivec_vprtybd(__a);
1921 static __inline__ vector bool char __ATTRS_o_ai
1922 vec_cmpgt(vector signed char __a, vector signed char __b) {
1923 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1926 static __inline__ vector bool char __ATTRS_o_ai
1927 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1928 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1931 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1933 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1936 static __inline__ vector bool short __ATTRS_o_ai
1937 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1938 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1941 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1943 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1946 static __inline__ vector bool int __ATTRS_o_ai
1947 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1948 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1951 #ifdef __POWER8_VECTOR__
1952 static __inline__ vector bool long long __ATTRS_o_ai
1953 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1954 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1957 static __inline__ vector bool long long __ATTRS_o_ai
1958 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1959 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1963 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1966 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1968 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1973 static __inline__ vector bool long long __ATTRS_o_ai
1974 vec_cmpgt(vector double __a, vector double __b) {
1975 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1981 static __inline__ vector bool char __ATTRS_o_ai
1982 vec_cmpge(vector signed char __a, vector signed char __b) {
1983 return ~(vec_cmpgt(__b, __a));
1986 static __inline__ vector bool char __ATTRS_o_ai
1987 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1988 return ~(vec_cmpgt(__b, __a));
1991 static __inline__ vector bool short __ATTRS_o_ai
1992 vec_cmpge(vector signed short __a, vector signed short __b) {
1993 return ~(vec_cmpgt(__b, __a));
1996 static __inline__ vector bool short __ATTRS_o_ai
1997 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1998 return ~(vec_cmpgt(__b, __a));
2001 static __inline__ vector bool int __ATTRS_o_ai
2002 vec_cmpge(vector signed int __a, vector signed int __b) {
2003 return ~(vec_cmpgt(__b, __a));
2006 static __inline__ vector bool int __ATTRS_o_ai
2007 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2008 return ~(vec_cmpgt(__b, __a));
2011 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2014 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2016 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2021 static __inline__ vector bool long long __ATTRS_o_ai
2022 vec_cmpge(vector double __a, vector double __b) {
2023 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2027 #ifdef __POWER8_VECTOR__
2028 static __inline__ vector bool long long __ATTRS_o_ai
2029 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2030 return ~(vec_cmpgt(__b, __a));
2033 static __inline__ vector bool long long __ATTRS_o_ai
2034 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2035 return ~(vec_cmpgt(__b, __a));
2041 static __inline__ vector bool int __attribute__((__always_inline__))
2042 vec_vcmpgefp(vector float __a, vector float __b) {
2043 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2048 static __inline__ vector bool char __attribute__((__always_inline__))
2049 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2050 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2055 static __inline__ vector bool char __attribute__((__always_inline__))
2056 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2057 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2062 static __inline__ vector bool short __attribute__((__always_inline__))
2063 vec_vcmpgtsh(vector short __a, vector short __b) {
2064 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2069 static __inline__ vector bool short __attribute__((__always_inline__))
2070 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2071 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2076 static __inline__ vector bool int __attribute__((__always_inline__))
2077 vec_vcmpgtsw(vector int __a, vector int __b) {
2078 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2083 static __inline__ vector bool int __attribute__((__always_inline__))
2084 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2085 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2090 static __inline__ vector bool int __attribute__((__always_inline__))
2091 vec_vcmpgtfp(vector float __a, vector float __b) {
2092 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2097 static __inline__ vector bool char __ATTRS_o_ai
2098 vec_cmple(vector signed char __a, vector signed char __b) {
2099 return vec_cmpge(__b, __a);
2102 static __inline__ vector bool char __ATTRS_o_ai
2103 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2104 return vec_cmpge(__b, __a);
2107 static __inline__ vector bool short __ATTRS_o_ai
2108 vec_cmple(vector signed short __a, vector signed short __b) {
2109 return vec_cmpge(__b, __a);
2112 static __inline__ vector bool short __ATTRS_o_ai
2113 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2114 return vec_cmpge(__b, __a);
2117 static __inline__ vector bool int __ATTRS_o_ai
2118 vec_cmple(vector signed int __a, vector signed int __b) {
2119 return vec_cmpge(__b, __a);
2122 static __inline__ vector bool int __ATTRS_o_ai
2123 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2124 return vec_cmpge(__b, __a);
2127 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2129 return vec_cmpge(__b, __a);
2133 static __inline__ vector bool long long __ATTRS_o_ai
2134 vec_cmple(vector double __a, vector double __b) {
2135 return vec_cmpge(__b, __a);
2139 #ifdef __POWER8_VECTOR__
2140 static __inline__ vector bool long long __ATTRS_o_ai
2141 vec_cmple(vector signed long long __a, vector signed long long __b) {
2142 return vec_cmpge(__b, __a);
2145 static __inline__ vector bool long long __ATTRS_o_ai
2146 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2147 return vec_cmpge(__b, __a);
2153 static __inline__ vector bool char __ATTRS_o_ai
2154 vec_cmplt(vector signed char __a, vector signed char __b) {
2155 return vec_cmpgt(__b, __a);
2158 static __inline__ vector bool char __ATTRS_o_ai
2159 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2160 return vec_cmpgt(__b, __a);
2163 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2165 return vec_cmpgt(__b, __a);
2168 static __inline__ vector bool short __ATTRS_o_ai
2169 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2170 return vec_cmpgt(__b, __a);
2173 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2175 return vec_cmpgt(__b, __a);
2178 static __inline__ vector bool int __ATTRS_o_ai
2179 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2180 return vec_cmpgt(__b, __a);
2183 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2185 return vec_cmpgt(__b, __a);
2189 static __inline__ vector bool long long __ATTRS_o_ai
2190 vec_cmplt(vector double __a, vector double __b) {
2191 return vec_cmpgt(__b, __a);
2195 #ifdef __POWER8_VECTOR__
2196 static __inline__ vector bool long long __ATTRS_o_ai
2197 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2198 return vec_cmpgt(__b, __a);
2201 static __inline__ vector bool long long __ATTRS_o_ai
2202 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2203 return vec_cmpgt(__b, __a);
2208 static __inline__ vector signed char __ATTRS_o_ai
2209 vec_popcnt(vector signed char __a) {
2210 return __builtin_altivec_vpopcntb(__a);
2212 static __inline__ vector unsigned char __ATTRS_o_ai
2213 vec_popcnt(vector unsigned char __a) {
2214 return __builtin_altivec_vpopcntb(__a);
2216 static __inline__ vector signed short __ATTRS_o_ai
2217 vec_popcnt(vector signed short __a) {
2218 return __builtin_altivec_vpopcnth(__a);
2220 static __inline__ vector unsigned short __ATTRS_o_ai
2221 vec_popcnt(vector unsigned short __a) {
2222 return __builtin_altivec_vpopcnth(__a);
2224 static __inline__ vector signed int __ATTRS_o_ai
2225 vec_popcnt(vector signed int __a) {
2226 return __builtin_altivec_vpopcntw(__a);
2228 static __inline__ vector unsigned int __ATTRS_o_ai
2229 vec_popcnt(vector unsigned int __a) {
2230 return __builtin_altivec_vpopcntw(__a);
2232 static __inline__ vector signed long long __ATTRS_o_ai
2233 vec_popcnt(vector signed long long __a) {
2234 return __builtin_altivec_vpopcntd(__a);
2236 static __inline__ vector unsigned long long __ATTRS_o_ai
2237 vec_popcnt(vector unsigned long long __a) {
2238 return __builtin_altivec_vpopcntd(__a);
2243 static __inline__ vector signed char __ATTRS_o_ai
2244 vec_cntlz(vector signed char __a) {
2245 return __builtin_altivec_vclzb(__a);
2247 static __inline__ vector unsigned char __ATTRS_o_ai
2248 vec_cntlz(vector unsigned char __a) {
2249 return __builtin_altivec_vclzb(__a);
2251 static __inline__ vector signed short __ATTRS_o_ai
2252 vec_cntlz(vector signed short __a) {
2253 return __builtin_altivec_vclzh(__a);
2255 static __inline__ vector unsigned short __ATTRS_o_ai
2256 vec_cntlz(vector unsigned short __a) {
2257 return __builtin_altivec_vclzh(__a);
2259 static __inline__ vector signed int __ATTRS_o_ai
2260 vec_cntlz(vector signed int __a) {
2261 return __builtin_altivec_vclzw(__a);
2263 static __inline__ vector unsigned int __ATTRS_o_ai
2264 vec_cntlz(vector unsigned int __a) {
2265 return __builtin_altivec_vclzw(__a);
2267 static __inline__ vector signed long long __ATTRS_o_ai
2268 vec_cntlz(vector signed long long __a) {
2269 return __builtin_altivec_vclzd(__a);
2271 static __inline__ vector unsigned long long __ATTRS_o_ai
2272 vec_cntlz(vector unsigned long long __a) {
2273 return __builtin_altivec_vclzd(__a);
2277 #ifdef __POWER9_VECTOR__
2281 static __inline__ vector signed char __ATTRS_o_ai
2282 vec_cnttz(vector signed char __a) {
2283 return __builtin_altivec_vctzb(__a);
2285 static __inline__ vector unsigned char __ATTRS_o_ai
2286 vec_cnttz(vector unsigned char __a) {
2287 return __builtin_altivec_vctzb(__a);
2289 static __inline__ vector signed short __ATTRS_o_ai
2290 vec_cnttz(vector signed short __a) {
2291 return __builtin_altivec_vctzh(__a);
2293 static __inline__ vector unsigned short __ATTRS_o_ai
2294 vec_cnttz(vector unsigned short __a) {
2295 return __builtin_altivec_vctzh(__a);
2297 static __inline__ vector signed int __ATTRS_o_ai
2298 vec_cnttz(vector signed int __a) {
2299 return __builtin_altivec_vctzw(__a);
2301 static __inline__ vector unsigned int __ATTRS_o_ai
2302 vec_cnttz(vector unsigned int __a) {
2303 return __builtin_altivec_vctzw(__a);
2305 static __inline__ vector signed long long __ATTRS_o_ai
2306 vec_cnttz(vector signed long long __a) {
2307 return __builtin_altivec_vctzd(__a);
2309 static __inline__ vector unsigned long long __ATTRS_o_ai
2310 vec_cnttz(vector unsigned long long __a) {
2311 return __builtin_altivec_vctzd(__a);
2314 /* vec_first_match_index */
2316 static __inline__ unsigned __ATTRS_o_ai
2317 vec_first_match_index(vector signed char __a, vector signed char __b) {
2318 vector unsigned long long __res =
2319 #ifdef __LITTLE_ENDIAN__
2320 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2322 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2324 if (__res[0] == 64) {
2325 return (__res[1] + 64) >> 3;
2327 return __res[0] >> 3;
2330 static __inline__ unsigned __ATTRS_o_ai
2331 vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {
2332 vector unsigned long long __res =
2333 #ifdef __LITTLE_ENDIAN__
2334 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2336 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2338 if (__res[0] == 64) {
2339 return (__res[1] + 64) >> 3;
2341 return __res[0] >> 3;
2344 static __inline__ unsigned __ATTRS_o_ai
2345 vec_first_match_index(vector signed short __a, vector signed short __b) {
2346 vector unsigned long long __res =
2347 #ifdef __LITTLE_ENDIAN__
2348 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2350 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2352 if (__res[0] == 64) {
2353 return (__res[1] + 64) >> 4;
2355 return __res[0] >> 4;
2358 static __inline__ unsigned __ATTRS_o_ai
2359 vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2360 vector unsigned long long __res =
2361 #ifdef __LITTLE_ENDIAN__
2362 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2364 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2366 if (__res[0] == 64) {
2367 return (__res[1] + 64) >> 4;
2369 return __res[0] >> 4;
2372 static __inline__ unsigned __ATTRS_o_ai
2373 vec_first_match_index(vector signed int __a, vector signed int __b) {
2374 vector unsigned long long __res =
2375 #ifdef __LITTLE_ENDIAN__
2376 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2378 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2380 if (__res[0] == 64) {
2381 return (__res[1] + 64) >> 5;
2383 return __res[0] >> 5;
2386 static __inline__ unsigned __ATTRS_o_ai
2387 vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2388 vector unsigned long long __res =
2389 #ifdef __LITTLE_ENDIAN__
2390 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2392 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2394 if (__res[0] == 64) {
2395 return (__res[1] + 64) >> 5;
2397 return __res[0] >> 5;
2400 /* vec_first_match_or_eos_index */
2402 static __inline__ unsigned __ATTRS_o_ai
2403 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2404 /* Compare the result of the comparison of two vectors with either and OR the
2405 result. Either the elements are equal or one will equal the comparison
2406 result if either is zero.
2408 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2409 vector bool char __tmp2 = __tmp1 |
2410 vec_cmpeq((vector signed char)__tmp1, __a) |
2411 vec_cmpeq((vector signed char)__tmp1, __b);
2413 vector unsigned long long __res =
2414 #ifdef __LITTLE_ENDIAN__
2415 vec_cnttz((vector unsigned long long)__tmp2);
2417 vec_cntlz((vector unsigned long long)__tmp2);
2419 if (__res[0] == 64) {
2420 return (__res[1] + 64) >> 3;
2422 return __res[0] >> 3;
2425 static __inline__ unsigned __ATTRS_o_ai
2426 vec_first_match_or_eos_index(vector unsigned char __a,
2427 vector unsigned char __b) {
2428 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2429 vector bool char __tmp2 = __tmp1 |
2430 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2431 vec_cmpeq((vector unsigned char)__tmp1, __b);
2433 vector unsigned long long __res =
2434 #ifdef __LITTLE_ENDIAN__
2435 vec_cnttz((vector unsigned long long)__tmp2);
2437 vec_cntlz((vector unsigned long long)__tmp2);
2439 if (__res[0] == 64) {
2440 return (__res[1] + 64) >> 3;
2442 return __res[0] >> 3;
2445 static __inline__ unsigned __ATTRS_o_ai
2446 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2447 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2448 vector bool short __tmp2 = __tmp1 |
2449 vec_cmpeq((vector signed short)__tmp1, __a) |
2450 vec_cmpeq((vector signed short)__tmp1, __b);
2452 vector unsigned long long __res =
2453 #ifdef __LITTLE_ENDIAN__
2454 vec_cnttz((vector unsigned long long)__tmp2);
2456 vec_cntlz((vector unsigned long long)__tmp2);
2458 if (__res[0] == 64) {
2459 return (__res[1] + 64) >> 4;
2461 return __res[0] >> 4;
2464 static __inline__ unsigned __ATTRS_o_ai
2465 vec_first_match_or_eos_index(vector unsigned short __a,
2466 vector unsigned short __b) {
2467 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2468 vector bool short __tmp2 = __tmp1 |
2469 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2470 vec_cmpeq((vector unsigned short)__tmp1, __b);
2472 vector unsigned long long __res =
2473 #ifdef __LITTLE_ENDIAN__
2474 vec_cnttz((vector unsigned long long)__tmp2);
2476 vec_cntlz((vector unsigned long long)__tmp2);
2478 if (__res[0] == 64) {
2479 return (__res[1] + 64) >> 4;
2481 return __res[0] >> 4;
2484 static __inline__ unsigned __ATTRS_o_ai
2485 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2486 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2487 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2488 vec_cmpeq((vector signed int)__tmp1, __b);
2490 vector unsigned long long __res =
2491 #ifdef __LITTLE_ENDIAN__
2492 vec_cnttz((vector unsigned long long)__tmp2);
2494 vec_cntlz((vector unsigned long long)__tmp2);
2496 if (__res[0] == 64) {
2497 return (__res[1] + 64) >> 5;
2499 return __res[0] >> 5;
2502 static __inline__ unsigned __ATTRS_o_ai
2503 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2504 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2505 vector bool int __tmp2 = __tmp1 |
2506 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2507 vec_cmpeq((vector unsigned int)__tmp1, __b);
2509 vector unsigned long long __res =
2510 #ifdef __LITTLE_ENDIAN__
2511 vec_cnttz((vector unsigned long long)__tmp2);
2513 vec_cntlz((vector unsigned long long)__tmp2);
2515 if (__res[0] == 64) {
2516 return (__res[1] + 64) >> 5;
2518 return __res[0] >> 5;
2521 /* vec_first_mismatch_index */
2523 static __inline__ unsigned __ATTRS_o_ai
2524 vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2525 vector unsigned long long __res =
2526 #ifdef __LITTLE_ENDIAN__
2527 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2529 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2531 if (__res[0] == 64) {
2532 return (__res[1] + 64) >> 3;
2534 return __res[0] >> 3;
2537 static __inline__ unsigned __ATTRS_o_ai
2538 vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {
2539 vector unsigned long long __res =
2540 #ifdef __LITTLE_ENDIAN__
2541 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2543 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2545 if (__res[0] == 64) {
2546 return (__res[1] + 64) >> 3;
2548 return __res[0] >> 3;
2551 static __inline__ unsigned __ATTRS_o_ai
2552 vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2553 vector unsigned long long __res =
2554 #ifdef __LITTLE_ENDIAN__
2555 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2557 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2559 if (__res[0] == 64) {
2560 return (__res[1] + 64) >> 4;
2562 return __res[0] >> 4;
2565 static __inline__ unsigned __ATTRS_o_ai
2566 vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2567 vector unsigned long long __res =
2568 #ifdef __LITTLE_ENDIAN__
2569 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2571 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2573 if (__res[0] == 64) {
2574 return (__res[1] + 64) >> 4;
2576 return __res[0] >> 4;
2579 static __inline__ unsigned __ATTRS_o_ai
2580 vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2581 vector unsigned long long __res =
2582 #ifdef __LITTLE_ENDIAN__
2583 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2585 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2587 if (__res[0] == 64) {
2588 return (__res[1] + 64) >> 5;
2590 return __res[0] >> 5;
2593 static __inline__ unsigned __ATTRS_o_ai
2594 vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2595 vector unsigned long long __res =
2596 #ifdef __LITTLE_ENDIAN__
2597 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2599 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2601 if (__res[0] == 64) {
2602 return (__res[1] + 64) >> 5;
2604 return __res[0] >> 5;
2607 /* vec_first_mismatch_or_eos_index */
2609 static __inline__ unsigned __ATTRS_o_ai
2610 vec_first_mismatch_or_eos_index(vector signed char __a,
2611 vector signed char __b) {
2612 vector unsigned long long __res =
2613 #ifdef __LITTLE_ENDIAN__
2614 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2616 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2618 if (__res[0] == 64) {
2619 return (__res[1] + 64) >> 3;
2621 return __res[0] >> 3;
2624 static __inline__ unsigned __ATTRS_o_ai
2625 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2626 vector unsigned char __b) {
2627 vector unsigned long long __res =
2628 #ifdef __LITTLE_ENDIAN__
2629 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2631 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2633 if (__res[0] == 64) {
2634 return (__res[1] + 64) >> 3;
2636 return __res[0] >> 3;
2639 static __inline__ unsigned __ATTRS_o_ai
2640 vec_first_mismatch_or_eos_index(vector signed short __a,
2641 vector signed short __b) {
2642 vector unsigned long long __res =
2643 #ifdef __LITTLE_ENDIAN__
2644 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2646 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2648 if (__res[0] == 64) {
2649 return (__res[1] + 64) >> 4;
2651 return __res[0] >> 4;
2654 static __inline__ unsigned __ATTRS_o_ai
2655 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2656 vector unsigned short __b) {
2657 vector unsigned long long __res =
2658 #ifdef __LITTLE_ENDIAN__
2659 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2661 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2663 if (__res[0] == 64) {
2664 return (__res[1] + 64) >> 4;
2666 return __res[0] >> 4;
2669 static __inline__ unsigned __ATTRS_o_ai
2670 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2671 vector unsigned long long __res =
2672 #ifdef __LITTLE_ENDIAN__
2673 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2675 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2677 if (__res[0] == 64) {
2678 return (__res[1] + 64) >> 5;
2680 return __res[0] >> 5;
2683 static __inline__ unsigned __ATTRS_o_ai
2684 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2685 vector unsigned int __b) {
2686 vector unsigned long long __res =
2687 #ifdef __LITTLE_ENDIAN__
2688 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2690 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2692 if (__res[0] == 64) {
2693 return (__res[1] + 64) >> 5;
2695 return __res[0] >> 5;
2698 static __inline__ vector double __ATTRS_o_ai
2699 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2700 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2703 static __inline__ vector double __ATTRS_o_ai
2704 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2705 return __builtin_vsx_xviexpdp(__a,__b);
2708 static __inline__ vector float __ATTRS_o_ai
2709 vec_insert_exp(vector float __a, vector unsigned int __b) {
2710 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2713 static __inline__ vector float __ATTRS_o_ai
2714 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2715 return __builtin_vsx_xviexpsp(__a,__b);
2718 #if defined(__powerpc64__)
2719 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(signed char *__a,
2721 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2724 static __inline__ vector unsigned char __ATTRS_o_ai
2725 vec_xl_len(unsigned char *__a, size_t __b) {
2726 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2729 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(signed short *__a,
2731 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2734 static __inline__ vector unsigned short __ATTRS_o_ai
2735 vec_xl_len(unsigned short *__a, size_t __b) {
2736 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2739 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(signed int *__a,
2741 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2744 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(unsigned int *__a,
2746 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2749 static __inline__ vector float __ATTRS_o_ai vec_xl_len(float *__a, size_t __b) {
2750 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2753 static __inline__ vector signed __int128 __ATTRS_o_ai
2754 vec_xl_len(signed __int128 *__a, size_t __b) {
2755 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2758 static __inline__ vector unsigned __int128 __ATTRS_o_ai
2759 vec_xl_len(unsigned __int128 *__a, size_t __b) {
2760 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2763 static __inline__ vector signed long long __ATTRS_o_ai
2764 vec_xl_len(signed long long *__a, size_t __b) {
2765 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2768 static __inline__ vector unsigned long long __ATTRS_o_ai
2769 vec_xl_len(unsigned long long *__a, size_t __b) {
2770 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2773 static __inline__ vector double __ATTRS_o_ai vec_xl_len(double *__a,
2775 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2778 static __inline__ vector double __ATTRS_o_ai vec_xl_len_r(unsigned char *__a,
2780 vector unsigned char __res =
2781 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2782 #ifdef __LITTLE_ENDIAN__
2783 vector unsigned char __mask =
2784 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2785 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2786 (vector int)__res, (vector int)__res, __mask);
2792 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2795 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2798 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2799 signed char *__b, size_t __c) {
2800 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2803 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2804 signed short *__b, size_t __c) {
2805 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2808 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2809 unsigned short *__b,
2811 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2814 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2815 signed int *__b, size_t __c) {
2816 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2819 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2820 unsigned int *__b, size_t __c) {
2821 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2824 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2826 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2829 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2830 signed __int128 *__b,
2832 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2835 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2836 unsigned __int128 *__b,
2838 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2841 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2842 signed long long *__b,
2844 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2847 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2848 unsigned long long *__b,
2850 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2853 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2855 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2858 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2861 #ifdef __LITTLE_ENDIAN__
2862 vector unsigned char __mask =
2863 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2864 vector unsigned char __res =
2865 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2866 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2868 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2877 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2879 return __builtin_vsx_xvcpsgnsp(__a, __b);
2882 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2883 vector double __b) {
2884 return __builtin_vsx_xvcpsgndp(__a, __b);
2891 #define vec_ctf(__a, __b) \
2892 _Generic((__a), vector int \
2893 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2894 vector unsigned int \
2895 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)), \
2896 vector unsigned long long \
2897 : (__builtin_convertvector((vector unsigned long long)(__a), \
2899 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2901 vector signed long long \
2902 : (__builtin_convertvector((vector signed long long)(__a), \
2904 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2907 #define vec_ctf(__a, __b) \
2908 _Generic((__a), vector int \
2909 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2910 vector unsigned int \
2911 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)))
2916 #define vec_vcfux __builtin_altivec_vcfux
2920 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2925 #define vec_cts(__a, __b) \
2926 _Generic((__a), vector float \
2927 : __builtin_altivec_vctsxs((__a), (__b)), vector double \
2929 vector double __ret = \
2931 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2933 __builtin_convertvector(__ret, vector signed long long); \
2936 #define vec_cts __builtin_altivec_vctsxs
2941 #define vec_vctsxs __builtin_altivec_vctsxs
2946 #define vec_ctu(__a, __b) \
2947 _Generic((__a), vector float \
2948 : __builtin_altivec_vctuxs((__a), (__b)), vector double \
2950 vector double __ret = \
2952 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2954 __builtin_convertvector(__ret, vector unsigned long long); \
2957 #define vec_ctu __builtin_altivec_vctuxs
2962 #define vec_vctuxs __builtin_altivec_vctuxs
2966 static __inline__ vector signed int __ATTRS_o_ai
2967 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2969 static __inline__ vector signed int __ATTRS_o_ai
2970 vec_signed(vector float __a) {
2971 return __builtin_convertvector(__a, vector signed int);
2975 static __inline__ vector signed long long __ATTRS_o_ai
2976 vec_signed(vector double __a) {
2977 return __builtin_convertvector(__a, vector signed long long);
2980 static __inline__ vector signed int __attribute__((__always_inline__))
2981 vec_signed2(vector double __a, vector double __b) {
2982 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2985 static __inline__ vector signed int __ATTRS_o_ai
2986 vec_signede(vector double __a) {
2987 #ifdef __LITTLE_ENDIAN__
2988 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2989 return vec_sld(__ret, __ret, 12);
2991 return __builtin_vsx_xvcvdpsxws(__a);
2995 static __inline__ vector signed int __ATTRS_o_ai
2996 vec_signedo(vector double __a) {
2997 #ifdef __LITTLE_ENDIAN__
2998 return __builtin_vsx_xvcvdpsxws(__a);
3000 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3001 return vec_sld(__ret, __ret, 12);
3008 static __inline__ vector unsigned int __ATTRS_o_ai
3009 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3011 static __inline__ vector unsigned int __ATTRS_o_ai
3012 vec_unsigned(vector float __a) {
3013 return __builtin_convertvector(__a, vector unsigned int);
3017 static __inline__ vector unsigned long long __ATTRS_o_ai
3018 vec_unsigned(vector double __a) {
3019 return __builtin_convertvector(__a, vector unsigned long long);
3022 static __inline__ vector unsigned int __attribute__((__always_inline__))
3023 vec_unsigned2(vector double __a, vector double __b) {
3024 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3027 static __inline__ vector unsigned int __ATTRS_o_ai
3028 vec_unsignede(vector double __a) {
3029 #ifdef __LITTLE_ENDIAN__
3030 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3031 return vec_sld(__ret, __ret, 12);
3033 return __builtin_vsx_xvcvdpuxws(__a);
3037 static __inline__ vector unsigned int __ATTRS_o_ai
3038 vec_unsignedo(vector double __a) {
3039 #ifdef __LITTLE_ENDIAN__
3040 return __builtin_vsx_xvcvdpuxws(__a);
3042 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3043 return vec_sld(__ret, __ret, 12);
3050 static __inline__ vector float __ATTRS_o_ai
3051 vec_sld(vector float, vector float, unsigned const int __c);
3053 static __inline__ vector float __ATTRS_o_ai
3054 vec_float(vector signed int __a) {
3055 return __builtin_convertvector(__a, vector float);
3058 static __inline__ vector float __ATTRS_o_ai
3059 vec_float(vector unsigned int __a) {
3060 return __builtin_convertvector(__a, vector float);
3064 static __inline__ vector float __ATTRS_o_ai
3065 vec_float2(vector signed long long __a, vector signed long long __b) {
3066 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3069 static __inline__ vector float __ATTRS_o_ai
3070 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3071 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3074 static __inline__ vector float __ATTRS_o_ai
3075 vec_float2(vector double __a, vector double __b) {
3076 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3079 static __inline__ vector float __ATTRS_o_ai
3080 vec_floate(vector signed long long __a) {
3081 #ifdef __LITTLE_ENDIAN__
3082 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3083 return vec_sld(__ret, __ret, 12);
3085 return __builtin_vsx_xvcvsxdsp(__a);
3089 static __inline__ vector float __ATTRS_o_ai
3090 vec_floate(vector unsigned long long __a) {
3091 #ifdef __LITTLE_ENDIAN__
3092 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3093 return vec_sld(__ret, __ret, 12);
3095 return __builtin_vsx_xvcvuxdsp(__a);
3099 static __inline__ vector float __ATTRS_o_ai
3100 vec_floate(vector double __a) {
3101 #ifdef __LITTLE_ENDIAN__
3102 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3103 return vec_sld(__ret, __ret, 12);
3105 return __builtin_vsx_xvcvdpsp(__a);
3109 static __inline__ vector float __ATTRS_o_ai
3110 vec_floato(vector signed long long __a) {
3111 #ifdef __LITTLE_ENDIAN__
3112 return __builtin_vsx_xvcvsxdsp(__a);
3114 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3115 return vec_sld(__ret, __ret, 12);
3119 static __inline__ vector float __ATTRS_o_ai
3120 vec_floato(vector unsigned long long __a) {
3121 #ifdef __LITTLE_ENDIAN__
3122 return __builtin_vsx_xvcvuxdsp(__a);
3124 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3125 return vec_sld(__ret, __ret, 12);
3129 static __inline__ vector float __ATTRS_o_ai
3130 vec_floato(vector double __a) {
3131 #ifdef __LITTLE_ENDIAN__
3132 return __builtin_vsx_xvcvdpsp(__a);
3134 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3135 return vec_sld(__ret, __ret, 12);
3143 static __inline__ vector double __ATTRS_o_ai
3144 vec_double(vector signed long long __a) {
3145 return __builtin_convertvector(__a, vector double);
3148 static __inline__ vector double __ATTRS_o_ai
3149 vec_double(vector unsigned long long __a) {
3150 return __builtin_convertvector(__a, vector double);
3153 static __inline__ vector double __ATTRS_o_ai
3154 vec_doublee(vector signed int __a) {
3155 #ifdef __LITTLE_ENDIAN__
3156 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3158 return __builtin_vsx_xvcvsxwdp(__a);
3162 static __inline__ vector double __ATTRS_o_ai
3163 vec_doublee(vector unsigned int __a) {
3164 #ifdef __LITTLE_ENDIAN__
3165 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3167 return __builtin_vsx_xvcvuxwdp(__a);
3171 static __inline__ vector double __ATTRS_o_ai
3172 vec_doublee(vector float __a) {
3173 #ifdef __LITTLE_ENDIAN__
3174 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3176 return __builtin_vsx_xvcvspdp(__a);
3180 static __inline__ vector double __ATTRS_o_ai
3181 vec_doubleh(vector signed int __a) {
3182 vector double __ret = {__a[0], __a[1]};
3186 static __inline__ vector double __ATTRS_o_ai
3187 vec_doubleh(vector unsigned int __a) {
3188 vector double __ret = {__a[0], __a[1]};
3192 static __inline__ vector double __ATTRS_o_ai
3193 vec_doubleh(vector float __a) {
3194 vector double __ret = {__a[0], __a[1]};
3198 static __inline__ vector double __ATTRS_o_ai
3199 vec_doublel(vector signed int __a) {
3200 vector double __ret = {__a[2], __a[3]};
3204 static __inline__ vector double __ATTRS_o_ai
3205 vec_doublel(vector unsigned int __a) {
3206 vector double __ret = {__a[2], __a[3]};
3210 static __inline__ vector double __ATTRS_o_ai
3211 vec_doublel(vector float __a) {
3212 vector double __ret = {__a[2], __a[3]};
3216 static __inline__ vector double __ATTRS_o_ai
3217 vec_doubleo(vector signed int __a) {
3218 #ifdef __LITTLE_ENDIAN__
3219 return __builtin_vsx_xvcvsxwdp(__a);
3221 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3225 static __inline__ vector double __ATTRS_o_ai
3226 vec_doubleo(vector unsigned int __a) {
3227 #ifdef __LITTLE_ENDIAN__
3228 return __builtin_vsx_xvcvuxwdp(__a);
3230 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3234 static __inline__ vector double __ATTRS_o_ai
3235 vec_doubleo(vector float __a) {
3236 #ifdef __LITTLE_ENDIAN__
3237 return __builtin_vsx_xvcvspdp(__a);
3239 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3246 /* Integer vector divides (vectors are scalarized, elements divided
3247 and the vectors reassembled).
3249 static __inline__ vector signed char __ATTRS_o_ai
3250 vec_div(vector signed char __a, vector signed char __b) {
3254 static __inline__ vector unsigned char __ATTRS_o_ai
3255 vec_div(vector unsigned char __a, vector unsigned char __b) {
3259 static __inline__ vector signed short __ATTRS_o_ai
3260 vec_div(vector signed short __a, vector signed short __b) {
3264 static __inline__ vector unsigned short __ATTRS_o_ai
3265 vec_div(vector unsigned short __a, vector unsigned short __b) {
3269 static __inline__ vector signed int __ATTRS_o_ai
3270 vec_div(vector signed int __a, vector signed int __b) {
3274 static __inline__ vector unsigned int __ATTRS_o_ai
3275 vec_div(vector unsigned int __a, vector unsigned int __b) {
3280 static __inline__ vector signed long long __ATTRS_o_ai
3281 vec_div(vector signed long long __a, vector signed long long __b) {
3285 static __inline__ vector unsigned long long __ATTRS_o_ai
3286 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3290 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3295 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3296 vector double __b) {
3303 static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
3304 __builtin_altivec_dss(__a);
3309 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3310 __builtin_altivec_dssall();
3314 #define vec_dst(__PTR, __CW, __STR) \
3316 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3319 #define vec_dstst(__PTR, __CW, __STR) \
3321 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3324 #define vec_dststt(__PTR, __CW, __STR) \
3326 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3329 #define vec_dstt(__PTR, __CW, __STR) \
3331 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3335 #ifdef __POWER8_VECTOR__
3336 static __inline__ vector signed char __ATTRS_o_ai
3337 vec_eqv(vector signed char __a, vector signed char __b) {
3338 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3339 (vector unsigned int)__b);
3342 static __inline__ vector unsigned char __ATTRS_o_ai
3343 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3344 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3345 (vector unsigned int)__b);
3348 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3349 vector bool char __b) {
3350 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3351 (vector unsigned int)__b);
3354 static __inline__ vector signed short __ATTRS_o_ai
3355 vec_eqv(vector signed short __a, vector signed short __b) {
3356 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3357 (vector unsigned int)__b);
3360 static __inline__ vector unsigned short __ATTRS_o_ai
3361 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3362 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3363 (vector unsigned int)__b);
3366 static __inline__ vector bool short __ATTRS_o_ai
3367 vec_eqv(vector bool short __a, vector bool short __b) {
3368 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3369 (vector unsigned int)__b);
3372 static __inline__ vector signed int __ATTRS_o_ai
3373 vec_eqv(vector signed int __a, vector signed int __b) {
3374 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3375 (vector unsigned int)__b);
3378 static __inline__ vector unsigned int __ATTRS_o_ai
3379 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3380 return __builtin_vsx_xxleqv(__a, __b);
3383 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3384 vector bool int __b) {
3385 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3386 (vector unsigned int)__b);
3389 static __inline__ vector signed long long __ATTRS_o_ai
3390 vec_eqv(vector signed long long __a, vector signed long long __b) {
3391 return (vector signed long long)__builtin_vsx_xxleqv(
3392 (vector unsigned int)__a, (vector unsigned int)__b);
3395 static __inline__ vector unsigned long long __ATTRS_o_ai
3396 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3397 return (vector unsigned long long)__builtin_vsx_xxleqv(
3398 (vector unsigned int)__a, (vector unsigned int)__b);
3401 static __inline__ vector bool long long __ATTRS_o_ai
3402 vec_eqv(vector bool long long __a, vector bool long long __b) {
3403 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3404 (vector unsigned int)__b);
3407 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3409 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3410 (vector unsigned int)__b);
3413 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3414 vector double __b) {
3415 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3416 (vector unsigned int)__b);
3422 static __inline__ vector float __attribute__((__always_inline__))
3423 vec_expte(vector float __a) {
3424 return __builtin_altivec_vexptefp(__a);
3429 static __inline__ vector float __attribute__((__always_inline__))
3430 vec_vexptefp(vector float __a) {
3431 return __builtin_altivec_vexptefp(__a);
3436 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3438 return __builtin_vsx_xvrspim(__a);
3440 return __builtin_altivec_vrfim(__a);
3445 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3446 return __builtin_vsx_xvrdpim(__a);
3452 static __inline__ vector float __attribute__((__always_inline__))
3453 vec_vrfim(vector float __a) {
3454 return __builtin_altivec_vrfim(__a);
3459 static __inline__ vector signed char __ATTRS_o_ai
3460 vec_ld(int __a, const vector signed char *__b) {
3461 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3464 static __inline__ vector signed char __ATTRS_o_ai
3465 vec_ld(int __a, const signed char *__b) {
3466 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3469 static __inline__ vector unsigned char __ATTRS_o_ai
3470 vec_ld(int __a, const vector unsigned char *__b) {
3471 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3474 static __inline__ vector unsigned char __ATTRS_o_ai
3475 vec_ld(int __a, const unsigned char *__b) {
3476 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3479 static __inline__ vector bool char __ATTRS_o_ai
3480 vec_ld(int __a, const vector bool char *__b) {
3481 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3484 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3485 const vector short *__b) {
3486 return (vector short)__builtin_altivec_lvx(__a, __b);
3489 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3490 return (vector short)__builtin_altivec_lvx(__a, __b);
3493 static __inline__ vector unsigned short __ATTRS_o_ai
3494 vec_ld(int __a, const vector unsigned short *__b) {
3495 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3498 static __inline__ vector unsigned short __ATTRS_o_ai
3499 vec_ld(int __a, const unsigned short *__b) {
3500 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3503 static __inline__ vector bool short __ATTRS_o_ai
3504 vec_ld(int __a, const vector bool short *__b) {
3505 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3508 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3509 const vector pixel *__b) {
3510 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3513 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3514 const vector int *__b) {
3515 return (vector int)__builtin_altivec_lvx(__a, __b);
3518 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3519 return (vector int)__builtin_altivec_lvx(__a, __b);
3522 static __inline__ vector unsigned int __ATTRS_o_ai
3523 vec_ld(int __a, const vector unsigned int *__b) {
3524 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3527 static __inline__ vector unsigned int __ATTRS_o_ai
3528 vec_ld(int __a, const unsigned int *__b) {
3529 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3532 static __inline__ vector bool int __ATTRS_o_ai
3533 vec_ld(int __a, const vector bool int *__b) {
3534 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3537 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3538 const vector float *__b) {
3539 return (vector float)__builtin_altivec_lvx(__a, __b);
3542 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3543 return (vector float)__builtin_altivec_lvx(__a, __b);
3548 static __inline__ vector signed char __ATTRS_o_ai
3549 vec_lvx(int __a, const vector signed char *__b) {
3550 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3553 static __inline__ vector signed char __ATTRS_o_ai
3554 vec_lvx(int __a, const signed char *__b) {
3555 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3558 static __inline__ vector unsigned char __ATTRS_o_ai
3559 vec_lvx(int __a, const vector unsigned char *__b) {
3560 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3563 static __inline__ vector unsigned char __ATTRS_o_ai
3564 vec_lvx(int __a, const unsigned char *__b) {
3565 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3568 static __inline__ vector bool char __ATTRS_o_ai
3569 vec_lvx(int __a, const vector bool char *__b) {
3570 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3573 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3574 const vector short *__b) {
3575 return (vector short)__builtin_altivec_lvx(__a, __b);
3578 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3579 return (vector short)__builtin_altivec_lvx(__a, __b);
3582 static __inline__ vector unsigned short __ATTRS_o_ai
3583 vec_lvx(int __a, const vector unsigned short *__b) {
3584 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3587 static __inline__ vector unsigned short __ATTRS_o_ai
3588 vec_lvx(int __a, const unsigned short *__b) {
3589 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3592 static __inline__ vector bool short __ATTRS_o_ai
3593 vec_lvx(int __a, const vector bool short *__b) {
3594 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3597 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3598 const vector pixel *__b) {
3599 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3602 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3603 const vector int *__b) {
3604 return (vector int)__builtin_altivec_lvx(__a, __b);
3607 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3608 return (vector int)__builtin_altivec_lvx(__a, __b);
3611 static __inline__ vector unsigned int __ATTRS_o_ai
3612 vec_lvx(int __a, const vector unsigned int *__b) {
3613 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3616 static __inline__ vector unsigned int __ATTRS_o_ai
3617 vec_lvx(int __a, const unsigned int *__b) {
3618 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3621 static __inline__ vector bool int __ATTRS_o_ai
3622 vec_lvx(int __a, const vector bool int *__b) {
3623 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3626 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3627 const vector float *__b) {
3628 return (vector float)__builtin_altivec_lvx(__a, __b);
3631 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3632 return (vector float)__builtin_altivec_lvx(__a, __b);
3637 static __inline__ vector signed char __ATTRS_o_ai
3638 vec_lde(int __a, const signed char *__b) {
3639 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3642 static __inline__ vector unsigned char __ATTRS_o_ai
3643 vec_lde(int __a, const unsigned char *__b) {
3644 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3647 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3648 return (vector short)__builtin_altivec_lvehx(__a, __b);
3651 static __inline__ vector unsigned short __ATTRS_o_ai
3652 vec_lde(int __a, const unsigned short *__b) {
3653 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3656 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3657 return (vector int)__builtin_altivec_lvewx(__a, __b);
3660 static __inline__ vector unsigned int __ATTRS_o_ai
3661 vec_lde(int __a, const unsigned int *__b) {
3662 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3665 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3666 return (vector float)__builtin_altivec_lvewx(__a, __b);
3671 static __inline__ vector signed char __ATTRS_o_ai
3672 vec_lvebx(int __a, const signed char *__b) {
3673 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3676 static __inline__ vector unsigned char __ATTRS_o_ai
3677 vec_lvebx(int __a, const unsigned char *__b) {
3678 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3683 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3685 return (vector short)__builtin_altivec_lvehx(__a, __b);
3688 static __inline__ vector unsigned short __ATTRS_o_ai
3689 vec_lvehx(int __a, const unsigned short *__b) {
3690 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3695 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3696 return (vector int)__builtin_altivec_lvewx(__a, __b);
3699 static __inline__ vector unsigned int __ATTRS_o_ai
3700 vec_lvewx(int __a, const unsigned int *__b) {
3701 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3704 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3706 return (vector float)__builtin_altivec_lvewx(__a, __b);
3711 static __inline__ vector signed char __ATTRS_o_ai
3712 vec_ldl(int __a, const vector signed char *__b) {
3713 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3716 static __inline__ vector signed char __ATTRS_o_ai
3717 vec_ldl(int __a, const signed char *__b) {
3718 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3721 static __inline__ vector unsigned char __ATTRS_o_ai
3722 vec_ldl(int __a, const vector unsigned char *__b) {
3723 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3726 static __inline__ vector unsigned char __ATTRS_o_ai
3727 vec_ldl(int __a, const unsigned char *__b) {
3728 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3731 static __inline__ vector bool char __ATTRS_o_ai
3732 vec_ldl(int __a, const vector bool char *__b) {
3733 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3736 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3737 const vector short *__b) {
3738 return (vector short)__builtin_altivec_lvxl(__a, __b);
3741 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3742 return (vector short)__builtin_altivec_lvxl(__a, __b);
3745 static __inline__ vector unsigned short __ATTRS_o_ai
3746 vec_ldl(int __a, const vector unsigned short *__b) {
3747 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3750 static __inline__ vector unsigned short __ATTRS_o_ai
3751 vec_ldl(int __a, const unsigned short *__b) {
3752 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3755 static __inline__ vector bool short __ATTRS_o_ai
3756 vec_ldl(int __a, const vector bool short *__b) {
3757 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3760 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3761 const vector pixel *__b) {
3762 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3765 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3766 const vector int *__b) {
3767 return (vector int)__builtin_altivec_lvxl(__a, __b);
3770 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3771 return (vector int)__builtin_altivec_lvxl(__a, __b);
3774 static __inline__ vector unsigned int __ATTRS_o_ai
3775 vec_ldl(int __a, const vector unsigned int *__b) {
3776 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3779 static __inline__ vector unsigned int __ATTRS_o_ai
3780 vec_ldl(int __a, const unsigned int *__b) {
3781 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3784 static __inline__ vector bool int __ATTRS_o_ai
3785 vec_ldl(int __a, const vector bool int *__b) {
3786 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3789 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3790 const vector float *__b) {
3791 return (vector float)__builtin_altivec_lvxl(__a, __b);
3794 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3795 return (vector float)__builtin_altivec_lvxl(__a, __b);
3800 static __inline__ vector signed char __ATTRS_o_ai
3801 vec_lvxl(int __a, const vector signed char *__b) {
3802 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3805 static __inline__ vector signed char __ATTRS_o_ai
3806 vec_lvxl(int __a, const signed char *__b) {
3807 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3810 static __inline__ vector unsigned char __ATTRS_o_ai
3811 vec_lvxl(int __a, const vector unsigned char *__b) {
3812 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3815 static __inline__ vector unsigned char __ATTRS_o_ai
3816 vec_lvxl(int __a, const unsigned char *__b) {
3817 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3820 static __inline__ vector bool char __ATTRS_o_ai
3821 vec_lvxl(int __a, const vector bool char *__b) {
3822 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3825 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3826 const vector short *__b) {
3827 return (vector short)__builtin_altivec_lvxl(__a, __b);
3830 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3832 return (vector short)__builtin_altivec_lvxl(__a, __b);
3835 static __inline__ vector unsigned short __ATTRS_o_ai
3836 vec_lvxl(int __a, const vector unsigned short *__b) {
3837 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3840 static __inline__ vector unsigned short __ATTRS_o_ai
3841 vec_lvxl(int __a, const unsigned short *__b) {
3842 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3845 static __inline__ vector bool short __ATTRS_o_ai
3846 vec_lvxl(int __a, const vector bool short *__b) {
3847 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3850 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3851 const vector pixel *__b) {
3852 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3855 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3856 const vector int *__b) {
3857 return (vector int)__builtin_altivec_lvxl(__a, __b);
3860 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3861 return (vector int)__builtin_altivec_lvxl(__a, __b);
3864 static __inline__ vector unsigned int __ATTRS_o_ai
3865 vec_lvxl(int __a, const vector unsigned int *__b) {
3866 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3869 static __inline__ vector unsigned int __ATTRS_o_ai
3870 vec_lvxl(int __a, const unsigned int *__b) {
3871 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3874 static __inline__ vector bool int __ATTRS_o_ai
3875 vec_lvxl(int __a, const vector bool int *__b) {
3876 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3879 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3880 const vector float *__b) {
3881 return (vector float)__builtin_altivec_lvxl(__a, __b);
3884 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3886 return (vector float)__builtin_altivec_lvxl(__a, __b);
3891 static __inline__ vector float __attribute__((__always_inline__))
3892 vec_loge(vector float __a) {
3893 return __builtin_altivec_vlogefp(__a);
3898 static __inline__ vector float __attribute__((__always_inline__))
3899 vec_vlogefp(vector float __a) {
3900 return __builtin_altivec_vlogefp(__a);
3905 #ifdef __LITTLE_ENDIAN__
3906 static __inline__ vector unsigned char __ATTRS_o_ai
3907 __attribute__((__deprecated__("use assignment for unaligned little endian \
3908 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3909 vector unsigned char mask =
3910 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3911 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3912 7, 6, 5, 4, 3, 2, 1, 0};
3913 return vec_perm(mask, mask, reverse);
3916 static __inline__ vector unsigned char __ATTRS_o_ai
3917 vec_lvsl(int __a, const signed char *__b) {
3918 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3922 #ifdef __LITTLE_ENDIAN__
3923 static __inline__ vector unsigned char __ATTRS_o_ai
3924 __attribute__((__deprecated__("use assignment for unaligned little endian \
3925 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3926 vector unsigned char mask =
3927 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3928 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3929 7, 6, 5, 4, 3, 2, 1, 0};
3930 return vec_perm(mask, mask, reverse);
3933 static __inline__ vector unsigned char __ATTRS_o_ai
3934 vec_lvsl(int __a, const unsigned char *__b) {
3935 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3939 #ifdef __LITTLE_ENDIAN__
3940 static __inline__ vector unsigned char __ATTRS_o_ai
3941 __attribute__((__deprecated__("use assignment for unaligned little endian \
3942 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3943 vector unsigned char mask =
3944 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3945 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3946 7, 6, 5, 4, 3, 2, 1, 0};
3947 return vec_perm(mask, mask, reverse);
3950 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3952 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3956 #ifdef __LITTLE_ENDIAN__
3957 static __inline__ vector unsigned char __ATTRS_o_ai
3958 __attribute__((__deprecated__("use assignment for unaligned little endian \
3959 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3960 vector unsigned char mask =
3961 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3962 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3963 7, 6, 5, 4, 3, 2, 1, 0};
3964 return vec_perm(mask, mask, reverse);
3967 static __inline__ vector unsigned char __ATTRS_o_ai
3968 vec_lvsl(int __a, const unsigned short *__b) {
3969 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3973 #ifdef __LITTLE_ENDIAN__
3974 static __inline__ vector unsigned char __ATTRS_o_ai
3975 __attribute__((__deprecated__("use assignment for unaligned little endian \
3976 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3977 vector unsigned char mask =
3978 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3979 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3980 7, 6, 5, 4, 3, 2, 1, 0};
3981 return vec_perm(mask, mask, reverse);
3984 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3986 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3990 #ifdef __LITTLE_ENDIAN__
3991 static __inline__ vector unsigned char __ATTRS_o_ai
3992 __attribute__((__deprecated__("use assignment for unaligned little endian \
3993 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
3994 vector unsigned char mask =
3995 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3996 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3997 7, 6, 5, 4, 3, 2, 1, 0};
3998 return vec_perm(mask, mask, reverse);
4001 static __inline__ vector unsigned char __ATTRS_o_ai
4002 vec_lvsl(int __a, const unsigned int *__b) {
4003 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4007 #ifdef __LITTLE_ENDIAN__
4008 static __inline__ vector unsigned char __ATTRS_o_ai
4009 __attribute__((__deprecated__("use assignment for unaligned little endian \
4010 loads/stores"))) vec_lvsl(int __a, const float *__b) {
4011 vector unsigned char mask =
4012 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4013 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4014 7, 6, 5, 4, 3, 2, 1, 0};
4015 return vec_perm(mask, mask, reverse);
4018 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4020 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4026 #ifdef __LITTLE_ENDIAN__
4027 static __inline__ vector unsigned char __ATTRS_o_ai
4028 __attribute__((__deprecated__("use assignment for unaligned little endian \
4029 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4030 vector unsigned char mask =
4031 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4032 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4033 7, 6, 5, 4, 3, 2, 1, 0};
4034 return vec_perm(mask, mask, reverse);
4037 static __inline__ vector unsigned char __ATTRS_o_ai
4038 vec_lvsr(int __a, const signed char *__b) {
4039 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4043 #ifdef __LITTLE_ENDIAN__
4044 static __inline__ vector unsigned char __ATTRS_o_ai
4045 __attribute__((__deprecated__("use assignment for unaligned little endian \
4046 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4047 vector unsigned char mask =
4048 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4049 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4050 7, 6, 5, 4, 3, 2, 1, 0};
4051 return vec_perm(mask, mask, reverse);
4054 static __inline__ vector unsigned char __ATTRS_o_ai
4055 vec_lvsr(int __a, const unsigned char *__b) {
4056 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4060 #ifdef __LITTLE_ENDIAN__
4061 static __inline__ vector unsigned char __ATTRS_o_ai
4062 __attribute__((__deprecated__("use assignment for unaligned little endian \
4063 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4064 vector unsigned char mask =
4065 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4066 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4067 7, 6, 5, 4, 3, 2, 1, 0};
4068 return vec_perm(mask, mask, reverse);
4071 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4073 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4077 #ifdef __LITTLE_ENDIAN__
4078 static __inline__ vector unsigned char __ATTRS_o_ai
4079 __attribute__((__deprecated__("use assignment for unaligned little endian \
4080 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4081 vector unsigned char mask =
4082 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4083 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4084 7, 6, 5, 4, 3, 2, 1, 0};
4085 return vec_perm(mask, mask, reverse);
4088 static __inline__ vector unsigned char __ATTRS_o_ai
4089 vec_lvsr(int __a, const unsigned short *__b) {
4090 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4094 #ifdef __LITTLE_ENDIAN__
4095 static __inline__ vector unsigned char __ATTRS_o_ai
4096 __attribute__((__deprecated__("use assignment for unaligned little endian \
4097 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4098 vector unsigned char mask =
4099 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4100 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4101 7, 6, 5, 4, 3, 2, 1, 0};
4102 return vec_perm(mask, mask, reverse);
4105 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4107 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4111 #ifdef __LITTLE_ENDIAN__
4112 static __inline__ vector unsigned char __ATTRS_o_ai
4113 __attribute__((__deprecated__("use assignment for unaligned little endian \
4114 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4115 vector unsigned char mask =
4116 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4117 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4118 7, 6, 5, 4, 3, 2, 1, 0};
4119 return vec_perm(mask, mask, reverse);
4122 static __inline__ vector unsigned char __ATTRS_o_ai
4123 vec_lvsr(int __a, const unsigned int *__b) {
4124 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4128 #ifdef __LITTLE_ENDIAN__
4129 static __inline__ vector unsigned char __ATTRS_o_ai
4130 __attribute__((__deprecated__("use assignment for unaligned little endian \
4131 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4132 vector unsigned char mask =
4133 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4134 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4135 7, 6, 5, 4, 3, 2, 1, 0};
4136 return vec_perm(mask, mask, reverse);
4139 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4141 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4146 static __inline__ vector signed short __ATTRS_o_ai
4147 vec_mladd(vector signed short, vector signed short, vector signed short);
4148 static __inline__ vector signed short __ATTRS_o_ai
4149 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4150 static __inline__ vector signed short __ATTRS_o_ai
4151 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4152 static __inline__ vector unsigned short __ATTRS_o_ai
4153 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4155 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4156 vector signed short __a, vector signed short __b, vector signed short __c) {
4157 return vec_mladd(__a, __b, __c);
4160 static __inline__ vector signed short __ATTRS_o_ai
4161 vec_madd(vector signed short __a, vector unsigned short __b,
4162 vector unsigned short __c) {
4163 return vec_mladd(__a, __b, __c);
4166 static __inline__ vector signed short __ATTRS_o_ai
4167 vec_madd(vector unsigned short __a, vector signed short __b,
4168 vector signed short __c) {
4169 return vec_mladd(__a, __b, __c);
4172 static __inline__ vector unsigned short __ATTRS_o_ai
4173 vec_madd(vector unsigned short __a, vector unsigned short __b,
4174 vector unsigned short __c) {
4175 return vec_mladd(__a, __b, __c);
4178 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4182 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4184 return __builtin_altivec_vmaddfp(__a, __b, __c);
4189 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4191 vector double __c) {
4192 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4198 static __inline__ vector float __attribute__((__always_inline__))
4199 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4200 return __builtin_altivec_vmaddfp(__a, __b, __c);
4205 static __inline__ vector signed short __attribute__((__always_inline__))
4206 vec_madds(vector signed short __a, vector signed short __b,
4207 vector signed short __c) {
4208 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4212 static __inline__ vector signed short __attribute__((__always_inline__))
4213 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4214 vector signed short __c) {
4215 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4221 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4224 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4227 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4229 vector double __c) {
4230 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4236 static __inline__ vector signed char __ATTRS_o_ai
4237 vec_max(vector signed char __a, vector signed char __b) {
4238 return __builtin_altivec_vmaxsb(__a, __b);
4241 static __inline__ vector signed char __ATTRS_o_ai
4242 vec_max(vector bool char __a, vector signed char __b) {
4243 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4246 static __inline__ vector signed char __ATTRS_o_ai
4247 vec_max(vector signed char __a, vector bool char __b) {
4248 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4251 static __inline__ vector unsigned char __ATTRS_o_ai
4252 vec_max(vector unsigned char __a, vector unsigned char __b) {
4253 return __builtin_altivec_vmaxub(__a, __b);
4256 static __inline__ vector unsigned char __ATTRS_o_ai
4257 vec_max(vector bool char __a, vector unsigned char __b) {
4258 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4261 static __inline__ vector unsigned char __ATTRS_o_ai
4262 vec_max(vector unsigned char __a, vector bool char __b) {
4263 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4266 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4268 return __builtin_altivec_vmaxsh(__a, __b);
4271 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4273 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4276 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4277 vector bool short __b) {
4278 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4281 static __inline__ vector unsigned short __ATTRS_o_ai
4282 vec_max(vector unsigned short __a, vector unsigned short __b) {
4283 return __builtin_altivec_vmaxuh(__a, __b);
4286 static __inline__ vector unsigned short __ATTRS_o_ai
4287 vec_max(vector bool short __a, vector unsigned short __b) {
4288 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4291 static __inline__ vector unsigned short __ATTRS_o_ai
4292 vec_max(vector unsigned short __a, vector bool short __b) {
4293 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4296 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4298 return __builtin_altivec_vmaxsw(__a, __b);
4301 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4303 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4306 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4307 vector bool int __b) {
4308 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4311 static __inline__ vector unsigned int __ATTRS_o_ai
4312 vec_max(vector unsigned int __a, vector unsigned int __b) {
4313 return __builtin_altivec_vmaxuw(__a, __b);
4316 static __inline__ vector unsigned int __ATTRS_o_ai
4317 vec_max(vector bool int __a, vector unsigned int __b) {
4318 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4321 static __inline__ vector unsigned int __ATTRS_o_ai
4322 vec_max(vector unsigned int __a, vector bool int __b) {
4323 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4326 #ifdef __POWER8_VECTOR__
4327 static __inline__ vector signed long long __ATTRS_o_ai
4328 vec_max(vector signed long long __a, vector signed long long __b) {
4329 return __builtin_altivec_vmaxsd(__a, __b);
4332 static __inline__ vector signed long long __ATTRS_o_ai
4333 vec_max(vector bool long long __a, vector signed long long __b) {
4334 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4337 static __inline__ vector signed long long __ATTRS_o_ai
4338 vec_max(vector signed long long __a, vector bool long long __b) {
4339 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4342 static __inline__ vector unsigned long long __ATTRS_o_ai
4343 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4344 return __builtin_altivec_vmaxud(__a, __b);
4347 static __inline__ vector unsigned long long __ATTRS_o_ai
4348 vec_max(vector bool long long __a, vector unsigned long long __b) {
4349 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4352 static __inline__ vector unsigned long long __ATTRS_o_ai
4353 vec_max(vector unsigned long long __a, vector bool long long __b) {
4354 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4358 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4361 return __builtin_vsx_xvmaxsp(__a, __b);
4363 return __builtin_altivec_vmaxfp(__a, __b);
4368 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4369 vector double __b) {
4370 return __builtin_vsx_xvmaxdp(__a, __b);
4376 static __inline__ vector signed char __ATTRS_o_ai
4377 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4378 return __builtin_altivec_vmaxsb(__a, __b);
4381 static __inline__ vector signed char __ATTRS_o_ai
4382 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4383 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4386 static __inline__ vector signed char __ATTRS_o_ai
4387 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4388 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4393 static __inline__ vector unsigned char __ATTRS_o_ai
4394 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4395 return __builtin_altivec_vmaxub(__a, __b);
4398 static __inline__ vector unsigned char __ATTRS_o_ai
4399 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4400 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4403 static __inline__ vector unsigned char __ATTRS_o_ai
4404 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4405 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4410 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4412 return __builtin_altivec_vmaxsh(__a, __b);
4415 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4417 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4420 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4421 vector bool short __b) {
4422 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4427 static __inline__ vector unsigned short __ATTRS_o_ai
4428 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4429 return __builtin_altivec_vmaxuh(__a, __b);
4432 static __inline__ vector unsigned short __ATTRS_o_ai
4433 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4434 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4437 static __inline__ vector unsigned short __ATTRS_o_ai
4438 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4439 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4444 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4446 return __builtin_altivec_vmaxsw(__a, __b);
4449 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4451 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4454 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4455 vector bool int __b) {
4456 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4461 static __inline__ vector unsigned int __ATTRS_o_ai
4462 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4463 return __builtin_altivec_vmaxuw(__a, __b);
4466 static __inline__ vector unsigned int __ATTRS_o_ai
4467 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4468 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4471 static __inline__ vector unsigned int __ATTRS_o_ai
4472 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4473 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4478 static __inline__ vector float __attribute__((__always_inline__))
4479 vec_vmaxfp(vector float __a, vector float __b) {
4481 return __builtin_vsx_xvmaxsp(__a, __b);
4483 return __builtin_altivec_vmaxfp(__a, __b);
4489 static __inline__ vector signed char __ATTRS_o_ai
4490 vec_mergeh(vector signed char __a, vector signed char __b) {
4491 return vec_perm(__a, __b,
4492 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4493 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4494 0x06, 0x16, 0x07, 0x17));
4497 static __inline__ vector unsigned char __ATTRS_o_ai
4498 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4499 return vec_perm(__a, __b,
4500 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4501 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4502 0x06, 0x16, 0x07, 0x17));
4505 static __inline__ vector bool char __ATTRS_o_ai
4506 vec_mergeh(vector bool char __a, vector bool char __b) {
4507 return vec_perm(__a, __b,
4508 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4509 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4510 0x06, 0x16, 0x07, 0x17));
4513 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4515 return vec_perm(__a, __b,
4516 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4517 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4518 0x06, 0x07, 0x16, 0x17));
4521 static __inline__ vector unsigned short __ATTRS_o_ai
4522 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4523 return vec_perm(__a, __b,
4524 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4525 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4526 0x06, 0x07, 0x16, 0x17));
4529 static __inline__ vector bool short __ATTRS_o_ai
4530 vec_mergeh(vector bool short __a, vector bool short __b) {
4531 return vec_perm(__a, __b,
4532 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4533 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4534 0x06, 0x07, 0x16, 0x17));
4537 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4539 return vec_perm(__a, __b,
4540 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4541 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4542 0x06, 0x07, 0x16, 0x17));
4545 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4547 return vec_perm(__a, __b,
4548 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4549 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4550 0x14, 0x15, 0x16, 0x17));
4553 static __inline__ vector unsigned int __ATTRS_o_ai
4554 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4555 return vec_perm(__a, __b,
4556 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4557 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4558 0x14, 0x15, 0x16, 0x17));
4561 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4562 vector bool int __b) {
4563 return vec_perm(__a, __b,
4564 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4565 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4566 0x14, 0x15, 0x16, 0x17));
4569 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4571 return vec_perm(__a, __b,
4572 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4573 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4574 0x14, 0x15, 0x16, 0x17));
4578 static __inline__ vector signed long long __ATTRS_o_ai
4579 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4580 return vec_perm(__a, __b,
4581 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4582 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4583 0x14, 0x15, 0x16, 0x17));
4586 static __inline__ vector signed long long __ATTRS_o_ai
4587 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4588 return vec_perm(__a, (vector signed long long)__b,
4589 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4590 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4591 0x14, 0x15, 0x16, 0x17));
4594 static __inline__ vector signed long long __ATTRS_o_ai
4595 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4596 return vec_perm((vector signed long long)__a, __b,
4597 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4598 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4599 0x14, 0x15, 0x16, 0x17));
4602 static __inline__ vector unsigned long long __ATTRS_o_ai
4603 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4604 return vec_perm(__a, __b,
4605 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4606 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4607 0x14, 0x15, 0x16, 0x17));
4610 static __inline__ vector unsigned long long __ATTRS_o_ai
4611 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4612 return vec_perm(__a, (vector unsigned long long)__b,
4613 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4614 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4615 0x14, 0x15, 0x16, 0x17));
4618 static __inline__ vector unsigned long long __ATTRS_o_ai
4619 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4620 return vec_perm((vector unsigned long long)__a, __b,
4621 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4622 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4623 0x14, 0x15, 0x16, 0x17));
4626 static __inline__ vector bool long long __ATTRS_o_ai
4627 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4628 return vec_perm(__a, __b,
4629 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4630 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4631 0x14, 0x15, 0x16, 0x17));
4634 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4635 vector double __b) {
4636 return vec_perm(__a, __b,
4637 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4638 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4639 0x14, 0x15, 0x16, 0x17));
4641 static __inline__ vector double __ATTRS_o_ai
4642 vec_mergeh(vector double __a, vector bool long long __b) {
4643 return vec_perm(__a, (vector double)__b,
4644 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4645 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4646 0x14, 0x15, 0x16, 0x17));
4648 static __inline__ vector double __ATTRS_o_ai
4649 vec_mergeh(vector bool long long __a, vector double __b) {
4650 return vec_perm((vector double)__a, __b,
4651 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4652 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4653 0x14, 0x15, 0x16, 0x17));
4659 #define __builtin_altivec_vmrghb vec_vmrghb
4661 static __inline__ vector signed char __ATTRS_o_ai
4662 vec_vmrghb(vector signed char __a, vector signed char __b) {
4663 return vec_perm(__a, __b,
4664 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4665 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4666 0x06, 0x16, 0x07, 0x17));
4669 static __inline__ vector unsigned char __ATTRS_o_ai
4670 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4671 return vec_perm(__a, __b,
4672 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4673 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4674 0x06, 0x16, 0x07, 0x17));
4677 static __inline__ vector bool char __ATTRS_o_ai
4678 vec_vmrghb(vector bool char __a, vector bool char __b) {
4679 return vec_perm(__a, __b,
4680 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4681 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4682 0x06, 0x16, 0x07, 0x17));
4687 #define __builtin_altivec_vmrghh vec_vmrghh
4689 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4691 return vec_perm(__a, __b,
4692 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4693 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4694 0x06, 0x07, 0x16, 0x17));
4697 static __inline__ vector unsigned short __ATTRS_o_ai
4698 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4699 return vec_perm(__a, __b,
4700 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4701 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4702 0x06, 0x07, 0x16, 0x17));
4705 static __inline__ vector bool short __ATTRS_o_ai
4706 vec_vmrghh(vector bool short __a, vector bool short __b) {
4707 return vec_perm(__a, __b,
4708 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4709 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4710 0x06, 0x07, 0x16, 0x17));
4713 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4715 return vec_perm(__a, __b,
4716 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4717 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4718 0x06, 0x07, 0x16, 0x17));
4723 #define __builtin_altivec_vmrghw vec_vmrghw
4725 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4727 return vec_perm(__a, __b,
4728 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4729 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4730 0x14, 0x15, 0x16, 0x17));
4733 static __inline__ vector unsigned int __ATTRS_o_ai
4734 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4735 return vec_perm(__a, __b,
4736 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4737 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4738 0x14, 0x15, 0x16, 0x17));
4741 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4742 vector bool int __b) {
4743 return vec_perm(__a, __b,
4744 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4745 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4746 0x14, 0x15, 0x16, 0x17));
4749 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4751 return vec_perm(__a, __b,
4752 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4753 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4754 0x14, 0x15, 0x16, 0x17));
4759 static __inline__ vector signed char __ATTRS_o_ai
4760 vec_mergel(vector signed char __a, vector signed char __b) {
4761 return vec_perm(__a, __b,
4762 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4763 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4764 0x0E, 0x1E, 0x0F, 0x1F));
4767 static __inline__ vector unsigned char __ATTRS_o_ai
4768 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4769 return vec_perm(__a, __b,
4770 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4771 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4772 0x0E, 0x1E, 0x0F, 0x1F));
4775 static __inline__ vector bool char __ATTRS_o_ai
4776 vec_mergel(vector bool char __a, vector bool char __b) {
4777 return vec_perm(__a, __b,
4778 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4779 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4780 0x0E, 0x1E, 0x0F, 0x1F));
4783 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4785 return vec_perm(__a, __b,
4786 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4787 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4788 0x0E, 0x0F, 0x1E, 0x1F));
4791 static __inline__ vector unsigned short __ATTRS_o_ai
4792 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4793 return vec_perm(__a, __b,
4794 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4795 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4796 0x0E, 0x0F, 0x1E, 0x1F));
4799 static __inline__ vector bool short __ATTRS_o_ai
4800 vec_mergel(vector bool short __a, vector bool short __b) {
4801 return vec_perm(__a, __b,
4802 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4803 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4804 0x0E, 0x0F, 0x1E, 0x1F));
4807 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4809 return vec_perm(__a, __b,
4810 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4811 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4812 0x0E, 0x0F, 0x1E, 0x1F));
4815 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4817 return vec_perm(__a, __b,
4818 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4819 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4820 0x1C, 0x1D, 0x1E, 0x1F));
4823 static __inline__ vector unsigned int __ATTRS_o_ai
4824 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4825 return vec_perm(__a, __b,
4826 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4827 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4828 0x1C, 0x1D, 0x1E, 0x1F));
4831 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4832 vector bool int __b) {
4833 return vec_perm(__a, __b,
4834 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4835 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4836 0x1C, 0x1D, 0x1E, 0x1F));
4839 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4841 return vec_perm(__a, __b,
4842 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4843 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4844 0x1C, 0x1D, 0x1E, 0x1F));
4848 static __inline__ vector signed long long __ATTRS_o_ai
4849 vec_mergel(vector signed long long __a, vector signed long long __b) {
4850 return vec_perm(__a, __b,
4851 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4852 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4853 0x1C, 0x1D, 0x1E, 0x1F));
4855 static __inline__ vector signed long long __ATTRS_o_ai
4856 vec_mergel(vector signed long long __a, vector bool long long __b) {
4857 return vec_perm(__a, (vector signed long long)__b,
4858 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4859 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4860 0x1C, 0x1D, 0x1E, 0x1F));
4862 static __inline__ vector signed long long __ATTRS_o_ai
4863 vec_mergel(vector bool long long __a, vector signed long long __b) {
4864 return vec_perm((vector signed long long)__a, __b,
4865 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4866 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4867 0x1C, 0x1D, 0x1E, 0x1F));
4869 static __inline__ vector unsigned long long __ATTRS_o_ai
4870 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4871 return vec_perm(__a, __b,
4872 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4873 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4874 0x1C, 0x1D, 0x1E, 0x1F));
4876 static __inline__ vector unsigned long long __ATTRS_o_ai
4877 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4878 return vec_perm(__a, (vector unsigned long long)__b,
4879 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4880 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4881 0x1C, 0x1D, 0x1E, 0x1F));
4883 static __inline__ vector unsigned long long __ATTRS_o_ai
4884 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4885 return vec_perm((vector unsigned long long)__a, __b,
4886 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4887 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4888 0x1C, 0x1D, 0x1E, 0x1F));
4890 static __inline__ vector bool long long __ATTRS_o_ai
4891 vec_mergel(vector bool long long __a, vector bool long long __b) {
4892 return vec_perm(__a, __b,
4893 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4894 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4895 0x1C, 0x1D, 0x1E, 0x1F));
4897 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4898 vector double __b) {
4899 return vec_perm(__a, __b,
4900 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4901 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4902 0x1C, 0x1D, 0x1E, 0x1F));
4904 static __inline__ vector double __ATTRS_o_ai
4905 vec_mergel(vector double __a, vector bool long long __b) {
4906 return vec_perm(__a, (vector double)__b,
4907 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4908 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4909 0x1C, 0x1D, 0x1E, 0x1F));
4911 static __inline__ vector double __ATTRS_o_ai
4912 vec_mergel(vector bool long long __a, vector double __b) {
4913 return vec_perm((vector double)__a, __b,
4914 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4915 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4916 0x1C, 0x1D, 0x1E, 0x1F));
4922 #define __builtin_altivec_vmrglb vec_vmrglb
4924 static __inline__ vector signed char __ATTRS_o_ai
4925 vec_vmrglb(vector signed char __a, vector signed char __b) {
4926 return vec_perm(__a, __b,
4927 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4928 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4929 0x0E, 0x1E, 0x0F, 0x1F));
4932 static __inline__ vector unsigned char __ATTRS_o_ai
4933 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4934 return vec_perm(__a, __b,
4935 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4936 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4937 0x0E, 0x1E, 0x0F, 0x1F));
4940 static __inline__ vector bool char __ATTRS_o_ai
4941 vec_vmrglb(vector bool char __a, vector bool char __b) {
4942 return vec_perm(__a, __b,
4943 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4944 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4945 0x0E, 0x1E, 0x0F, 0x1F));
4950 #define __builtin_altivec_vmrglh vec_vmrglh
4952 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4954 return vec_perm(__a, __b,
4955 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4956 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4957 0x0E, 0x0F, 0x1E, 0x1F));
4960 static __inline__ vector unsigned short __ATTRS_o_ai
4961 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4962 return vec_perm(__a, __b,
4963 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4964 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4965 0x0E, 0x0F, 0x1E, 0x1F));
4968 static __inline__ vector bool short __ATTRS_o_ai
4969 vec_vmrglh(vector bool short __a, vector bool short __b) {
4970 return vec_perm(__a, __b,
4971 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4972 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4973 0x0E, 0x0F, 0x1E, 0x1F));
4976 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4978 return vec_perm(__a, __b,
4979 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4980 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4981 0x0E, 0x0F, 0x1E, 0x1F));
4986 #define __builtin_altivec_vmrglw vec_vmrglw
4988 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4990 return vec_perm(__a, __b,
4991 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4992 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4993 0x1C, 0x1D, 0x1E, 0x1F));
4996 static __inline__ vector unsigned int __ATTRS_o_ai
4997 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
4998 return vec_perm(__a, __b,
4999 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5000 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5001 0x1C, 0x1D, 0x1E, 0x1F));
5004 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5005 vector bool int __b) {
5006 return vec_perm(__a, __b,
5007 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5008 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5009 0x1C, 0x1D, 0x1E, 0x1F));
5012 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5014 return vec_perm(__a, __b,
5015 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5016 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5017 0x1C, 0x1D, 0x1E, 0x1F));
5020 #ifdef __POWER8_VECTOR__
5023 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5024 vector bool int __b) {
5025 return vec_perm(__a, __b,
5026 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5027 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5028 0x18, 0x19, 0x1A, 0x1B));
5031 static __inline__ vector signed int __ATTRS_o_ai
5032 vec_mergee(vector signed int __a, vector signed int __b) {
5033 return vec_perm(__a, __b,
5034 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5035 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5036 0x18, 0x19, 0x1A, 0x1B));
5039 static __inline__ vector unsigned int __ATTRS_o_ai
5040 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5041 return vec_perm(__a, __b,
5042 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5043 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5044 0x18, 0x19, 0x1A, 0x1B));
5047 static __inline__ vector bool long long __ATTRS_o_ai
5048 vec_mergee(vector bool long long __a, vector bool long long __b) {
5049 return vec_mergeh(__a, __b);
5052 static __inline__ vector signed long long __ATTRS_o_ai
5053 vec_mergee(vector signed long long __a, vector signed long long __b) {
5054 return vec_mergeh(__a, __b);
5057 static __inline__ vector unsigned long long __ATTRS_o_ai
5058 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5059 return vec_mergeh(__a, __b);
5062 static __inline__ vector float __ATTRS_o_ai
5063 vec_mergee(vector float __a, vector float __b) {
5064 return vec_perm(__a, __b,
5065 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5066 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5067 0x18, 0x19, 0x1A, 0x1B));
5070 static __inline__ vector double __ATTRS_o_ai
5071 vec_mergee(vector double __a, vector double __b) {
5072 return vec_mergeh(__a, __b);
5077 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5078 vector bool int __b) {
5079 return vec_perm(__a, __b,
5080 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5081 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5082 0x1C, 0x1D, 0x1E, 0x1F));
5085 static __inline__ vector signed int __ATTRS_o_ai
5086 vec_mergeo(vector signed int __a, vector signed int __b) {
5087 return vec_perm(__a, __b,
5088 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5089 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5090 0x1C, 0x1D, 0x1E, 0x1F));
5093 static __inline__ vector unsigned int __ATTRS_o_ai
5094 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5095 return vec_perm(__a, __b,
5096 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5097 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5098 0x1C, 0x1D, 0x1E, 0x1F));
5101 static __inline__ vector bool long long __ATTRS_o_ai
5102 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5103 return vec_mergel(__a, __b);
5106 static __inline__ vector signed long long __ATTRS_o_ai
5107 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5108 return vec_mergel(__a, __b);
5111 static __inline__ vector unsigned long long __ATTRS_o_ai
5112 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5113 return vec_mergel(__a, __b);
5116 static __inline__ vector float __ATTRS_o_ai
5117 vec_mergeo(vector float __a, vector float __b) {
5118 return vec_perm(__a, __b,
5119 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5120 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5121 0x1C, 0x1D, 0x1E, 0x1F));
5124 static __inline__ vector double __ATTRS_o_ai
5125 vec_mergeo(vector double __a, vector double __b) {
5126 return vec_mergel(__a, __b);
5133 static __inline__ vector unsigned short __attribute__((__always_inline__))
5135 return __builtin_altivec_mfvscr();
5140 static __inline__ vector signed char __ATTRS_o_ai
5141 vec_min(vector signed char __a, vector signed char __b) {
5142 return __builtin_altivec_vminsb(__a, __b);
5145 static __inline__ vector signed char __ATTRS_o_ai
5146 vec_min(vector bool char __a, vector signed char __b) {
5147 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5150 static __inline__ vector signed char __ATTRS_o_ai
5151 vec_min(vector signed char __a, vector bool char __b) {
5152 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5155 static __inline__ vector unsigned char __ATTRS_o_ai
5156 vec_min(vector unsigned char __a, vector unsigned char __b) {
5157 return __builtin_altivec_vminub(__a, __b);
5160 static __inline__ vector unsigned char __ATTRS_o_ai
5161 vec_min(vector bool char __a, vector unsigned char __b) {
5162 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5165 static __inline__ vector unsigned char __ATTRS_o_ai
5166 vec_min(vector unsigned char __a, vector bool char __b) {
5167 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5170 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5172 return __builtin_altivec_vminsh(__a, __b);
5175 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5177 return __builtin_altivec_vminsh((vector short)__a, __b);
5180 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5181 vector bool short __b) {
5182 return __builtin_altivec_vminsh(__a, (vector short)__b);
5185 static __inline__ vector unsigned short __ATTRS_o_ai
5186 vec_min(vector unsigned short __a, vector unsigned short __b) {
5187 return __builtin_altivec_vminuh(__a, __b);
5190 static __inline__ vector unsigned short __ATTRS_o_ai
5191 vec_min(vector bool short __a, vector unsigned short __b) {
5192 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5195 static __inline__ vector unsigned short __ATTRS_o_ai
5196 vec_min(vector unsigned short __a, vector bool short __b) {
5197 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5200 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5202 return __builtin_altivec_vminsw(__a, __b);
5205 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5207 return __builtin_altivec_vminsw((vector int)__a, __b);
5210 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5211 vector bool int __b) {
5212 return __builtin_altivec_vminsw(__a, (vector int)__b);
5215 static __inline__ vector unsigned int __ATTRS_o_ai
5216 vec_min(vector unsigned int __a, vector unsigned int __b) {
5217 return __builtin_altivec_vminuw(__a, __b);
5220 static __inline__ vector unsigned int __ATTRS_o_ai
5221 vec_min(vector bool int __a, vector unsigned int __b) {
5222 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5225 static __inline__ vector unsigned int __ATTRS_o_ai
5226 vec_min(vector unsigned int __a, vector bool int __b) {
5227 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5230 #ifdef __POWER8_VECTOR__
5231 static __inline__ vector signed long long __ATTRS_o_ai
5232 vec_min(vector signed long long __a, vector signed long long __b) {
5233 return __builtin_altivec_vminsd(__a, __b);
5236 static __inline__ vector signed long long __ATTRS_o_ai
5237 vec_min(vector bool long long __a, vector signed long long __b) {
5238 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5241 static __inline__ vector signed long long __ATTRS_o_ai
5242 vec_min(vector signed long long __a, vector bool long long __b) {
5243 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5246 static __inline__ vector unsigned long long __ATTRS_o_ai
5247 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5248 return __builtin_altivec_vminud(__a, __b);
5251 static __inline__ vector unsigned long long __ATTRS_o_ai
5252 vec_min(vector bool long long __a, vector unsigned long long __b) {
5253 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5256 static __inline__ vector unsigned long long __ATTRS_o_ai
5257 vec_min(vector unsigned long long __a, vector bool long long __b) {
5258 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5262 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5265 return __builtin_vsx_xvminsp(__a, __b);
5267 return __builtin_altivec_vminfp(__a, __b);
5272 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5273 vector double __b) {
5274 return __builtin_vsx_xvmindp(__a, __b);
5280 static __inline__ vector signed char __ATTRS_o_ai
5281 vec_vminsb(vector signed char __a, vector signed char __b) {
5282 return __builtin_altivec_vminsb(__a, __b);
5285 static __inline__ vector signed char __ATTRS_o_ai
5286 vec_vminsb(vector bool char __a, vector signed char __b) {
5287 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5290 static __inline__ vector signed char __ATTRS_o_ai
5291 vec_vminsb(vector signed char __a, vector bool char __b) {
5292 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5297 static __inline__ vector unsigned char __ATTRS_o_ai
5298 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5299 return __builtin_altivec_vminub(__a, __b);
5302 static __inline__ vector unsigned char __ATTRS_o_ai
5303 vec_vminub(vector bool char __a, vector unsigned char __b) {
5304 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5307 static __inline__ vector unsigned char __ATTRS_o_ai
5308 vec_vminub(vector unsigned char __a, vector bool char __b) {
5309 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5314 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5316 return __builtin_altivec_vminsh(__a, __b);
5319 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5321 return __builtin_altivec_vminsh((vector short)__a, __b);
5324 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5325 vector bool short __b) {
5326 return __builtin_altivec_vminsh(__a, (vector short)__b);
5331 static __inline__ vector unsigned short __ATTRS_o_ai
5332 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5333 return __builtin_altivec_vminuh(__a, __b);
5336 static __inline__ vector unsigned short __ATTRS_o_ai
5337 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5338 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5341 static __inline__ vector unsigned short __ATTRS_o_ai
5342 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5343 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5348 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5350 return __builtin_altivec_vminsw(__a, __b);
5353 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5355 return __builtin_altivec_vminsw((vector int)__a, __b);
5358 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5359 vector bool int __b) {
5360 return __builtin_altivec_vminsw(__a, (vector int)__b);
5365 static __inline__ vector unsigned int __ATTRS_o_ai
5366 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5367 return __builtin_altivec_vminuw(__a, __b);
5370 static __inline__ vector unsigned int __ATTRS_o_ai
5371 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5372 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5375 static __inline__ vector unsigned int __ATTRS_o_ai
5376 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5377 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5382 static __inline__ vector float __attribute__((__always_inline__))
5383 vec_vminfp(vector float __a, vector float __b) {
5385 return __builtin_vsx_xvminsp(__a, __b);
5387 return __builtin_altivec_vminfp(__a, __b);
5393 #define __builtin_altivec_vmladduhm vec_mladd
5395 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5398 return __a * __b + __c;
5401 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5402 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5403 return __a * (vector short)__b + (vector short)__c;
5406 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5409 return (vector short)__a * __b + __c;
5412 static __inline__ vector unsigned short __ATTRS_o_ai
5413 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5414 vector unsigned short __c) {
5415 return __a * __b + __c;
5420 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5423 return __a * __b + __c;
5426 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5427 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5428 return __a * (vector short)__b + (vector short)__c;
5431 static __inline__ vector short __ATTRS_o_ai
5432 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5433 return (vector short)__a * __b + __c;
5436 static __inline__ vector unsigned short __ATTRS_o_ai
5437 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5438 vector unsigned short __c) {
5439 return __a * __b + __c;
5444 static __inline__ vector short __attribute__((__always_inline__))
5445 vec_mradds(vector short __a, vector short __b, vector short __c) {
5446 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5449 /* vec_vmhraddshs */
5451 static __inline__ vector short __attribute__((__always_inline__))
5452 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5453 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5458 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5459 vector unsigned char __b,
5461 return __builtin_altivec_vmsummbm(__a, __b, __c);
5464 static __inline__ vector unsigned int __ATTRS_o_ai
5465 vec_msum(vector unsigned char __a, vector unsigned char __b,
5466 vector unsigned int __c) {
5467 return __builtin_altivec_vmsumubm(__a, __b, __c);
5470 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5473 return __builtin_altivec_vmsumshm(__a, __b, __c);
5476 static __inline__ vector unsigned int __ATTRS_o_ai
5477 vec_msum(vector unsigned short __a, vector unsigned short __b,
5478 vector unsigned int __c) {
5479 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5484 static __inline__ vector int __attribute__((__always_inline__))
5485 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5486 return __builtin_altivec_vmsummbm(__a, __b, __c);
5491 static __inline__ vector unsigned int __attribute__((__always_inline__))
5492 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5493 vector unsigned int __c) {
5494 return __builtin_altivec_vmsumubm(__a, __b, __c);
5499 static __inline__ vector int __attribute__((__always_inline__))
5500 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5501 return __builtin_altivec_vmsumshm(__a, __b, __c);
5506 static __inline__ vector unsigned int __attribute__((__always_inline__))
5507 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5508 vector unsigned int __c) {
5509 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5514 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5517 return __builtin_altivec_vmsumshs(__a, __b, __c);
5520 static __inline__ vector unsigned int __ATTRS_o_ai
5521 vec_msums(vector unsigned short __a, vector unsigned short __b,
5522 vector unsigned int __c) {
5523 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5528 static __inline__ vector int __attribute__((__always_inline__))
5529 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5530 return __builtin_altivec_vmsumshs(__a, __b, __c);
5535 static __inline__ vector unsigned int __attribute__((__always_inline__))
5536 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5537 vector unsigned int __c) {
5538 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5543 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5544 __builtin_altivec_mtvscr((vector int)__a);
5547 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5548 __builtin_altivec_mtvscr((vector int)__a);
5551 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5552 __builtin_altivec_mtvscr((vector int)__a);
5555 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5556 __builtin_altivec_mtvscr((vector int)__a);
5559 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5560 __builtin_altivec_mtvscr((vector int)__a);
5563 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5564 __builtin_altivec_mtvscr((vector int)__a);
5567 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5568 __builtin_altivec_mtvscr((vector int)__a);
5571 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5572 __builtin_altivec_mtvscr((vector int)__a);
5575 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5576 __builtin_altivec_mtvscr((vector int)__a);
5579 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5580 __builtin_altivec_mtvscr((vector int)__a);
5583 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5584 __builtin_altivec_mtvscr((vector int)__a);
5589 /* Integer vector multiplication will involve multiplication of the odd/even
5590 elements separately, then truncating the results and moving to the
5593 static __inline__ vector signed char __ATTRS_o_ai
5594 vec_mul(vector signed char __a, vector signed char __b) {
5598 static __inline__ vector unsigned char __ATTRS_o_ai
5599 vec_mul(vector unsigned char __a, vector unsigned char __b) {
5603 static __inline__ vector signed short __ATTRS_o_ai
5604 vec_mul(vector signed short __a, vector signed short __b) {
5608 static __inline__ vector unsigned short __ATTRS_o_ai
5609 vec_mul(vector unsigned short __a, vector unsigned short __b) {
5613 static __inline__ vector signed int __ATTRS_o_ai
5614 vec_mul(vector signed int __a, vector signed int __b) {
5618 static __inline__ vector unsigned int __ATTRS_o_ai
5619 vec_mul(vector unsigned int __a, vector unsigned int __b) {
5624 static __inline__ vector signed long long __ATTRS_o_ai
5625 vec_mul(vector signed long long __a, vector signed long long __b) {
5629 static __inline__ vector unsigned long long __ATTRS_o_ai
5630 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5635 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5641 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5642 vector double __b) {
5647 /* The vmulos* and vmules* instructions have a big endian bias, so
5648 we must reverse the meaning of "even" and "odd" for little endian. */
5652 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5653 vector signed char __b) {
5654 #ifdef __LITTLE_ENDIAN__
5655 return __builtin_altivec_vmulosb(__a, __b);
5657 return __builtin_altivec_vmulesb(__a, __b);
5661 static __inline__ vector unsigned short __ATTRS_o_ai
5662 vec_mule(vector unsigned char __a, vector unsigned char __b) {
5663 #ifdef __LITTLE_ENDIAN__
5664 return __builtin_altivec_vmuloub(__a, __b);
5666 return __builtin_altivec_vmuleub(__a, __b);
5670 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5672 #ifdef __LITTLE_ENDIAN__
5673 return __builtin_altivec_vmulosh(__a, __b);
5675 return __builtin_altivec_vmulesh(__a, __b);
5679 static __inline__ vector unsigned int __ATTRS_o_ai
5680 vec_mule(vector unsigned short __a, vector unsigned short __b) {
5681 #ifdef __LITTLE_ENDIAN__
5682 return __builtin_altivec_vmulouh(__a, __b);
5684 return __builtin_altivec_vmuleuh(__a, __b);
5688 #ifdef __POWER8_VECTOR__
5689 static __inline__ vector signed long long __ATTRS_o_ai
5690 vec_mule(vector signed int __a, vector signed int __b) {
5691 #ifdef __LITTLE_ENDIAN__
5692 return __builtin_altivec_vmulosw(__a, __b);
5694 return __builtin_altivec_vmulesw(__a, __b);
5698 static __inline__ vector unsigned long long __ATTRS_o_ai
5699 vec_mule(vector unsigned int __a, vector unsigned int __b) {
5700 #ifdef __LITTLE_ENDIAN__
5701 return __builtin_altivec_vmulouw(__a, __b);
5703 return __builtin_altivec_vmuleuw(__a, __b);
5710 static __inline__ vector short __attribute__((__always_inline__))
5711 vec_vmulesb(vector signed char __a, vector signed char __b) {
5712 #ifdef __LITTLE_ENDIAN__
5713 return __builtin_altivec_vmulosb(__a, __b);
5715 return __builtin_altivec_vmulesb(__a, __b);
5721 static __inline__ vector unsigned short __attribute__((__always_inline__))
5722 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5723 #ifdef __LITTLE_ENDIAN__
5724 return __builtin_altivec_vmuloub(__a, __b);
5726 return __builtin_altivec_vmuleub(__a, __b);
5732 static __inline__ vector int __attribute__((__always_inline__))
5733 vec_vmulesh(vector short __a, vector short __b) {
5734 #ifdef __LITTLE_ENDIAN__
5735 return __builtin_altivec_vmulosh(__a, __b);
5737 return __builtin_altivec_vmulesh(__a, __b);
5743 static __inline__ vector unsigned int __attribute__((__always_inline__))
5744 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5745 #ifdef __LITTLE_ENDIAN__
5746 return __builtin_altivec_vmulouh(__a, __b);
5748 return __builtin_altivec_vmuleuh(__a, __b);
5754 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5755 vector signed char __b) {
5756 #ifdef __LITTLE_ENDIAN__
5757 return __builtin_altivec_vmulesb(__a, __b);
5759 return __builtin_altivec_vmulosb(__a, __b);
5763 static __inline__ vector unsigned short __ATTRS_o_ai
5764 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5765 #ifdef __LITTLE_ENDIAN__
5766 return __builtin_altivec_vmuleub(__a, __b);
5768 return __builtin_altivec_vmuloub(__a, __b);
5772 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5774 #ifdef __LITTLE_ENDIAN__
5775 return __builtin_altivec_vmulesh(__a, __b);
5777 return __builtin_altivec_vmulosh(__a, __b);
5781 static __inline__ vector unsigned int __ATTRS_o_ai
5782 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5783 #ifdef __LITTLE_ENDIAN__
5784 return __builtin_altivec_vmuleuh(__a, __b);
5786 return __builtin_altivec_vmulouh(__a, __b);
5790 #ifdef __POWER8_VECTOR__
5791 static __inline__ vector signed long long __ATTRS_o_ai
5792 vec_mulo(vector signed int __a, vector signed int __b) {
5793 #ifdef __LITTLE_ENDIAN__
5794 return __builtin_altivec_vmulesw(__a, __b);
5796 return __builtin_altivec_vmulosw(__a, __b);
5800 static __inline__ vector unsigned long long __ATTRS_o_ai
5801 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5802 #ifdef __LITTLE_ENDIAN__
5803 return __builtin_altivec_vmuleuw(__a, __b);
5805 return __builtin_altivec_vmulouw(__a, __b);
5812 static __inline__ vector short __attribute__((__always_inline__))
5813 vec_vmulosb(vector signed char __a, vector signed char __b) {
5814 #ifdef __LITTLE_ENDIAN__
5815 return __builtin_altivec_vmulesb(__a, __b);
5817 return __builtin_altivec_vmulosb(__a, __b);
5823 static __inline__ vector unsigned short __attribute__((__always_inline__))
5824 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5825 #ifdef __LITTLE_ENDIAN__
5826 return __builtin_altivec_vmuleub(__a, __b);
5828 return __builtin_altivec_vmuloub(__a, __b);
5834 static __inline__ vector int __attribute__((__always_inline__))
5835 vec_vmulosh(vector short __a, vector short __b) {
5836 #ifdef __LITTLE_ENDIAN__
5837 return __builtin_altivec_vmulesh(__a, __b);
5839 return __builtin_altivec_vmulosh(__a, __b);
5845 static __inline__ vector unsigned int __attribute__((__always_inline__))
5846 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5847 #ifdef __LITTLE_ENDIAN__
5848 return __builtin_altivec_vmuleuh(__a, __b);
5850 return __builtin_altivec_vmulouh(__a, __b);
5856 #ifdef __POWER8_VECTOR__
5857 static __inline__ vector signed char __ATTRS_o_ai
5858 vec_nand(vector signed char __a, vector signed char __b) {
5859 return ~(__a & __b);
5862 static __inline__ vector signed char __ATTRS_o_ai
5863 vec_nand(vector signed char __a, vector bool char __b) {
5864 return ~(__a & __b);
5867 static __inline__ vector signed char __ATTRS_o_ai
5868 vec_nand(vector bool char __a, vector signed char __b) {
5869 return ~(__a & __b);
5872 static __inline__ vector unsigned char __ATTRS_o_ai
5873 vec_nand(vector unsigned char __a, vector unsigned char __b) {
5874 return ~(__a & __b);
5877 static __inline__ vector unsigned char __ATTRS_o_ai
5878 vec_nand(vector unsigned char __a, vector bool char __b) {
5879 return ~(__a & __b);
5882 static __inline__ vector unsigned char __ATTRS_o_ai
5883 vec_nand(vector bool char __a, vector unsigned char __b) {
5884 return ~(__a & __b);
5887 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5888 vector bool char __b) {
5889 return ~(__a & __b);
5892 static __inline__ vector signed short __ATTRS_o_ai
5893 vec_nand(vector signed short __a, vector signed short __b) {
5894 return ~(__a & __b);
5897 static __inline__ vector signed short __ATTRS_o_ai
5898 vec_nand(vector signed short __a, vector bool short __b) {
5899 return ~(__a & __b);
5902 static __inline__ vector signed short __ATTRS_o_ai
5903 vec_nand(vector bool short __a, vector signed short __b) {
5904 return ~(__a & __b);
5907 static __inline__ vector unsigned short __ATTRS_o_ai
5908 vec_nand(vector unsigned short __a, vector unsigned short __b) {
5909 return ~(__a & __b);
5912 static __inline__ vector unsigned short __ATTRS_o_ai
5913 vec_nand(vector unsigned short __a, vector bool short __b) {
5914 return ~(__a & __b);
5917 static __inline__ vector bool short __ATTRS_o_ai
5918 vec_nand(vector bool short __a, vector bool short __b) {
5919 return ~(__a & __b);
5922 static __inline__ vector signed int __ATTRS_o_ai
5923 vec_nand(vector signed int __a, vector signed int __b) {
5924 return ~(__a & __b);
5927 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5928 vector bool int __b) {
5929 return ~(__a & __b);
5932 static __inline__ vector signed int __ATTRS_o_ai
5933 vec_nand(vector bool int __a, vector signed int __b) {
5934 return ~(__a & __b);
5937 static __inline__ vector unsigned int __ATTRS_o_ai
5938 vec_nand(vector unsigned int __a, vector unsigned int __b) {
5939 return ~(__a & __b);
5942 static __inline__ vector unsigned int __ATTRS_o_ai
5943 vec_nand(vector unsigned int __a, vector bool int __b) {
5944 return ~(__a & __b);
5947 static __inline__ vector unsigned int __ATTRS_o_ai
5948 vec_nand(vector bool int __a, vector unsigned int __b) {
5949 return ~(__a & __b);
5952 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5953 vector bool int __b) {
5954 return ~(__a & __b);
5957 static __inline__ vector float __ATTRS_o_ai
5958 vec_nand(vector float __a, vector float __b) {
5959 return (vector float)(~((vector unsigned int)__a &
5960 (vector unsigned int)__b));
5963 static __inline__ vector signed long long __ATTRS_o_ai
5964 vec_nand(vector signed long long __a, vector signed long long __b) {
5965 return ~(__a & __b);
5968 static __inline__ vector signed long long __ATTRS_o_ai
5969 vec_nand(vector signed long long __a, vector bool long long __b) {
5970 return ~(__a & __b);
5973 static __inline__ vector signed long long __ATTRS_o_ai
5974 vec_nand(vector bool long long __a, vector signed long long __b) {
5975 return ~(__a & __b);
5978 static __inline__ vector unsigned long long __ATTRS_o_ai
5979 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
5980 return ~(__a & __b);
5983 static __inline__ vector unsigned long long __ATTRS_o_ai
5984 vec_nand(vector unsigned long long __a, vector bool long long __b) {
5985 return ~(__a & __b);
5988 static __inline__ vector unsigned long long __ATTRS_o_ai
5989 vec_nand(vector bool long long __a, vector unsigned long long __b) {
5990 return ~(__a & __b);
5993 static __inline__ vector bool long long __ATTRS_o_ai
5994 vec_nand(vector bool long long __a, vector bool long long __b) {
5995 return ~(__a & __b);
5998 static __inline__ vector double __ATTRS_o_ai
5999 vec_nand(vector double __a, vector double __b) {
6000 return (vector double)(~((vector unsigned long long)__a &
6001 (vector unsigned long long)__b));
6009 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6012 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6015 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6017 vector double __c) {
6018 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6024 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6028 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6030 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6035 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6037 vector double __c) {
6038 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6044 static __inline__ vector float __attribute__((__always_inline__))
6045 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6046 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6051 #define __builtin_altivec_vnor vec_nor
6053 static __inline__ vector signed char __ATTRS_o_ai
6054 vec_nor(vector signed char __a, vector signed char __b) {
6055 return ~(__a | __b);
6058 static __inline__ vector unsigned char __ATTRS_o_ai
6059 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6060 return ~(__a | __b);
6063 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6064 vector bool char __b) {
6065 return ~(__a | __b);
6068 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6070 return ~(__a | __b);
6073 static __inline__ vector unsigned short __ATTRS_o_ai
6074 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6075 return ~(__a | __b);
6078 static __inline__ vector bool short __ATTRS_o_ai
6079 vec_nor(vector bool short __a, vector bool short __b) {
6080 return ~(__a | __b);
6083 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6085 return ~(__a | __b);
6088 static __inline__ vector unsigned int __ATTRS_o_ai
6089 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6090 return ~(__a | __b);
6093 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6094 vector bool int __b) {
6095 return ~(__a | __b);
6098 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6100 vector unsigned int __res =
6101 ~((vector unsigned int)__a | (vector unsigned int)__b);
6102 return (vector float)__res;
6106 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6107 vector double __b) {
6108 vector unsigned long long __res =
6109 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6110 return (vector double)__res;
6116 static __inline__ vector signed char __ATTRS_o_ai
6117 vec_vnor(vector signed char __a, vector signed char __b) {
6118 return ~(__a | __b);
6121 static __inline__ vector unsigned char __ATTRS_o_ai
6122 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6123 return ~(__a | __b);
6126 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6127 vector bool char __b) {
6128 return ~(__a | __b);
6131 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6133 return ~(__a | __b);
6136 static __inline__ vector unsigned short __ATTRS_o_ai
6137 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6138 return ~(__a | __b);
6141 static __inline__ vector bool short __ATTRS_o_ai
6142 vec_vnor(vector bool short __a, vector bool short __b) {
6143 return ~(__a | __b);
6146 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6148 return ~(__a | __b);
6151 static __inline__ vector unsigned int __ATTRS_o_ai
6152 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6153 return ~(__a | __b);
6156 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6157 vector bool int __b) {
6158 return ~(__a | __b);
6161 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6163 vector unsigned int __res =
6164 ~((vector unsigned int)__a | (vector unsigned int)__b);
6165 return (vector float)__res;
6169 static __inline__ vector signed long long __ATTRS_o_ai
6170 vec_nor(vector signed long long __a, vector signed long long __b) {
6171 return ~(__a | __b);
6174 static __inline__ vector unsigned long long __ATTRS_o_ai
6175 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6176 return ~(__a | __b);
6179 static __inline__ vector bool long long __ATTRS_o_ai
6180 vec_nor(vector bool long long __a, vector bool long long __b) {
6181 return ~(__a | __b);
6187 #define __builtin_altivec_vor vec_or
6189 static __inline__ vector signed char __ATTRS_o_ai
6190 vec_or(vector signed char __a, vector signed char __b) {
6194 static __inline__ vector signed char __ATTRS_o_ai
6195 vec_or(vector bool char __a, vector signed char __b) {
6196 return (vector signed char)__a | __b;
6199 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6200 vector bool char __b) {
6201 return __a | (vector signed char)__b;
6204 static __inline__ vector unsigned char __ATTRS_o_ai
6205 vec_or(vector unsigned char __a, vector unsigned char __b) {
6209 static __inline__ vector unsigned char __ATTRS_o_ai
6210 vec_or(vector bool char __a, vector unsigned char __b) {
6211 return (vector unsigned char)__a | __b;
6214 static __inline__ vector unsigned char __ATTRS_o_ai
6215 vec_or(vector unsigned char __a, vector bool char __b) {
6216 return __a | (vector unsigned char)__b;
6219 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6220 vector bool char __b) {
6224 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6229 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6231 return (vector short)__a | __b;
6234 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6235 vector bool short __b) {
6236 return __a | (vector short)__b;
6239 static __inline__ vector unsigned short __ATTRS_o_ai
6240 vec_or(vector unsigned short __a, vector unsigned short __b) {
6244 static __inline__ vector unsigned short __ATTRS_o_ai
6245 vec_or(vector bool short __a, vector unsigned short __b) {
6246 return (vector unsigned short)__a | __b;
6249 static __inline__ vector unsigned short __ATTRS_o_ai
6250 vec_or(vector unsigned short __a, vector bool short __b) {
6251 return __a | (vector unsigned short)__b;
6254 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6255 vector bool short __b) {
6259 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6264 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6266 return (vector int)__a | __b;
6269 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6270 vector bool int __b) {
6271 return __a | (vector int)__b;
6274 static __inline__ vector unsigned int __ATTRS_o_ai
6275 vec_or(vector unsigned int __a, vector unsigned int __b) {
6279 static __inline__ vector unsigned int __ATTRS_o_ai
6280 vec_or(vector bool int __a, vector unsigned int __b) {
6281 return (vector unsigned int)__a | __b;
6284 static __inline__ vector unsigned int __ATTRS_o_ai
6285 vec_or(vector unsigned int __a, vector bool int __b) {
6286 return __a | (vector unsigned int)__b;
6289 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6290 vector bool int __b) {
6294 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6296 vector unsigned int __res =
6297 (vector unsigned int)__a | (vector unsigned int)__b;
6298 return (vector float)__res;
6301 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6303 vector unsigned int __res =
6304 (vector unsigned int)__a | (vector unsigned int)__b;
6305 return (vector float)__res;
6308 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6309 vector bool int __b) {
6310 vector unsigned int __res =
6311 (vector unsigned int)__a | (vector unsigned int)__b;
6312 return (vector float)__res;
6316 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6317 vector double __b) {
6318 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6321 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6322 vector bool long long __b) {
6323 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6326 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6327 vector double __b) {
6328 vector unsigned long long __res =
6329 (vector unsigned long long)__a | (vector unsigned long long)__b;
6330 return (vector double)__res;
6333 static __inline__ vector signed long long __ATTRS_o_ai
6334 vec_or(vector signed long long __a, vector signed long long __b) {
6338 static __inline__ vector signed long long __ATTRS_o_ai
6339 vec_or(vector bool long long __a, vector signed long long __b) {
6340 return (vector signed long long)__a | __b;
6343 static __inline__ vector signed long long __ATTRS_o_ai
6344 vec_or(vector signed long long __a, vector bool long long __b) {
6345 return __a | (vector signed long long)__b;
6348 static __inline__ vector unsigned long long __ATTRS_o_ai
6349 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6353 static __inline__ vector unsigned long long __ATTRS_o_ai
6354 vec_or(vector bool long long __a, vector unsigned long long __b) {
6355 return (vector unsigned long long)__a | __b;
6358 static __inline__ vector unsigned long long __ATTRS_o_ai
6359 vec_or(vector unsigned long long __a, vector bool long long __b) {
6360 return __a | (vector unsigned long long)__b;
6363 static __inline__ vector bool long long __ATTRS_o_ai
6364 vec_or(vector bool long long __a, vector bool long long __b) {
6369 #ifdef __POWER8_VECTOR__
6370 static __inline__ vector signed char __ATTRS_o_ai
6371 vec_orc(vector signed char __a, vector signed char __b) {
6375 static __inline__ vector signed char __ATTRS_o_ai
6376 vec_orc(vector signed char __a, vector bool char __b) {
6380 static __inline__ vector signed char __ATTRS_o_ai
6381 vec_orc(vector bool char __a, vector signed char __b) {
6385 static __inline__ vector unsigned char __ATTRS_o_ai
6386 vec_orc(vector unsigned char __a, vector unsigned char __b) {
6390 static __inline__ vector unsigned char __ATTRS_o_ai
6391 vec_orc(vector unsigned char __a, vector bool char __b) {
6395 static __inline__ vector unsigned char __ATTRS_o_ai
6396 vec_orc(vector bool char __a, vector unsigned char __b) {
6400 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6401 vector bool char __b) {
6405 static __inline__ vector signed short __ATTRS_o_ai
6406 vec_orc(vector signed short __a, vector signed short __b) {
6410 static __inline__ vector signed short __ATTRS_o_ai
6411 vec_orc(vector signed short __a, vector bool short __b) {
6415 static __inline__ vector signed short __ATTRS_o_ai
6416 vec_orc(vector bool short __a, vector signed short __b) {
6420 static __inline__ vector unsigned short __ATTRS_o_ai
6421 vec_orc(vector unsigned short __a, vector unsigned short __b) {
6425 static __inline__ vector unsigned short __ATTRS_o_ai
6426 vec_orc(vector unsigned short __a, vector bool short __b) {
6430 static __inline__ vector unsigned short __ATTRS_o_ai
6431 vec_orc(vector bool short __a, vector unsigned short __b) {
6435 static __inline__ vector bool short __ATTRS_o_ai
6436 vec_orc(vector bool short __a, vector bool short __b) {
6440 static __inline__ vector signed int __ATTRS_o_ai
6441 vec_orc(vector signed int __a, vector signed int __b) {
6445 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6446 vector bool int __b) {
6450 static __inline__ vector signed int __ATTRS_o_ai
6451 vec_orc(vector bool int __a, vector signed int __b) {
6455 static __inline__ vector unsigned int __ATTRS_o_ai
6456 vec_orc(vector unsigned int __a, vector unsigned int __b) {
6460 static __inline__ vector unsigned int __ATTRS_o_ai
6461 vec_orc(vector unsigned int __a, vector bool int __b) {
6465 static __inline__ vector unsigned int __ATTRS_o_ai
6466 vec_orc(vector bool int __a, vector unsigned int __b) {
6470 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6471 vector bool int __b) {
6475 static __inline__ vector float __ATTRS_o_ai
6476 vec_orc(vector bool int __a, vector float __b) {
6477 return (vector float)(__a | ~(vector unsigned int)__b);
6480 static __inline__ vector float __ATTRS_o_ai
6481 vec_orc(vector float __a, vector bool int __b) {
6482 return (vector float)((vector unsigned int)__a | ~__b);
6485 static __inline__ vector signed long long __ATTRS_o_ai
6486 vec_orc(vector signed long long __a, vector signed long long __b) {
6490 static __inline__ vector signed long long __ATTRS_o_ai
6491 vec_orc(vector signed long long __a, vector bool long long __b) {
6495 static __inline__ vector signed long long __ATTRS_o_ai
6496 vec_orc(vector bool long long __a, vector signed long long __b) {
6500 static __inline__ vector unsigned long long __ATTRS_o_ai
6501 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6505 static __inline__ vector unsigned long long __ATTRS_o_ai
6506 vec_orc(vector unsigned long long __a, vector bool long long __b) {
6510 static __inline__ vector unsigned long long __ATTRS_o_ai
6511 vec_orc(vector bool long long __a, vector unsigned long long __b) {
6515 static __inline__ vector bool long long __ATTRS_o_ai
6516 vec_orc(vector bool long long __a, vector bool long long __b) {
6520 static __inline__ vector double __ATTRS_o_ai
6521 vec_orc(vector double __a, vector bool long long __b) {
6522 return (vector double)((vector unsigned long long)__a | ~__b);
6525 static __inline__ vector double __ATTRS_o_ai
6526 vec_orc(vector bool long long __a, vector double __b) {
6527 return (vector double)(__a | ~(vector unsigned long long)__b);
6533 static __inline__ vector signed char __ATTRS_o_ai
6534 vec_vor(vector signed char __a, vector signed char __b) {
6538 static __inline__ vector signed char __ATTRS_o_ai
6539 vec_vor(vector bool char __a, vector signed char __b) {
6540 return (vector signed char)__a | __b;
6543 static __inline__ vector signed char __ATTRS_o_ai
6544 vec_vor(vector signed char __a, vector bool char __b) {
6545 return __a | (vector signed char)__b;
6548 static __inline__ vector unsigned char __ATTRS_o_ai
6549 vec_vor(vector unsigned char __a, vector unsigned char __b) {
6553 static __inline__ vector unsigned char __ATTRS_o_ai
6554 vec_vor(vector bool char __a, vector unsigned char __b) {
6555 return (vector unsigned char)__a | __b;
6558 static __inline__ vector unsigned char __ATTRS_o_ai
6559 vec_vor(vector unsigned char __a, vector bool char __b) {
6560 return __a | (vector unsigned char)__b;
6563 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6564 vector bool char __b) {
6568 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6573 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6575 return (vector short)__a | __b;
6578 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6579 vector bool short __b) {
6580 return __a | (vector short)__b;
6583 static __inline__ vector unsigned short __ATTRS_o_ai
6584 vec_vor(vector unsigned short __a, vector unsigned short __b) {
6588 static __inline__ vector unsigned short __ATTRS_o_ai
6589 vec_vor(vector bool short __a, vector unsigned short __b) {
6590 return (vector unsigned short)__a | __b;
6593 static __inline__ vector unsigned short __ATTRS_o_ai
6594 vec_vor(vector unsigned short __a, vector bool short __b) {
6595 return __a | (vector unsigned short)__b;
6598 static __inline__ vector bool short __ATTRS_o_ai
6599 vec_vor(vector bool short __a, vector bool short __b) {
6603 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6608 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6610 return (vector int)__a | __b;
6613 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6614 vector bool int __b) {
6615 return __a | (vector int)__b;
6618 static __inline__ vector unsigned int __ATTRS_o_ai
6619 vec_vor(vector unsigned int __a, vector unsigned int __b) {
6623 static __inline__ vector unsigned int __ATTRS_o_ai
6624 vec_vor(vector bool int __a, vector unsigned int __b) {
6625 return (vector unsigned int)__a | __b;
6628 static __inline__ vector unsigned int __ATTRS_o_ai
6629 vec_vor(vector unsigned int __a, vector bool int __b) {
6630 return __a | (vector unsigned int)__b;
6633 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6634 vector bool int __b) {
6638 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6640 vector unsigned int __res =
6641 (vector unsigned int)__a | (vector unsigned int)__b;
6642 return (vector float)__res;
6645 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6647 vector unsigned int __res =
6648 (vector unsigned int)__a | (vector unsigned int)__b;
6649 return (vector float)__res;
6652 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6653 vector bool int __b) {
6654 vector unsigned int __res =
6655 (vector unsigned int)__a | (vector unsigned int)__b;
6656 return (vector float)__res;
6660 static __inline__ vector signed long long __ATTRS_o_ai
6661 vec_vor(vector signed long long __a, vector signed long long __b) {
6665 static __inline__ vector signed long long __ATTRS_o_ai
6666 vec_vor(vector bool long long __a, vector signed long long __b) {
6667 return (vector signed long long)__a | __b;
6670 static __inline__ vector signed long long __ATTRS_o_ai
6671 vec_vor(vector signed long long __a, vector bool long long __b) {
6672 return __a | (vector signed long long)__b;
6675 static __inline__ vector unsigned long long __ATTRS_o_ai
6676 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6680 static __inline__ vector unsigned long long __ATTRS_o_ai
6681 vec_vor(vector bool long long __a, vector unsigned long long __b) {
6682 return (vector unsigned long long)__a | __b;
6685 static __inline__ vector unsigned long long __ATTRS_o_ai
6686 vec_vor(vector unsigned long long __a, vector bool long long __b) {
6687 return __a | (vector unsigned long long)__b;
6690 static __inline__ vector bool long long __ATTRS_o_ai
6691 vec_vor(vector bool long long __a, vector bool long long __b) {
6698 /* The various vector pack instructions have a big-endian bias, so for
6699 little endian we must handle reversed element numbering. */
6701 static __inline__ vector signed char __ATTRS_o_ai
6702 vec_pack(vector signed short __a, vector signed short __b) {
6703 #ifdef __LITTLE_ENDIAN__
6704 return (vector signed char)vec_perm(
6706 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6707 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6709 return (vector signed char)vec_perm(
6711 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6712 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6716 static __inline__ vector unsigned char __ATTRS_o_ai
6717 vec_pack(vector unsigned short __a, vector unsigned short __b) {
6718 #ifdef __LITTLE_ENDIAN__
6719 return (vector unsigned char)vec_perm(
6721 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6722 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6724 return (vector unsigned char)vec_perm(
6726 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6727 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6731 static __inline__ vector bool char __ATTRS_o_ai
6732 vec_pack(vector bool short __a, vector bool short __b) {
6733 #ifdef __LITTLE_ENDIAN__
6734 return (vector bool char)vec_perm(
6736 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6737 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6739 return (vector bool char)vec_perm(
6741 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6742 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6746 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6748 #ifdef __LITTLE_ENDIAN__
6749 return (vector short)vec_perm(
6751 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6752 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6754 return (vector short)vec_perm(
6756 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6757 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6761 static __inline__ vector unsigned short __ATTRS_o_ai
6762 vec_pack(vector unsigned int __a, vector unsigned int __b) {
6763 #ifdef __LITTLE_ENDIAN__
6764 return (vector unsigned short)vec_perm(
6766 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6767 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6769 return (vector unsigned short)vec_perm(
6771 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6772 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6776 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6777 vector bool int __b) {
6778 #ifdef __LITTLE_ENDIAN__
6779 return (vector bool short)vec_perm(
6781 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6782 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6784 return (vector bool short)vec_perm(
6786 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6787 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6792 static __inline__ vector signed int __ATTRS_o_ai
6793 vec_pack(vector signed long long __a, vector signed long long __b) {
6794 #ifdef __LITTLE_ENDIAN__
6795 return (vector signed int)vec_perm(
6797 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6798 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6800 return (vector signed int)vec_perm(
6802 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6803 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6806 static __inline__ vector unsigned int __ATTRS_o_ai
6807 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6808 #ifdef __LITTLE_ENDIAN__
6809 return (vector unsigned int)vec_perm(
6811 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6812 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6814 return (vector unsigned int)vec_perm(
6816 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6817 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6821 static __inline__ vector bool int __ATTRS_o_ai
6822 vec_pack(vector bool long long __a, vector bool long long __b) {
6823 #ifdef __LITTLE_ENDIAN__
6824 return (vector bool int)vec_perm(
6826 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6827 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6829 return (vector bool int)vec_perm(
6831 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6832 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6836 static __inline__ vector float __ATTRS_o_ai
6837 vec_pack(vector double __a, vector double __b) {
6838 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6842 #ifdef __POWER9_VECTOR__
6843 static __inline__ vector unsigned short __ATTRS_o_ai
6844 vec_pack_to_short_fp32(vector float __a, vector float __b) {
6845 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6846 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6847 #ifdef __LITTLE_ENDIAN__
6848 return (vector unsigned short)vec_mergee(__resa, __resb);
6850 return (vector unsigned short)vec_mergeo(__resa, __resb);
6857 #define __builtin_altivec_vpkuhum vec_vpkuhum
6859 static __inline__ vector signed char __ATTRS_o_ai
6860 vec_vpkuhum(vector signed short __a, vector signed short __b) {
6861 #ifdef __LITTLE_ENDIAN__
6862 return (vector signed char)vec_perm(
6864 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6865 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6867 return (vector signed char)vec_perm(
6869 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6870 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6874 static __inline__ vector unsigned char __ATTRS_o_ai
6875 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6876 #ifdef __LITTLE_ENDIAN__
6877 return (vector unsigned char)vec_perm(
6879 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6880 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6882 return (vector unsigned char)vec_perm(
6884 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6885 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6889 static __inline__ vector bool char __ATTRS_o_ai
6890 vec_vpkuhum(vector bool short __a, vector bool short __b) {
6891 #ifdef __LITTLE_ENDIAN__
6892 return (vector bool char)vec_perm(
6894 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6895 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6897 return (vector bool char)vec_perm(
6899 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6900 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6906 #define __builtin_altivec_vpkuwum vec_vpkuwum
6908 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6910 #ifdef __LITTLE_ENDIAN__
6911 return (vector short)vec_perm(
6913 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6914 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6916 return (vector short)vec_perm(
6918 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6919 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6923 static __inline__ vector unsigned short __ATTRS_o_ai
6924 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6925 #ifdef __LITTLE_ENDIAN__
6926 return (vector unsigned short)vec_perm(
6928 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6929 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6931 return (vector unsigned short)vec_perm(
6933 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6934 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6938 static __inline__ vector bool short __ATTRS_o_ai
6939 vec_vpkuwum(vector bool int __a, vector bool int __b) {
6940 #ifdef __LITTLE_ENDIAN__
6941 return (vector bool short)vec_perm(
6943 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6944 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6946 return (vector bool short)vec_perm(
6948 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6949 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6955 #ifdef __POWER8_VECTOR__
6956 #define __builtin_altivec_vpkudum vec_vpkudum
6958 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
6959 vector long long __b) {
6960 #ifdef __LITTLE_ENDIAN__
6961 return (vector int)vec_perm(
6963 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6964 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6966 return (vector int)vec_perm(
6968 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6969 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6973 static __inline__ vector unsigned int __ATTRS_o_ai
6974 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
6975 #ifdef __LITTLE_ENDIAN__
6976 return (vector unsigned int)vec_perm(
6978 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6979 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6981 return (vector unsigned int)vec_perm(
6983 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6984 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6988 static __inline__ vector bool int __ATTRS_o_ai
6989 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
6990 #ifdef __LITTLE_ENDIAN__
6991 return (vector bool int)vec_perm(
6992 (vector long long)__a, (vector long long)__b,
6993 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6994 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6996 return (vector bool int)vec_perm(
6997 (vector long long)__a, (vector long long)__b,
6998 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6999 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7006 static __inline__ vector pixel __attribute__((__always_inline__))
7007 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7008 #ifdef __LITTLE_ENDIAN__
7009 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7011 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7017 static __inline__ vector pixel __attribute__((__always_inline__))
7018 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7019 #ifdef __LITTLE_ENDIAN__
7020 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7022 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7028 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7030 #ifdef __LITTLE_ENDIAN__
7031 return __builtin_altivec_vpkshss(__b, __a);
7033 return __builtin_altivec_vpkshss(__a, __b);
7037 static __inline__ vector unsigned char __ATTRS_o_ai
7038 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7039 #ifdef __LITTLE_ENDIAN__
7040 return __builtin_altivec_vpkuhus(__b, __a);
7042 return __builtin_altivec_vpkuhus(__a, __b);
7046 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7048 #ifdef __LITTLE_ENDIAN__
7049 return __builtin_altivec_vpkswss(__b, __a);
7051 return __builtin_altivec_vpkswss(__a, __b);
7055 static __inline__ vector unsigned short __ATTRS_o_ai
7056 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7057 #ifdef __LITTLE_ENDIAN__
7058 return __builtin_altivec_vpkuwus(__b, __a);
7060 return __builtin_altivec_vpkuwus(__a, __b);
7064 #ifdef __POWER8_VECTOR__
7065 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7066 vector long long __b) {
7067 #ifdef __LITTLE_ENDIAN__
7068 return __builtin_altivec_vpksdss(__b, __a);
7070 return __builtin_altivec_vpksdss(__a, __b);
7074 static __inline__ vector unsigned int __ATTRS_o_ai
7075 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7076 #ifdef __LITTLE_ENDIAN__
7077 return __builtin_altivec_vpkudus(__b, __a);
7079 return __builtin_altivec_vpkudus(__a, __b);
7086 static __inline__ vector signed char __attribute__((__always_inline__))
7087 vec_vpkshss(vector short __a, vector short __b) {
7088 #ifdef __LITTLE_ENDIAN__
7089 return __builtin_altivec_vpkshss(__b, __a);
7091 return __builtin_altivec_vpkshss(__a, __b);
7097 #ifdef __POWER8_VECTOR__
7098 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7099 vector long long __b) {
7100 #ifdef __LITTLE_ENDIAN__
7101 return __builtin_altivec_vpksdss(__b, __a);
7103 return __builtin_altivec_vpksdss(__a, __b);
7110 static __inline__ vector unsigned char __attribute__((__always_inline__))
7111 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7112 #ifdef __LITTLE_ENDIAN__
7113 return __builtin_altivec_vpkuhus(__b, __a);
7115 return __builtin_altivec_vpkuhus(__a, __b);
7121 #ifdef __POWER8_VECTOR__
7122 static __inline__ vector unsigned int __attribute__((__always_inline__))
7123 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7124 #ifdef __LITTLE_ENDIAN__
7125 return __builtin_altivec_vpkudus(__b, __a);
7127 return __builtin_altivec_vpkudus(__a, __b);
7134 static __inline__ vector signed short __attribute__((__always_inline__))
7135 vec_vpkswss(vector int __a, vector int __b) {
7136 #ifdef __LITTLE_ENDIAN__
7137 return __builtin_altivec_vpkswss(__b, __a);
7139 return __builtin_altivec_vpkswss(__a, __b);
7145 static __inline__ vector unsigned short __attribute__((__always_inline__))
7146 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7147 #ifdef __LITTLE_ENDIAN__
7148 return __builtin_altivec_vpkuwus(__b, __a);
7150 return __builtin_altivec_vpkuwus(__a, __b);
7156 static __inline__ vector unsigned char __ATTRS_o_ai
7157 vec_packsu(vector short __a, vector short __b) {
7158 #ifdef __LITTLE_ENDIAN__
7159 return __builtin_altivec_vpkshus(__b, __a);
7161 return __builtin_altivec_vpkshus(__a, __b);
7165 static __inline__ vector unsigned char __ATTRS_o_ai
7166 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7167 #ifdef __LITTLE_ENDIAN__
7168 return __builtin_altivec_vpkuhus(__b, __a);
7170 return __builtin_altivec_vpkuhus(__a, __b);
7174 static __inline__ vector unsigned short __ATTRS_o_ai
7175 vec_packsu(vector int __a, vector int __b) {
7176 #ifdef __LITTLE_ENDIAN__
7177 return __builtin_altivec_vpkswus(__b, __a);
7179 return __builtin_altivec_vpkswus(__a, __b);
7183 static __inline__ vector unsigned short __ATTRS_o_ai
7184 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7185 #ifdef __LITTLE_ENDIAN__
7186 return __builtin_altivec_vpkuwus(__b, __a);
7188 return __builtin_altivec_vpkuwus(__a, __b);
7192 #ifdef __POWER8_VECTOR__
7193 static __inline__ vector unsigned int __ATTRS_o_ai
7194 vec_packsu(vector long long __a, vector long long __b) {
7195 #ifdef __LITTLE_ENDIAN__
7196 return __builtin_altivec_vpksdus(__b, __a);
7198 return __builtin_altivec_vpksdus(__a, __b);
7202 static __inline__ vector unsigned int __ATTRS_o_ai
7203 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7204 #ifdef __LITTLE_ENDIAN__
7205 return __builtin_altivec_vpkudus(__b, __a);
7207 return __builtin_altivec_vpkudus(__a, __b);
7214 static __inline__ vector unsigned char __ATTRS_o_ai
7215 vec_vpkshus(vector short __a, vector short __b) {
7216 #ifdef __LITTLE_ENDIAN__
7217 return __builtin_altivec_vpkshus(__b, __a);
7219 return __builtin_altivec_vpkshus(__a, __b);
7223 static __inline__ vector unsigned char __ATTRS_o_ai
7224 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7225 #ifdef __LITTLE_ENDIAN__
7226 return __builtin_altivec_vpkuhus(__b, __a);
7228 return __builtin_altivec_vpkuhus(__a, __b);
7234 static __inline__ vector unsigned short __ATTRS_o_ai
7235 vec_vpkswus(vector int __a, vector int __b) {
7236 #ifdef __LITTLE_ENDIAN__
7237 return __builtin_altivec_vpkswus(__b, __a);
7239 return __builtin_altivec_vpkswus(__a, __b);
7243 static __inline__ vector unsigned short __ATTRS_o_ai
7244 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7245 #ifdef __LITTLE_ENDIAN__
7246 return __builtin_altivec_vpkuwus(__b, __a);
7248 return __builtin_altivec_vpkuwus(__a, __b);
7254 #ifdef __POWER8_VECTOR__
7255 static __inline__ vector unsigned int __ATTRS_o_ai
7256 vec_vpksdus(vector long long __a, vector long long __b) {
7257 #ifdef __LITTLE_ENDIAN__
7258 return __builtin_altivec_vpksdus(__b, __a);
7260 return __builtin_altivec_vpksdus(__a, __b);
7267 // The vperm instruction is defined architecturally with a big-endian bias.
7268 // For little endian, we swap the input operands and invert the permute
7269 // control vector. Only the rightmost 5 bits matter, so we could use
7270 // a vector of all 31s instead of all 255s to perform the inversion.
7271 // However, when the PCV is not a constant, using 255 has an advantage
7272 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7273 // later, possibly a vec_nand).
7275 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7276 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7277 #ifdef __LITTLE_ENDIAN__
7278 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7279 255, 255, 255, 255, 255, 255, 255, 255};
7280 __d = vec_xor(__c, __d);
7281 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7282 (vector int)__a, __d);
7284 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7285 (vector int)__b, __c);
7289 static __inline__ vector unsigned char __ATTRS_o_ai
7290 vec_perm(vector unsigned char __a, vector unsigned char __b,
7291 vector unsigned char __c) {
7292 #ifdef __LITTLE_ENDIAN__
7293 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7294 255, 255, 255, 255, 255, 255, 255, 255};
7295 __d = vec_xor(__c, __d);
7296 return (vector unsigned char)__builtin_altivec_vperm_4si(
7297 (vector int)__b, (vector int)__a, __d);
7299 return (vector unsigned char)__builtin_altivec_vperm_4si(
7300 (vector int)__a, (vector int)__b, __c);
7304 static __inline__ vector bool char __ATTRS_o_ai
7305 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7306 #ifdef __LITTLE_ENDIAN__
7307 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7308 255, 255, 255, 255, 255, 255, 255, 255};
7309 __d = vec_xor(__c, __d);
7310 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7311 (vector int)__a, __d);
7313 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7314 (vector int)__b, __c);
7318 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7319 vector signed short __b,
7320 vector unsigned char __c) {
7321 #ifdef __LITTLE_ENDIAN__
7322 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7323 255, 255, 255, 255, 255, 255, 255, 255};
7324 __d = vec_xor(__c, __d);
7325 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7326 (vector int)__a, __d);
7328 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7329 (vector int)__b, __c);
7333 static __inline__ vector unsigned short __ATTRS_o_ai
7334 vec_perm(vector unsigned short __a, vector unsigned short __b,
7335 vector unsigned char __c) {
7336 #ifdef __LITTLE_ENDIAN__
7337 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7338 255, 255, 255, 255, 255, 255, 255, 255};
7339 __d = vec_xor(__c, __d);
7340 return (vector unsigned short)__builtin_altivec_vperm_4si(
7341 (vector int)__b, (vector int)__a, __d);
7343 return (vector unsigned short)__builtin_altivec_vperm_4si(
7344 (vector int)__a, (vector int)__b, __c);
7348 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7349 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7350 #ifdef __LITTLE_ENDIAN__
7351 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7352 255, 255, 255, 255, 255, 255, 255, 255};
7353 __d = vec_xor(__c, __d);
7354 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7355 (vector int)__a, __d);
7357 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7358 (vector int)__b, __c);
7362 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7364 vector unsigned char __c) {
7365 #ifdef __LITTLE_ENDIAN__
7366 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7367 255, 255, 255, 255, 255, 255, 255, 255};
7368 __d = vec_xor(__c, __d);
7369 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7370 (vector int)__a, __d);
7372 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7373 (vector int)__b, __c);
7377 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7378 vector signed int __b,
7379 vector unsigned char __c) {
7380 #ifdef __LITTLE_ENDIAN__
7381 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7382 255, 255, 255, 255, 255, 255, 255, 255};
7383 __d = vec_xor(__c, __d);
7384 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7386 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7390 static __inline__ vector unsigned int __ATTRS_o_ai
7391 vec_perm(vector unsigned int __a, vector unsigned int __b,
7392 vector unsigned char __c) {
7393 #ifdef __LITTLE_ENDIAN__
7394 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7395 255, 255, 255, 255, 255, 255, 255, 255};
7396 __d = vec_xor(__c, __d);
7397 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7398 (vector int)__a, __d);
7400 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7401 (vector int)__b, __c);
7405 static __inline__ vector bool int __ATTRS_o_ai
7406 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7407 #ifdef __LITTLE_ENDIAN__
7408 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7409 255, 255, 255, 255, 255, 255, 255, 255};
7410 __d = vec_xor(__c, __d);
7411 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
7412 (vector int)__a, __d);
7414 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7415 (vector int)__b, __c);
7419 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7421 vector unsigned char __c) {
7422 #ifdef __LITTLE_ENDIAN__
7423 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7424 255, 255, 255, 255, 255, 255, 255, 255};
7425 __d = vec_xor(__c, __d);
7426 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7427 (vector int)__a, __d);
7429 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7430 (vector int)__b, __c);
7435 static __inline__ vector long long __ATTRS_o_ai
7436 vec_perm(vector signed long long __a, vector signed long long __b,
7437 vector unsigned char __c) {
7438 #ifdef __LITTLE_ENDIAN__
7439 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7440 255, 255, 255, 255, 255, 255, 255, 255};
7441 __d = vec_xor(__c, __d);
7442 return (vector signed long long)__builtin_altivec_vperm_4si(
7443 (vector int)__b, (vector int)__a, __d);
7445 return (vector signed long long)__builtin_altivec_vperm_4si(
7446 (vector int)__a, (vector int)__b, __c);
7450 static __inline__ vector unsigned long long __ATTRS_o_ai
7451 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7452 vector unsigned char __c) {
7453 #ifdef __LITTLE_ENDIAN__
7454 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7455 255, 255, 255, 255, 255, 255, 255, 255};
7456 __d = vec_xor(__c, __d);
7457 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7458 (vector int)__b, (vector int)__a, __d);
7460 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7461 (vector int)__a, (vector int)__b, __c);
7465 static __inline__ vector bool long long __ATTRS_o_ai
7466 vec_perm(vector bool long long __a, vector bool long long __b,
7467 vector unsigned char __c) {
7468 #ifdef __LITTLE_ENDIAN__
7469 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7470 255, 255, 255, 255, 255, 255, 255, 255};
7471 __d = vec_xor(__c, __d);
7472 return (vector bool long long)__builtin_altivec_vperm_4si(
7473 (vector int)__b, (vector int)__a, __d);
7475 return (vector bool long long)__builtin_altivec_vperm_4si(
7476 (vector int)__a, (vector int)__b, __c);
7480 static __inline__ vector double __ATTRS_o_ai
7481 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
7482 #ifdef __LITTLE_ENDIAN__
7483 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7484 255, 255, 255, 255, 255, 255, 255, 255};
7485 __d = vec_xor(__c, __d);
7486 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
7487 (vector int)__a, __d);
7489 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7490 (vector int)__b, __c);
7497 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7498 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7499 return vec_perm(__a, __b, __c);
7502 static __inline__ vector unsigned char __ATTRS_o_ai
7503 vec_vperm(vector unsigned char __a, vector unsigned char __b,
7504 vector unsigned char __c) {
7505 return vec_perm(__a, __b, __c);
7508 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7509 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7510 return vec_perm(__a, __b, __c);
7513 static __inline__ vector short __ATTRS_o_ai
7514 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7515 return vec_perm(__a, __b, __c);
7518 static __inline__ vector unsigned short __ATTRS_o_ai
7519 vec_vperm(vector unsigned short __a, vector unsigned short __b,
7520 vector unsigned char __c) {
7521 return vec_perm(__a, __b, __c);
7524 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7525 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7526 return vec_perm(__a, __b, __c);
7529 static __inline__ vector pixel __ATTRS_o_ai
7530 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7531 return vec_perm(__a, __b, __c);
7534 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7536 vector unsigned char __c) {
7537 return vec_perm(__a, __b, __c);
7540 static __inline__ vector unsigned int __ATTRS_o_ai
7541 vec_vperm(vector unsigned int __a, vector unsigned int __b,
7542 vector unsigned char __c) {
7543 return vec_perm(__a, __b, __c);
7546 static __inline__ vector bool int __ATTRS_o_ai
7547 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7548 return vec_perm(__a, __b, __c);
7551 static __inline__ vector float __ATTRS_o_ai
7552 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7553 return vec_perm(__a, __b, __c);
7557 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7558 vector long long __a, vector long long __b, vector unsigned char __c) {
7559 return vec_perm(__a, __b, __c);
7562 static __inline__ vector unsigned long long __ATTRS_o_ai
7563 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7564 vector unsigned char __c) {
7565 return vec_perm(__a, __b, __c);
7568 static __inline__ vector double __ATTRS_o_ai
7569 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7570 return vec_perm(__a, __b, __c);
7576 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7578 return __builtin_vsx_xvresp(__a);
7580 return __builtin_altivec_vrefp(__a);
7585 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7586 return __builtin_vsx_xvredp(__a);
7592 static __inline__ vector float __attribute__((__always_inline__))
7593 vec_vrefp(vector float __a) {
7594 return __builtin_altivec_vrefp(__a);
7599 static __inline__ vector signed char __ATTRS_o_ai
7600 vec_rl(vector signed char __a, vector unsigned char __b) {
7601 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7604 static __inline__ vector unsigned char __ATTRS_o_ai
7605 vec_rl(vector unsigned char __a, vector unsigned char __b) {
7606 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7609 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7610 vector unsigned short __b) {
7611 return __builtin_altivec_vrlh(__a, __b);
7614 static __inline__ vector unsigned short __ATTRS_o_ai
7615 vec_rl(vector unsigned short __a, vector unsigned short __b) {
7616 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7619 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7620 vector unsigned int __b) {
7621 return __builtin_altivec_vrlw(__a, __b);
7624 static __inline__ vector unsigned int __ATTRS_o_ai
7625 vec_rl(vector unsigned int __a, vector unsigned int __b) {
7626 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7629 #ifdef __POWER8_VECTOR__
7630 static __inline__ vector signed long long __ATTRS_o_ai
7631 vec_rl(vector signed long long __a, vector unsigned long long __b) {
7632 return __builtin_altivec_vrld(__a, __b);
7635 static __inline__ vector unsigned long long __ATTRS_o_ai
7636 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7637 return __builtin_altivec_vrld(__a, __b);
7642 #ifdef __POWER9_VECTOR__
7643 static __inline__ vector unsigned int __ATTRS_o_ai
7644 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7645 vector unsigned int __c) {
7646 return __builtin_altivec_vrlwmi(__a, __c, __b);
7649 static __inline__ vector unsigned long long __ATTRS_o_ai
7650 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7651 vector unsigned long long __c) {
7652 return __builtin_altivec_vrldmi(__a, __c, __b);
7656 static __inline__ vector unsigned int __ATTRS_o_ai
7657 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7658 vector unsigned int __c) {
7659 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7660 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7663 static __inline__ vector unsigned long long __ATTRS_o_ai
7664 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7665 vector unsigned long long __c) {
7666 vector unsigned long long OneByte = { 0x8, 0x8 };
7667 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7673 static __inline__ vector signed char __ATTRS_o_ai
7674 vec_vrlb(vector signed char __a, vector unsigned char __b) {
7675 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7678 static __inline__ vector unsigned char __ATTRS_o_ai
7679 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7680 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7685 static __inline__ vector short __ATTRS_o_ai
7686 vec_vrlh(vector short __a, vector unsigned short __b) {
7687 return __builtin_altivec_vrlh(__a, __b);
7690 static __inline__ vector unsigned short __ATTRS_o_ai
7691 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7692 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7697 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7698 vector unsigned int __b) {
7699 return __builtin_altivec_vrlw(__a, __b);
7702 static __inline__ vector unsigned int __ATTRS_o_ai
7703 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7704 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7709 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7711 return __builtin_vsx_xvrspi(__a);
7713 return __builtin_altivec_vrfin(__a);
7718 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7719 return __builtin_vsx_xvrdpi(__a);
7724 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7725 return __builtin_vsx_xvrspic(__a);
7728 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7729 return __builtin_vsx_xvrdpic(__a);
7734 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7735 return __builtin_vsx_xvrspi(__a);
7738 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7739 return __builtin_vsx_xvrdpi(__a);
7745 static __inline__ vector float __attribute__((__always_inline__))
7746 vec_vrfin(vector float __a) {
7747 return __builtin_altivec_vrfin(__a);
7753 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7754 return __builtin_vsx_xvsqrtsp(__a);
7757 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7758 return __builtin_vsx_xvsqrtdp(__a);
7764 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7766 return __builtin_vsx_xvrsqrtesp(__a);
7768 return __builtin_altivec_vrsqrtefp(__a);
7773 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7774 return __builtin_vsx_xvrsqrtedp(__a);
7780 static __inline__ __vector float __attribute__((__always_inline__))
7781 vec_vrsqrtefp(vector float __a) {
7782 return __builtin_altivec_vrsqrtefp(__a);
7787 #define __builtin_altivec_vsel_4si vec_sel
7789 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7790 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7791 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7794 static __inline__ vector signed char __ATTRS_o_ai
7795 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7796 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7799 static __inline__ vector unsigned char __ATTRS_o_ai
7800 vec_sel(vector unsigned char __a, vector unsigned char __b,
7801 vector unsigned char __c) {
7802 return (__a & ~__c) | (__b & __c);
7805 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7806 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7807 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7810 static __inline__ vector bool char __ATTRS_o_ai
7811 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7812 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7815 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7816 vector bool char __b,
7817 vector bool char __c) {
7818 return (__a & ~__c) | (__b & __c);
7821 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7823 vector unsigned short __c) {
7824 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7827 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7829 vector bool short __c) {
7830 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7833 static __inline__ vector unsigned short __ATTRS_o_ai
7834 vec_sel(vector unsigned short __a, vector unsigned short __b,
7835 vector unsigned short __c) {
7836 return (__a & ~__c) | (__b & __c);
7839 static __inline__ vector unsigned short __ATTRS_o_ai
7840 vec_sel(vector unsigned short __a, vector unsigned short __b,
7841 vector bool short __c) {
7842 return (__a & ~(vector unsigned short)__c) |
7843 (__b & (vector unsigned short)__c);
7846 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7847 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7848 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7851 static __inline__ vector bool short __ATTRS_o_ai
7852 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7853 return (__a & ~__c) | (__b & __c);
7856 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7858 vector unsigned int __c) {
7859 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7862 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7864 vector bool int __c) {
7865 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7868 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7869 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7870 return (__a & ~__c) | (__b & __c);
7873 static __inline__ vector unsigned int __ATTRS_o_ai
7874 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7875 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7878 static __inline__ vector bool int __ATTRS_o_ai
7879 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7880 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7883 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7884 vector bool int __b,
7885 vector bool int __c) {
7886 return (__a & ~__c) | (__b & __c);
7889 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7891 vector unsigned int __c) {
7892 vector int __res = ((vector int)__a & ~(vector int)__c) |
7893 ((vector int)__b & (vector int)__c);
7894 return (vector float)__res;
7897 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7899 vector bool int __c) {
7900 vector int __res = ((vector int)__a & ~(vector int)__c) |
7901 ((vector int)__b & (vector int)__c);
7902 return (vector float)__res;
7906 static __inline__ vector double __ATTRS_o_ai
7907 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7908 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7909 ((vector long long)__b & (vector long long)__c);
7910 return (vector double)__res;
7913 static __inline__ vector double __ATTRS_o_ai
7914 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7915 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7916 ((vector long long)__b & (vector long long)__c);
7917 return (vector double)__res;
7923 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7924 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7925 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7928 static __inline__ vector signed char __ATTRS_o_ai
7929 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7930 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7933 static __inline__ vector unsigned char __ATTRS_o_ai
7934 vec_vsel(vector unsigned char __a, vector unsigned char __b,
7935 vector unsigned char __c) {
7936 return (__a & ~__c) | (__b & __c);
7939 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7940 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7941 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7944 static __inline__ vector bool char __ATTRS_o_ai
7945 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7946 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7949 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7950 vector bool char __b,
7951 vector bool char __c) {
7952 return (__a & ~__c) | (__b & __c);
7955 static __inline__ vector short __ATTRS_o_ai
7956 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
7957 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7960 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
7962 vector bool short __c) {
7963 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7966 static __inline__ vector unsigned short __ATTRS_o_ai
7967 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7968 vector unsigned short __c) {
7969 return (__a & ~__c) | (__b & __c);
7972 static __inline__ vector unsigned short __ATTRS_o_ai
7973 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7974 vector bool short __c) {
7975 return (__a & ~(vector unsigned short)__c) |
7976 (__b & (vector unsigned short)__c);
7979 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
7980 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7981 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7984 static __inline__ vector bool short __ATTRS_o_ai
7985 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
7986 return (__a & ~__c) | (__b & __c);
7989 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7991 vector unsigned int __c) {
7992 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7995 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7997 vector bool int __c) {
7998 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8001 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8002 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8003 return (__a & ~__c) | (__b & __c);
8006 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8007 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8008 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8011 static __inline__ vector bool int __ATTRS_o_ai
8012 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8013 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8016 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8017 vector bool int __b,
8018 vector bool int __c) {
8019 return (__a & ~__c) | (__b & __c);
8022 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8024 vector unsigned int __c) {
8025 vector int __res = ((vector int)__a & ~(vector int)__c) |
8026 ((vector int)__b & (vector int)__c);
8027 return (vector float)__res;
8030 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8032 vector bool int __c) {
8033 vector int __res = ((vector int)__a & ~(vector int)__c) |
8034 ((vector int)__b & (vector int)__c);
8035 return (vector float)__res;
8040 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8041 // than the length of __a.
8042 static __inline__ vector unsigned char __ATTRS_o_ai
8043 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8044 return __a << (__b %
8045 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8048 static __inline__ vector signed char __ATTRS_o_ai
8049 vec_sl(vector signed char __a, vector unsigned char __b) {
8050 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8053 static __inline__ vector unsigned short __ATTRS_o_ai
8054 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8055 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8059 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8060 vector unsigned short __b) {
8061 return (vector short)vec_sl((vector unsigned short)__a, __b);
8064 static __inline__ vector unsigned int __ATTRS_o_ai
8065 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8066 return __a << (__b %
8067 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8070 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8071 vector unsigned int __b) {
8072 return (vector int)vec_sl((vector unsigned int)__a, __b);
8075 #ifdef __POWER8_VECTOR__
8076 static __inline__ vector unsigned long long __ATTRS_o_ai
8077 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8078 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8082 static __inline__ vector long long __ATTRS_o_ai
8083 vec_sl(vector long long __a, vector unsigned long long __b) {
8084 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8090 #define __builtin_altivec_vslb vec_vslb
8092 static __inline__ vector signed char __ATTRS_o_ai
8093 vec_vslb(vector signed char __a, vector unsigned char __b) {
8094 return vec_sl(__a, __b);
8097 static __inline__ vector unsigned char __ATTRS_o_ai
8098 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8099 return vec_sl(__a, __b);
8104 #define __builtin_altivec_vslh vec_vslh
8106 static __inline__ vector short __ATTRS_o_ai
8107 vec_vslh(vector short __a, vector unsigned short __b) {
8108 return vec_sl(__a, __b);
8111 static __inline__ vector unsigned short __ATTRS_o_ai
8112 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8113 return vec_sl(__a, __b);
8118 #define __builtin_altivec_vslw vec_vslw
8120 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8121 vector unsigned int __b) {
8122 return vec_sl(__a, __b);
8125 static __inline__ vector unsigned int __ATTRS_o_ai
8126 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8127 return vec_sl(__a, __b);
8132 #define __builtin_altivec_vsldoi_4si vec_sld
8134 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8135 vector signed char __a, vector signed char __b, unsigned const int __c) {
8136 unsigned char __d = __c & 0x0F;
8137 #ifdef __LITTLE_ENDIAN__
8139 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8140 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8141 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8142 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8146 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8147 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8148 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8152 static __inline__ vector unsigned char __ATTRS_o_ai
8153 vec_sld(vector unsigned char __a, vector unsigned char __b,
8154 unsigned const int __c) {
8155 unsigned char __d = __c & 0x0F;
8156 #ifdef __LITTLE_ENDIAN__
8158 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8159 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8160 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8161 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8165 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8166 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8167 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8171 static __inline__ vector bool char __ATTRS_o_ai
8172 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8173 unsigned char __d = __c & 0x0F;
8174 #ifdef __LITTLE_ENDIAN__
8176 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8177 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8178 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8179 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8183 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8184 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8185 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8189 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8190 vector signed short __a, vector signed short __b, unsigned const int __c) {
8191 unsigned char __d = __c & 0x0F;
8192 #ifdef __LITTLE_ENDIAN__
8194 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8195 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8196 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8197 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8201 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8202 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8203 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8207 static __inline__ vector unsigned short __ATTRS_o_ai
8208 vec_sld(vector unsigned short __a, vector unsigned short __b,
8209 unsigned const int __c) {
8210 unsigned char __d = __c & 0x0F;
8211 #ifdef __LITTLE_ENDIAN__
8213 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8214 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8215 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8216 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8220 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8221 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8222 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8226 static __inline__ vector bool short __ATTRS_o_ai
8227 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8228 unsigned char __d = __c & 0x0F;
8229 #ifdef __LITTLE_ENDIAN__
8231 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8232 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8233 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8234 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8238 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8239 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8240 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8244 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8246 unsigned const int __c) {
8247 unsigned char __d = __c & 0x0F;
8248 #ifdef __LITTLE_ENDIAN__
8250 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8251 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8252 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8253 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8257 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8258 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8259 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8263 static __inline__ vector signed int __ATTRS_o_ai
8264 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
8265 unsigned char __d = __c & 0x0F;
8266 #ifdef __LITTLE_ENDIAN__
8268 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8269 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8270 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8271 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8275 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8276 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8277 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8281 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8282 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8283 unsigned char __d = __c & 0x0F;
8284 #ifdef __LITTLE_ENDIAN__
8286 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8287 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8288 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8289 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8293 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8294 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8295 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8299 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8300 vector bool int __b,
8301 unsigned const int __c) {
8302 unsigned char __d = __c & 0x0F;
8303 #ifdef __LITTLE_ENDIAN__
8305 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8306 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8307 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8308 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8312 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8313 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8314 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8318 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8320 unsigned const int __c) {
8321 unsigned char __d = __c & 0x0F;
8322 #ifdef __LITTLE_ENDIAN__
8324 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8325 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8326 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8327 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8331 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8332 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8333 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8338 static __inline__ vector bool long long __ATTRS_o_ai
8339 vec_sld(vector bool long long __a, vector bool long long __b,
8340 unsigned const int __c) {
8341 unsigned char __d = __c & 0x0F;
8342 #ifdef __LITTLE_ENDIAN__
8344 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8345 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8346 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8347 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8351 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8352 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8353 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8357 static __inline__ vector signed long long __ATTRS_o_ai
8358 vec_sld(vector signed long long __a, vector signed long long __b,
8359 unsigned const int __c) {
8360 unsigned char __d = __c & 0x0F;
8361 #ifdef __LITTLE_ENDIAN__
8363 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8364 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8365 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8366 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8370 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8371 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8372 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8376 static __inline__ vector unsigned long long __ATTRS_o_ai
8377 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8378 unsigned const int __c) {
8379 unsigned char __d = __c & 0x0F;
8380 #ifdef __LITTLE_ENDIAN__
8382 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8383 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8384 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8385 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8389 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8390 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8391 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8395 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8397 unsigned const int __c) {
8398 unsigned char __d = __c & 0x0F;
8399 #ifdef __LITTLE_ENDIAN__
8401 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8402 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8403 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8404 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8408 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8409 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8410 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8416 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8417 vector signed char __a, vector signed char __b, unsigned const int __c) {
8418 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8421 static __inline__ vector unsigned char __ATTRS_o_ai
8422 vec_sldw(vector unsigned char __a, vector unsigned char __b,
8423 unsigned const int __c) {
8424 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8427 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8428 vector signed short __a, vector signed short __b, unsigned const int __c) {
8429 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8432 static __inline__ vector unsigned short __ATTRS_o_ai
8433 vec_sldw(vector unsigned short __a, vector unsigned short __b,
8434 unsigned const int __c) {
8435 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8438 static __inline__ vector signed int __ATTRS_o_ai
8439 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8440 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8443 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8444 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8445 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8449 static __inline__ vector signed long long __ATTRS_o_ai
8450 vec_sldw(vector signed long long __a, vector signed long long __b,
8451 unsigned const int __c) {
8452 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8455 static __inline__ vector unsigned long long __ATTRS_o_ai
8456 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8457 unsigned const int __c) {
8458 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8462 #ifdef __POWER9_VECTOR__
8464 static __inline__ vector unsigned char __ATTRS_o_ai
8465 vec_slv(vector unsigned char __a, vector unsigned char __b) {
8466 return __builtin_altivec_vslv(__a, __b);
8470 static __inline__ vector unsigned char __ATTRS_o_ai
8471 vec_srv(vector unsigned char __a, vector unsigned char __b) {
8472 return __builtin_altivec_vsrv(__a, __b);
8478 static __inline__ vector signed char __ATTRS_o_ai
8479 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8480 unsigned char __d = __c & 0x0F;
8481 #ifdef __LITTLE_ENDIAN__
8483 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8484 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8485 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8486 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8490 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8491 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8492 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8496 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8497 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
8498 unsigned char __d = __c & 0x0F;
8499 #ifdef __LITTLE_ENDIAN__
8501 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8502 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8503 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8504 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8508 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8509 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8510 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8514 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
8516 unsigned char __c) {
8517 unsigned char __d = __c & 0x0F;
8518 #ifdef __LITTLE_ENDIAN__
8520 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8521 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8522 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8523 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8527 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8528 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8529 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8533 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
8534 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
8535 unsigned char __d = __c & 0x0F;
8536 #ifdef __LITTLE_ENDIAN__
8538 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8539 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8540 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8541 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8545 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8546 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8547 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8551 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
8553 unsigned char __c) {
8554 unsigned char __d = __c & 0x0F;
8555 #ifdef __LITTLE_ENDIAN__
8557 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8558 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8559 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8560 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8564 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8565 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8566 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8570 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8572 unsigned char __c) {
8573 unsigned char __d = __c & 0x0F;
8574 #ifdef __LITTLE_ENDIAN__
8576 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8577 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8578 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8579 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8583 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8584 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8585 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8589 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8590 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8591 unsigned char __d = __c & 0x0F;
8592 #ifdef __LITTLE_ENDIAN__
8594 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8595 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8596 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8597 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8601 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8602 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8603 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8607 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8609 unsigned char __c) {
8610 unsigned char __d = __c & 0x0F;
8611 #ifdef __LITTLE_ENDIAN__
8613 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8614 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8615 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8616 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8620 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8621 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8622 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8628 static __inline__ vector signed char __ATTRS_o_ai
8629 vec_sll(vector signed char __a, vector unsigned char __b) {
8630 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8634 static __inline__ vector signed char __ATTRS_o_ai
8635 vec_sll(vector signed char __a, vector unsigned short __b) {
8636 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8640 static __inline__ vector signed char __ATTRS_o_ai
8641 vec_sll(vector signed char __a, vector unsigned int __b) {
8642 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8646 static __inline__ vector unsigned char __ATTRS_o_ai
8647 vec_sll(vector unsigned char __a, vector unsigned char __b) {
8648 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8652 static __inline__ vector unsigned char __ATTRS_o_ai
8653 vec_sll(vector unsigned char __a, vector unsigned short __b) {
8654 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8658 static __inline__ vector unsigned char __ATTRS_o_ai
8659 vec_sll(vector unsigned char __a, vector unsigned int __b) {
8660 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8664 static __inline__ vector bool char __ATTRS_o_ai
8665 vec_sll(vector bool char __a, vector unsigned char __b) {
8666 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8670 static __inline__ vector bool char __ATTRS_o_ai
8671 vec_sll(vector bool char __a, vector unsigned short __b) {
8672 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8676 static __inline__ vector bool char __ATTRS_o_ai
8677 vec_sll(vector bool char __a, vector unsigned int __b) {
8678 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8682 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8683 vector unsigned char __b) {
8684 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8687 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8688 vector unsigned short __b) {
8689 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8692 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8693 vector unsigned int __b) {
8694 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8697 static __inline__ vector unsigned short __ATTRS_o_ai
8698 vec_sll(vector unsigned short __a, vector unsigned char __b) {
8699 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8703 static __inline__ vector unsigned short __ATTRS_o_ai
8704 vec_sll(vector unsigned short __a, vector unsigned short __b) {
8705 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8709 static __inline__ vector unsigned short __ATTRS_o_ai
8710 vec_sll(vector unsigned short __a, vector unsigned int __b) {
8711 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8715 static __inline__ vector bool short __ATTRS_o_ai
8716 vec_sll(vector bool short __a, vector unsigned char __b) {
8717 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8721 static __inline__ vector bool short __ATTRS_o_ai
8722 vec_sll(vector bool short __a, vector unsigned short __b) {
8723 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8727 static __inline__ vector bool short __ATTRS_o_ai
8728 vec_sll(vector bool short __a, vector unsigned int __b) {
8729 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8733 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8734 vector unsigned char __b) {
8735 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8738 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8739 vector unsigned short __b) {
8740 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8743 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8744 vector unsigned int __b) {
8745 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8748 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8749 vector unsigned char __b) {
8750 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8753 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8754 vector unsigned short __b) {
8755 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8758 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8759 vector unsigned int __b) {
8760 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8763 static __inline__ vector unsigned int __ATTRS_o_ai
8764 vec_sll(vector unsigned int __a, vector unsigned char __b) {
8765 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8769 static __inline__ vector unsigned int __ATTRS_o_ai
8770 vec_sll(vector unsigned int __a, vector unsigned short __b) {
8771 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8775 static __inline__ vector unsigned int __ATTRS_o_ai
8776 vec_sll(vector unsigned int __a, vector unsigned int __b) {
8777 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8781 static __inline__ vector bool int __ATTRS_o_ai
8782 vec_sll(vector bool int __a, vector unsigned char __b) {
8783 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8787 static __inline__ vector bool int __ATTRS_o_ai
8788 vec_sll(vector bool int __a, vector unsigned short __b) {
8789 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8793 static __inline__ vector bool int __ATTRS_o_ai
8794 vec_sll(vector bool int __a, vector unsigned int __b) {
8795 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8800 static __inline__ vector signed long long __ATTRS_o_ai
8801 vec_sll(vector signed long long __a, vector unsigned char __b) {
8802 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8806 static __inline__ vector unsigned long long __ATTRS_o_ai
8807 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8808 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8815 static __inline__ vector signed char __ATTRS_o_ai
8816 vec_vsl(vector signed char __a, vector unsigned char __b) {
8817 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8821 static __inline__ vector signed char __ATTRS_o_ai
8822 vec_vsl(vector signed char __a, vector unsigned short __b) {
8823 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8827 static __inline__ vector signed char __ATTRS_o_ai
8828 vec_vsl(vector signed char __a, vector unsigned int __b) {
8829 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8833 static __inline__ vector unsigned char __ATTRS_o_ai
8834 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8835 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8839 static __inline__ vector unsigned char __ATTRS_o_ai
8840 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8841 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8845 static __inline__ vector unsigned char __ATTRS_o_ai
8846 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8847 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8851 static __inline__ vector bool char __ATTRS_o_ai
8852 vec_vsl(vector bool char __a, vector unsigned char __b) {
8853 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8857 static __inline__ vector bool char __ATTRS_o_ai
8858 vec_vsl(vector bool char __a, vector unsigned short __b) {
8859 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8863 static __inline__ vector bool char __ATTRS_o_ai
8864 vec_vsl(vector bool char __a, vector unsigned int __b) {
8865 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8869 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8870 vector unsigned char __b) {
8871 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8874 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8875 vector unsigned short __b) {
8876 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8879 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8880 vector unsigned int __b) {
8881 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8884 static __inline__ vector unsigned short __ATTRS_o_ai
8885 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8886 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8890 static __inline__ vector unsigned short __ATTRS_o_ai
8891 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8892 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8896 static __inline__ vector unsigned short __ATTRS_o_ai
8897 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8898 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8902 static __inline__ vector bool short __ATTRS_o_ai
8903 vec_vsl(vector bool short __a, vector unsigned char __b) {
8904 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8908 static __inline__ vector bool short __ATTRS_o_ai
8909 vec_vsl(vector bool short __a, vector unsigned short __b) {
8910 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8914 static __inline__ vector bool short __ATTRS_o_ai
8915 vec_vsl(vector bool short __a, vector unsigned int __b) {
8916 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8920 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8921 vector unsigned char __b) {
8922 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8925 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8926 vector unsigned short __b) {
8927 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8930 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8931 vector unsigned int __b) {
8932 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8935 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8936 vector unsigned char __b) {
8937 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8940 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8941 vector unsigned short __b) {
8942 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8945 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8946 vector unsigned int __b) {
8947 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8950 static __inline__ vector unsigned int __ATTRS_o_ai
8951 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8952 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8956 static __inline__ vector unsigned int __ATTRS_o_ai
8957 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
8958 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8962 static __inline__ vector unsigned int __ATTRS_o_ai
8963 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
8964 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8968 static __inline__ vector bool int __ATTRS_o_ai
8969 vec_vsl(vector bool int __a, vector unsigned char __b) {
8970 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8974 static __inline__ vector bool int __ATTRS_o_ai
8975 vec_vsl(vector bool int __a, vector unsigned short __b) {
8976 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8980 static __inline__ vector bool int __ATTRS_o_ai
8981 vec_vsl(vector bool int __a, vector unsigned int __b) {
8982 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8988 static __inline__ vector signed char __ATTRS_o_ai
8989 vec_slo(vector signed char __a, vector signed char __b) {
8990 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8994 static __inline__ vector signed char __ATTRS_o_ai
8995 vec_slo(vector signed char __a, vector unsigned char __b) {
8996 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9000 static __inline__ vector unsigned char __ATTRS_o_ai
9001 vec_slo(vector unsigned char __a, vector signed char __b) {
9002 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9006 static __inline__ vector unsigned char __ATTRS_o_ai
9007 vec_slo(vector unsigned char __a, vector unsigned char __b) {
9008 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9012 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9013 vector signed char __b) {
9014 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9017 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9018 vector unsigned char __b) {
9019 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9022 static __inline__ vector unsigned short __ATTRS_o_ai
9023 vec_slo(vector unsigned short __a, vector signed char __b) {
9024 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9028 static __inline__ vector unsigned short __ATTRS_o_ai
9029 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9030 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9034 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9035 vector signed char __b) {
9036 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9039 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9040 vector unsigned char __b) {
9041 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9044 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9045 vector signed char __b) {
9046 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9049 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9050 vector unsigned char __b) {
9051 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9054 static __inline__ vector unsigned int __ATTRS_o_ai
9055 vec_slo(vector unsigned int __a, vector signed char __b) {
9056 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9060 static __inline__ vector unsigned int __ATTRS_o_ai
9061 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9062 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9066 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9067 vector signed char __b) {
9068 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9071 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9072 vector unsigned char __b) {
9073 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9077 static __inline__ vector signed long long __ATTRS_o_ai
9078 vec_slo(vector signed long long __a, vector signed char __b) {
9079 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9083 static __inline__ vector signed long long __ATTRS_o_ai
9084 vec_slo(vector signed long long __a, vector unsigned char __b) {
9085 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9089 static __inline__ vector unsigned long long __ATTRS_o_ai
9090 vec_slo(vector unsigned long long __a, vector signed char __b) {
9091 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9095 static __inline__ vector unsigned long long __ATTRS_o_ai
9096 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9097 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9104 static __inline__ vector signed char __ATTRS_o_ai
9105 vec_vslo(vector signed char __a, vector signed char __b) {
9106 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9110 static __inline__ vector signed char __ATTRS_o_ai
9111 vec_vslo(vector signed char __a, vector unsigned char __b) {
9112 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9116 static __inline__ vector unsigned char __ATTRS_o_ai
9117 vec_vslo(vector unsigned char __a, vector signed char __b) {
9118 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9122 static __inline__ vector unsigned char __ATTRS_o_ai
9123 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9124 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9128 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9129 vector signed char __b) {
9130 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9133 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9134 vector unsigned char __b) {
9135 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9138 static __inline__ vector unsigned short __ATTRS_o_ai
9139 vec_vslo(vector unsigned short __a, vector signed char __b) {
9140 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9144 static __inline__ vector unsigned short __ATTRS_o_ai
9145 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9146 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9150 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9151 vector signed char __b) {
9152 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9155 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9156 vector unsigned char __b) {
9157 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9160 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9161 vector signed char __b) {
9162 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9165 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9166 vector unsigned char __b) {
9167 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9170 static __inline__ vector unsigned int __ATTRS_o_ai
9171 vec_vslo(vector unsigned int __a, vector signed char __b) {
9172 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9176 static __inline__ vector unsigned int __ATTRS_o_ai
9177 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9178 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9182 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9183 vector signed char __b) {
9184 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9187 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9188 vector unsigned char __b) {
9189 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9194 static __inline__ vector signed char __ATTRS_o_ai
9195 vec_splat(vector signed char __a, unsigned const int __b) {
9196 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9199 static __inline__ vector unsigned char __ATTRS_o_ai
9200 vec_splat(vector unsigned char __a, unsigned const int __b) {
9201 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9204 static __inline__ vector bool char __ATTRS_o_ai
9205 vec_splat(vector bool char __a, unsigned const int __b) {
9206 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9209 static __inline__ vector signed short __ATTRS_o_ai
9210 vec_splat(vector signed short __a, unsigned const int __b) {
9211 unsigned char b0 = (__b & 0x07) * 2;
9212 unsigned char b1 = b0 + 1;
9213 return vec_perm(__a, __a,
9214 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9215 b0, b1, b0, b1, b0, b1));
9218 static __inline__ vector unsigned short __ATTRS_o_ai
9219 vec_splat(vector unsigned short __a, unsigned const int __b) {
9220 unsigned char b0 = (__b & 0x07) * 2;
9221 unsigned char b1 = b0 + 1;
9222 return vec_perm(__a, __a,
9223 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9224 b0, b1, b0, b1, b0, b1));
9227 static __inline__ vector bool short __ATTRS_o_ai
9228 vec_splat(vector bool short __a, unsigned const int __b) {
9229 unsigned char b0 = (__b & 0x07) * 2;
9230 unsigned char b1 = b0 + 1;
9231 return vec_perm(__a, __a,
9232 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9233 b0, b1, b0, b1, b0, b1));
9236 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9237 unsigned const int __b) {
9238 unsigned char b0 = (__b & 0x07) * 2;
9239 unsigned char b1 = b0 + 1;
9240 return vec_perm(__a, __a,
9241 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9242 b0, b1, b0, b1, b0, b1));
9245 static __inline__ vector signed int __ATTRS_o_ai
9246 vec_splat(vector signed int __a, unsigned const int __b) {
9247 unsigned char b0 = (__b & 0x03) * 4;
9248 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9249 return vec_perm(__a, __a,
9250 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9251 b2, b3, b0, b1, b2, b3));
9254 static __inline__ vector unsigned int __ATTRS_o_ai
9255 vec_splat(vector unsigned int __a, unsigned const int __b) {
9256 unsigned char b0 = (__b & 0x03) * 4;
9257 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9258 return vec_perm(__a, __a,
9259 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9260 b2, b3, b0, b1, b2, b3));
9263 static __inline__ vector bool int __ATTRS_o_ai
9264 vec_splat(vector bool int __a, unsigned const int __b) {
9265 unsigned char b0 = (__b & 0x03) * 4;
9266 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9267 return vec_perm(__a, __a,
9268 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9269 b2, b3, b0, b1, b2, b3));
9272 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9273 unsigned const int __b) {
9274 unsigned char b0 = (__b & 0x03) * 4;
9275 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9276 return vec_perm(__a, __a,
9277 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9278 b2, b3, b0, b1, b2, b3));
9282 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9283 unsigned const int __b) {
9284 unsigned char b0 = (__b & 0x01) * 8;
9285 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9286 b6 = b0 + 6, b7 = b0 + 7;
9287 return vec_perm(__a, __a,
9288 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9289 b2, b3, b4, b5, b6, b7));
9291 static __inline__ vector bool long long __ATTRS_o_ai
9292 vec_splat(vector bool long long __a, unsigned const int __b) {
9293 unsigned char b0 = (__b & 0x01) * 8;
9294 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9295 b6 = b0 + 6, b7 = b0 + 7;
9296 return vec_perm(__a, __a,
9297 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9298 b2, b3, b4, b5, b6, b7));
9300 static __inline__ vector signed long long __ATTRS_o_ai
9301 vec_splat(vector signed long long __a, unsigned const int __b) {
9302 unsigned char b0 = (__b & 0x01) * 8;
9303 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9304 b6 = b0 + 6, b7 = b0 + 7;
9305 return vec_perm(__a, __a,
9306 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9307 b2, b3, b4, b5, b6, b7));
9309 static __inline__ vector unsigned long long __ATTRS_o_ai
9310 vec_splat(vector unsigned long long __a, unsigned const int __b) {
9311 unsigned char b0 = (__b & 0x01) * 8;
9312 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9313 b6 = b0 + 6, b7 = b0 + 7;
9314 return vec_perm(__a, __a,
9315 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9316 b2, b3, b4, b5, b6, b7));
9322 #define __builtin_altivec_vspltb vec_vspltb
9324 static __inline__ vector signed char __ATTRS_o_ai
9325 vec_vspltb(vector signed char __a, unsigned char __b) {
9326 return vec_perm(__a, __a, (vector unsigned char)(__b));
9329 static __inline__ vector unsigned char __ATTRS_o_ai
9330 vec_vspltb(vector unsigned char __a, unsigned char __b) {
9331 return vec_perm(__a, __a, (vector unsigned char)(__b));
9334 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9335 unsigned char __b) {
9336 return vec_perm(__a, __a, (vector unsigned char)(__b));
9341 #define __builtin_altivec_vsplth vec_vsplth
9343 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9344 unsigned char __b) {
9346 unsigned char b1 = __b + 1;
9347 return vec_perm(__a, __a,
9348 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9349 __b, b1, __b, b1, __b, b1, __b, b1));
9352 static __inline__ vector unsigned short __ATTRS_o_ai
9353 vec_vsplth(vector unsigned short __a, unsigned char __b) {
9355 unsigned char b1 = __b + 1;
9356 return vec_perm(__a, __a,
9357 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9358 __b, b1, __b, b1, __b, b1, __b, b1));
9361 static __inline__ vector bool short __ATTRS_o_ai
9362 vec_vsplth(vector bool short __a, unsigned char __b) {
9364 unsigned char b1 = __b + 1;
9365 return vec_perm(__a, __a,
9366 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9367 __b, b1, __b, b1, __b, b1, __b, b1));
9370 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9371 unsigned char __b) {
9373 unsigned char b1 = __b + 1;
9374 return vec_perm(__a, __a,
9375 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9376 __b, b1, __b, b1, __b, b1, __b, b1));
9381 #define __builtin_altivec_vspltw vec_vspltw
9383 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9384 unsigned char __b) {
9386 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9387 return vec_perm(__a, __a,
9388 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9389 b1, b2, b3, __b, b1, b2, b3));
9392 static __inline__ vector unsigned int __ATTRS_o_ai
9393 vec_vspltw(vector unsigned int __a, unsigned char __b) {
9395 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9396 return vec_perm(__a, __a,
9397 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9398 b1, b2, b3, __b, b1, b2, b3));
9401 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9402 unsigned char __b) {
9404 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9405 return vec_perm(__a, __a,
9406 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9407 b1, b2, b3, __b, b1, b2, b3));
9410 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9411 unsigned char __b) {
9413 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9414 return vec_perm(__a, __a,
9415 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9416 b1, b2, b3, __b, b1, b2, b3));
9421 #define __builtin_altivec_vspltisb vec_splat_s8
9423 // FIXME: parameter should be treated as 5-bit signed literal
9424 static __inline__ vector signed char __ATTRS_o_ai
9425 vec_splat_s8(signed char __a) {
9426 return (vector signed char)(__a);
9431 // FIXME: parameter should be treated as 5-bit signed literal
9432 static __inline__ vector signed char __ATTRS_o_ai
9433 vec_vspltisb(signed char __a) {
9434 return (vector signed char)(__a);
9439 #define __builtin_altivec_vspltish vec_splat_s16
9441 // FIXME: parameter should be treated as 5-bit signed literal
9442 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9443 return (vector short)(__a);
9448 // FIXME: parameter should be treated as 5-bit signed literal
9449 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9450 return (vector short)(__a);
9455 #define __builtin_altivec_vspltisw vec_splat_s32
9457 // FIXME: parameter should be treated as 5-bit signed literal
9458 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9459 return (vector int)(__a);
9464 // FIXME: parameter should be treated as 5-bit signed literal
9465 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9466 return (vector int)(__a);
9471 // FIXME: parameter should be treated as 5-bit signed literal
9472 static __inline__ vector unsigned char __ATTRS_o_ai
9473 vec_splat_u8(unsigned char __a) {
9474 return (vector unsigned char)(__a);
9479 // FIXME: parameter should be treated as 5-bit signed literal
9480 static __inline__ vector unsigned short __ATTRS_o_ai
9481 vec_splat_u16(signed char __a) {
9482 return (vector unsigned short)(__a);
9487 // FIXME: parameter should be treated as 5-bit signed literal
9488 static __inline__ vector unsigned int __ATTRS_o_ai
9489 vec_splat_u32(signed char __a) {
9490 return (vector unsigned int)(__a);
9495 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
9496 // than the length of __a.
9497 static __inline__ vector unsigned char __ATTRS_o_ai
9498 vec_sr(vector unsigned char __a, vector unsigned char __b) {
9500 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
9503 static __inline__ vector signed char __ATTRS_o_ai
9504 vec_sr(vector signed char __a, vector unsigned char __b) {
9505 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
9508 static __inline__ vector unsigned short __ATTRS_o_ai
9509 vec_sr(vector unsigned short __a, vector unsigned short __b) {
9511 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
9514 static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
9515 vector unsigned short __b) {
9516 return (vector short)vec_sr((vector unsigned short)__a, __b);
9519 static __inline__ vector unsigned int __ATTRS_o_ai
9520 vec_sr(vector unsigned int __a, vector unsigned int __b) {
9522 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
9525 static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
9526 vector unsigned int __b) {
9527 return (vector int)vec_sr((vector unsigned int)__a, __b);
9530 #ifdef __POWER8_VECTOR__
9531 static __inline__ vector unsigned long long __ATTRS_o_ai
9532 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9533 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
9537 static __inline__ vector long long __ATTRS_o_ai
9538 vec_sr(vector long long __a, vector unsigned long long __b) {
9539 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9545 #define __builtin_altivec_vsrb vec_vsrb
9547 static __inline__ vector signed char __ATTRS_o_ai
9548 vec_vsrb(vector signed char __a, vector unsigned char __b) {
9549 return vec_sr(__a, __b);
9552 static __inline__ vector unsigned char __ATTRS_o_ai
9553 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9554 return vec_sr(__a, __b);
9559 #define __builtin_altivec_vsrh vec_vsrh
9561 static __inline__ vector short __ATTRS_o_ai
9562 vec_vsrh(vector short __a, vector unsigned short __b) {
9563 return vec_sr(__a, __b);
9566 static __inline__ vector unsigned short __ATTRS_o_ai
9567 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9568 return vec_sr(__a, __b);
9573 #define __builtin_altivec_vsrw vec_vsrw
9575 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9576 vector unsigned int __b) {
9577 return vec_sr(__a, __b);
9580 static __inline__ vector unsigned int __ATTRS_o_ai
9581 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9582 return vec_sr(__a, __b);
9587 static __inline__ vector signed char __ATTRS_o_ai
9588 vec_sra(vector signed char __a, vector unsigned char __b) {
9589 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9592 static __inline__ vector unsigned char __ATTRS_o_ai
9593 vec_sra(vector unsigned char __a, vector unsigned char __b) {
9594 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9597 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9598 vector unsigned short __b) {
9599 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9602 static __inline__ vector unsigned short __ATTRS_o_ai
9603 vec_sra(vector unsigned short __a, vector unsigned short __b) {
9604 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9607 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9608 vector unsigned int __b) {
9609 return __builtin_altivec_vsraw(__a, __b);
9612 static __inline__ vector unsigned int __ATTRS_o_ai
9613 vec_sra(vector unsigned int __a, vector unsigned int __b) {
9614 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9617 #ifdef __POWER8_VECTOR__
9618 static __inline__ vector signed long long __ATTRS_o_ai
9619 vec_sra(vector signed long long __a, vector unsigned long long __b) {
9623 static __inline__ vector unsigned long long __ATTRS_o_ai
9624 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9625 return (vector unsigned long long)((vector signed long long)__a >> __b);
9631 static __inline__ vector signed char __ATTRS_o_ai
9632 vec_vsrab(vector signed char __a, vector unsigned char __b) {
9633 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9636 static __inline__ vector unsigned char __ATTRS_o_ai
9637 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9638 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9643 static __inline__ vector short __ATTRS_o_ai
9644 vec_vsrah(vector short __a, vector unsigned short __b) {
9645 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9648 static __inline__ vector unsigned short __ATTRS_o_ai
9649 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9650 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9655 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9656 vector unsigned int __b) {
9657 return __builtin_altivec_vsraw(__a, __b);
9660 static __inline__ vector unsigned int __ATTRS_o_ai
9661 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9662 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9667 static __inline__ vector signed char __ATTRS_o_ai
9668 vec_srl(vector signed char __a, vector unsigned char __b) {
9669 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9673 static __inline__ vector signed char __ATTRS_o_ai
9674 vec_srl(vector signed char __a, vector unsigned short __b) {
9675 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9679 static __inline__ vector signed char __ATTRS_o_ai
9680 vec_srl(vector signed char __a, vector unsigned int __b) {
9681 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9685 static __inline__ vector unsigned char __ATTRS_o_ai
9686 vec_srl(vector unsigned char __a, vector unsigned char __b) {
9687 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9691 static __inline__ vector unsigned char __ATTRS_o_ai
9692 vec_srl(vector unsigned char __a, vector unsigned short __b) {
9693 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9697 static __inline__ vector unsigned char __ATTRS_o_ai
9698 vec_srl(vector unsigned char __a, vector unsigned int __b) {
9699 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9703 static __inline__ vector bool char __ATTRS_o_ai
9704 vec_srl(vector bool char __a, vector unsigned char __b) {
9705 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9709 static __inline__ vector bool char __ATTRS_o_ai
9710 vec_srl(vector bool char __a, vector unsigned short __b) {
9711 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9715 static __inline__ vector bool char __ATTRS_o_ai
9716 vec_srl(vector bool char __a, vector unsigned int __b) {
9717 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9721 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9722 vector unsigned char __b) {
9723 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9726 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9727 vector unsigned short __b) {
9728 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9731 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9732 vector unsigned int __b) {
9733 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9736 static __inline__ vector unsigned short __ATTRS_o_ai
9737 vec_srl(vector unsigned short __a, vector unsigned char __b) {
9738 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9742 static __inline__ vector unsigned short __ATTRS_o_ai
9743 vec_srl(vector unsigned short __a, vector unsigned short __b) {
9744 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9748 static __inline__ vector unsigned short __ATTRS_o_ai
9749 vec_srl(vector unsigned short __a, vector unsigned int __b) {
9750 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9754 static __inline__ vector bool short __ATTRS_o_ai
9755 vec_srl(vector bool short __a, vector unsigned char __b) {
9756 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9760 static __inline__ vector bool short __ATTRS_o_ai
9761 vec_srl(vector bool short __a, vector unsigned short __b) {
9762 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9766 static __inline__ vector bool short __ATTRS_o_ai
9767 vec_srl(vector bool short __a, vector unsigned int __b) {
9768 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9772 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9773 vector unsigned char __b) {
9774 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9777 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9778 vector unsigned short __b) {
9779 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9782 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9783 vector unsigned int __b) {
9784 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9787 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9788 vector unsigned char __b) {
9789 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9792 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9793 vector unsigned short __b) {
9794 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9797 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9798 vector unsigned int __b) {
9799 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9802 static __inline__ vector unsigned int __ATTRS_o_ai
9803 vec_srl(vector unsigned int __a, vector unsigned char __b) {
9804 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9808 static __inline__ vector unsigned int __ATTRS_o_ai
9809 vec_srl(vector unsigned int __a, vector unsigned short __b) {
9810 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9814 static __inline__ vector unsigned int __ATTRS_o_ai
9815 vec_srl(vector unsigned int __a, vector unsigned int __b) {
9816 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9820 static __inline__ vector bool int __ATTRS_o_ai
9821 vec_srl(vector bool int __a, vector unsigned char __b) {
9822 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9826 static __inline__ vector bool int __ATTRS_o_ai
9827 vec_srl(vector bool int __a, vector unsigned short __b) {
9828 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9832 static __inline__ vector bool int __ATTRS_o_ai
9833 vec_srl(vector bool int __a, vector unsigned int __b) {
9834 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9839 static __inline__ vector signed long long __ATTRS_o_ai
9840 vec_srl(vector signed long long __a, vector unsigned char __b) {
9841 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9845 static __inline__ vector unsigned long long __ATTRS_o_ai
9846 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9847 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9854 static __inline__ vector signed char __ATTRS_o_ai
9855 vec_vsr(vector signed char __a, vector unsigned char __b) {
9856 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9860 static __inline__ vector signed char __ATTRS_o_ai
9861 vec_vsr(vector signed char __a, vector unsigned short __b) {
9862 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9866 static __inline__ vector signed char __ATTRS_o_ai
9867 vec_vsr(vector signed char __a, vector unsigned int __b) {
9868 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9872 static __inline__ vector unsigned char __ATTRS_o_ai
9873 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9874 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9878 static __inline__ vector unsigned char __ATTRS_o_ai
9879 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9880 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9884 static __inline__ vector unsigned char __ATTRS_o_ai
9885 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9886 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9890 static __inline__ vector bool char __ATTRS_o_ai
9891 vec_vsr(vector bool char __a, vector unsigned char __b) {
9892 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9896 static __inline__ vector bool char __ATTRS_o_ai
9897 vec_vsr(vector bool char __a, vector unsigned short __b) {
9898 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9902 static __inline__ vector bool char __ATTRS_o_ai
9903 vec_vsr(vector bool char __a, vector unsigned int __b) {
9904 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9908 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9909 vector unsigned char __b) {
9910 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9913 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9914 vector unsigned short __b) {
9915 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9918 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9919 vector unsigned int __b) {
9920 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9923 static __inline__ vector unsigned short __ATTRS_o_ai
9924 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9925 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9929 static __inline__ vector unsigned short __ATTRS_o_ai
9930 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9931 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9935 static __inline__ vector unsigned short __ATTRS_o_ai
9936 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9937 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9941 static __inline__ vector bool short __ATTRS_o_ai
9942 vec_vsr(vector bool short __a, vector unsigned char __b) {
9943 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9947 static __inline__ vector bool short __ATTRS_o_ai
9948 vec_vsr(vector bool short __a, vector unsigned short __b) {
9949 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9953 static __inline__ vector bool short __ATTRS_o_ai
9954 vec_vsr(vector bool short __a, vector unsigned int __b) {
9955 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9959 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9960 vector unsigned char __b) {
9961 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9964 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9965 vector unsigned short __b) {
9966 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9969 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9970 vector unsigned int __b) {
9971 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9974 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9975 vector unsigned char __b) {
9976 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9979 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9980 vector unsigned short __b) {
9981 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9984 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9985 vector unsigned int __b) {
9986 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9989 static __inline__ vector unsigned int __ATTRS_o_ai
9990 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
9991 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9995 static __inline__ vector unsigned int __ATTRS_o_ai
9996 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
9997 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10001 static __inline__ vector unsigned int __ATTRS_o_ai
10002 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10003 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10007 static __inline__ vector bool int __ATTRS_o_ai
10008 vec_vsr(vector bool int __a, vector unsigned char __b) {
10009 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10013 static __inline__ vector bool int __ATTRS_o_ai
10014 vec_vsr(vector bool int __a, vector unsigned short __b) {
10015 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10019 static __inline__ vector bool int __ATTRS_o_ai
10020 vec_vsr(vector bool int __a, vector unsigned int __b) {
10021 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10027 static __inline__ vector signed char __ATTRS_o_ai
10028 vec_sro(vector signed char __a, vector signed char __b) {
10029 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10033 static __inline__ vector signed char __ATTRS_o_ai
10034 vec_sro(vector signed char __a, vector unsigned char __b) {
10035 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10039 static __inline__ vector unsigned char __ATTRS_o_ai
10040 vec_sro(vector unsigned char __a, vector signed char __b) {
10041 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10045 static __inline__ vector unsigned char __ATTRS_o_ai
10046 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10047 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10051 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10052 vector signed char __b) {
10053 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10056 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10057 vector unsigned char __b) {
10058 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10061 static __inline__ vector unsigned short __ATTRS_o_ai
10062 vec_sro(vector unsigned short __a, vector signed char __b) {
10063 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10067 static __inline__ vector unsigned short __ATTRS_o_ai
10068 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10069 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10073 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10074 vector signed char __b) {
10075 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10078 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10079 vector unsigned char __b) {
10080 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10083 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10084 vector signed char __b) {
10085 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10088 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10089 vector unsigned char __b) {
10090 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10093 static __inline__ vector unsigned int __ATTRS_o_ai
10094 vec_sro(vector unsigned int __a, vector signed char __b) {
10095 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10099 static __inline__ vector unsigned int __ATTRS_o_ai
10100 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10101 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10105 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10106 vector signed char __b) {
10107 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10110 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10111 vector unsigned char __b) {
10112 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10116 static __inline__ vector signed long long __ATTRS_o_ai
10117 vec_sro(vector signed long long __a, vector signed char __b) {
10118 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10122 static __inline__ vector signed long long __ATTRS_o_ai
10123 vec_sro(vector signed long long __a, vector unsigned char __b) {
10124 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10128 static __inline__ vector unsigned long long __ATTRS_o_ai
10129 vec_sro(vector unsigned long long __a, vector signed char __b) {
10130 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10134 static __inline__ vector unsigned long long __ATTRS_o_ai
10135 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10136 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10143 static __inline__ vector signed char __ATTRS_o_ai
10144 vec_vsro(vector signed char __a, vector signed char __b) {
10145 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10149 static __inline__ vector signed char __ATTRS_o_ai
10150 vec_vsro(vector signed char __a, vector unsigned char __b) {
10151 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10155 static __inline__ vector unsigned char __ATTRS_o_ai
10156 vec_vsro(vector unsigned char __a, vector signed char __b) {
10157 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10161 static __inline__ vector unsigned char __ATTRS_o_ai
10162 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10163 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10167 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10168 vector signed char __b) {
10169 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10172 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10173 vector unsigned char __b) {
10174 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10177 static __inline__ vector unsigned short __ATTRS_o_ai
10178 vec_vsro(vector unsigned short __a, vector signed char __b) {
10179 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10183 static __inline__ vector unsigned short __ATTRS_o_ai
10184 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10185 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10189 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10190 vector signed char __b) {
10191 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10194 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10195 vector unsigned char __b) {
10196 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10199 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10200 vector signed char __b) {
10201 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10204 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10205 vector unsigned char __b) {
10206 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10209 static __inline__ vector unsigned int __ATTRS_o_ai
10210 vec_vsro(vector unsigned int __a, vector signed char __b) {
10211 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10215 static __inline__ vector unsigned int __ATTRS_o_ai
10216 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10217 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10221 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10222 vector signed char __b) {
10223 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10226 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10227 vector unsigned char __b) {
10228 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10233 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10234 vector signed char *__c) {
10235 __builtin_altivec_stvx((vector int)__a, __b, __c);
10238 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10239 signed char *__c) {
10240 __builtin_altivec_stvx((vector int)__a, __b, __c);
10243 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10244 vector unsigned char *__c) {
10245 __builtin_altivec_stvx((vector int)__a, __b, __c);
10248 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10249 unsigned char *__c) {
10250 __builtin_altivec_stvx((vector int)__a, __b, __c);
10253 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10254 signed char *__c) {
10255 __builtin_altivec_stvx((vector int)__a, __b, __c);
10258 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10259 unsigned char *__c) {
10260 __builtin_altivec_stvx((vector int)__a, __b, __c);
10263 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10264 vector bool char *__c) {
10265 __builtin_altivec_stvx((vector int)__a, __b, __c);
10268 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10269 vector short *__c) {
10270 __builtin_altivec_stvx((vector int)__a, __b, __c);
10273 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10275 __builtin_altivec_stvx((vector int)__a, __b, __c);
10278 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10279 vector unsigned short *__c) {
10280 __builtin_altivec_stvx((vector int)__a, __b, __c);
10283 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10284 unsigned short *__c) {
10285 __builtin_altivec_stvx((vector int)__a, __b, __c);
10288 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10290 __builtin_altivec_stvx((vector int)__a, __b, __c);
10293 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10294 unsigned short *__c) {
10295 __builtin_altivec_stvx((vector int)__a, __b, __c);
10298 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10299 vector bool short *__c) {
10300 __builtin_altivec_stvx((vector int)__a, __b, __c);
10303 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10305 __builtin_altivec_stvx((vector int)__a, __b, __c);
10308 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10309 unsigned short *__c) {
10310 __builtin_altivec_stvx((vector int)__a, __b, __c);
10313 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10314 vector pixel *__c) {
10315 __builtin_altivec_stvx((vector int)__a, __b, __c);
10318 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10320 __builtin_altivec_stvx(__a, __b, __c);
10323 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10324 __builtin_altivec_stvx(__a, __b, __c);
10327 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10328 vector unsigned int *__c) {
10329 __builtin_altivec_stvx((vector int)__a, __b, __c);
10332 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10333 unsigned int *__c) {
10334 __builtin_altivec_stvx((vector int)__a, __b, __c);
10337 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10339 __builtin_altivec_stvx((vector int)__a, __b, __c);
10342 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10343 unsigned int *__c) {
10344 __builtin_altivec_stvx((vector int)__a, __b, __c);
10347 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10348 vector bool int *__c) {
10349 __builtin_altivec_stvx((vector int)__a, __b, __c);
10352 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10353 vector float *__c) {
10354 __builtin_altivec_stvx((vector int)__a, __b, __c);
10357 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10359 __builtin_altivec_stvx((vector int)__a, __b, __c);
10364 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10365 vector signed char *__c) {
10366 __builtin_altivec_stvx((vector int)__a, __b, __c);
10369 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10370 signed char *__c) {
10371 __builtin_altivec_stvx((vector int)__a, __b, __c);
10374 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10375 vector unsigned char *__c) {
10376 __builtin_altivec_stvx((vector int)__a, __b, __c);
10379 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10380 unsigned char *__c) {
10381 __builtin_altivec_stvx((vector int)__a, __b, __c);
10384 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10385 signed char *__c) {
10386 __builtin_altivec_stvx((vector int)__a, __b, __c);
10389 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10390 unsigned char *__c) {
10391 __builtin_altivec_stvx((vector int)__a, __b, __c);
10394 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10395 vector bool char *__c) {
10396 __builtin_altivec_stvx((vector int)__a, __b, __c);
10399 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10400 vector short *__c) {
10401 __builtin_altivec_stvx((vector int)__a, __b, __c);
10404 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10406 __builtin_altivec_stvx((vector int)__a, __b, __c);
10409 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10410 vector unsigned short *__c) {
10411 __builtin_altivec_stvx((vector int)__a, __b, __c);
10414 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10415 unsigned short *__c) {
10416 __builtin_altivec_stvx((vector int)__a, __b, __c);
10419 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10421 __builtin_altivec_stvx((vector int)__a, __b, __c);
10424 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10425 unsigned short *__c) {
10426 __builtin_altivec_stvx((vector int)__a, __b, __c);
10429 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10430 vector bool short *__c) {
10431 __builtin_altivec_stvx((vector int)__a, __b, __c);
10434 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10436 __builtin_altivec_stvx((vector int)__a, __b, __c);
10439 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10440 unsigned short *__c) {
10441 __builtin_altivec_stvx((vector int)__a, __b, __c);
10444 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10445 vector pixel *__c) {
10446 __builtin_altivec_stvx((vector int)__a, __b, __c);
10449 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10451 __builtin_altivec_stvx(__a, __b, __c);
10454 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10456 __builtin_altivec_stvx(__a, __b, __c);
10459 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10460 vector unsigned int *__c) {
10461 __builtin_altivec_stvx((vector int)__a, __b, __c);
10464 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10465 unsigned int *__c) {
10466 __builtin_altivec_stvx((vector int)__a, __b, __c);
10469 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10471 __builtin_altivec_stvx((vector int)__a, __b, __c);
10474 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10475 unsigned int *__c) {
10476 __builtin_altivec_stvx((vector int)__a, __b, __c);
10479 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10480 vector bool int *__c) {
10481 __builtin_altivec_stvx((vector int)__a, __b, __c);
10484 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10485 vector float *__c) {
10486 __builtin_altivec_stvx((vector int)__a, __b, __c);
10489 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10491 __builtin_altivec_stvx((vector int)__a, __b, __c);
10496 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10497 signed char *__c) {
10498 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10501 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10502 unsigned char *__c) {
10503 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10506 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10507 signed char *__c) {
10508 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10511 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10512 unsigned char *__c) {
10513 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10516 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10518 __builtin_altivec_stvehx(__a, __b, __c);
10521 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10522 unsigned short *__c) {
10523 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10526 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10528 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10531 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10532 unsigned short *__c) {
10533 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10536 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10538 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10541 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10542 unsigned short *__c) {
10543 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10546 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10547 __builtin_altivec_stvewx(__a, __b, __c);
10550 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10551 unsigned int *__c) {
10552 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10555 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10557 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10560 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10561 unsigned int *__c) {
10562 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10565 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10567 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10572 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10573 signed char *__c) {
10574 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10577 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10578 int __b, unsigned char *__c) {
10579 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10582 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10583 signed char *__c) {
10584 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10587 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10588 unsigned char *__c) {
10589 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10594 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10596 __builtin_altivec_stvehx(__a, __b, __c);
10599 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10600 int __b, unsigned short *__c) {
10601 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10604 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10606 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10609 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10610 unsigned short *__c) {
10611 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10614 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10616 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10619 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10620 unsigned short *__c) {
10621 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10626 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10628 __builtin_altivec_stvewx(__a, __b, __c);
10631 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10632 unsigned int *__c) {
10633 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10636 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10638 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10641 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10642 unsigned int *__c) {
10643 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10646 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10648 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10653 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10654 vector signed char *__c) {
10655 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10658 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10659 signed char *__c) {
10660 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10663 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10664 vector unsigned char *__c) {
10665 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10668 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10669 unsigned char *__c) {
10670 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10673 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10674 signed char *__c) {
10675 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10678 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10679 unsigned char *__c) {
10680 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10683 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10684 vector bool char *__c) {
10685 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10688 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10689 vector short *__c) {
10690 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10693 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10695 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10698 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10699 vector unsigned short *__c) {
10700 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10703 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10704 unsigned short *__c) {
10705 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10708 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10710 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10713 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10714 unsigned short *__c) {
10715 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10718 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10719 vector bool short *__c) {
10720 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10723 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10725 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10728 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10729 unsigned short *__c) {
10730 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10733 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10734 vector pixel *__c) {
10735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10738 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10740 __builtin_altivec_stvxl(__a, __b, __c);
10743 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10744 __builtin_altivec_stvxl(__a, __b, __c);
10747 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10748 vector unsigned int *__c) {
10749 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10752 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10753 unsigned int *__c) {
10754 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10757 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10759 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10762 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10763 unsigned int *__c) {
10764 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10767 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10768 vector bool int *__c) {
10769 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10772 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10773 vector float *__c) {
10774 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10777 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10779 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10784 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10785 vector signed char *__c) {
10786 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10789 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10790 signed char *__c) {
10791 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10794 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10795 vector unsigned char *__c) {
10796 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10799 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10800 unsigned char *__c) {
10801 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10804 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10805 signed char *__c) {
10806 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10809 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10810 unsigned char *__c) {
10811 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10814 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10815 vector bool char *__c) {
10816 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10819 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10820 vector short *__c) {
10821 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10824 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10826 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10829 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10831 vector unsigned short *__c) {
10832 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10835 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10836 int __b, unsigned short *__c) {
10837 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10840 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10842 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10845 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10846 unsigned short *__c) {
10847 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10850 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10851 vector bool short *__c) {
10852 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10855 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10857 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10860 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10861 unsigned short *__c) {
10862 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10865 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10866 vector pixel *__c) {
10867 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10870 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10872 __builtin_altivec_stvxl(__a, __b, __c);
10875 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10877 __builtin_altivec_stvxl(__a, __b, __c);
10880 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10881 vector unsigned int *__c) {
10882 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10885 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10886 unsigned int *__c) {
10887 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10890 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10892 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10895 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10896 unsigned int *__c) {
10897 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10900 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10901 vector bool int *__c) {
10902 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10905 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10906 vector float *__c) {
10907 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10910 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10912 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10917 static __inline__ vector signed char __ATTRS_o_ai
10918 vec_sub(vector signed char __a, vector signed char __b) {
10922 static __inline__ vector signed char __ATTRS_o_ai
10923 vec_sub(vector bool char __a, vector signed char __b) {
10924 return (vector signed char)__a - __b;
10927 static __inline__ vector signed char __ATTRS_o_ai
10928 vec_sub(vector signed char __a, vector bool char __b) {
10929 return __a - (vector signed char)__b;
10932 static __inline__ vector unsigned char __ATTRS_o_ai
10933 vec_sub(vector unsigned char __a, vector unsigned char __b) {
10937 static __inline__ vector unsigned char __ATTRS_o_ai
10938 vec_sub(vector bool char __a, vector unsigned char __b) {
10939 return (vector unsigned char)__a - __b;
10942 static __inline__ vector unsigned char __ATTRS_o_ai
10943 vec_sub(vector unsigned char __a, vector bool char __b) {
10944 return __a - (vector unsigned char)__b;
10947 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10948 vector short __b) {
10952 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10953 vector short __b) {
10954 return (vector short)__a - __b;
10957 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10958 vector bool short __b) {
10959 return __a - (vector short)__b;
10962 static __inline__ vector unsigned short __ATTRS_o_ai
10963 vec_sub(vector unsigned short __a, vector unsigned short __b) {
10967 static __inline__ vector unsigned short __ATTRS_o_ai
10968 vec_sub(vector bool short __a, vector unsigned short __b) {
10969 return (vector unsigned short)__a - __b;
10972 static __inline__ vector unsigned short __ATTRS_o_ai
10973 vec_sub(vector unsigned short __a, vector bool short __b) {
10974 return __a - (vector unsigned short)__b;
10977 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10982 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
10984 return (vector int)__a - __b;
10987 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10988 vector bool int __b) {
10989 return __a - (vector int)__b;
10992 static __inline__ vector unsigned int __ATTRS_o_ai
10993 vec_sub(vector unsigned int __a, vector unsigned int __b) {
10997 static __inline__ vector unsigned int __ATTRS_o_ai
10998 vec_sub(vector bool int __a, vector unsigned int __b) {
10999 return (vector unsigned int)__a - __b;
11002 static __inline__ vector unsigned int __ATTRS_o_ai
11003 vec_sub(vector unsigned int __a, vector bool int __b) {
11004 return __a - (vector unsigned int)__b;
11007 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11008 static __inline__ vector signed __int128 __ATTRS_o_ai
11009 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11013 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11014 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11017 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11020 static __inline__ vector signed long long __ATTRS_o_ai
11021 vec_sub(vector signed long long __a, vector signed long long __b) {
11025 static __inline__ vector unsigned long long __ATTRS_o_ai
11026 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11030 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11031 vector double __b) {
11036 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11037 vector float __b) {
11043 #define __builtin_altivec_vsububm vec_vsububm
11045 static __inline__ vector signed char __ATTRS_o_ai
11046 vec_vsububm(vector signed char __a, vector signed char __b) {
11050 static __inline__ vector signed char __ATTRS_o_ai
11051 vec_vsububm(vector bool char __a, vector signed char __b) {
11052 return (vector signed char)__a - __b;
11055 static __inline__ vector signed char __ATTRS_o_ai
11056 vec_vsububm(vector signed char __a, vector bool char __b) {
11057 return __a - (vector signed char)__b;
11060 static __inline__ vector unsigned char __ATTRS_o_ai
11061 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11065 static __inline__ vector unsigned char __ATTRS_o_ai
11066 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11067 return (vector unsigned char)__a - __b;
11070 static __inline__ vector unsigned char __ATTRS_o_ai
11071 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11072 return __a - (vector unsigned char)__b;
11077 #define __builtin_altivec_vsubuhm vec_vsubuhm
11079 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11080 vector short __b) {
11084 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11085 vector short __b) {
11086 return (vector short)__a - __b;
11089 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11090 vector bool short __b) {
11091 return __a - (vector short)__b;
11094 static __inline__ vector unsigned short __ATTRS_o_ai
11095 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11099 static __inline__ vector unsigned short __ATTRS_o_ai
11100 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11101 return (vector unsigned short)__a - __b;
11104 static __inline__ vector unsigned short __ATTRS_o_ai
11105 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11106 return __a - (vector unsigned short)__b;
11111 #define __builtin_altivec_vsubuwm vec_vsubuwm
11113 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11118 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11120 return (vector int)__a - __b;
11123 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11124 vector bool int __b) {
11125 return __a - (vector int)__b;
11128 static __inline__ vector unsigned int __ATTRS_o_ai
11129 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11133 static __inline__ vector unsigned int __ATTRS_o_ai
11134 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11135 return (vector unsigned int)__a - __b;
11138 static __inline__ vector unsigned int __ATTRS_o_ai
11139 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11140 return __a - (vector unsigned int)__b;
11145 #define __builtin_altivec_vsubfp vec_vsubfp
11147 static __inline__ vector float __attribute__((__always_inline__))
11148 vec_vsubfp(vector float __a, vector float __b) {
11154 static __inline__ vector signed int __ATTRS_o_ai
11155 vec_subc(vector signed int __a, vector signed int __b) {
11156 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11157 (vector unsigned int) __b);
11160 static __inline__ vector unsigned int __ATTRS_o_ai
11161 vec_subc(vector unsigned int __a, vector unsigned int __b) {
11162 return __builtin_altivec_vsubcuw(__a, __b);
11165 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11166 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11167 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11168 return __builtin_altivec_vsubcuq(__a, __b);
11171 static __inline__ vector signed __int128 __ATTRS_o_ai
11172 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11173 return __builtin_altivec_vsubcuq(__a, __b);
11175 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11179 static __inline__ vector unsigned int __attribute__((__always_inline__))
11180 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11181 return __builtin_altivec_vsubcuw(__a, __b);
11186 static __inline__ vector signed char __ATTRS_o_ai
11187 vec_subs(vector signed char __a, vector signed char __b) {
11188 return __builtin_altivec_vsubsbs(__a, __b);
11191 static __inline__ vector signed char __ATTRS_o_ai
11192 vec_subs(vector bool char __a, vector signed char __b) {
11193 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11196 static __inline__ vector signed char __ATTRS_o_ai
11197 vec_subs(vector signed char __a, vector bool char __b) {
11198 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11201 static __inline__ vector unsigned char __ATTRS_o_ai
11202 vec_subs(vector unsigned char __a, vector unsigned char __b) {
11203 return __builtin_altivec_vsububs(__a, __b);
11206 static __inline__ vector unsigned char __ATTRS_o_ai
11207 vec_subs(vector bool char __a, vector unsigned char __b) {
11208 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11211 static __inline__ vector unsigned char __ATTRS_o_ai
11212 vec_subs(vector unsigned char __a, vector bool char __b) {
11213 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11216 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11217 vector short __b) {
11218 return __builtin_altivec_vsubshs(__a, __b);
11221 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11222 vector short __b) {
11223 return __builtin_altivec_vsubshs((vector short)__a, __b);
11226 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11227 vector bool short __b) {
11228 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11231 static __inline__ vector unsigned short __ATTRS_o_ai
11232 vec_subs(vector unsigned short __a, vector unsigned short __b) {
11233 return __builtin_altivec_vsubuhs(__a, __b);
11236 static __inline__ vector unsigned short __ATTRS_o_ai
11237 vec_subs(vector bool short __a, vector unsigned short __b) {
11238 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11241 static __inline__ vector unsigned short __ATTRS_o_ai
11242 vec_subs(vector unsigned short __a, vector bool short __b) {
11243 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11246 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11248 return __builtin_altivec_vsubsws(__a, __b);
11251 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11253 return __builtin_altivec_vsubsws((vector int)__a, __b);
11256 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11257 vector bool int __b) {
11258 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11261 static __inline__ vector unsigned int __ATTRS_o_ai
11262 vec_subs(vector unsigned int __a, vector unsigned int __b) {
11263 return __builtin_altivec_vsubuws(__a, __b);
11266 static __inline__ vector unsigned int __ATTRS_o_ai
11267 vec_subs(vector bool int __a, vector unsigned int __b) {
11268 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11271 static __inline__ vector unsigned int __ATTRS_o_ai
11272 vec_subs(vector unsigned int __a, vector bool int __b) {
11273 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11278 static __inline__ vector signed char __ATTRS_o_ai
11279 vec_vsubsbs(vector signed char __a, vector signed char __b) {
11280 return __builtin_altivec_vsubsbs(__a, __b);
11283 static __inline__ vector signed char __ATTRS_o_ai
11284 vec_vsubsbs(vector bool char __a, vector signed char __b) {
11285 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11288 static __inline__ vector signed char __ATTRS_o_ai
11289 vec_vsubsbs(vector signed char __a, vector bool char __b) {
11290 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11295 static __inline__ vector unsigned char __ATTRS_o_ai
11296 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11297 return __builtin_altivec_vsububs(__a, __b);
11300 static __inline__ vector unsigned char __ATTRS_o_ai
11301 vec_vsububs(vector bool char __a, vector unsigned char __b) {
11302 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11305 static __inline__ vector unsigned char __ATTRS_o_ai
11306 vec_vsububs(vector unsigned char __a, vector bool char __b) {
11307 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11312 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11313 vector short __b) {
11314 return __builtin_altivec_vsubshs(__a, __b);
11317 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11318 vector short __b) {
11319 return __builtin_altivec_vsubshs((vector short)__a, __b);
11322 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11323 vector bool short __b) {
11324 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11329 static __inline__ vector unsigned short __ATTRS_o_ai
11330 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11331 return __builtin_altivec_vsubuhs(__a, __b);
11334 static __inline__ vector unsigned short __ATTRS_o_ai
11335 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11336 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11339 static __inline__ vector unsigned short __ATTRS_o_ai
11340 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11341 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11346 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11348 return __builtin_altivec_vsubsws(__a, __b);
11351 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11353 return __builtin_altivec_vsubsws((vector int)__a, __b);
11356 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11357 vector bool int __b) {
11358 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11363 static __inline__ vector unsigned int __ATTRS_o_ai
11364 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11365 return __builtin_altivec_vsubuws(__a, __b);
11368 static __inline__ vector unsigned int __ATTRS_o_ai
11369 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11370 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11373 static __inline__ vector unsigned int __ATTRS_o_ai
11374 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11375 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11378 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11381 static __inline__ vector signed __int128 __ATTRS_o_ai
11382 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11386 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11387 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11394 static __inline__ vector signed __int128 __ATTRS_o_ai
11395 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11396 vector signed __int128 __c) {
11397 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11400 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11401 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11402 vector unsigned __int128 __c) {
11403 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11406 static __inline__ vector signed __int128 __ATTRS_o_ai
11407 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11408 vector signed __int128 __c) {
11409 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11412 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11413 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11414 vector unsigned __int128 __c) {
11415 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11420 static __inline__ vector signed __int128 __ATTRS_o_ai
11421 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11422 return __builtin_altivec_vsubcuq(__a, __b);
11425 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11426 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11427 return __builtin_altivec_vsubcuq(__a, __b);
11432 static __inline__ vector signed __int128 __ATTRS_o_ai
11433 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11434 vector signed __int128 __c) {
11435 return __builtin_altivec_vsubecuq(__a, __b, __c);
11438 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11439 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11440 vector unsigned __int128 __c) {
11441 return __builtin_altivec_vsubecuq(__a, __b, __c);
11444 static __inline__ vector signed int __ATTRS_o_ai
11445 vec_subec(vector signed int __a, vector signed int __b,
11446 vector signed int __c) {
11447 return vec_addec(__a, ~__b, __c);
11450 static __inline__ vector unsigned int __ATTRS_o_ai
11451 vec_subec(vector unsigned int __a, vector unsigned int __b,
11452 vector unsigned int __c) {
11453 return vec_addec(__a, ~__b, __c);
11456 static __inline__ vector signed __int128 __ATTRS_o_ai
11457 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11458 vector signed __int128 __c) {
11459 return __builtin_altivec_vsubecuq(__a, __b, __c);
11462 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11463 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11464 vector unsigned __int128 __c) {
11465 return __builtin_altivec_vsubecuq(__a, __b, __c);
11467 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11469 static __inline__ vector signed int __ATTRS_o_ai
11470 vec_sube(vector signed int __a, vector signed int __b,
11471 vector signed int __c) {
11472 vector signed int __mask = {1, 1, 1, 1};
11473 vector signed int __carry = __c & __mask;
11474 return vec_adde(__a, ~__b, __carry);
11477 static __inline__ vector unsigned int __ATTRS_o_ai
11478 vec_sube(vector unsigned int __a, vector unsigned int __b,
11479 vector unsigned int __c) {
11480 vector unsigned int __mask = {1, 1, 1, 1};
11481 vector unsigned int __carry = __c & __mask;
11482 return vec_adde(__a, ~__b, __carry);
11486 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11488 return __builtin_altivec_vsum4sbs(__a, __b);
11491 static __inline__ vector unsigned int __ATTRS_o_ai
11492 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11493 return __builtin_altivec_vsum4ubs(__a, __b);
11496 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11498 return __builtin_altivec_vsum4shs(__a, __b);
11503 static __inline__ vector int __attribute__((__always_inline__))
11504 vec_vsum4sbs(vector signed char __a, vector int __b) {
11505 return __builtin_altivec_vsum4sbs(__a, __b);
11510 static __inline__ vector unsigned int __attribute__((__always_inline__))
11511 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11512 return __builtin_altivec_vsum4ubs(__a, __b);
11517 static __inline__ vector int __attribute__((__always_inline__))
11518 vec_vsum4shs(vector signed short __a, vector int __b) {
11519 return __builtin_altivec_vsum4shs(__a, __b);
11524 /* The vsum2sws instruction has a big-endian bias, so that the second
11525 input vector and the result always reference big-endian elements
11526 1 and 3 (little-endian element 0 and 2). For ease of porting the
11527 programmer wants elements 1 and 3 in both cases, so for little
11528 endian we must perform some permutes. */
11530 static __inline__ vector signed int __attribute__((__always_inline__))
11531 vec_sum2s(vector int __a, vector int __b) {
11532 #ifdef __LITTLE_ENDIAN__
11533 vector int __c = (vector signed int)vec_perm(
11534 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11536 __c = __builtin_altivec_vsum2sws(__a, __c);
11537 return (vector signed int)vec_perm(
11538 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11541 return __builtin_altivec_vsum2sws(__a, __b);
11547 static __inline__ vector signed int __attribute__((__always_inline__))
11548 vec_vsum2sws(vector int __a, vector int __b) {
11549 #ifdef __LITTLE_ENDIAN__
11550 vector int __c = (vector signed int)vec_perm(
11551 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11553 __c = __builtin_altivec_vsum2sws(__a, __c);
11554 return (vector signed int)vec_perm(
11555 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11558 return __builtin_altivec_vsum2sws(__a, __b);
11564 /* The vsumsws instruction has a big-endian bias, so that the second
11565 input vector and the result always reference big-endian element 3
11566 (little-endian element 0). For ease of porting the programmer
11567 wants element 3 in both cases, so for little endian we must perform
11570 static __inline__ vector signed int __attribute__((__always_inline__))
11571 vec_sums(vector signed int __a, vector signed int __b) {
11572 #ifdef __LITTLE_ENDIAN__
11573 __b = (vector signed int)vec_splat(__b, 3);
11574 __b = __builtin_altivec_vsumsws(__a, __b);
11575 return (vector signed int)(0, 0, 0, __b[0]);
11577 return __builtin_altivec_vsumsws(__a, __b);
11583 static __inline__ vector signed int __attribute__((__always_inline__))
11584 vec_vsumsws(vector signed int __a, vector signed int __b) {
11585 #ifdef __LITTLE_ENDIAN__
11586 __b = (vector signed int)vec_splat(__b, 3);
11587 __b = __builtin_altivec_vsumsws(__a, __b);
11588 return (vector signed int)(0, 0, 0, __b[0]);
11590 return __builtin_altivec_vsumsws(__a, __b);
11596 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11598 return __builtin_vsx_xvrspiz(__a);
11600 return __builtin_altivec_vrfiz(__a);
11605 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11606 return __builtin_vsx_xvrdpiz(__a);
11612 static __inline__ vector float __attribute__((__always_inline__))
11613 vec_vrfiz(vector float __a) {
11614 return __builtin_altivec_vrfiz(__a);
11619 /* The vector unpack instructions all have a big-endian bias, so for
11620 little endian we must reverse the meanings of "high" and "low." */
11622 static __inline__ vector short __ATTRS_o_ai
11623 vec_unpackh(vector signed char __a) {
11624 #ifdef __LITTLE_ENDIAN__
11625 return __builtin_altivec_vupklsb((vector char)__a);
11627 return __builtin_altivec_vupkhsb((vector char)__a);
11631 static __inline__ vector bool short __ATTRS_o_ai
11632 vec_unpackh(vector bool char __a) {
11633 #ifdef __LITTLE_ENDIAN__
11634 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11636 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11640 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11641 #ifdef __LITTLE_ENDIAN__
11642 return __builtin_altivec_vupklsh(__a);
11644 return __builtin_altivec_vupkhsh(__a);
11648 static __inline__ vector bool int __ATTRS_o_ai
11649 vec_unpackh(vector bool short __a) {
11650 #ifdef __LITTLE_ENDIAN__
11651 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11653 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11657 static __inline__ vector unsigned int __ATTRS_o_ai
11658 vec_unpackh(vector pixel __a) {
11659 #ifdef __LITTLE_ENDIAN__
11660 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11662 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11666 #ifdef __POWER8_VECTOR__
11667 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11668 #ifdef __LITTLE_ENDIAN__
11669 return __builtin_altivec_vupklsw(__a);
11671 return __builtin_altivec_vupkhsw(__a);
11675 static __inline__ vector bool long long __ATTRS_o_ai
11676 vec_unpackh(vector bool int __a) {
11677 #ifdef __LITTLE_ENDIAN__
11678 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11680 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11684 static __inline__ vector double __ATTRS_o_ai
11685 vec_unpackh(vector float __a) {
11686 return (vector double)(__a[0], __a[1]);
11692 static __inline__ vector short __ATTRS_o_ai
11693 vec_vupkhsb(vector signed char __a) {
11694 #ifdef __LITTLE_ENDIAN__
11695 return __builtin_altivec_vupklsb((vector char)__a);
11697 return __builtin_altivec_vupkhsb((vector char)__a);
11701 static __inline__ vector bool short __ATTRS_o_ai
11702 vec_vupkhsb(vector bool char __a) {
11703 #ifdef __LITTLE_ENDIAN__
11704 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11706 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11712 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11713 #ifdef __LITTLE_ENDIAN__
11714 return __builtin_altivec_vupklsh(__a);
11716 return __builtin_altivec_vupkhsh(__a);
11720 static __inline__ vector bool int __ATTRS_o_ai
11721 vec_vupkhsh(vector bool short __a) {
11722 #ifdef __LITTLE_ENDIAN__
11723 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11725 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11729 static __inline__ vector unsigned int __ATTRS_o_ai
11730 vec_vupkhsh(vector pixel __a) {
11731 #ifdef __LITTLE_ENDIAN__
11732 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11734 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11740 #ifdef __POWER8_VECTOR__
11741 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11742 #ifdef __LITTLE_ENDIAN__
11743 return __builtin_altivec_vupklsw(__a);
11745 return __builtin_altivec_vupkhsw(__a);
11749 static __inline__ vector bool long long __ATTRS_o_ai
11750 vec_vupkhsw(vector bool int __a) {
11751 #ifdef __LITTLE_ENDIAN__
11752 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11754 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11761 static __inline__ vector short __ATTRS_o_ai
11762 vec_unpackl(vector signed char __a) {
11763 #ifdef __LITTLE_ENDIAN__
11764 return __builtin_altivec_vupkhsb((vector char)__a);
11766 return __builtin_altivec_vupklsb((vector char)__a);
11770 static __inline__ vector bool short __ATTRS_o_ai
11771 vec_unpackl(vector bool char __a) {
11772 #ifdef __LITTLE_ENDIAN__
11773 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11775 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11779 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11780 #ifdef __LITTLE_ENDIAN__
11781 return __builtin_altivec_vupkhsh(__a);
11783 return __builtin_altivec_vupklsh(__a);
11787 static __inline__ vector bool int __ATTRS_o_ai
11788 vec_unpackl(vector bool short __a) {
11789 #ifdef __LITTLE_ENDIAN__
11790 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11792 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11796 static __inline__ vector unsigned int __ATTRS_o_ai
11797 vec_unpackl(vector pixel __a) {
11798 #ifdef __LITTLE_ENDIAN__
11799 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11801 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11805 #ifdef __POWER8_VECTOR__
11806 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11807 #ifdef __LITTLE_ENDIAN__
11808 return __builtin_altivec_vupkhsw(__a);
11810 return __builtin_altivec_vupklsw(__a);
11814 static __inline__ vector bool long long __ATTRS_o_ai
11815 vec_unpackl(vector bool int __a) {
11816 #ifdef __LITTLE_ENDIAN__
11817 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11819 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11823 static __inline__ vector double __ATTRS_o_ai
11824 vec_unpackl(vector float __a) {
11825 return (vector double)(__a[2], __a[3]);
11831 static __inline__ vector short __ATTRS_o_ai
11832 vec_vupklsb(vector signed char __a) {
11833 #ifdef __LITTLE_ENDIAN__
11834 return __builtin_altivec_vupkhsb((vector char)__a);
11836 return __builtin_altivec_vupklsb((vector char)__a);
11840 static __inline__ vector bool short __ATTRS_o_ai
11841 vec_vupklsb(vector bool char __a) {
11842 #ifdef __LITTLE_ENDIAN__
11843 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11845 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11851 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11852 #ifdef __LITTLE_ENDIAN__
11853 return __builtin_altivec_vupkhsh(__a);
11855 return __builtin_altivec_vupklsh(__a);
11859 static __inline__ vector bool int __ATTRS_o_ai
11860 vec_vupklsh(vector bool short __a) {
11861 #ifdef __LITTLE_ENDIAN__
11862 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11864 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11868 static __inline__ vector unsigned int __ATTRS_o_ai
11869 vec_vupklsh(vector pixel __a) {
11870 #ifdef __LITTLE_ENDIAN__
11871 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11873 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11879 #ifdef __POWER8_VECTOR__
11880 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11881 #ifdef __LITTLE_ENDIAN__
11882 return __builtin_altivec_vupkhsw(__a);
11884 return __builtin_altivec_vupklsw(__a);
11888 static __inline__ vector bool long long __ATTRS_o_ai
11889 vec_vupklsw(vector bool int __a) {
11890 #ifdef __LITTLE_ENDIAN__
11891 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11893 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11902 static __inline__ vector bool int __ATTRS_o_ai
11903 vec_vsx_ld(int __a, const vector bool int *__b) {
11904 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11907 static __inline__ vector signed int __ATTRS_o_ai
11908 vec_vsx_ld(int __a, const vector signed int *__b) {
11909 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11912 static __inline__ vector signed int __ATTRS_o_ai
11913 vec_vsx_ld(int __a, const signed int *__b) {
11914 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11917 static __inline__ vector unsigned int __ATTRS_o_ai
11918 vec_vsx_ld(int __a, const vector unsigned int *__b) {
11919 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11922 static __inline__ vector unsigned int __ATTRS_o_ai
11923 vec_vsx_ld(int __a, const unsigned int *__b) {
11924 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11927 static __inline__ vector float __ATTRS_o_ai
11928 vec_vsx_ld(int __a, const vector float *__b) {
11929 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11932 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11933 const float *__b) {
11934 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11937 static __inline__ vector signed long long __ATTRS_o_ai
11938 vec_vsx_ld(int __a, const vector signed long long *__b) {
11939 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11942 static __inline__ vector unsigned long long __ATTRS_o_ai
11943 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11944 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11947 static __inline__ vector double __ATTRS_o_ai
11948 vec_vsx_ld(int __a, const vector double *__b) {
11949 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11952 static __inline__ vector double __ATTRS_o_ai
11953 vec_vsx_ld(int __a, const double *__b) {
11954 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11957 static __inline__ vector bool short __ATTRS_o_ai
11958 vec_vsx_ld(int __a, const vector bool short *__b) {
11959 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
11962 static __inline__ vector signed short __ATTRS_o_ai
11963 vec_vsx_ld(int __a, const vector signed short *__b) {
11964 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11967 static __inline__ vector signed short __ATTRS_o_ai
11968 vec_vsx_ld(int __a, const signed short *__b) {
11969 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11972 static __inline__ vector unsigned short __ATTRS_o_ai
11973 vec_vsx_ld(int __a, const vector unsigned short *__b) {
11974 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11977 static __inline__ vector unsigned short __ATTRS_o_ai
11978 vec_vsx_ld(int __a, const unsigned short *__b) {
11979 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11982 static __inline__ vector bool char __ATTRS_o_ai
11983 vec_vsx_ld(int __a, const vector bool char *__b) {
11984 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
11987 static __inline__ vector signed char __ATTRS_o_ai
11988 vec_vsx_ld(int __a, const vector signed char *__b) {
11989 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11992 static __inline__ vector signed char __ATTRS_o_ai
11993 vec_vsx_ld(int __a, const signed char *__b) {
11994 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11997 static __inline__ vector unsigned char __ATTRS_o_ai
11998 vec_vsx_ld(int __a, const vector unsigned char *__b) {
11999 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12002 static __inline__ vector unsigned char __ATTRS_o_ai
12003 vec_vsx_ld(int __a, const unsigned char *__b) {
12004 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12013 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12014 vector bool int *__c) {
12015 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12018 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12020 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12023 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12024 unsigned int *__c) {
12025 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12028 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12029 vector signed int *__c) {
12030 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12033 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12035 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12038 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12039 vector unsigned int *__c) {
12040 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12043 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12044 unsigned int *__c) {
12045 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12048 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12049 vector float *__c) {
12050 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12053 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12055 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12058 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12060 vector signed long long *__c) {
12061 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12064 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12066 vector unsigned long long *__c) {
12067 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12070 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12071 vector double *__c) {
12072 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12075 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12077 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12080 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12081 vector bool short *__c) {
12082 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12085 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12086 signed short *__c) {
12087 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12090 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12091 unsigned short *__c) {
12092 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12094 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12095 vector signed short *__c) {
12096 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12099 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12100 signed short *__c) {
12101 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12104 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12106 vector unsigned short *__c) {
12107 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12110 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12111 int __b, unsigned short *__c) {
12112 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12115 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12116 vector bool char *__c) {
12117 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12120 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12121 signed char *__c) {
12122 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12125 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12126 unsigned char *__c) {
12127 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12130 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12131 vector signed char *__c) {
12132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12135 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12136 signed char *__c) {
12137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12140 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12142 vector unsigned char *__c) {
12143 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12146 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12147 int __b, unsigned char *__c) {
12148 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12154 #define vec_xxpermdi __builtin_vsx_xxpermdi
12155 #define vec_xxsldwi __builtin_vsx_xxsldwi
12160 #define __builtin_altivec_vxor vec_xor
12162 static __inline__ vector signed char __ATTRS_o_ai
12163 vec_xor(vector signed char __a, vector signed char __b) {
12167 static __inline__ vector signed char __ATTRS_o_ai
12168 vec_xor(vector bool char __a, vector signed char __b) {
12169 return (vector signed char)__a ^ __b;
12172 static __inline__ vector signed char __ATTRS_o_ai
12173 vec_xor(vector signed char __a, vector bool char __b) {
12174 return __a ^ (vector signed char)__b;
12177 static __inline__ vector unsigned char __ATTRS_o_ai
12178 vec_xor(vector unsigned char __a, vector unsigned char __b) {
12182 static __inline__ vector unsigned char __ATTRS_o_ai
12183 vec_xor(vector bool char __a, vector unsigned char __b) {
12184 return (vector unsigned char)__a ^ __b;
12187 static __inline__ vector unsigned char __ATTRS_o_ai
12188 vec_xor(vector unsigned char __a, vector bool char __b) {
12189 return __a ^ (vector unsigned char)__b;
12192 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12193 vector bool char __b) {
12197 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12198 vector short __b) {
12202 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12203 vector short __b) {
12204 return (vector short)__a ^ __b;
12207 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12208 vector bool short __b) {
12209 return __a ^ (vector short)__b;
12212 static __inline__ vector unsigned short __ATTRS_o_ai
12213 vec_xor(vector unsigned short __a, vector unsigned short __b) {
12217 static __inline__ vector unsigned short __ATTRS_o_ai
12218 vec_xor(vector bool short __a, vector unsigned short __b) {
12219 return (vector unsigned short)__a ^ __b;
12222 static __inline__ vector unsigned short __ATTRS_o_ai
12223 vec_xor(vector unsigned short __a, vector bool short __b) {
12224 return __a ^ (vector unsigned short)__b;
12227 static __inline__ vector bool short __ATTRS_o_ai
12228 vec_xor(vector bool short __a, vector bool short __b) {
12232 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12237 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12239 return (vector int)__a ^ __b;
12242 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12243 vector bool int __b) {
12244 return __a ^ (vector int)__b;
12247 static __inline__ vector unsigned int __ATTRS_o_ai
12248 vec_xor(vector unsigned int __a, vector unsigned int __b) {
12252 static __inline__ vector unsigned int __ATTRS_o_ai
12253 vec_xor(vector bool int __a, vector unsigned int __b) {
12254 return (vector unsigned int)__a ^ __b;
12257 static __inline__ vector unsigned int __ATTRS_o_ai
12258 vec_xor(vector unsigned int __a, vector bool int __b) {
12259 return __a ^ (vector unsigned int)__b;
12262 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12263 vector bool int __b) {
12267 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12268 vector float __b) {
12269 vector unsigned int __res =
12270 (vector unsigned int)__a ^ (vector unsigned int)__b;
12271 return (vector float)__res;
12274 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12275 vector float __b) {
12276 vector unsigned int __res =
12277 (vector unsigned int)__a ^ (vector unsigned int)__b;
12278 return (vector float)__res;
12281 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12282 vector bool int __b) {
12283 vector unsigned int __res =
12284 (vector unsigned int)__a ^ (vector unsigned int)__b;
12285 return (vector float)__res;
12289 static __inline__ vector signed long long __ATTRS_o_ai
12290 vec_xor(vector signed long long __a, vector signed long long __b) {
12294 static __inline__ vector signed long long __ATTRS_o_ai
12295 vec_xor(vector bool long long __a, vector signed long long __b) {
12296 return (vector signed long long)__a ^ __b;
12299 static __inline__ vector signed long long __ATTRS_o_ai
12300 vec_xor(vector signed long long __a, vector bool long long __b) {
12301 return __a ^ (vector signed long long)__b;
12304 static __inline__ vector unsigned long long __ATTRS_o_ai
12305 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12309 static __inline__ vector unsigned long long __ATTRS_o_ai
12310 vec_xor(vector bool long long __a, vector unsigned long long __b) {
12311 return (vector unsigned long long)__a ^ __b;
12314 static __inline__ vector unsigned long long __ATTRS_o_ai
12315 vec_xor(vector unsigned long long __a, vector bool long long __b) {
12316 return __a ^ (vector unsigned long long)__b;
12319 static __inline__ vector bool long long __ATTRS_o_ai
12320 vec_xor(vector bool long long __a, vector bool long long __b) {
12324 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12325 vector double __b) {
12326 return (vector double)((vector unsigned long long)__a ^
12327 (vector unsigned long long)__b);
12330 static __inline__ vector double __ATTRS_o_ai
12331 vec_xor(vector double __a, vector bool long long __b) {
12332 return (vector double)((vector unsigned long long)__a ^
12333 (vector unsigned long long)__b);
12336 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12337 vector double __b) {
12338 return (vector double)((vector unsigned long long)__a ^
12339 (vector unsigned long long)__b);
12345 static __inline__ vector signed char __ATTRS_o_ai
12346 vec_vxor(vector signed char __a, vector signed char __b) {
12350 static __inline__ vector signed char __ATTRS_o_ai
12351 vec_vxor(vector bool char __a, vector signed char __b) {
12352 return (vector signed char)__a ^ __b;
12355 static __inline__ vector signed char __ATTRS_o_ai
12356 vec_vxor(vector signed char __a, vector bool char __b) {
12357 return __a ^ (vector signed char)__b;
12360 static __inline__ vector unsigned char __ATTRS_o_ai
12361 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12365 static __inline__ vector unsigned char __ATTRS_o_ai
12366 vec_vxor(vector bool char __a, vector unsigned char __b) {
12367 return (vector unsigned char)__a ^ __b;
12370 static __inline__ vector unsigned char __ATTRS_o_ai
12371 vec_vxor(vector unsigned char __a, vector bool char __b) {
12372 return __a ^ (vector unsigned char)__b;
12375 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12376 vector bool char __b) {
12380 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12381 vector short __b) {
12385 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12386 vector short __b) {
12387 return (vector short)__a ^ __b;
12390 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12391 vector bool short __b) {
12392 return __a ^ (vector short)__b;
12395 static __inline__ vector unsigned short __ATTRS_o_ai
12396 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12400 static __inline__ vector unsigned short __ATTRS_o_ai
12401 vec_vxor(vector bool short __a, vector unsigned short __b) {
12402 return (vector unsigned short)__a ^ __b;
12405 static __inline__ vector unsigned short __ATTRS_o_ai
12406 vec_vxor(vector unsigned short __a, vector bool short __b) {
12407 return __a ^ (vector unsigned short)__b;
12410 static __inline__ vector bool short __ATTRS_o_ai
12411 vec_vxor(vector bool short __a, vector bool short __b) {
12415 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12420 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12422 return (vector int)__a ^ __b;
12425 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12426 vector bool int __b) {
12427 return __a ^ (vector int)__b;
12430 static __inline__ vector unsigned int __ATTRS_o_ai
12431 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12435 static __inline__ vector unsigned int __ATTRS_o_ai
12436 vec_vxor(vector bool int __a, vector unsigned int __b) {
12437 return (vector unsigned int)__a ^ __b;
12440 static __inline__ vector unsigned int __ATTRS_o_ai
12441 vec_vxor(vector unsigned int __a, vector bool int __b) {
12442 return __a ^ (vector unsigned int)__b;
12445 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12446 vector bool int __b) {
12450 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12451 vector float __b) {
12452 vector unsigned int __res =
12453 (vector unsigned int)__a ^ (vector unsigned int)__b;
12454 return (vector float)__res;
12457 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12458 vector float __b) {
12459 vector unsigned int __res =
12460 (vector unsigned int)__a ^ (vector unsigned int)__b;
12461 return (vector float)__res;
12464 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12465 vector bool int __b) {
12466 vector unsigned int __res =
12467 (vector unsigned int)__a ^ (vector unsigned int)__b;
12468 return (vector float)__res;
12472 static __inline__ vector signed long long __ATTRS_o_ai
12473 vec_vxor(vector signed long long __a, vector signed long long __b) {
12477 static __inline__ vector signed long long __ATTRS_o_ai
12478 vec_vxor(vector bool long long __a, vector signed long long __b) {
12479 return (vector signed long long)__a ^ __b;
12482 static __inline__ vector signed long long __ATTRS_o_ai
12483 vec_vxor(vector signed long long __a, vector bool long long __b) {
12484 return __a ^ (vector signed long long)__b;
12487 static __inline__ vector unsigned long long __ATTRS_o_ai
12488 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12492 static __inline__ vector unsigned long long __ATTRS_o_ai
12493 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12494 return (vector unsigned long long)__a ^ __b;
12497 static __inline__ vector unsigned long long __ATTRS_o_ai
12498 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12499 return __a ^ (vector unsigned long long)__b;
12502 static __inline__ vector bool long long __ATTRS_o_ai
12503 vec_vxor(vector bool long long __a, vector bool long long __b) {
12508 /* ------------------------ extensions for CBEA ----------------------------- */
12512 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12517 static __inline__ unsigned char __ATTRS_o_ai
12518 vec_extract(vector unsigned char __a, int __b) {
12522 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12527 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12532 static __inline__ unsigned short __ATTRS_o_ai
12533 vec_extract(vector unsigned short __a, int __b) {
12537 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12542 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12547 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12552 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12558 static __inline__ signed long long __ATTRS_o_ai
12559 vec_extract(vector signed long long __a, int __b) {
12563 static __inline__ unsigned long long __ATTRS_o_ai
12564 vec_extract(vector unsigned long long __a, int __b) {
12568 static __inline__ unsigned long long __ATTRS_o_ai
12569 vec_extract(vector bool long long __a, int __b) {
12573 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12578 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12582 #ifdef __POWER9_VECTOR__
12584 #define vec_insert4b __builtin_vsx_insertword
12585 #define vec_extract4b __builtin_vsx_extractuword
12587 /* vec_extract_exp */
12589 static __inline__ vector unsigned int __ATTRS_o_ai
12590 vec_extract_exp(vector float __a) {
12591 return __builtin_vsx_xvxexpsp(__a);
12594 static __inline__ vector unsigned long long __ATTRS_o_ai
12595 vec_extract_exp(vector double __a) {
12596 return __builtin_vsx_xvxexpdp(__a);
12599 /* vec_extract_sig */
12601 static __inline__ vector unsigned int __ATTRS_o_ai
12602 vec_extract_sig(vector float __a) {
12603 return __builtin_vsx_xvxsigsp(__a);
12606 static __inline__ vector unsigned long long __ATTRS_o_ai
12607 vec_extract_sig (vector double __a) {
12608 return __builtin_vsx_xvxsigdp(__a);
12611 static __inline__ vector float __ATTRS_o_ai
12612 vec_extract_fp32_from_shorth(vector unsigned short __a) {
12613 vector unsigned short __b =
12614 #ifdef __LITTLE_ENDIAN__
12615 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12617 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12619 return __builtin_vsx_xvcvhpsp(__b);
12622 static __inline__ vector float __ATTRS_o_ai
12623 vec_extract_fp32_from_shortl(vector unsigned short __a) {
12624 vector unsigned short __b =
12625 #ifdef __LITTLE_ENDIAN__
12626 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12628 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12630 return __builtin_vsx_xvcvhpsp(__b);
12632 #endif /* __POWER9_VECTOR__ */
12636 static __inline__ vector signed char __ATTRS_o_ai
12637 vec_insert(signed char __a, vector signed char __b, int __c) {
12642 static __inline__ vector unsigned char __ATTRS_o_ai
12643 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12648 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12649 vector bool char __b,
12655 static __inline__ vector signed short __ATTRS_o_ai
12656 vec_insert(signed short __a, vector signed short __b, int __c) {
12661 static __inline__ vector unsigned short __ATTRS_o_ai
12662 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12667 static __inline__ vector bool short __ATTRS_o_ai
12668 vec_insert(unsigned short __a, vector bool short __b, int __c) {
12673 static __inline__ vector signed int __ATTRS_o_ai
12674 vec_insert(signed int __a, vector signed int __b, int __c) {
12679 static __inline__ vector unsigned int __ATTRS_o_ai
12680 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12685 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12686 vector bool int __b,
12693 static __inline__ vector signed long long __ATTRS_o_ai
12694 vec_insert(signed long long __a, vector signed long long __b, int __c) {
12699 static __inline__ vector unsigned long long __ATTRS_o_ai
12700 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12705 static __inline__ vector bool long long __ATTRS_o_ai
12706 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12710 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12718 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12727 static __inline__ vector signed char __ATTRS_o_ai
12728 vec_lvlx(int __a, const signed char *__b) {
12729 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12730 vec_lvsl(__a, __b));
12733 static __inline__ vector signed char __ATTRS_o_ai
12734 vec_lvlx(int __a, const vector signed char *__b) {
12735 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12736 vec_lvsl(__a, (unsigned char *)__b));
12739 static __inline__ vector unsigned char __ATTRS_o_ai
12740 vec_lvlx(int __a, const unsigned char *__b) {
12741 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12742 vec_lvsl(__a, __b));
12745 static __inline__ vector unsigned char __ATTRS_o_ai
12746 vec_lvlx(int __a, const vector unsigned char *__b) {
12747 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12748 vec_lvsl(__a, (unsigned char *)__b));
12751 static __inline__ vector bool char __ATTRS_o_ai
12752 vec_lvlx(int __a, const vector bool char *__b) {
12753 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12754 vec_lvsl(__a, (unsigned char *)__b));
12757 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12758 const short *__b) {
12759 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12762 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12763 const vector short *__b) {
12764 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12765 vec_lvsl(__a, (unsigned char *)__b));
12768 static __inline__ vector unsigned short __ATTRS_o_ai
12769 vec_lvlx(int __a, const unsigned short *__b) {
12770 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12771 vec_lvsl(__a, __b));
12774 static __inline__ vector unsigned short __ATTRS_o_ai
12775 vec_lvlx(int __a, const vector unsigned short *__b) {
12776 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12777 vec_lvsl(__a, (unsigned char *)__b));
12780 static __inline__ vector bool short __ATTRS_o_ai
12781 vec_lvlx(int __a, const vector bool short *__b) {
12782 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12783 vec_lvsl(__a, (unsigned char *)__b));
12786 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12787 const vector pixel *__b) {
12788 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12789 vec_lvsl(__a, (unsigned char *)__b));
12792 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12793 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12796 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12797 const vector int *__b) {
12798 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12799 vec_lvsl(__a, (unsigned char *)__b));
12802 static __inline__ vector unsigned int __ATTRS_o_ai
12803 vec_lvlx(int __a, const unsigned int *__b) {
12804 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12805 vec_lvsl(__a, __b));
12808 static __inline__ vector unsigned int __ATTRS_o_ai
12809 vec_lvlx(int __a, const vector unsigned int *__b) {
12810 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12811 vec_lvsl(__a, (unsigned char *)__b));
12814 static __inline__ vector bool int __ATTRS_o_ai
12815 vec_lvlx(int __a, const vector bool int *__b) {
12816 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12817 vec_lvsl(__a, (unsigned char *)__b));
12820 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12821 const float *__b) {
12822 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12825 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12826 const vector float *__b) {
12827 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12828 vec_lvsl(__a, (unsigned char *)__b));
12833 static __inline__ vector signed char __ATTRS_o_ai
12834 vec_lvlxl(int __a, const signed char *__b) {
12835 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12836 vec_lvsl(__a, __b));
12839 static __inline__ vector signed char __ATTRS_o_ai
12840 vec_lvlxl(int __a, const vector signed char *__b) {
12841 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12842 vec_lvsl(__a, (unsigned char *)__b));
12845 static __inline__ vector unsigned char __ATTRS_o_ai
12846 vec_lvlxl(int __a, const unsigned char *__b) {
12847 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12848 vec_lvsl(__a, __b));
12851 static __inline__ vector unsigned char __ATTRS_o_ai
12852 vec_lvlxl(int __a, const vector unsigned char *__b) {
12853 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12854 vec_lvsl(__a, (unsigned char *)__b));
12857 static __inline__ vector bool char __ATTRS_o_ai
12858 vec_lvlxl(int __a, const vector bool char *__b) {
12859 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12860 vec_lvsl(__a, (unsigned char *)__b));
12863 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12864 const short *__b) {
12865 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12868 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12869 const vector short *__b) {
12870 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12871 vec_lvsl(__a, (unsigned char *)__b));
12874 static __inline__ vector unsigned short __ATTRS_o_ai
12875 vec_lvlxl(int __a, const unsigned short *__b) {
12876 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12877 vec_lvsl(__a, __b));
12880 static __inline__ vector unsigned short __ATTRS_o_ai
12881 vec_lvlxl(int __a, const vector unsigned short *__b) {
12882 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12883 vec_lvsl(__a, (unsigned char *)__b));
12886 static __inline__ vector bool short __ATTRS_o_ai
12887 vec_lvlxl(int __a, const vector bool short *__b) {
12888 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12889 vec_lvsl(__a, (unsigned char *)__b));
12892 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12893 const vector pixel *__b) {
12894 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12895 vec_lvsl(__a, (unsigned char *)__b));
12898 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12899 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12902 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12903 const vector int *__b) {
12904 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12905 vec_lvsl(__a, (unsigned char *)__b));
12908 static __inline__ vector unsigned int __ATTRS_o_ai
12909 vec_lvlxl(int __a, const unsigned int *__b) {
12910 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12911 vec_lvsl(__a, __b));
12914 static __inline__ vector unsigned int __ATTRS_o_ai
12915 vec_lvlxl(int __a, const vector unsigned int *__b) {
12916 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12917 vec_lvsl(__a, (unsigned char *)__b));
12920 static __inline__ vector bool int __ATTRS_o_ai
12921 vec_lvlxl(int __a, const vector bool int *__b) {
12922 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12923 vec_lvsl(__a, (unsigned char *)__b));
12926 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12927 const float *__b) {
12928 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12931 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12932 vector float *__b) {
12933 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12934 vec_lvsl(__a, (unsigned char *)__b));
12939 static __inline__ vector signed char __ATTRS_o_ai
12940 vec_lvrx(int __a, const signed char *__b) {
12941 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12942 vec_lvsl(__a, __b));
12945 static __inline__ vector signed char __ATTRS_o_ai
12946 vec_lvrx(int __a, const vector signed char *__b) {
12947 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12948 vec_lvsl(__a, (unsigned char *)__b));
12951 static __inline__ vector unsigned char __ATTRS_o_ai
12952 vec_lvrx(int __a, const unsigned char *__b) {
12953 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12954 vec_lvsl(__a, __b));
12957 static __inline__ vector unsigned char __ATTRS_o_ai
12958 vec_lvrx(int __a, const vector unsigned char *__b) {
12959 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12960 vec_lvsl(__a, (unsigned char *)__b));
12963 static __inline__ vector bool char __ATTRS_o_ai
12964 vec_lvrx(int __a, const vector bool char *__b) {
12965 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
12966 vec_lvsl(__a, (unsigned char *)__b));
12969 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12970 const short *__b) {
12971 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12974 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12975 const vector short *__b) {
12976 return vec_perm((vector short)(0), vec_ld(__a, __b),
12977 vec_lvsl(__a, (unsigned char *)__b));
12980 static __inline__ vector unsigned short __ATTRS_o_ai
12981 vec_lvrx(int __a, const unsigned short *__b) {
12982 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12983 vec_lvsl(__a, __b));
12986 static __inline__ vector unsigned short __ATTRS_o_ai
12987 vec_lvrx(int __a, const vector unsigned short *__b) {
12988 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12989 vec_lvsl(__a, (unsigned char *)__b));
12992 static __inline__ vector bool short __ATTRS_o_ai
12993 vec_lvrx(int __a, const vector bool short *__b) {
12994 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
12995 vec_lvsl(__a, (unsigned char *)__b));
12998 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
12999 const vector pixel *__b) {
13000 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
13001 vec_lvsl(__a, (unsigned char *)__b));
13004 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
13005 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13008 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
13009 const vector int *__b) {
13010 return vec_perm((vector int)(0), vec_ld(__a, __b),
13011 vec_lvsl(__a, (unsigned char *)__b));
13014 static __inline__ vector unsigned int __ATTRS_o_ai
13015 vec_lvrx(int __a, const unsigned int *__b) {
13016 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13017 vec_lvsl(__a, __b));
13020 static __inline__ vector unsigned int __ATTRS_o_ai
13021 vec_lvrx(int __a, const vector unsigned int *__b) {
13022 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13023 vec_lvsl(__a, (unsigned char *)__b));
13026 static __inline__ vector bool int __ATTRS_o_ai
13027 vec_lvrx(int __a, const vector bool int *__b) {
13028 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13029 vec_lvsl(__a, (unsigned char *)__b));
13032 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13033 const float *__b) {
13034 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13037 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13038 const vector float *__b) {
13039 return vec_perm((vector float)(0), vec_ld(__a, __b),
13040 vec_lvsl(__a, (unsigned char *)__b));
13045 static __inline__ vector signed char __ATTRS_o_ai
13046 vec_lvrxl(int __a, const signed char *__b) {
13047 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13048 vec_lvsl(__a, __b));
13051 static __inline__ vector signed char __ATTRS_o_ai
13052 vec_lvrxl(int __a, const vector signed char *__b) {
13053 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13054 vec_lvsl(__a, (unsigned char *)__b));
13057 static __inline__ vector unsigned char __ATTRS_o_ai
13058 vec_lvrxl(int __a, const unsigned char *__b) {
13059 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13060 vec_lvsl(__a, __b));
13063 static __inline__ vector unsigned char __ATTRS_o_ai
13064 vec_lvrxl(int __a, const vector unsigned char *__b) {
13065 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13066 vec_lvsl(__a, (unsigned char *)__b));
13069 static __inline__ vector bool char __ATTRS_o_ai
13070 vec_lvrxl(int __a, const vector bool char *__b) {
13071 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13072 vec_lvsl(__a, (unsigned char *)__b));
13075 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13076 const short *__b) {
13077 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13080 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13081 const vector short *__b) {
13082 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13083 vec_lvsl(__a, (unsigned char *)__b));
13086 static __inline__ vector unsigned short __ATTRS_o_ai
13087 vec_lvrxl(int __a, const unsigned short *__b) {
13088 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13089 vec_lvsl(__a, __b));
13092 static __inline__ vector unsigned short __ATTRS_o_ai
13093 vec_lvrxl(int __a, const vector unsigned short *__b) {
13094 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13095 vec_lvsl(__a, (unsigned char *)__b));
13098 static __inline__ vector bool short __ATTRS_o_ai
13099 vec_lvrxl(int __a, const vector bool short *__b) {
13100 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13101 vec_lvsl(__a, (unsigned char *)__b));
13104 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13105 const vector pixel *__b) {
13106 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13107 vec_lvsl(__a, (unsigned char *)__b));
13110 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13111 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13114 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13115 const vector int *__b) {
13116 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13117 vec_lvsl(__a, (unsigned char *)__b));
13120 static __inline__ vector unsigned int __ATTRS_o_ai
13121 vec_lvrxl(int __a, const unsigned int *__b) {
13122 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13123 vec_lvsl(__a, __b));
13126 static __inline__ vector unsigned int __ATTRS_o_ai
13127 vec_lvrxl(int __a, const vector unsigned int *__b) {
13128 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13129 vec_lvsl(__a, (unsigned char *)__b));
13132 static __inline__ vector bool int __ATTRS_o_ai
13133 vec_lvrxl(int __a, const vector bool int *__b) {
13134 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13135 vec_lvsl(__a, (unsigned char *)__b));
13138 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13139 const float *__b) {
13140 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13143 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13144 const vector float *__b) {
13145 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13146 vec_lvsl(__a, (unsigned char *)__b));
13151 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13152 signed char *__c) {
13153 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13157 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13158 vector signed char *__c) {
13160 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13164 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13165 unsigned char *__c) {
13166 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13170 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13171 vector unsigned char *__c) {
13173 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13177 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13178 vector bool char *__c) {
13180 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13184 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13186 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13190 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13191 vector short *__c) {
13193 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13197 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13198 int __b, unsigned short *__c) {
13199 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13203 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13205 vector unsigned short *__c) {
13207 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13211 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
13212 vector bool short *__c) {
13214 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13218 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13219 vector pixel *__c) {
13221 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13225 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13227 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13231 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13234 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13238 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13239 unsigned int *__c) {
13240 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13244 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13245 vector unsigned int *__c) {
13247 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13251 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13252 vector bool int *__c) {
13254 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13258 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13259 vector float *__c) {
13261 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13267 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13268 signed char *__c) {
13269 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13273 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13274 vector signed char *__c) {
13276 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13280 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13281 int __b, unsigned char *__c) {
13282 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13286 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13288 vector unsigned char *__c) {
13290 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13294 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
13295 vector bool char *__c) {
13297 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13301 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13303 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13307 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13308 vector short *__c) {
13310 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13314 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13315 int __b, unsigned short *__c) {
13316 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13320 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13322 vector unsigned short *__c) {
13324 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13328 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
13329 vector bool short *__c) {
13331 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13335 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13336 vector pixel *__c) {
13338 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13342 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13344 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13348 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13351 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13355 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13356 unsigned int *__c) {
13357 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13361 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13362 vector unsigned int *__c) {
13364 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13368 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13369 vector bool int *__c) {
13371 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13375 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13376 vector float *__c) {
13378 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13384 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13385 signed char *__c) {
13386 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13390 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13391 vector signed char *__c) {
13393 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13397 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13398 unsigned char *__c) {
13399 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13403 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13404 vector unsigned char *__c) {
13406 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13410 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13411 vector bool char *__c) {
13413 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13417 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13419 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13423 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13424 vector short *__c) {
13426 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13430 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13431 int __b, unsigned short *__c) {
13432 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13436 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13438 vector unsigned short *__c) {
13440 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13444 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
13445 vector bool short *__c) {
13447 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13451 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13452 vector pixel *__c) {
13454 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13458 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13460 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13464 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13467 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13471 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13472 unsigned int *__c) {
13473 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13477 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13478 vector unsigned int *__c) {
13480 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13484 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13485 vector bool int *__c) {
13487 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13491 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13492 vector float *__c) {
13494 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13500 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13501 signed char *__c) {
13502 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13506 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13507 vector signed char *__c) {
13509 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13513 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13514 int __b, unsigned char *__c) {
13515 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13519 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13521 vector unsigned char *__c) {
13523 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13527 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
13528 vector bool char *__c) {
13530 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13534 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13536 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13540 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13541 vector short *__c) {
13543 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13547 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13548 int __b, unsigned short *__c) {
13549 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13553 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13555 vector unsigned short *__c) {
13557 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13561 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
13562 vector bool short *__c) {
13564 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13568 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13569 vector pixel *__c) {
13571 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13575 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13577 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13581 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13584 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13588 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13589 unsigned int *__c) {
13590 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13594 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13595 vector unsigned int *__c) {
13597 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13601 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13602 vector bool int *__c) {
13604 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13608 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13609 vector float *__c) {
13611 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13617 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13619 vector signed char __res = (vector signed char)(0);
13624 static __inline__ vector unsigned char __ATTRS_o_ai
13625 vec_promote(unsigned char __a, int __b) {
13626 vector unsigned char __res = (vector unsigned char)(0);
13631 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13632 vector short __res = (vector short)(0);
13637 static __inline__ vector unsigned short __ATTRS_o_ai
13638 vec_promote(unsigned short __a, int __b) {
13639 vector unsigned short __res = (vector unsigned short)(0);
13644 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13645 vector int __res = (vector int)(0);
13650 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13652 vector unsigned int __res = (vector unsigned int)(0);
13657 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13658 vector float __res = (vector float)(0);
13665 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13666 return (vector signed char)(__a);
13669 static __inline__ vector unsigned char __ATTRS_o_ai
13670 vec_splats(unsigned char __a) {
13671 return (vector unsigned char)(__a);
13674 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13675 return (vector short)(__a);
13678 static __inline__ vector unsigned short __ATTRS_o_ai
13679 vec_splats(unsigned short __a) {
13680 return (vector unsigned short)(__a);
13683 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13684 return (vector int)(__a);
13687 static __inline__ vector unsigned int __ATTRS_o_ai
13688 vec_splats(unsigned int __a) {
13689 return (vector unsigned int)(__a);
13693 static __inline__ vector signed long long __ATTRS_o_ai
13694 vec_splats(signed long long __a) {
13695 return (vector signed long long)(__a);
13698 static __inline__ vector unsigned long long __ATTRS_o_ai
13699 vec_splats(unsigned long long __a) {
13700 return (vector unsigned long long)(__a);
13703 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13704 static __inline__ vector signed __int128 __ATTRS_o_ai
13705 vec_splats(signed __int128 __a) {
13706 return (vector signed __int128)(__a);
13709 static __inline__ vector unsigned __int128 __ATTRS_o_ai
13710 vec_splats(unsigned __int128 __a) {
13711 return (vector unsigned __int128)(__a);
13716 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13717 return (vector double)(__a);
13721 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13722 return (vector float)(__a);
13725 /* ----------------------------- predicates --------------------------------- */
13729 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13730 vector signed char __b) {
13731 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13735 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13736 vector bool char __b) {
13737 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13741 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13742 vector unsigned char __b) {
13743 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13747 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13748 vector bool char __b) {
13749 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13753 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13754 vector signed char __b) {
13755 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13759 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13760 vector unsigned char __b) {
13761 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13765 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13766 vector bool char __b) {
13767 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13771 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13772 vector short __b) {
13773 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13776 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13777 vector bool short __b) {
13778 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13781 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13782 vector unsigned short __b) {
13783 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13784 (vector short)__b);
13787 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13788 vector bool short __b) {
13789 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13790 (vector short)__b);
13793 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13794 vector short __b) {
13795 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13796 (vector short)__b);
13799 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13800 vector unsigned short __b) {
13801 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13802 (vector short)__b);
13805 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13806 vector bool short __b) {
13807 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13808 (vector short)__b);
13811 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13812 vector pixel __b) {
13813 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13814 (vector short)__b);
13817 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13818 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13821 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13822 vector bool int __b) {
13823 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13826 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13827 vector unsigned int __b) {
13828 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13832 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13833 vector bool int __b) {
13834 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13838 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13840 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13844 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13845 vector unsigned int __b) {
13846 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13850 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13851 vector bool int __b) {
13852 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13856 #ifdef __POWER8_VECTOR__
13857 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13858 vector signed long long __b) {
13859 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13862 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13863 vector bool long long __b) {
13864 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13867 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13868 vector unsigned long long __b) {
13869 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13870 (vector long long)__b);
13873 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13874 vector bool long long __b) {
13875 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13876 (vector long long)__b);
13879 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13880 vector long long __b) {
13881 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13882 (vector long long)__b);
13885 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13886 vector unsigned long long __b) {
13887 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13888 (vector long long)__b);
13891 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13892 vector bool long long __b) {
13893 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13894 (vector long long)__b);
13898 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13899 vector float __b) {
13901 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13903 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13908 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13909 vector double __b) {
13910 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13916 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13917 vector signed char __b) {
13918 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13921 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13922 vector bool char __b) {
13923 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13926 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13927 vector unsigned char __b) {
13928 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13931 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13932 vector bool char __b) {
13933 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13936 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13937 vector signed char __b) {
13938 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13939 (vector unsigned char)__a);
13942 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13943 vector unsigned char __b) {
13944 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13947 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13948 vector bool char __b) {
13949 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13950 (vector unsigned char)__a);
13953 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13954 vector short __b) {
13955 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
13958 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13959 vector bool short __b) {
13960 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
13963 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13964 vector unsigned short __b) {
13965 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
13968 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13969 vector bool short __b) {
13970 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13974 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13975 vector short __b) {
13976 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13977 (vector unsigned short)__a);
13980 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13981 vector unsigned short __b) {
13982 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
13983 (vector unsigned short)__a);
13986 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13987 vector bool short __b) {
13988 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13989 (vector unsigned short)__a);
13992 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
13993 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
13996 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
13997 vector bool int __b) {
13998 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
14001 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14002 vector unsigned int __b) {
14003 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
14006 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14007 vector bool int __b) {
14008 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14011 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14013 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14014 (vector unsigned int)__a);
14017 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14018 vector unsigned int __b) {
14019 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14022 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14023 vector bool int __b) {
14024 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14025 (vector unsigned int)__a);
14028 #ifdef __POWER8_VECTOR__
14029 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14030 vector signed long long __b) {
14031 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14033 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14034 vector bool long long __b) {
14035 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14039 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14040 vector unsigned long long __b) {
14041 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14044 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14045 vector bool long long __b) {
14046 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14050 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14051 vector signed long long __b) {
14052 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14053 (vector unsigned long long)__a);
14056 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14057 vector unsigned long long __b) {
14058 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14059 (vector unsigned long long)__a);
14062 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14063 vector bool long long __b) {
14064 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14065 (vector unsigned long long)__a);
14069 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14070 vector float __b) {
14072 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14074 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14079 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14080 vector double __b) {
14081 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14087 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14088 vector signed char __b) {
14089 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14092 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14093 vector bool char __b) {
14094 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14097 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14098 vector unsigned char __b) {
14099 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14102 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14103 vector bool char __b) {
14104 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14107 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14108 vector signed char __b) {
14109 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14110 (vector unsigned char)__b);
14113 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14114 vector unsigned char __b) {
14115 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14118 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14119 vector bool char __b) {
14120 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14121 (vector unsigned char)__b);
14124 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14125 vector short __b) {
14126 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14129 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14130 vector bool short __b) {
14131 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14134 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14135 vector unsigned short __b) {
14136 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14139 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14140 vector bool short __b) {
14141 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14142 (vector unsigned short)__b);
14145 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14146 vector short __b) {
14147 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14148 (vector unsigned short)__b);
14151 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14152 vector unsigned short __b) {
14153 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14157 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14158 vector bool short __b) {
14159 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14160 (vector unsigned short)__b);
14163 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14164 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14167 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14168 vector bool int __b) {
14169 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14172 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14173 vector unsigned int __b) {
14174 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14177 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14178 vector bool int __b) {
14179 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14182 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14184 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14185 (vector unsigned int)__b);
14188 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14189 vector unsigned int __b) {
14190 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14193 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14194 vector bool int __b) {
14195 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14196 (vector unsigned int)__b);
14199 #ifdef __POWER8_VECTOR__
14200 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14201 vector signed long long __b) {
14202 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14204 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14205 vector bool long long __b) {
14206 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14207 (vector signed long long)__b);
14210 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14211 vector unsigned long long __b) {
14212 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14215 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14216 vector bool long long __b) {
14217 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14218 (vector unsigned long long)__b);
14221 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14222 vector signed long long __b) {
14223 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14224 (vector unsigned long long)__b);
14227 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14228 vector unsigned long long __b) {
14229 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14233 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14234 vector bool long long __b) {
14235 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14236 (vector unsigned long long)__b);
14240 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14241 vector float __b) {
14243 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14245 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14250 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14251 vector double __b) {
14252 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14258 static __inline__ int __attribute__((__always_inline__))
14259 vec_all_in(vector float __a, vector float __b) {
14260 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14265 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14266 vector signed char __b) {
14267 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14270 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14271 vector bool char __b) {
14272 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14275 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14276 vector unsigned char __b) {
14277 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14280 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14281 vector bool char __b) {
14282 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14285 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14286 vector signed char __b) {
14287 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14288 (vector unsigned char)__b);
14291 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14292 vector unsigned char __b) {
14293 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14296 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14297 vector bool char __b) {
14298 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14299 (vector unsigned char)__b);
14302 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14303 vector short __b) {
14304 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14307 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14308 vector bool short __b) {
14309 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14312 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14313 vector unsigned short __b) {
14314 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14317 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14318 vector bool short __b) {
14319 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14320 (vector unsigned short)__b);
14323 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14324 vector short __b) {
14325 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14326 (vector unsigned short)__b);
14329 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14330 vector unsigned short __b) {
14331 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14335 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14336 vector bool short __b) {
14337 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14338 (vector unsigned short)__b);
14341 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14342 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14345 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14346 vector bool int __b) {
14347 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14350 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14351 vector unsigned int __b) {
14352 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14355 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14356 vector bool int __b) {
14357 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14360 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14362 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14363 (vector unsigned int)__b);
14366 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14367 vector unsigned int __b) {
14368 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14371 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14372 vector bool int __b) {
14373 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14374 (vector unsigned int)__b);
14377 #ifdef __POWER8_VECTOR__
14378 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14379 vector signed long long __b) {
14380 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14383 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14384 vector unsigned long long __b) {
14385 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14388 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14389 vector bool long long __b) {
14390 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14391 (vector signed long long)__b);
14394 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14395 vector bool long long __b) {
14396 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14397 (vector unsigned long long)__b);
14400 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14401 vector signed long long __b) {
14402 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14403 (vector unsigned long long)__b);
14406 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14407 vector unsigned long long __b) {
14408 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14412 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14413 vector bool long long __b) {
14414 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14415 (vector unsigned long long)__b);
14419 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14420 vector float __b) {
14422 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14424 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14429 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14430 vector double __b) {
14431 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14437 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14438 vector signed char __b) {
14439 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14442 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14443 vector bool char __b) {
14444 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14447 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14448 vector unsigned char __b) {
14449 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14452 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14453 vector bool char __b) {
14454 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14457 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14458 vector signed char __b) {
14459 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14460 (vector unsigned char)__a);
14463 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14464 vector unsigned char __b) {
14465 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14468 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14469 vector bool char __b) {
14470 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14471 (vector unsigned char)__a);
14474 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14475 vector short __b) {
14476 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14479 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14480 vector bool short __b) {
14481 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14484 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14485 vector unsigned short __b) {
14486 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14489 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14490 vector bool short __b) {
14491 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14495 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14496 vector short __b) {
14497 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14498 (vector unsigned short)__a);
14501 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14502 vector unsigned short __b) {
14503 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14504 (vector unsigned short)__a);
14507 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14508 vector bool short __b) {
14509 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14510 (vector unsigned short)__a);
14513 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14514 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14517 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14518 vector bool int __b) {
14519 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14522 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14523 vector unsigned int __b) {
14524 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14527 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14528 vector bool int __b) {
14529 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14532 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14534 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14535 (vector unsigned int)__a);
14538 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14539 vector unsigned int __b) {
14540 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14543 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14544 vector bool int __b) {
14545 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14546 (vector unsigned int)__a);
14549 #ifdef __POWER8_VECTOR__
14550 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14551 vector signed long long __b) {
14552 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14555 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14556 vector unsigned long long __b) {
14557 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14560 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14561 vector bool long long __b) {
14562 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14566 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14567 vector bool long long __b) {
14568 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14572 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14573 vector signed long long __b) {
14574 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14575 (vector unsigned long long)__a);
14578 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14579 vector unsigned long long __b) {
14580 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14581 (vector unsigned long long)__a);
14584 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14585 vector bool long long __b) {
14586 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14587 (vector unsigned long long)__a);
14591 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14592 vector float __b) {
14594 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14596 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14601 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14602 vector double __b) {
14603 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14609 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14611 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14613 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14618 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14619 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14625 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14626 vector signed char __b) {
14627 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14631 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14632 vector bool char __b) {
14633 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14637 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14638 vector unsigned char __b) {
14639 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14643 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14644 vector bool char __b) {
14645 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14649 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14650 vector signed char __b) {
14651 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14655 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14656 vector unsigned char __b) {
14657 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14661 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14662 vector bool char __b) {
14663 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14667 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14668 vector short __b) {
14669 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14672 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14673 vector bool short __b) {
14674 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14677 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14678 vector unsigned short __b) {
14679 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14680 (vector short)__b);
14683 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14684 vector bool short __b) {
14685 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14686 (vector short)__b);
14689 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14690 vector short __b) {
14691 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14692 (vector short)__b);
14695 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14696 vector unsigned short __b) {
14697 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14698 (vector short)__b);
14701 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14702 vector bool short __b) {
14703 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14704 (vector short)__b);
14707 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14708 vector pixel __b) {
14709 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14710 (vector short)__b);
14713 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14714 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14717 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14718 vector bool int __b) {
14719 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14722 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14723 vector unsigned int __b) {
14724 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14728 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14729 vector bool int __b) {
14730 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14734 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14736 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14740 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14741 vector unsigned int __b) {
14742 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14746 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14747 vector bool int __b) {
14748 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14752 #ifdef __POWER8_VECTOR__
14753 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14754 vector signed long long __b) {
14755 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14758 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14759 vector unsigned long long __b) {
14760 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14761 (vector long long)__b);
14764 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14765 vector bool long long __b) {
14766 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14767 (vector signed long long)__b);
14770 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14771 vector bool long long __b) {
14772 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14773 (vector signed long long)__b);
14776 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14777 vector signed long long __b) {
14778 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14779 (vector signed long long)__b);
14782 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14783 vector unsigned long long __b) {
14784 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14785 (vector signed long long)__b);
14788 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14789 vector bool long long __b) {
14790 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14791 (vector signed long long)__b);
14795 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14796 vector float __b) {
14798 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14800 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14805 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14806 vector double __b) {
14807 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14813 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14814 vector float __b) {
14816 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14818 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14823 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14824 vector double __b) {
14825 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14831 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14832 vector float __b) {
14834 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14836 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14841 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14842 vector double __b) {
14843 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14849 static __inline__ int __attribute__((__always_inline__))
14850 vec_all_nle(vector float __a, vector float __b) {
14851 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14856 static __inline__ int __attribute__((__always_inline__))
14857 vec_all_nlt(vector float __a, vector float __b) {
14858 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14861 /* vec_all_numeric */
14863 static __inline__ int __attribute__((__always_inline__))
14864 vec_all_numeric(vector float __a) {
14865 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14870 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14871 vector signed char __b) {
14872 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14876 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14877 vector bool char __b) {
14878 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14882 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14883 vector unsigned char __b) {
14884 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14888 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14889 vector bool char __b) {
14890 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14894 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14895 vector signed char __b) {
14896 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14900 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14901 vector unsigned char __b) {
14902 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14906 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14907 vector bool char __b) {
14908 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14912 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14913 vector short __b) {
14914 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14917 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14918 vector bool short __b) {
14919 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14922 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14923 vector unsigned short __b) {
14924 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14925 (vector short)__b);
14928 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14929 vector bool short __b) {
14930 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14931 (vector short)__b);
14934 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14935 vector short __b) {
14936 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14937 (vector short)__b);
14940 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14941 vector unsigned short __b) {
14942 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14943 (vector short)__b);
14946 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14947 vector bool short __b) {
14948 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14949 (vector short)__b);
14952 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14953 vector pixel __b) {
14954 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14955 (vector short)__b);
14958 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
14959 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
14962 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
14963 vector bool int __b) {
14964 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
14967 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14968 vector unsigned int __b) {
14969 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14973 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14974 vector bool int __b) {
14975 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14979 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14981 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14985 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14986 vector unsigned int __b) {
14987 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14991 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14992 vector bool int __b) {
14993 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14997 #ifdef __POWER8_VECTOR__
14998 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14999 vector signed long long __b) {
15000 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
15003 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15004 vector unsigned long long __b) {
15005 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
15006 (vector long long)__b);
15009 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15010 vector bool long long __b) {
15011 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
15012 (vector signed long long)__b);
15015 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15016 vector bool long long __b) {
15017 return __builtin_altivec_vcmpequd_p(
15018 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15021 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15022 vector signed long long __b) {
15023 return __builtin_altivec_vcmpequd_p(
15024 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15027 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15028 vector unsigned long long __b) {
15029 return __builtin_altivec_vcmpequd_p(
15030 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15033 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15034 vector bool long long __b) {
15035 return __builtin_altivec_vcmpequd_p(
15036 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15040 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15041 vector float __b) {
15043 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15045 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15050 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15051 vector double __b) {
15052 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15058 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15059 vector signed char __b) {
15060 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15063 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15064 vector bool char __b) {
15065 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15069 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15070 vector unsigned char __b) {
15071 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15074 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15075 vector bool char __b) {
15076 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15080 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15081 vector signed char __b) {
15082 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15083 (vector unsigned char)__a);
15086 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15087 vector unsigned char __b) {
15088 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15089 (vector unsigned char)__a);
15092 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15093 vector bool char __b) {
15094 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15095 (vector unsigned char)__a);
15098 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15099 vector short __b) {
15100 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15103 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15104 vector bool short __b) {
15105 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15108 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15109 vector unsigned short __b) {
15110 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15113 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15114 vector bool short __b) {
15115 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15119 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15120 vector short __b) {
15121 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15122 (vector unsigned short)__a);
15125 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15126 vector unsigned short __b) {
15127 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15128 (vector unsigned short)__a);
15131 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15132 vector bool short __b) {
15133 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15134 (vector unsigned short)__a);
15137 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15138 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15141 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15142 vector bool int __b) {
15143 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15146 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15147 vector unsigned int __b) {
15148 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15151 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15152 vector bool int __b) {
15153 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15157 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15159 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15160 (vector unsigned int)__a);
15163 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15164 vector unsigned int __b) {
15165 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15166 (vector unsigned int)__a);
15169 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15170 vector bool int __b) {
15171 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15172 (vector unsigned int)__a);
15175 #ifdef __POWER8_VECTOR__
15176 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15177 vector signed long long __b) {
15178 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15181 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15182 vector unsigned long long __b) {
15183 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15186 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15187 vector bool long long __b) {
15188 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15189 (vector signed long long)__b, __a);
15192 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15193 vector bool long long __b) {
15194 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15195 (vector unsigned long long)__b, __a);
15198 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15199 vector signed long long __b) {
15200 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15201 (vector unsigned long long)__b,
15202 (vector unsigned long long)__a);
15205 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15206 vector unsigned long long __b) {
15207 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15208 (vector unsigned long long)__a);
15211 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15212 vector bool long long __b) {
15213 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15214 (vector unsigned long long)__b,
15215 (vector unsigned long long)__a);
15219 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15220 vector float __b) {
15222 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15224 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15229 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15230 vector double __b) {
15231 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15237 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15238 vector signed char __b) {
15239 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15242 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15243 vector bool char __b) {
15244 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15245 (vector signed char)__b);
15248 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15249 vector unsigned char __b) {
15250 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15253 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15254 vector bool char __b) {
15255 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15256 (vector unsigned char)__b);
15259 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15260 vector signed char __b) {
15261 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15262 (vector unsigned char)__b);
15265 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15266 vector unsigned char __b) {
15267 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15271 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15272 vector bool char __b) {
15273 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15274 (vector unsigned char)__b);
15277 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15278 vector short __b) {
15279 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15282 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15283 vector bool short __b) {
15284 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15287 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15288 vector unsigned short __b) {
15289 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15292 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15293 vector bool short __b) {
15294 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15295 (vector unsigned short)__b);
15298 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15299 vector short __b) {
15300 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15301 (vector unsigned short)__b);
15304 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15305 vector unsigned short __b) {
15306 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15310 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15311 vector bool short __b) {
15312 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15313 (vector unsigned short)__b);
15316 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15317 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15320 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15321 vector bool int __b) {
15322 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15325 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15326 vector unsigned int __b) {
15327 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15330 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15331 vector bool int __b) {
15332 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15333 (vector unsigned int)__b);
15336 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15338 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15339 (vector unsigned int)__b);
15342 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15343 vector unsigned int __b) {
15344 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15348 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15349 vector bool int __b) {
15350 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15351 (vector unsigned int)__b);
15354 #ifdef __POWER8_VECTOR__
15355 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15356 vector signed long long __b) {
15357 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15360 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15361 vector unsigned long long __b) {
15362 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15365 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15366 vector bool long long __b) {
15367 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15368 (vector signed long long)__b);
15371 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15372 vector bool long long __b) {
15373 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15374 (vector unsigned long long)__b);
15377 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15378 vector signed long long __b) {
15379 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15380 (vector unsigned long long)__a,
15381 (vector unsigned long long)__b);
15384 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15385 vector unsigned long long __b) {
15386 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15387 (vector unsigned long long)__a, __b);
15390 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15391 vector bool long long __b) {
15392 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15393 (vector unsigned long long)__a,
15394 (vector unsigned long long)__b);
15398 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15399 vector float __b) {
15401 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15403 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15408 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15409 vector double __b) {
15410 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15416 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15417 vector signed char __b) {
15418 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15421 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15422 vector bool char __b) {
15423 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15424 (vector signed char)__b);
15427 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15428 vector unsigned char __b) {
15429 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15432 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15433 vector bool char __b) {
15434 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15435 (vector unsigned char)__b);
15438 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15439 vector signed char __b) {
15440 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15441 (vector unsigned char)__b);
15444 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15445 vector unsigned char __b) {
15446 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15450 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15451 vector bool char __b) {
15452 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15453 (vector unsigned char)__b);
15456 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15457 vector short __b) {
15458 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15461 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15462 vector bool short __b) {
15463 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15466 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15467 vector unsigned short __b) {
15468 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15471 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15472 vector bool short __b) {
15473 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15474 (vector unsigned short)__b);
15477 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15478 vector short __b) {
15479 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15480 (vector unsigned short)__b);
15483 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15484 vector unsigned short __b) {
15485 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15489 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15490 vector bool short __b) {
15491 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15492 (vector unsigned short)__b);
15495 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15496 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15499 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15500 vector bool int __b) {
15501 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15504 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15505 vector unsigned int __b) {
15506 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15509 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15510 vector bool int __b) {
15511 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15512 (vector unsigned int)__b);
15515 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15517 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15518 (vector unsigned int)__b);
15521 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15522 vector unsigned int __b) {
15523 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15527 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15528 vector bool int __b) {
15529 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15530 (vector unsigned int)__b);
15533 #ifdef __POWER8_VECTOR__
15534 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15535 vector signed long long __b) {
15536 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15539 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15540 vector unsigned long long __b) {
15541 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15544 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15545 vector bool long long __b) {
15546 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15547 (vector signed long long)__b);
15550 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15551 vector bool long long __b) {
15552 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15553 (vector unsigned long long)__b);
15556 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15557 vector signed long long __b) {
15558 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15559 (vector unsigned long long)__a,
15560 (vector unsigned long long)__b);
15563 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15564 vector unsigned long long __b) {
15565 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15566 (vector unsigned long long)__a, __b);
15569 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15570 vector bool long long __b) {
15571 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15572 (vector unsigned long long)__a,
15573 (vector unsigned long long)__b);
15577 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15578 vector float __b) {
15580 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15582 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15587 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15588 vector double __b) {
15589 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15595 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15596 vector signed char __b) {
15597 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15600 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15601 vector bool char __b) {
15602 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15606 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15607 vector unsigned char __b) {
15608 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15611 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15612 vector bool char __b) {
15613 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15617 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15618 vector signed char __b) {
15619 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15620 (vector unsigned char)__a);
15623 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15624 vector unsigned char __b) {
15625 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15626 (vector unsigned char)__a);
15629 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15630 vector bool char __b) {
15631 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15632 (vector unsigned char)__a);
15635 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15636 vector short __b) {
15637 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15640 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15641 vector bool short __b) {
15642 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15645 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15646 vector unsigned short __b) {
15647 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15650 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15651 vector bool short __b) {
15652 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15656 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15657 vector short __b) {
15658 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15659 (vector unsigned short)__a);
15662 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15663 vector unsigned short __b) {
15664 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15665 (vector unsigned short)__a);
15668 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15669 vector bool short __b) {
15670 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15671 (vector unsigned short)__a);
15674 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15675 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15678 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15679 vector bool int __b) {
15680 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15683 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15684 vector unsigned int __b) {
15685 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15688 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15689 vector bool int __b) {
15690 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15694 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15696 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15697 (vector unsigned int)__a);
15700 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15701 vector unsigned int __b) {
15702 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15703 (vector unsigned int)__a);
15706 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15707 vector bool int __b) {
15708 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15709 (vector unsigned int)__a);
15712 #ifdef __POWER8_VECTOR__
15713 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15714 vector signed long long __b) {
15715 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15718 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15719 vector unsigned long long __b) {
15720 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15723 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15724 vector bool long long __b) {
15725 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15726 (vector signed long long)__b, __a);
15729 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15730 vector bool long long __b) {
15731 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15732 (vector unsigned long long)__b, __a);
15735 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15736 vector signed long long __b) {
15737 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15738 (vector unsigned long long)__b,
15739 (vector unsigned long long)__a);
15742 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15743 vector unsigned long long __b) {
15744 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15745 (vector unsigned long long)__a);
15748 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15749 vector bool long long __b) {
15750 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15751 (vector unsigned long long)__b,
15752 (vector unsigned long long)__a);
15756 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15757 vector float __b) {
15759 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15761 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15766 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15767 vector double __b) {
15768 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15774 static __inline__ int __attribute__((__always_inline__))
15775 vec_any_nan(vector float __a) {
15776 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15781 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15782 vector signed char __b) {
15783 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15787 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15788 vector bool char __b) {
15789 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15793 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15794 vector unsigned char __b) {
15795 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15799 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15800 vector bool char __b) {
15801 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15805 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15806 vector signed char __b) {
15807 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15811 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15812 vector unsigned char __b) {
15813 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15817 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15818 vector bool char __b) {
15819 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15823 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15824 vector short __b) {
15825 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15828 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15829 vector bool short __b) {
15830 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15833 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15834 vector unsigned short __b) {
15835 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15836 (vector short)__b);
15839 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15840 vector bool short __b) {
15841 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15842 (vector short)__b);
15845 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15846 vector short __b) {
15847 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15848 (vector short)__b);
15851 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15852 vector unsigned short __b) {
15853 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15854 (vector short)__b);
15857 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15858 vector bool short __b) {
15859 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15860 (vector short)__b);
15863 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15864 vector pixel __b) {
15865 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15866 (vector short)__b);
15869 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15870 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15873 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15874 vector bool int __b) {
15875 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15878 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15879 vector unsigned int __b) {
15880 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15884 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15885 vector bool int __b) {
15886 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15890 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15892 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15896 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15897 vector unsigned int __b) {
15898 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15902 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15903 vector bool int __b) {
15904 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15908 #ifdef __POWER8_VECTOR__
15909 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15910 vector signed long long __b) {
15911 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15914 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15915 vector unsigned long long __b) {
15916 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15917 (vector long long)__b);
15920 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15921 vector bool long long __b) {
15922 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15923 (vector signed long long)__b);
15926 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15927 vector bool long long __b) {
15928 return __builtin_altivec_vcmpequd_p(
15929 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15932 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15933 vector signed long long __b) {
15934 return __builtin_altivec_vcmpequd_p(
15935 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15938 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15939 vector unsigned long long __b) {
15940 return __builtin_altivec_vcmpequd_p(
15941 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15944 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15945 vector bool long long __b) {
15946 return __builtin_altivec_vcmpequd_p(
15947 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15951 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15952 vector float __b) {
15954 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
15956 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
15961 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
15962 vector double __b) {
15963 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
15969 static __inline__ int __attribute__((__always_inline__))
15970 vec_any_nge(vector float __a, vector float __b) {
15971 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
15976 static __inline__ int __attribute__((__always_inline__))
15977 vec_any_ngt(vector float __a, vector float __b) {
15978 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
15983 static __inline__ int __attribute__((__always_inline__))
15984 vec_any_nle(vector float __a, vector float __b) {
15985 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
15990 static __inline__ int __attribute__((__always_inline__))
15991 vec_any_nlt(vector float __a, vector float __b) {
15992 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
15995 /* vec_any_numeric */
15997 static __inline__ int __attribute__((__always_inline__))
15998 vec_any_numeric(vector float __a) {
15999 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
16004 static __inline__ int __attribute__((__always_inline__))
16005 vec_any_out(vector float __a, vector float __b) {
16006 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
16009 /* Power 8 Crypto functions
16010 Note: We diverge from the current GCC implementation with regard
16011 to cryptography and related functions as follows:
16012 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
16013 - The remaining ones are only available on Power8 and up so
16014 require -mpower8-vector
16015 The justification for this is that export requirements require that
16016 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16017 support). As a result, we need to be able to turn off support for those.
16018 The remaining ones (currently controlled by -mcrypto for GCC) still
16019 need to be provided on compliant hardware even if Vector.Crypto is not
16023 #define vec_sbox_be __builtin_altivec_crypto_vsbox
16024 #define vec_cipher_be __builtin_altivec_crypto_vcipher
16025 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16026 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16027 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16029 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16030 __builtin_crypto_vsbox(vector unsigned long long __a) {
16031 return __builtin_altivec_crypto_vsbox(__a);
16034 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16035 __builtin_crypto_vcipher(vector unsigned long long __a,
16036 vector unsigned long long __b) {
16037 return __builtin_altivec_crypto_vcipher(__a, __b);
16040 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16041 __builtin_crypto_vcipherlast(vector unsigned long long __a,
16042 vector unsigned long long __b) {
16043 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16046 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16047 __builtin_crypto_vncipher(vector unsigned long long __a,
16048 vector unsigned long long __b) {
16049 return __builtin_altivec_crypto_vncipher(__a, __b);
16052 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16053 __builtin_crypto_vncipherlast(vector unsigned long long __a,
16054 vector unsigned long long __b) {
16055 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16058 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16059 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16061 #define vec_shasigma_be(X, Y, Z) \
16062 _Generic((X), vector unsigned int \
16063 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16064 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16067 #ifdef __POWER8_VECTOR__
16068 static __inline__ vector bool char __ATTRS_o_ai
16069 vec_permxor(vector bool char __a, vector bool char __b,
16070 vector bool char __c) {
16071 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16074 static __inline__ vector signed char __ATTRS_o_ai
16075 vec_permxor(vector signed char __a, vector signed char __b,
16076 vector signed char __c) {
16077 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16080 static __inline__ vector unsigned char __ATTRS_o_ai
16081 vec_permxor(vector unsigned char __a, vector unsigned char __b,
16082 vector unsigned char __c) {
16083 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16086 static __inline__ vector unsigned char __ATTRS_o_ai
16087 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16088 vector unsigned char __c) {
16089 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16092 static __inline__ vector unsigned short __ATTRS_o_ai
16093 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16094 vector unsigned short __c) {
16095 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16096 (vector unsigned char)__a, (vector unsigned char)__b,
16097 (vector unsigned char)__c);
16100 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16101 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16102 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16103 (vector unsigned char)__a, (vector unsigned char)__b,
16104 (vector unsigned char)__c);
16107 static __inline__ vector unsigned long long __ATTRS_o_ai
16108 __builtin_crypto_vpermxor(vector unsigned long long __a,
16109 vector unsigned long long __b,
16110 vector unsigned long long __c) {
16111 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16112 (vector unsigned char)__a, (vector unsigned char)__b,
16113 (vector unsigned char)__c);
16116 static __inline__ vector unsigned char __ATTRS_o_ai
16117 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16118 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16121 static __inline__ vector unsigned short __ATTRS_o_ai
16122 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16123 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16126 static __inline__ vector unsigned int __ATTRS_o_ai
16127 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16128 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16131 static __inline__ vector unsigned long long __ATTRS_o_ai
16132 __builtin_crypto_vpmsumb(vector unsigned long long __a,
16133 vector unsigned long long __b) {
16134 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16137 static __inline__ vector signed char __ATTRS_o_ai
16138 vec_vgbbd(vector signed char __a) {
16139 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16142 #define vec_pmsum_be __builtin_crypto_vpmsumb
16143 #define vec_gb __builtin_altivec_vgbbd
16145 static __inline__ vector unsigned char __ATTRS_o_ai
16146 vec_vgbbd(vector unsigned char __a) {
16147 return __builtin_altivec_vgbbd(__a);
16150 static __inline__ vector long long __ATTRS_o_ai
16151 vec_vbpermq(vector signed char __a, vector signed char __b) {
16152 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16153 (vector unsigned char)__b);
16156 static __inline__ vector long long __ATTRS_o_ai
16157 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16158 return __builtin_altivec_vbpermq(__a, __b);
16161 #ifdef __powerpc64__
16162 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16163 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16164 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16165 (vector unsigned char)__b);
16173 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16174 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16178 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16179 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16183 static inline __ATTRS_o_ai vector unsigned char
16184 vec_reve(vector unsigned char __a) {
16185 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16189 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16190 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16193 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16194 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16197 static inline __ATTRS_o_ai vector unsigned int
16198 vec_reve(vector unsigned int __a) {
16199 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16202 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16203 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16206 static inline __ATTRS_o_ai vector signed short
16207 vec_reve(vector signed short __a) {
16208 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16211 static inline __ATTRS_o_ai vector unsigned short
16212 vec_reve(vector unsigned short __a) {
16213 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16216 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16217 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16221 static inline __ATTRS_o_ai vector bool long long
16222 vec_reve(vector bool long long __a) {
16223 return __builtin_shufflevector(__a, __a, 1, 0);
16226 static inline __ATTRS_o_ai vector signed long long
16227 vec_reve(vector signed long long __a) {
16228 return __builtin_shufflevector(__a, __a, 1, 0);
16231 static inline __ATTRS_o_ai vector unsigned long long
16232 vec_reve(vector unsigned long long __a) {
16233 return __builtin_shufflevector(__a, __a, 1, 0);
16236 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16237 return __builtin_shufflevector(__a, __a, 1, 0);
16242 static __inline__ vector bool char __ATTRS_o_ai
16243 vec_revb(vector bool char __a) {
16247 static __inline__ vector signed char __ATTRS_o_ai
16248 vec_revb(vector signed char __a) {
16252 static __inline__ vector unsigned char __ATTRS_o_ai
16253 vec_revb(vector unsigned char __a) {
16257 static __inline__ vector bool short __ATTRS_o_ai
16258 vec_revb(vector bool short __a) {
16259 vector unsigned char __indices =
16260 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16261 return vec_perm(__a, __a, __indices);
16264 static __inline__ vector signed short __ATTRS_o_ai
16265 vec_revb(vector signed short __a) {
16266 vector unsigned char __indices =
16267 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16268 return vec_perm(__a, __a, __indices);
16271 static __inline__ vector unsigned short __ATTRS_o_ai
16272 vec_revb(vector unsigned short __a) {
16273 vector unsigned char __indices =
16274 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16275 return vec_perm(__a, __a, __indices);
16278 static __inline__ vector bool int __ATTRS_o_ai
16279 vec_revb(vector bool int __a) {
16280 vector unsigned char __indices =
16281 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16282 return vec_perm(__a, __a, __indices);
16285 static __inline__ vector signed int __ATTRS_o_ai
16286 vec_revb(vector signed int __a) {
16287 vector unsigned char __indices =
16288 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16289 return vec_perm(__a, __a, __indices);
16292 static __inline__ vector unsigned int __ATTRS_o_ai
16293 vec_revb(vector unsigned int __a) {
16294 vector unsigned char __indices =
16295 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16296 return vec_perm(__a, __a, __indices);
16299 static __inline__ vector float __ATTRS_o_ai
16300 vec_revb(vector float __a) {
16301 vector unsigned char __indices =
16302 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16303 return vec_perm(__a, __a, __indices);
16307 static __inline__ vector bool long long __ATTRS_o_ai
16308 vec_revb(vector bool long long __a) {
16309 vector unsigned char __indices =
16310 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16311 return vec_perm(__a, __a, __indices);
16314 static __inline__ vector signed long long __ATTRS_o_ai
16315 vec_revb(vector signed long long __a) {
16316 vector unsigned char __indices =
16317 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16318 return vec_perm(__a, __a, __indices);
16321 static __inline__ vector unsigned long long __ATTRS_o_ai
16322 vec_revb(vector unsigned long long __a) {
16323 vector unsigned char __indices =
16324 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16325 return vec_perm(__a, __a, __indices);
16328 static __inline__ vector double __ATTRS_o_ai
16329 vec_revb(vector double __a) {
16330 vector unsigned char __indices =
16331 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16332 return vec_perm(__a, __a, __indices);
16334 #endif /* End __VSX__ */
16336 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16337 static __inline__ vector signed __int128 __ATTRS_o_ai
16338 vec_revb(vector signed __int128 __a) {
16339 vector unsigned char __indices =
16340 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16341 return (vector signed __int128)vec_perm((vector signed int)__a,
16342 (vector signed int)__a,
16346 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16347 vec_revb(vector unsigned __int128 __a) {
16348 vector unsigned char __indices =
16349 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16350 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16351 (vector signed int)__a,
16354 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16358 typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16359 typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16360 typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
16361 typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
16362 typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16363 typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16364 typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16366 static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16367 signed char *__ptr) {
16368 return *(unaligned_vec_schar *)(__ptr + __offset);
16371 static inline __ATTRS_o_ai vector unsigned char
16372 vec_xl(signed long long __offset, unsigned char *__ptr) {
16373 return *(unaligned_vec_uchar*)(__ptr + __offset);
16376 static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16377 signed short *__ptr) {
16378 return *(unaligned_vec_sshort *)(__ptr + __offset);
16381 static inline __ATTRS_o_ai vector unsigned short
16382 vec_xl(signed long long __offset, unsigned short *__ptr) {
16383 return *(unaligned_vec_ushort *)(__ptr + __offset);
16386 static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16387 signed int *__ptr) {
16388 return *(unaligned_vec_sint *)(__ptr + __offset);
16391 static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16392 unsigned int *__ptr) {
16393 return *(unaligned_vec_uint *)(__ptr + __offset);
16396 static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16398 return *(unaligned_vec_float *)(__ptr + __offset);
16402 typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
16403 typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16404 typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16406 static inline __ATTRS_o_ai vector signed long long
16407 vec_xl(signed long long __offset, signed long long *__ptr) {
16408 return *(unaligned_vec_sll *)(__ptr + __offset);
16411 static inline __ATTRS_o_ai vector unsigned long long
16412 vec_xl(signed long long __offset, unsigned long long *__ptr) {
16413 return *(unaligned_vec_ull *)(__ptr + __offset);
16416 static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16418 return *(unaligned_vec_double *)(__ptr + __offset);
16422 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16423 typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16424 typedef vector unsigned __int128 unaligned_vec_ui128
16425 __attribute__((aligned(1)));
16426 static inline __ATTRS_o_ai vector signed __int128
16427 vec_xl(signed long long __offset, signed __int128 *__ptr) {
16428 return *(unaligned_vec_si128 *)(__ptr + __offset);
16431 static inline __ATTRS_o_ai vector unsigned __int128
16432 vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
16433 return *(unaligned_vec_ui128 *)(__ptr + __offset);
16439 #ifdef __LITTLE_ENDIAN__
16440 static __inline__ vector signed char __ATTRS_o_ai
16441 vec_xl_be(signed long long __offset, signed char *__ptr) {
16442 vector signed char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16443 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16444 13, 12, 11, 10, 9, 8);
16447 static __inline__ vector unsigned char __ATTRS_o_ai
16448 vec_xl_be(signed long long __offset, unsigned char *__ptr) {
16449 vector unsigned char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16450 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16451 13, 12, 11, 10, 9, 8);
16454 static __inline__ vector signed short __ATTRS_o_ai
16455 vec_xl_be(signed long long __offset, signed short *__ptr) {
16456 vector signed short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16457 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16460 static __inline__ vector unsigned short __ATTRS_o_ai
16461 vec_xl_be(signed long long __offset, unsigned short *__ptr) {
16462 vector unsigned short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16463 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16466 static __inline__ vector signed int __ATTRS_o_ai
16467 vec_xl_be(signed long long __offset, signed int *__ptr) {
16468 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16471 static __inline__ vector unsigned int __ATTRS_o_ai
16472 vec_xl_be(signed long long __offset, unsigned int *__ptr) {
16473 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16476 static __inline__ vector float __ATTRS_o_ai
16477 vec_xl_be(signed long long __offset, float *__ptr) {
16478 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16482 static __inline__ vector signed long long __ATTRS_o_ai
16483 vec_xl_be(signed long long __offset, signed long long *__ptr) {
16484 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16487 static __inline__ vector unsigned long long __ATTRS_o_ai
16488 vec_xl_be(signed long long __offset, unsigned long long *__ptr) {
16489 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16492 static __inline__ vector double __ATTRS_o_ai
16493 vec_xl_be(signed long long __offset, double *__ptr) {
16494 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16498 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16499 static __inline__ vector signed __int128 __ATTRS_o_ai
16500 vec_xl_be(signed long long __offset, signed __int128 *__ptr) {
16501 return vec_xl(__offset, __ptr);
16504 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16505 vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
16506 return vec_xl(__offset, __ptr);
16510 #define vec_xl_be vec_xl
16515 static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16516 signed long long __offset,
16517 signed char *__ptr) {
16518 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
16521 static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16522 signed long long __offset,
16523 unsigned char *__ptr) {
16524 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
16527 static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16528 signed long long __offset,
16529 signed short *__ptr) {
16530 *(unaligned_vec_sshort *)(__ptr + __offset) = __vec;
16533 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16534 signed long long __offset,
16535 unsigned short *__ptr) {
16536 *(unaligned_vec_ushort *)(__ptr + __offset) = __vec;
16539 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16540 signed long long __offset,
16541 signed int *__ptr) {
16542 *(unaligned_vec_sint *)(__ptr + __offset) = __vec;
16545 static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16546 signed long long __offset,
16547 unsigned int *__ptr) {
16548 *(unaligned_vec_uint *)(__ptr + __offset) = __vec;
16551 static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16552 signed long long __offset,
16554 *(unaligned_vec_float *)(__ptr + __offset) = __vec;
16558 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16559 signed long long __offset,
16560 signed long long *__ptr) {
16561 *(unaligned_vec_sll *)(__ptr + __offset) = __vec;
16564 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16565 signed long long __offset,
16566 unsigned long long *__ptr) {
16567 *(unaligned_vec_ull *)(__ptr + __offset) = __vec;
16570 static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16571 signed long long __offset,
16573 *(unaligned_vec_double *)(__ptr + __offset) = __vec;
16577 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16578 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16579 signed long long __offset,
16580 signed __int128 *__ptr) {
16581 *(unaligned_vec_si128 *)(__ptr + __offset) = __vec;
16584 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16585 signed long long __offset,
16586 unsigned __int128 *__ptr) {
16587 *(unaligned_vec_ui128 *)(__ptr + __offset) = __vec;
16593 #ifdef __LITTLE_ENDIAN__
16594 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16595 signed long long __offset,
16596 signed char *__ptr) {
16597 vector signed char __tmp =
16598 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16599 13, 12, 11, 10, 9, 8);
16600 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16603 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16604 signed long long __offset,
16605 unsigned char *__ptr) {
16606 vector unsigned char __tmp =
16607 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16608 13, 12, 11, 10, 9, 8);
16609 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16612 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16613 signed long long __offset,
16614 signed short *__ptr) {
16615 vector signed short __tmp =
16616 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16617 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16620 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16621 signed long long __offset,
16622 unsigned short *__ptr) {
16623 vector unsigned short __tmp =
16624 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16625 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16628 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16629 signed long long __offset,
16630 signed int *__ptr) {
16631 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16634 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16635 signed long long __offset,
16636 unsigned int *__ptr) {
16637 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16640 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16641 signed long long __offset,
16643 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16647 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16648 signed long long __offset,
16649 signed long long *__ptr) {
16650 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16653 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16654 signed long long __offset,
16655 unsigned long long *__ptr) {
16656 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16659 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16660 signed long long __offset,
16662 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16666 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16667 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16668 signed long long __offset,
16669 signed __int128 *__ptr) {
16670 vec_xst(__vec, __offset, __ptr);
16673 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16674 signed long long __offset,
16675 unsigned __int128 *__ptr) {
16676 vec_xst(__vec, __offset, __ptr);
16680 #define vec_xst_be vec_xst
16683 #ifdef __POWER9_VECTOR__
16684 #define vec_test_data_class(__a, __b) \
16687 (vector bool int)__builtin_vsx_xvtstdcsp((__a), (__b)), \
16689 (vector bool long long)__builtin_vsx_xvtstdcdp((__a), (__b)) \
16692 #endif /* #ifdef __POWER9_VECTOR__ */
16694 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16699 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16705 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16706 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16711 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16715 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16719 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16723 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16724 return - vec_abs(__a);
16728 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16729 return - vec_abs(__a);
16734 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16735 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16736 return __builtin_altivec_vminsd(__a, -__a);
16740 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16741 return __builtin_altivec_vminsw(__a, -__a);
16744 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16745 return __builtin_altivec_vminsh(__a, -__a);
16748 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16749 return __builtin_altivec_vminsb(__a, -__a);
16751 #undef __ATTRS_o_ai
16753 #endif /* __ALTIVEC_H */