1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 \*===----------------------------------------------------------------------===*/
13 #error "AltiVec support not enabled"
16 /* Constants for mapping CR6 bits to predicate result. */
19 #define __CR6_EQ_REV 1
21 #define __CR6_LT_REV 3
23 /* Constants for vec_test_data_class */
24 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
25 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
26 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
27 __VEC_CLASS_FP_SUBNORMAL_N)
28 #define __VEC_CLASS_FP_ZERO_N (1<<2)
29 #define __VEC_CLASS_FP_ZERO_P (1<<3)
30 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
31 __VEC_CLASS_FP_ZERO_N)
32 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
33 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
34 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
35 __VEC_CLASS_FP_INFINITY_N)
36 #define __VEC_CLASS_FP_NAN (1<<6)
37 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
38 __VEC_CLASS_FP_SUBNORMAL | \
39 __VEC_CLASS_FP_ZERO | \
40 __VEC_CLASS_FP_INFINITY)
42 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
44 #ifdef __POWER9_VECTOR__
48 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
49 vector signed char __a, vector signed char __b, vector unsigned char __c);
51 static __inline__ vector unsigned char __ATTRS_o_ai
52 vec_perm(vector unsigned char __a, vector unsigned char __b,
53 vector unsigned char __c);
55 static __inline__ vector bool char __ATTRS_o_ai
56 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
58 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
59 vector signed short __b,
60 vector unsigned char __c);
62 static __inline__ vector unsigned short __ATTRS_o_ai
63 vec_perm(vector unsigned short __a, vector unsigned short __b,
64 vector unsigned char __c);
66 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
67 vector bool short __a, vector bool short __b, vector unsigned char __c);
69 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
71 vector unsigned char __c);
73 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
74 vector signed int __b,
75 vector unsigned char __c);
77 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
78 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
80 static __inline__ vector bool int __ATTRS_o_ai
81 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
83 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
85 vector unsigned char __c);
88 static __inline__ vector long long __ATTRS_o_ai
89 vec_perm(vector signed long long __a, vector signed long long __b,
90 vector unsigned char __c);
92 static __inline__ vector unsigned long long __ATTRS_o_ai
93 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
94 vector unsigned char __c);
96 static __inline__ vector bool long long __ATTRS_o_ai
97 vec_perm(vector bool long long __a, vector bool long long __b,
98 vector unsigned char __c);
100 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
102 vector unsigned char __c);
105 static __inline__ vector unsigned char __ATTRS_o_ai
106 vec_xor(vector unsigned char __a, vector unsigned char __b);
110 #define __builtin_altivec_abs_v16qi vec_abs
111 #define __builtin_altivec_abs_v8hi vec_abs
112 #define __builtin_altivec_abs_v4si vec_abs
114 static __inline__ vector signed char __ATTRS_o_ai
115 vec_abs(vector signed char __a) {
116 return __builtin_altivec_vmaxsb(__a, -__a);
119 static __inline__ vector signed short __ATTRS_o_ai
120 vec_abs(vector signed short __a) {
121 return __builtin_altivec_vmaxsh(__a, -__a);
124 static __inline__ vector signed int __ATTRS_o_ai
125 vec_abs(vector signed int __a) {
126 return __builtin_altivec_vmaxsw(__a, -__a);
129 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
130 static __inline__ vector signed long long __ATTRS_o_ai
131 vec_abs(vector signed long long __a) {
132 return __builtin_altivec_vmaxsd(__a, -__a);
136 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
138 return __builtin_vsx_xvabssp(__a);
140 vector unsigned int __res =
141 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
142 return (vector float)__res;
147 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
148 return __builtin_vsx_xvabsdp(__a);
153 #define __builtin_altivec_abss_v16qi vec_abss
154 #define __builtin_altivec_abss_v8hi vec_abss
155 #define __builtin_altivec_abss_v4si vec_abss
157 static __inline__ vector signed char __ATTRS_o_ai
158 vec_abss(vector signed char __a) {
159 return __builtin_altivec_vmaxsb(
160 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
163 static __inline__ vector signed short __ATTRS_o_ai
164 vec_abss(vector signed short __a) {
165 return __builtin_altivec_vmaxsh(
166 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
169 static __inline__ vector signed int __ATTRS_o_ai
170 vec_abss(vector signed int __a) {
171 return __builtin_altivec_vmaxsw(
172 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
176 #if defined(__POWER9_VECTOR__)
178 static __inline__ vector unsigned char __ATTRS_o_ai
179 vec_absd(vector unsigned char __a, vector unsigned char __b) {
180 return __builtin_altivec_vabsdub(__a, __b);
183 static __inline__ vector unsigned short __ATTRS_o_ai
184 vec_absd(vector unsigned short __a, vector unsigned short __b) {
185 return __builtin_altivec_vabsduh(__a, __b);
188 static __inline__ vector unsigned int __ATTRS_o_ai
189 vec_absd(vector unsigned int __a, vector unsigned int __b) {
190 return __builtin_altivec_vabsduw(__a, __b);
193 #endif /* End __POWER9_VECTOR__ */
197 static __inline__ vector signed char __ATTRS_o_ai
198 vec_add(vector signed char __a, vector signed char __b) {
202 static __inline__ vector signed char __ATTRS_o_ai
203 vec_add(vector bool char __a, vector signed char __b) {
204 return (vector signed char)__a + __b;
207 static __inline__ vector signed char __ATTRS_o_ai
208 vec_add(vector signed char __a, vector bool char __b) {
209 return __a + (vector signed char)__b;
212 static __inline__ vector unsigned char __ATTRS_o_ai
213 vec_add(vector unsigned char __a, vector unsigned char __b) {
217 static __inline__ vector unsigned char __ATTRS_o_ai
218 vec_add(vector bool char __a, vector unsigned char __b) {
219 return (vector unsigned char)__a + __b;
222 static __inline__ vector unsigned char __ATTRS_o_ai
223 vec_add(vector unsigned char __a, vector bool char __b) {
224 return __a + (vector unsigned char)__b;
227 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
232 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
234 return (vector short)__a + __b;
237 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
238 vector bool short __b) {
239 return __a + (vector short)__b;
242 static __inline__ vector unsigned short __ATTRS_o_ai
243 vec_add(vector unsigned short __a, vector unsigned short __b) {
247 static __inline__ vector unsigned short __ATTRS_o_ai
248 vec_add(vector bool short __a, vector unsigned short __b) {
249 return (vector unsigned short)__a + __b;
252 static __inline__ vector unsigned short __ATTRS_o_ai
253 vec_add(vector unsigned short __a, vector bool short __b) {
254 return __a + (vector unsigned short)__b;
257 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
262 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
264 return (vector int)__a + __b;
267 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
268 vector bool int __b) {
269 return __a + (vector int)__b;
272 static __inline__ vector unsigned int __ATTRS_o_ai
273 vec_add(vector unsigned int __a, vector unsigned int __b) {
277 static __inline__ vector unsigned int __ATTRS_o_ai
278 vec_add(vector bool int __a, vector unsigned int __b) {
279 return (vector unsigned int)__a + __b;
282 static __inline__ vector unsigned int __ATTRS_o_ai
283 vec_add(vector unsigned int __a, vector bool int __b) {
284 return __a + (vector unsigned int)__b;
287 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
288 static __inline__ vector signed long long __ATTRS_o_ai
289 vec_add(vector signed long long __a, vector signed long long __b) {
293 static __inline__ vector unsigned long long __ATTRS_o_ai
294 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
298 static __inline__ vector signed __int128 __ATTRS_o_ai
299 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
303 static __inline__ vector unsigned __int128 __ATTRS_o_ai
304 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
307 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
309 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
315 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
323 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
324 static __inline__ vector signed __int128 __ATTRS_o_ai
325 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
326 vector signed __int128 __c) {
327 return __builtin_altivec_vaddeuqm(__a, __b, __c);
330 static __inline__ vector unsigned __int128 __ATTRS_o_ai
331 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
332 vector unsigned __int128 __c) {
333 return __builtin_altivec_vaddeuqm(__a, __b, __c);
337 static __inline__ vector signed int __ATTRS_o_ai
338 vec_adde(vector signed int __a, vector signed int __b,
339 vector signed int __c) {
340 vector signed int __mask = {1, 1, 1, 1};
341 vector signed int __carry = __c & __mask;
342 return vec_add(vec_add(__a, __b), __carry);
345 static __inline__ vector unsigned int __ATTRS_o_ai
346 vec_adde(vector unsigned int __a, vector unsigned int __b,
347 vector unsigned int __c) {
348 vector unsigned int __mask = {1, 1, 1, 1};
349 vector unsigned int __carry = __c & __mask;
350 return vec_add(vec_add(__a, __b), __carry);
355 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
356 static __inline__ vector signed __int128 __ATTRS_o_ai
357 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
358 vector signed __int128 __c) {
359 return __builtin_altivec_vaddecuq(__a, __b, __c);
362 static __inline__ vector unsigned __int128 __ATTRS_o_ai
363 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
364 vector unsigned __int128 __c) {
365 return __builtin_altivec_vaddecuq(__a, __b, __c);
368 static __inline__ vector signed int __ATTRS_o_ai
369 vec_addec(vector signed int __a, vector signed int __b,
370 vector signed int __c) {
372 signed int __result[4];
373 for (int i = 0; i < 4; i++) {
374 unsigned int __tempa = (unsigned int) __a[i];
375 unsigned int __tempb = (unsigned int) __b[i];
376 unsigned int __tempc = (unsigned int) __c[i];
377 __tempc = __tempc & 0x00000001;
378 unsigned long long __longa = (unsigned long long) __tempa;
379 unsigned long long __longb = (unsigned long long) __tempb;
380 unsigned long long __longc = (unsigned long long) __tempc;
381 unsigned long long __sum = __longa + __longb + __longc;
382 unsigned long long __res = (__sum >> 32) & 0x01;
383 unsigned long long __tempres = (unsigned int) __res;
384 __result[i] = (signed int) __tempres;
387 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
391 static __inline__ vector unsigned int __ATTRS_o_ai
392 vec_addec(vector unsigned int __a, vector unsigned int __b,
393 vector unsigned int __c) {
395 unsigned int __result[4];
396 for (int i = 0; i < 4; i++) {
397 unsigned int __tempc = __c[i] & 1;
398 unsigned long long __longa = (unsigned long long) __a[i];
399 unsigned long long __longb = (unsigned long long) __b[i];
400 unsigned long long __longc = (unsigned long long) __tempc;
401 unsigned long long __sum = __longa + __longb + __longc;
402 unsigned long long __res = (__sum >> 32) & 0x01;
403 unsigned long long __tempres = (unsigned int) __res;
404 __result[i] = (signed int) __tempres;
407 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
415 #define __builtin_altivec_vaddubm vec_vaddubm
417 static __inline__ vector signed char __ATTRS_o_ai
418 vec_vaddubm(vector signed char __a, vector signed char __b) {
422 static __inline__ vector signed char __ATTRS_o_ai
423 vec_vaddubm(vector bool char __a, vector signed char __b) {
424 return (vector signed char)__a + __b;
427 static __inline__ vector signed char __ATTRS_o_ai
428 vec_vaddubm(vector signed char __a, vector bool char __b) {
429 return __a + (vector signed char)__b;
432 static __inline__ vector unsigned char __ATTRS_o_ai
433 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
437 static __inline__ vector unsigned char __ATTRS_o_ai
438 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
439 return (vector unsigned char)__a + __b;
442 static __inline__ vector unsigned char __ATTRS_o_ai
443 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
444 return __a + (vector unsigned char)__b;
449 #define __builtin_altivec_vadduhm vec_vadduhm
451 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
456 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
458 return (vector short)__a + __b;
461 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
462 vector bool short __b) {
463 return __a + (vector short)__b;
466 static __inline__ vector unsigned short __ATTRS_o_ai
467 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
471 static __inline__ vector unsigned short __ATTRS_o_ai
472 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
473 return (vector unsigned short)__a + __b;
476 static __inline__ vector unsigned short __ATTRS_o_ai
477 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
478 return __a + (vector unsigned short)__b;
483 #define __builtin_altivec_vadduwm vec_vadduwm
485 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
490 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
492 return (vector int)__a + __b;
495 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
496 vector bool int __b) {
497 return __a + (vector int)__b;
500 static __inline__ vector unsigned int __ATTRS_o_ai
501 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
505 static __inline__ vector unsigned int __ATTRS_o_ai
506 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
507 return (vector unsigned int)__a + __b;
510 static __inline__ vector unsigned int __ATTRS_o_ai
511 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
512 return __a + (vector unsigned int)__b;
517 #define __builtin_altivec_vaddfp vec_vaddfp
519 static __inline__ vector float __attribute__((__always_inline__))
520 vec_vaddfp(vector float __a, vector float __b) {
526 static __inline__ vector signed int __ATTRS_o_ai
527 vec_addc(vector signed int __a, vector signed int __b) {
528 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
529 (vector unsigned int)__b);
532 static __inline__ vector unsigned int __ATTRS_o_ai
533 vec_addc(vector unsigned int __a, vector unsigned int __b) {
534 return __builtin_altivec_vaddcuw(__a, __b);
537 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
538 static __inline__ vector signed __int128 __ATTRS_o_ai
539 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
540 return (vector signed __int128)__builtin_altivec_vaddcuq(
541 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
544 static __inline__ vector unsigned __int128 __ATTRS_o_ai
545 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
546 return __builtin_altivec_vaddcuq(__a, __b);
548 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
552 static __inline__ vector unsigned int __attribute__((__always_inline__))
553 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
554 return __builtin_altivec_vaddcuw(__a, __b);
559 static __inline__ vector signed char __ATTRS_o_ai
560 vec_adds(vector signed char __a, vector signed char __b) {
561 return __builtin_altivec_vaddsbs(__a, __b);
564 static __inline__ vector signed char __ATTRS_o_ai
565 vec_adds(vector bool char __a, vector signed char __b) {
566 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
569 static __inline__ vector signed char __ATTRS_o_ai
570 vec_adds(vector signed char __a, vector bool char __b) {
571 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
574 static __inline__ vector unsigned char __ATTRS_o_ai
575 vec_adds(vector unsigned char __a, vector unsigned char __b) {
576 return __builtin_altivec_vaddubs(__a, __b);
579 static __inline__ vector unsigned char __ATTRS_o_ai
580 vec_adds(vector bool char __a, vector unsigned char __b) {
581 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
584 static __inline__ vector unsigned char __ATTRS_o_ai
585 vec_adds(vector unsigned char __a, vector bool char __b) {
586 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
589 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
591 return __builtin_altivec_vaddshs(__a, __b);
594 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
596 return __builtin_altivec_vaddshs((vector short)__a, __b);
599 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
600 vector bool short __b) {
601 return __builtin_altivec_vaddshs(__a, (vector short)__b);
604 static __inline__ vector unsigned short __ATTRS_o_ai
605 vec_adds(vector unsigned short __a, vector unsigned short __b) {
606 return __builtin_altivec_vadduhs(__a, __b);
609 static __inline__ vector unsigned short __ATTRS_o_ai
610 vec_adds(vector bool short __a, vector unsigned short __b) {
611 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
614 static __inline__ vector unsigned short __ATTRS_o_ai
615 vec_adds(vector unsigned short __a, vector bool short __b) {
616 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
619 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
621 return __builtin_altivec_vaddsws(__a, __b);
624 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
626 return __builtin_altivec_vaddsws((vector int)__a, __b);
629 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
630 vector bool int __b) {
631 return __builtin_altivec_vaddsws(__a, (vector int)__b);
634 static __inline__ vector unsigned int __ATTRS_o_ai
635 vec_adds(vector unsigned int __a, vector unsigned int __b) {
636 return __builtin_altivec_vadduws(__a, __b);
639 static __inline__ vector unsigned int __ATTRS_o_ai
640 vec_adds(vector bool int __a, vector unsigned int __b) {
641 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
644 static __inline__ vector unsigned int __ATTRS_o_ai
645 vec_adds(vector unsigned int __a, vector bool int __b) {
646 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
651 static __inline__ vector signed char __ATTRS_o_ai
652 vec_vaddsbs(vector signed char __a, vector signed char __b) {
653 return __builtin_altivec_vaddsbs(__a, __b);
656 static __inline__ vector signed char __ATTRS_o_ai
657 vec_vaddsbs(vector bool char __a, vector signed char __b) {
658 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
661 static __inline__ vector signed char __ATTRS_o_ai
662 vec_vaddsbs(vector signed char __a, vector bool char __b) {
663 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
668 static __inline__ vector unsigned char __ATTRS_o_ai
669 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
670 return __builtin_altivec_vaddubs(__a, __b);
673 static __inline__ vector unsigned char __ATTRS_o_ai
674 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
675 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
678 static __inline__ vector unsigned char __ATTRS_o_ai
679 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
680 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
685 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
687 return __builtin_altivec_vaddshs(__a, __b);
690 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
692 return __builtin_altivec_vaddshs((vector short)__a, __b);
695 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
696 vector bool short __b) {
697 return __builtin_altivec_vaddshs(__a, (vector short)__b);
702 static __inline__ vector unsigned short __ATTRS_o_ai
703 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
704 return __builtin_altivec_vadduhs(__a, __b);
707 static __inline__ vector unsigned short __ATTRS_o_ai
708 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
709 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
712 static __inline__ vector unsigned short __ATTRS_o_ai
713 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
714 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
719 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
721 return __builtin_altivec_vaddsws(__a, __b);
724 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
726 return __builtin_altivec_vaddsws((vector int)__a, __b);
729 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
730 vector bool int __b) {
731 return __builtin_altivec_vaddsws(__a, (vector int)__b);
736 static __inline__ vector unsigned int __ATTRS_o_ai
737 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
738 return __builtin_altivec_vadduws(__a, __b);
741 static __inline__ vector unsigned int __ATTRS_o_ai
742 vec_vadduws(vector bool int __a, vector unsigned int __b) {
743 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
746 static __inline__ vector unsigned int __ATTRS_o_ai
747 vec_vadduws(vector unsigned int __a, vector bool int __b) {
748 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
751 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
754 static __inline__ vector signed __int128 __ATTRS_o_ai
755 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
759 static __inline__ vector unsigned __int128 __ATTRS_o_ai
760 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
766 static __inline__ vector signed __int128 __ATTRS_o_ai
767 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
768 vector signed __int128 __c) {
769 return __builtin_altivec_vaddeuqm(__a, __b, __c);
772 static __inline__ vector unsigned __int128 __ATTRS_o_ai
773 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
774 vector unsigned __int128 __c) {
775 return __builtin_altivec_vaddeuqm(__a, __b, __c);
780 static __inline__ vector signed __int128 __ATTRS_o_ai
781 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
782 return __builtin_altivec_vaddcuq(__a, __b);
785 static __inline__ vector unsigned __int128 __ATTRS_o_ai
786 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
787 return __builtin_altivec_vaddcuq(__a, __b);
792 static __inline__ vector signed __int128 __ATTRS_o_ai
793 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
794 vector signed __int128 __c) {
795 return __builtin_altivec_vaddecuq(__a, __b, __c);
798 static __inline__ vector unsigned __int128 __ATTRS_o_ai
799 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
800 vector unsigned __int128 __c) {
801 return __builtin_altivec_vaddecuq(__a, __b, __c);
803 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
807 #define __builtin_altivec_vand vec_and
809 static __inline__ vector signed char __ATTRS_o_ai
810 vec_and(vector signed char __a, vector signed char __b) {
814 static __inline__ vector signed char __ATTRS_o_ai
815 vec_and(vector bool char __a, vector signed char __b) {
816 return (vector signed char)__a & __b;
819 static __inline__ vector signed char __ATTRS_o_ai
820 vec_and(vector signed char __a, vector bool char __b) {
821 return __a & (vector signed char)__b;
824 static __inline__ vector unsigned char __ATTRS_o_ai
825 vec_and(vector unsigned char __a, vector unsigned char __b) {
829 static __inline__ vector unsigned char __ATTRS_o_ai
830 vec_and(vector bool char __a, vector unsigned char __b) {
831 return (vector unsigned char)__a & __b;
834 static __inline__ vector unsigned char __ATTRS_o_ai
835 vec_and(vector unsigned char __a, vector bool char __b) {
836 return __a & (vector unsigned char)__b;
839 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
840 vector bool char __b) {
844 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
849 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
851 return (vector short)__a & __b;
854 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
855 vector bool short __b) {
856 return __a & (vector short)__b;
859 static __inline__ vector unsigned short __ATTRS_o_ai
860 vec_and(vector unsigned short __a, vector unsigned short __b) {
864 static __inline__ vector unsigned short __ATTRS_o_ai
865 vec_and(vector bool short __a, vector unsigned short __b) {
866 return (vector unsigned short)__a & __b;
869 static __inline__ vector unsigned short __ATTRS_o_ai
870 vec_and(vector unsigned short __a, vector bool short __b) {
871 return __a & (vector unsigned short)__b;
874 static __inline__ vector bool short __ATTRS_o_ai
875 vec_and(vector bool short __a, vector bool short __b) {
879 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
884 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
886 return (vector int)__a & __b;
889 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
890 vector bool int __b) {
891 return __a & (vector int)__b;
894 static __inline__ vector unsigned int __ATTRS_o_ai
895 vec_and(vector unsigned int __a, vector unsigned int __b) {
899 static __inline__ vector unsigned int __ATTRS_o_ai
900 vec_and(vector bool int __a, vector unsigned int __b) {
901 return (vector unsigned int)__a & __b;
904 static __inline__ vector unsigned int __ATTRS_o_ai
905 vec_and(vector unsigned int __a, vector bool int __b) {
906 return __a & (vector unsigned int)__b;
909 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
910 vector bool int __b) {
914 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
916 vector unsigned int __res =
917 (vector unsigned int)__a & (vector unsigned int)__b;
918 return (vector float)__res;
921 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
923 vector unsigned int __res =
924 (vector unsigned int)__a & (vector unsigned int)__b;
925 return (vector float)__res;
928 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
929 vector bool int __b) {
930 vector unsigned int __res =
931 (vector unsigned int)__a & (vector unsigned int)__b;
932 return (vector float)__res;
936 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
938 vector unsigned long long __res =
939 (vector unsigned long long)__a & (vector unsigned long long)__b;
940 return (vector double)__res;
943 static __inline__ vector double __ATTRS_o_ai
944 vec_and(vector double __a, vector bool long long __b) {
945 vector unsigned long long __res =
946 (vector unsigned long long)__a & (vector unsigned long long)__b;
947 return (vector double)__res;
950 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __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 signed long long __ATTRS_o_ai
958 vec_and(vector signed long long __a, vector signed long long __b) {
962 static __inline__ vector signed long long __ATTRS_o_ai
963 vec_and(vector bool long long __a, vector signed long long __b) {
964 return (vector signed long long)__a & __b;
967 static __inline__ vector signed long long __ATTRS_o_ai
968 vec_and(vector signed long long __a, vector bool long long __b) {
969 return __a & (vector signed long long)__b;
972 static __inline__ vector unsigned long long __ATTRS_o_ai
973 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
977 static __inline__ vector unsigned long long __ATTRS_o_ai
978 vec_and(vector bool long long __a, vector unsigned long long __b) {
979 return (vector unsigned long long)__a & __b;
982 static __inline__ vector unsigned long long __ATTRS_o_ai
983 vec_and(vector unsigned long long __a, vector bool long long __b) {
984 return __a & (vector unsigned long long)__b;
987 static __inline__ vector bool long long __ATTRS_o_ai
988 vec_and(vector bool long long __a, vector bool long long __b) {
995 static __inline__ vector signed char __ATTRS_o_ai
996 vec_vand(vector signed char __a, vector signed char __b) {
1000 static __inline__ vector signed char __ATTRS_o_ai
1001 vec_vand(vector bool char __a, vector signed char __b) {
1002 return (vector signed char)__a & __b;
1005 static __inline__ vector signed char __ATTRS_o_ai
1006 vec_vand(vector signed char __a, vector bool char __b) {
1007 return __a & (vector signed char)__b;
1010 static __inline__ vector unsigned char __ATTRS_o_ai
1011 vec_vand(vector unsigned char __a, vector unsigned char __b) {
1015 static __inline__ vector unsigned char __ATTRS_o_ai
1016 vec_vand(vector bool char __a, vector unsigned char __b) {
1017 return (vector unsigned char)__a & __b;
1020 static __inline__ vector unsigned char __ATTRS_o_ai
1021 vec_vand(vector unsigned char __a, vector bool char __b) {
1022 return __a & (vector unsigned char)__b;
1025 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1026 vector bool char __b) {
1030 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1035 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1037 return (vector short)__a & __b;
1040 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1041 vector bool short __b) {
1042 return __a & (vector short)__b;
1045 static __inline__ vector unsigned short __ATTRS_o_ai
1046 vec_vand(vector unsigned short __a, vector unsigned short __b) {
1050 static __inline__ vector unsigned short __ATTRS_o_ai
1051 vec_vand(vector bool short __a, vector unsigned short __b) {
1052 return (vector unsigned short)__a & __b;
1055 static __inline__ vector unsigned short __ATTRS_o_ai
1056 vec_vand(vector unsigned short __a, vector bool short __b) {
1057 return __a & (vector unsigned short)__b;
1060 static __inline__ vector bool short __ATTRS_o_ai
1061 vec_vand(vector bool short __a, vector bool short __b) {
1065 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1070 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1072 return (vector int)__a & __b;
1075 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1076 vector bool int __b) {
1077 return __a & (vector int)__b;
1080 static __inline__ vector unsigned int __ATTRS_o_ai
1081 vec_vand(vector unsigned int __a, vector unsigned int __b) {
1085 static __inline__ vector unsigned int __ATTRS_o_ai
1086 vec_vand(vector bool int __a, vector unsigned int __b) {
1087 return (vector unsigned int)__a & __b;
1090 static __inline__ vector unsigned int __ATTRS_o_ai
1091 vec_vand(vector unsigned int __a, vector bool int __b) {
1092 return __a & (vector unsigned int)__b;
1095 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1096 vector bool int __b) {
1100 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1102 vector unsigned int __res =
1103 (vector unsigned int)__a & (vector unsigned int)__b;
1104 return (vector float)__res;
1107 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1109 vector unsigned int __res =
1110 (vector unsigned int)__a & (vector unsigned int)__b;
1111 return (vector float)__res;
1114 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1115 vector bool int __b) {
1116 vector unsigned int __res =
1117 (vector unsigned int)__a & (vector unsigned int)__b;
1118 return (vector float)__res;
1122 static __inline__ vector signed long long __ATTRS_o_ai
1123 vec_vand(vector signed long long __a, vector signed long long __b) {
1127 static __inline__ vector signed long long __ATTRS_o_ai
1128 vec_vand(vector bool long long __a, vector signed long long __b) {
1129 return (vector signed long long)__a & __b;
1132 static __inline__ vector signed long long __ATTRS_o_ai
1133 vec_vand(vector signed long long __a, vector bool long long __b) {
1134 return __a & (vector signed long long)__b;
1137 static __inline__ vector unsigned long long __ATTRS_o_ai
1138 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1142 static __inline__ vector unsigned long long __ATTRS_o_ai
1143 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1144 return (vector unsigned long long)__a & __b;
1147 static __inline__ vector unsigned long long __ATTRS_o_ai
1148 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1149 return __a & (vector unsigned long long)__b;
1152 static __inline__ vector bool long long __ATTRS_o_ai
1153 vec_vand(vector bool long long __a, vector bool long long __b) {
1160 #define __builtin_altivec_vandc vec_andc
1162 static __inline__ vector signed char __ATTRS_o_ai
1163 vec_andc(vector signed char __a, vector signed char __b) {
1167 static __inline__ vector signed char __ATTRS_o_ai
1168 vec_andc(vector bool char __a, vector signed char __b) {
1169 return (vector signed char)__a & ~__b;
1172 static __inline__ vector signed char __ATTRS_o_ai
1173 vec_andc(vector signed char __a, vector bool char __b) {
1174 return __a & ~(vector signed char)__b;
1177 static __inline__ vector unsigned char __ATTRS_o_ai
1178 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1182 static __inline__ vector unsigned char __ATTRS_o_ai
1183 vec_andc(vector bool char __a, vector unsigned char __b) {
1184 return (vector unsigned char)__a & ~__b;
1187 static __inline__ vector unsigned char __ATTRS_o_ai
1188 vec_andc(vector unsigned char __a, vector bool char __b) {
1189 return __a & ~(vector unsigned char)__b;
1192 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1193 vector bool char __b) {
1197 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1202 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1204 return (vector short)__a & ~__b;
1207 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1208 vector bool short __b) {
1209 return __a & ~(vector short)__b;
1212 static __inline__ vector unsigned short __ATTRS_o_ai
1213 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1217 static __inline__ vector unsigned short __ATTRS_o_ai
1218 vec_andc(vector bool short __a, vector unsigned short __b) {
1219 return (vector unsigned short)__a & ~__b;
1222 static __inline__ vector unsigned short __ATTRS_o_ai
1223 vec_andc(vector unsigned short __a, vector bool short __b) {
1224 return __a & ~(vector unsigned short)__b;
1227 static __inline__ vector bool short __ATTRS_o_ai
1228 vec_andc(vector bool short __a, vector bool short __b) {
1232 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1237 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1239 return (vector int)__a & ~__b;
1242 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1243 vector bool int __b) {
1244 return __a & ~(vector int)__b;
1247 static __inline__ vector unsigned int __ATTRS_o_ai
1248 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1252 static __inline__ vector unsigned int __ATTRS_o_ai
1253 vec_andc(vector bool int __a, vector unsigned int __b) {
1254 return (vector unsigned int)__a & ~__b;
1257 static __inline__ vector unsigned int __ATTRS_o_ai
1258 vec_andc(vector unsigned int __a, vector bool int __b) {
1259 return __a & ~(vector unsigned int)__b;
1262 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1263 vector bool int __b) {
1267 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1269 vector unsigned int __res =
1270 (vector unsigned int)__a & ~(vector unsigned int)__b;
1271 return (vector float)__res;
1274 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1276 vector unsigned int __res =
1277 (vector unsigned int)__a & ~(vector unsigned int)__b;
1278 return (vector float)__res;
1281 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1282 vector bool int __b) {
1283 vector unsigned int __res =
1284 (vector unsigned int)__a & ~(vector unsigned int)__b;
1285 return (vector float)__res;
1289 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1290 vector double __b) {
1291 vector unsigned long long __res =
1292 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1293 return (vector double)__res;
1296 static __inline__ vector double __ATTRS_o_ai
1297 vec_andc(vector double __a, vector bool long long __b) {
1298 vector unsigned long long __res =
1299 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1300 return (vector double)__res;
1303 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __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 signed long long __ATTRS_o_ai
1311 vec_andc(vector signed long long __a, vector signed long long __b) {
1315 static __inline__ vector signed long long __ATTRS_o_ai
1316 vec_andc(vector bool long long __a, vector signed long long __b) {
1317 return (vector signed long long)__a & ~__b;
1320 static __inline__ vector signed long long __ATTRS_o_ai
1321 vec_andc(vector signed long long __a, vector bool long long __b) {
1322 return __a & ~(vector signed long long)__b;
1325 static __inline__ vector unsigned long long __ATTRS_o_ai
1326 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1330 static __inline__ vector unsigned long long __ATTRS_o_ai
1331 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1332 return (vector unsigned long long)__a & ~__b;
1335 static __inline__ vector unsigned long long __ATTRS_o_ai
1336 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1337 return __a & ~(vector unsigned long long)__b;
1340 static __inline__ vector bool long long __ATTRS_o_ai
1341 vec_andc(vector bool long long __a, vector bool long long __b) {
1348 static __inline__ vector signed char __ATTRS_o_ai
1349 vec_vandc(vector signed char __a, vector signed char __b) {
1353 static __inline__ vector signed char __ATTRS_o_ai
1354 vec_vandc(vector bool char __a, vector signed char __b) {
1355 return (vector signed char)__a & ~__b;
1358 static __inline__ vector signed char __ATTRS_o_ai
1359 vec_vandc(vector signed char __a, vector bool char __b) {
1360 return __a & ~(vector signed char)__b;
1363 static __inline__ vector unsigned char __ATTRS_o_ai
1364 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1368 static __inline__ vector unsigned char __ATTRS_o_ai
1369 vec_vandc(vector bool char __a, vector unsigned char __b) {
1370 return (vector unsigned char)__a & ~__b;
1373 static __inline__ vector unsigned char __ATTRS_o_ai
1374 vec_vandc(vector unsigned char __a, vector bool char __b) {
1375 return __a & ~(vector unsigned char)__b;
1378 static __inline__ vector bool char __ATTRS_o_ai
1379 vec_vandc(vector bool char __a, vector bool char __b) {
1383 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1388 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1390 return (vector short)__a & ~__b;
1393 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1394 vector bool short __b) {
1395 return __a & ~(vector short)__b;
1398 static __inline__ vector unsigned short __ATTRS_o_ai
1399 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1403 static __inline__ vector unsigned short __ATTRS_o_ai
1404 vec_vandc(vector bool short __a, vector unsigned short __b) {
1405 return (vector unsigned short)__a & ~__b;
1408 static __inline__ vector unsigned short __ATTRS_o_ai
1409 vec_vandc(vector unsigned short __a, vector bool short __b) {
1410 return __a & ~(vector unsigned short)__b;
1413 static __inline__ vector bool short __ATTRS_o_ai
1414 vec_vandc(vector bool short __a, vector bool short __b) {
1418 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1423 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1425 return (vector int)__a & ~__b;
1428 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1429 vector bool int __b) {
1430 return __a & ~(vector int)__b;
1433 static __inline__ vector unsigned int __ATTRS_o_ai
1434 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1438 static __inline__ vector unsigned int __ATTRS_o_ai
1439 vec_vandc(vector bool int __a, vector unsigned int __b) {
1440 return (vector unsigned int)__a & ~__b;
1443 static __inline__ vector unsigned int __ATTRS_o_ai
1444 vec_vandc(vector unsigned int __a, vector bool int __b) {
1445 return __a & ~(vector unsigned int)__b;
1448 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1449 vector bool int __b) {
1453 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1455 vector unsigned int __res =
1456 (vector unsigned int)__a & ~(vector unsigned int)__b;
1457 return (vector float)__res;
1460 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1462 vector unsigned int __res =
1463 (vector unsigned int)__a & ~(vector unsigned int)__b;
1464 return (vector float)__res;
1467 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1468 vector bool int __b) {
1469 vector unsigned int __res =
1470 (vector unsigned int)__a & ~(vector unsigned int)__b;
1471 return (vector float)__res;
1475 static __inline__ vector signed long long __ATTRS_o_ai
1476 vec_vandc(vector signed long long __a, vector signed long long __b) {
1480 static __inline__ vector signed long long __ATTRS_o_ai
1481 vec_vandc(vector bool long long __a, vector signed long long __b) {
1482 return (vector signed long long)__a & ~__b;
1485 static __inline__ vector signed long long __ATTRS_o_ai
1486 vec_vandc(vector signed long long __a, vector bool long long __b) {
1487 return __a & ~(vector signed long long)__b;
1490 static __inline__ vector unsigned long long __ATTRS_o_ai
1491 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1495 static __inline__ vector unsigned long long __ATTRS_o_ai
1496 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1497 return (vector unsigned long long)__a & ~__b;
1500 static __inline__ vector unsigned long long __ATTRS_o_ai
1501 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1502 return __a & ~(vector unsigned long long)__b;
1505 static __inline__ vector bool long long __ATTRS_o_ai
1506 vec_vandc(vector bool long long __a, vector bool long long __b) {
1513 static __inline__ vector signed char __ATTRS_o_ai
1514 vec_avg(vector signed char __a, vector signed char __b) {
1515 return __builtin_altivec_vavgsb(__a, __b);
1518 static __inline__ vector unsigned char __ATTRS_o_ai
1519 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1520 return __builtin_altivec_vavgub(__a, __b);
1523 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1525 return __builtin_altivec_vavgsh(__a, __b);
1528 static __inline__ vector unsigned short __ATTRS_o_ai
1529 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1530 return __builtin_altivec_vavguh(__a, __b);
1533 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1535 return __builtin_altivec_vavgsw(__a, __b);
1538 static __inline__ vector unsigned int __ATTRS_o_ai
1539 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1540 return __builtin_altivec_vavguw(__a, __b);
1545 static __inline__ vector signed char __attribute__((__always_inline__))
1546 vec_vavgsb(vector signed char __a, vector signed char __b) {
1547 return __builtin_altivec_vavgsb(__a, __b);
1552 static __inline__ vector unsigned char __attribute__((__always_inline__))
1553 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1554 return __builtin_altivec_vavgub(__a, __b);
1559 static __inline__ vector short __attribute__((__always_inline__))
1560 vec_vavgsh(vector short __a, vector short __b) {
1561 return __builtin_altivec_vavgsh(__a, __b);
1566 static __inline__ vector unsigned short __attribute__((__always_inline__))
1567 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1568 return __builtin_altivec_vavguh(__a, __b);
1573 static __inline__ vector int __attribute__((__always_inline__))
1574 vec_vavgsw(vector int __a, vector int __b) {
1575 return __builtin_altivec_vavgsw(__a, __b);
1580 static __inline__ vector unsigned int __attribute__((__always_inline__))
1581 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1582 return __builtin_altivec_vavguw(__a, __b);
1587 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1589 return __builtin_vsx_xvrspip(__a);
1591 return __builtin_altivec_vrfip(__a);
1596 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1597 return __builtin_vsx_xvrdpip(__a);
1603 static __inline__ vector float __attribute__((__always_inline__))
1604 vec_vrfip(vector float __a) {
1605 return __builtin_altivec_vrfip(__a);
1610 static __inline__ vector int __attribute__((__always_inline__))
1611 vec_cmpb(vector float __a, vector float __b) {
1612 return __builtin_altivec_vcmpbfp(__a, __b);
1617 static __inline__ vector int __attribute__((__always_inline__))
1618 vec_vcmpbfp(vector float __a, vector float __b) {
1619 return __builtin_altivec_vcmpbfp(__a, __b);
1624 static __inline__ vector bool char __ATTRS_o_ai
1625 vec_cmpeq(vector signed char __a, vector signed char __b) {
1626 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1630 static __inline__ vector bool char __ATTRS_o_ai
1631 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1632 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1636 static __inline__ vector bool char __ATTRS_o_ai
1637 vec_cmpeq(vector bool char __a, vector bool char __b) {
1638 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1642 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1644 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1647 static __inline__ vector bool short __ATTRS_o_ai
1648 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1649 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1653 static __inline__ vector bool short __ATTRS_o_ai
1654 vec_cmpeq(vector bool short __a, vector bool short __b) {
1655 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1659 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1661 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1664 static __inline__ vector bool int __ATTRS_o_ai
1665 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1666 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1670 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1671 vector bool int __b) {
1672 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1676 #ifdef __POWER8_VECTOR__
1677 static __inline__ vector bool long long __ATTRS_o_ai
1678 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1679 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1682 static __inline__ vector bool long long __ATTRS_o_ai
1683 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1684 return (vector bool long long)__builtin_altivec_vcmpequd(
1685 (vector long long)__a, (vector long long)__b);
1688 static __inline__ vector bool long long __ATTRS_o_ai
1689 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1690 return (vector bool long long)__builtin_altivec_vcmpequd(
1691 (vector long long)__a, (vector long long)__b);
1696 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1699 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1701 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1706 static __inline__ vector bool long long __ATTRS_o_ai
1707 vec_cmpeq(vector double __a, vector double __b) {
1708 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1712 #ifdef __POWER9_VECTOR__
1715 static __inline__ vector bool char __ATTRS_o_ai
1716 vec_cmpne(vector bool char __a, vector bool char __b) {
1717 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1721 static __inline__ vector bool char __ATTRS_o_ai
1722 vec_cmpne(vector signed char __a, vector signed char __b) {
1723 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1727 static __inline__ vector bool char __ATTRS_o_ai
1728 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1729 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1733 static __inline__ vector bool short __ATTRS_o_ai
1734 vec_cmpne(vector bool short __a, vector bool short __b) {
1735 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1739 static __inline__ vector bool short __ATTRS_o_ai
1740 vec_cmpne(vector signed short __a, vector signed short __b) {
1741 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1745 static __inline__ vector bool short __ATTRS_o_ai
1746 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1747 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1751 static __inline__ vector bool int __ATTRS_o_ai
1752 vec_cmpne(vector bool int __a, vector bool int __b) {
1753 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1757 static __inline__ vector bool int __ATTRS_o_ai
1758 vec_cmpne(vector signed int __a, vector signed int __b) {
1759 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1763 static __inline__ vector bool int __ATTRS_o_ai
1764 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1765 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1769 static __inline__ vector bool long long __ATTRS_o_ai
1770 vec_cmpne(vector bool long long __a, vector bool long long __b) {
1771 return (vector bool long long)
1772 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1775 static __inline__ vector bool long long __ATTRS_o_ai
1776 vec_cmpne(vector signed long long __a, vector signed long long __b) {
1777 return (vector bool long long)
1778 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1781 static __inline__ vector bool long long __ATTRS_o_ai
1782 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1783 return (vector bool long long)
1784 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1787 static __inline__ vector bool int __ATTRS_o_ai
1788 vec_cmpne(vector float __a, vector float __b) {
1789 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1793 static __inline__ vector bool long long __ATTRS_o_ai
1794 vec_cmpne(vector double __a, vector double __b) {
1795 return (vector bool long long)
1796 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1801 static __inline__ vector bool char __ATTRS_o_ai
1802 vec_cmpnez(vector signed char __a, vector signed char __b) {
1803 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1807 static __inline__ vector bool char __ATTRS_o_ai
1808 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1809 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1813 static __inline__ vector bool short __ATTRS_o_ai
1814 vec_cmpnez(vector signed short __a, vector signed short __b) {
1815 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1819 static __inline__ vector bool short __ATTRS_o_ai
1820 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1821 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1825 static __inline__ vector bool int __ATTRS_o_ai
1826 vec_cmpnez(vector signed int __a, vector signed int __b) {
1827 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1831 static __inline__ vector bool int __ATTRS_o_ai
1832 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1833 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1837 static __inline__ signed int __ATTRS_o_ai
1838 vec_cntlz_lsbb(vector signed char __a) {
1839 #ifdef __LITTLE_ENDIAN__
1840 return __builtin_altivec_vctzlsbb(__a);
1842 return __builtin_altivec_vclzlsbb(__a);
1846 static __inline__ signed int __ATTRS_o_ai
1847 vec_cntlz_lsbb(vector unsigned char __a) {
1848 #ifdef __LITTLE_ENDIAN__
1849 return __builtin_altivec_vctzlsbb(__a);
1851 return __builtin_altivec_vclzlsbb(__a);
1855 static __inline__ signed int __ATTRS_o_ai
1856 vec_cnttz_lsbb(vector signed char __a) {
1857 #ifdef __LITTLE_ENDIAN__
1858 return __builtin_altivec_vclzlsbb(__a);
1860 return __builtin_altivec_vctzlsbb(__a);
1864 static __inline__ signed int __ATTRS_o_ai
1865 vec_cnttz_lsbb(vector unsigned char __a) {
1866 #ifdef __LITTLE_ENDIAN__
1867 return __builtin_altivec_vclzlsbb(__a);
1869 return __builtin_altivec_vctzlsbb(__a);
1873 static __inline__ vector unsigned int __ATTRS_o_ai
1874 vec_parity_lsbb(vector unsigned int __a) {
1875 return __builtin_altivec_vprtybw(__a);
1878 static __inline__ vector unsigned int __ATTRS_o_ai
1879 vec_parity_lsbb(vector signed int __a) {
1880 return __builtin_altivec_vprtybw(__a);
1883 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1884 vec_parity_lsbb(vector unsigned __int128 __a) {
1885 return __builtin_altivec_vprtybq(__a);
1888 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1889 vec_parity_lsbb(vector signed __int128 __a) {
1890 return __builtin_altivec_vprtybq(__a);
1893 static __inline__ vector unsigned long long __ATTRS_o_ai
1894 vec_parity_lsbb(vector unsigned long long __a) {
1895 return __builtin_altivec_vprtybd(__a);
1898 static __inline__ vector unsigned long long __ATTRS_o_ai
1899 vec_parity_lsbb(vector signed long long __a) {
1900 return __builtin_altivec_vprtybd(__a);
1907 static __inline__ vector bool char __ATTRS_o_ai
1908 vec_cmpgt(vector signed char __a, vector signed char __b) {
1909 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1912 static __inline__ vector bool char __ATTRS_o_ai
1913 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1914 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1917 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1919 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1922 static __inline__ vector bool short __ATTRS_o_ai
1923 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1924 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1927 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1929 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1932 static __inline__ vector bool int __ATTRS_o_ai
1933 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1934 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1937 #ifdef __POWER8_VECTOR__
1938 static __inline__ vector bool long long __ATTRS_o_ai
1939 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1940 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1943 static __inline__ vector bool long long __ATTRS_o_ai
1944 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1945 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1949 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1952 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1954 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1959 static __inline__ vector bool long long __ATTRS_o_ai
1960 vec_cmpgt(vector double __a, vector double __b) {
1961 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1967 static __inline__ vector bool char __ATTRS_o_ai
1968 vec_cmpge(vector signed char __a, vector signed char __b) {
1969 return ~(vec_cmpgt(__b, __a));
1972 static __inline__ vector bool char __ATTRS_o_ai
1973 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1974 return ~(vec_cmpgt(__b, __a));
1977 static __inline__ vector bool short __ATTRS_o_ai
1978 vec_cmpge(vector signed short __a, vector signed short __b) {
1979 return ~(vec_cmpgt(__b, __a));
1982 static __inline__ vector bool short __ATTRS_o_ai
1983 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1984 return ~(vec_cmpgt(__b, __a));
1987 static __inline__ vector bool int __ATTRS_o_ai
1988 vec_cmpge(vector signed int __a, vector signed int __b) {
1989 return ~(vec_cmpgt(__b, __a));
1992 static __inline__ vector bool int __ATTRS_o_ai
1993 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
1994 return ~(vec_cmpgt(__b, __a));
1997 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2000 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2002 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2007 static __inline__ vector bool long long __ATTRS_o_ai
2008 vec_cmpge(vector double __a, vector double __b) {
2009 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2013 #ifdef __POWER8_VECTOR__
2014 static __inline__ vector bool long long __ATTRS_o_ai
2015 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2016 return ~(vec_cmpgt(__b, __a));
2019 static __inline__ vector bool long long __ATTRS_o_ai
2020 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2021 return ~(vec_cmpgt(__b, __a));
2027 static __inline__ vector bool int __attribute__((__always_inline__))
2028 vec_vcmpgefp(vector float __a, vector float __b) {
2029 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2034 static __inline__ vector bool char __attribute__((__always_inline__))
2035 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2036 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2041 static __inline__ vector bool char __attribute__((__always_inline__))
2042 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2043 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2048 static __inline__ vector bool short __attribute__((__always_inline__))
2049 vec_vcmpgtsh(vector short __a, vector short __b) {
2050 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2055 static __inline__ vector bool short __attribute__((__always_inline__))
2056 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2057 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2062 static __inline__ vector bool int __attribute__((__always_inline__))
2063 vec_vcmpgtsw(vector int __a, vector int __b) {
2064 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2069 static __inline__ vector bool int __attribute__((__always_inline__))
2070 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2071 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2076 static __inline__ vector bool int __attribute__((__always_inline__))
2077 vec_vcmpgtfp(vector float __a, vector float __b) {
2078 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2083 static __inline__ vector bool char __ATTRS_o_ai
2084 vec_cmple(vector signed char __a, vector signed char __b) {
2085 return vec_cmpge(__b, __a);
2088 static __inline__ vector bool char __ATTRS_o_ai
2089 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2090 return vec_cmpge(__b, __a);
2093 static __inline__ vector bool short __ATTRS_o_ai
2094 vec_cmple(vector signed short __a, vector signed short __b) {
2095 return vec_cmpge(__b, __a);
2098 static __inline__ vector bool short __ATTRS_o_ai
2099 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2100 return vec_cmpge(__b, __a);
2103 static __inline__ vector bool int __ATTRS_o_ai
2104 vec_cmple(vector signed int __a, vector signed int __b) {
2105 return vec_cmpge(__b, __a);
2108 static __inline__ vector bool int __ATTRS_o_ai
2109 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2110 return vec_cmpge(__b, __a);
2113 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2115 return vec_cmpge(__b, __a);
2119 static __inline__ vector bool long long __ATTRS_o_ai
2120 vec_cmple(vector double __a, vector double __b) {
2121 return vec_cmpge(__b, __a);
2125 #ifdef __POWER8_VECTOR__
2126 static __inline__ vector bool long long __ATTRS_o_ai
2127 vec_cmple(vector signed long long __a, vector signed long long __b) {
2128 return vec_cmpge(__b, __a);
2131 static __inline__ vector bool long long __ATTRS_o_ai
2132 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2133 return vec_cmpge(__b, __a);
2139 static __inline__ vector bool char __ATTRS_o_ai
2140 vec_cmplt(vector signed char __a, vector signed char __b) {
2141 return vec_cmpgt(__b, __a);
2144 static __inline__ vector bool char __ATTRS_o_ai
2145 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2146 return vec_cmpgt(__b, __a);
2149 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2151 return vec_cmpgt(__b, __a);
2154 static __inline__ vector bool short __ATTRS_o_ai
2155 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2156 return vec_cmpgt(__b, __a);
2159 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2161 return vec_cmpgt(__b, __a);
2164 static __inline__ vector bool int __ATTRS_o_ai
2165 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2166 return vec_cmpgt(__b, __a);
2169 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2171 return vec_cmpgt(__b, __a);
2175 static __inline__ vector bool long long __ATTRS_o_ai
2176 vec_cmplt(vector double __a, vector double __b) {
2177 return vec_cmpgt(__b, __a);
2181 #ifdef __POWER8_VECTOR__
2182 static __inline__ vector bool long long __ATTRS_o_ai
2183 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2184 return vec_cmpgt(__b, __a);
2187 static __inline__ vector bool long long __ATTRS_o_ai
2188 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2189 return vec_cmpgt(__b, __a);
2194 static __inline__ vector signed char __ATTRS_o_ai
2195 vec_popcnt(vector signed char __a) {
2196 return __builtin_altivec_vpopcntb(__a);
2198 static __inline__ vector unsigned char __ATTRS_o_ai
2199 vec_popcnt(vector unsigned char __a) {
2200 return __builtin_altivec_vpopcntb(__a);
2202 static __inline__ vector signed short __ATTRS_o_ai
2203 vec_popcnt(vector signed short __a) {
2204 return __builtin_altivec_vpopcnth(__a);
2206 static __inline__ vector unsigned short __ATTRS_o_ai
2207 vec_popcnt(vector unsigned short __a) {
2208 return __builtin_altivec_vpopcnth(__a);
2210 static __inline__ vector signed int __ATTRS_o_ai
2211 vec_popcnt(vector signed int __a) {
2212 return __builtin_altivec_vpopcntw(__a);
2214 static __inline__ vector unsigned int __ATTRS_o_ai
2215 vec_popcnt(vector unsigned int __a) {
2216 return __builtin_altivec_vpopcntw(__a);
2218 static __inline__ vector signed long long __ATTRS_o_ai
2219 vec_popcnt(vector signed long long __a) {
2220 return __builtin_altivec_vpopcntd(__a);
2222 static __inline__ vector unsigned long long __ATTRS_o_ai
2223 vec_popcnt(vector unsigned long long __a) {
2224 return __builtin_altivec_vpopcntd(__a);
2229 static __inline__ vector signed char __ATTRS_o_ai
2230 vec_cntlz(vector signed char __a) {
2231 return __builtin_altivec_vclzb(__a);
2233 static __inline__ vector unsigned char __ATTRS_o_ai
2234 vec_cntlz(vector unsigned char __a) {
2235 return __builtin_altivec_vclzb(__a);
2237 static __inline__ vector signed short __ATTRS_o_ai
2238 vec_cntlz(vector signed short __a) {
2239 return __builtin_altivec_vclzh(__a);
2241 static __inline__ vector unsigned short __ATTRS_o_ai
2242 vec_cntlz(vector unsigned short __a) {
2243 return __builtin_altivec_vclzh(__a);
2245 static __inline__ vector signed int __ATTRS_o_ai
2246 vec_cntlz(vector signed int __a) {
2247 return __builtin_altivec_vclzw(__a);
2249 static __inline__ vector unsigned int __ATTRS_o_ai
2250 vec_cntlz(vector unsigned int __a) {
2251 return __builtin_altivec_vclzw(__a);
2253 static __inline__ vector signed long long __ATTRS_o_ai
2254 vec_cntlz(vector signed long long __a) {
2255 return __builtin_altivec_vclzd(__a);
2257 static __inline__ vector unsigned long long __ATTRS_o_ai
2258 vec_cntlz(vector unsigned long long __a) {
2259 return __builtin_altivec_vclzd(__a);
2263 #ifdef __POWER9_VECTOR__
2267 static __inline__ vector signed char __ATTRS_o_ai
2268 vec_cnttz(vector signed char __a) {
2269 return __builtin_altivec_vctzb(__a);
2271 static __inline__ vector unsigned char __ATTRS_o_ai
2272 vec_cnttz(vector unsigned char __a) {
2273 return __builtin_altivec_vctzb(__a);
2275 static __inline__ vector signed short __ATTRS_o_ai
2276 vec_cnttz(vector signed short __a) {
2277 return __builtin_altivec_vctzh(__a);
2279 static __inline__ vector unsigned short __ATTRS_o_ai
2280 vec_cnttz(vector unsigned short __a) {
2281 return __builtin_altivec_vctzh(__a);
2283 static __inline__ vector signed int __ATTRS_o_ai
2284 vec_cnttz(vector signed int __a) {
2285 return __builtin_altivec_vctzw(__a);
2287 static __inline__ vector unsigned int __ATTRS_o_ai
2288 vec_cnttz(vector unsigned int __a) {
2289 return __builtin_altivec_vctzw(__a);
2291 static __inline__ vector signed long long __ATTRS_o_ai
2292 vec_cnttz(vector signed long long __a) {
2293 return __builtin_altivec_vctzd(__a);
2295 static __inline__ vector unsigned long long __ATTRS_o_ai
2296 vec_cnttz(vector unsigned long long __a) {
2297 return __builtin_altivec_vctzd(__a);
2300 /* vec_first_match_index */
2302 static __inline__ unsigned __ATTRS_o_ai
2303 vec_first_match_index(vector signed char __a, vector signed char __b) {
2304 vector unsigned long long __res =
2305 #ifdef __LITTLE_ENDIAN__
2306 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2308 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2310 if (__res[0] == 64) {
2311 return (__res[1] + 64) >> 3;
2313 return __res[0] >> 3;
2316 static __inline__ unsigned __ATTRS_o_ai
2317 vec_first_match_index(vector unsigned char __a, vector unsigned 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 signed short __a, vector signed short __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) >> 4;
2341 return __res[0] >> 4;
2344 static __inline__ unsigned __ATTRS_o_ai
2345 vec_first_match_index(vector unsigned short __a, vector unsigned 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 signed int __a, vector signed int __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) >> 5;
2369 return __res[0] >> 5;
2372 static __inline__ unsigned __ATTRS_o_ai
2373 vec_first_match_index(vector unsigned int __a, vector unsigned 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 /* vec_first_match_or_eos_index */
2388 static __inline__ unsigned __ATTRS_o_ai
2389 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2390 /* Compare the result of the comparison of two vectors with either and OR the
2391 result. Either the elements are equal or one will equal the comparison
2392 result if either is zero.
2394 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2395 vector bool char __tmp2 = __tmp1 |
2396 vec_cmpeq((vector signed char)__tmp1, __a) |
2397 vec_cmpeq((vector signed char)__tmp1, __b);
2399 vector unsigned long long __res =
2400 #ifdef __LITTLE_ENDIAN__
2401 vec_cnttz((vector unsigned long long)__tmp2);
2403 vec_cntlz((vector unsigned long long)__tmp2);
2405 if (__res[0] == 64) {
2406 return (__res[1] + 64) >> 3;
2408 return __res[0] >> 3;
2411 static __inline__ unsigned __ATTRS_o_ai
2412 vec_first_match_or_eos_index(vector unsigned char __a,
2413 vector unsigned char __b) {
2414 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2415 vector bool char __tmp2 = __tmp1 |
2416 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2417 vec_cmpeq((vector unsigned char)__tmp1, __b);
2419 vector unsigned long long __res =
2420 #ifdef __LITTLE_ENDIAN__
2421 vec_cnttz((vector unsigned long long)__tmp2);
2423 vec_cntlz((vector unsigned long long)__tmp2);
2425 if (__res[0] == 64) {
2426 return (__res[1] + 64) >> 3;
2428 return __res[0] >> 3;
2431 static __inline__ unsigned __ATTRS_o_ai
2432 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2433 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2434 vector bool short __tmp2 = __tmp1 |
2435 vec_cmpeq((vector signed short)__tmp1, __a) |
2436 vec_cmpeq((vector signed short)__tmp1, __b);
2438 vector unsigned long long __res =
2439 #ifdef __LITTLE_ENDIAN__
2440 vec_cnttz((vector unsigned long long)__tmp2);
2442 vec_cntlz((vector unsigned long long)__tmp2);
2444 if (__res[0] == 64) {
2445 return (__res[1] + 64) >> 4;
2447 return __res[0] >> 4;
2450 static __inline__ unsigned __ATTRS_o_ai
2451 vec_first_match_or_eos_index(vector unsigned short __a,
2452 vector unsigned short __b) {
2453 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2454 vector bool short __tmp2 = __tmp1 |
2455 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2456 vec_cmpeq((vector unsigned short)__tmp1, __b);
2458 vector unsigned long long __res =
2459 #ifdef __LITTLE_ENDIAN__
2460 vec_cnttz((vector unsigned long long)__tmp2);
2462 vec_cntlz((vector unsigned long long)__tmp2);
2464 if (__res[0] == 64) {
2465 return (__res[1] + 64) >> 4;
2467 return __res[0] >> 4;
2470 static __inline__ unsigned __ATTRS_o_ai
2471 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2472 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2473 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2474 vec_cmpeq((vector signed int)__tmp1, __b);
2476 vector unsigned long long __res =
2477 #ifdef __LITTLE_ENDIAN__
2478 vec_cnttz((vector unsigned long long)__tmp2);
2480 vec_cntlz((vector unsigned long long)__tmp2);
2482 if (__res[0] == 64) {
2483 return (__res[1] + 64) >> 5;
2485 return __res[0] >> 5;
2488 static __inline__ unsigned __ATTRS_o_ai
2489 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2490 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2491 vector bool int __tmp2 = __tmp1 |
2492 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2493 vec_cmpeq((vector unsigned int)__tmp1, __b);
2495 vector unsigned long long __res =
2496 #ifdef __LITTLE_ENDIAN__
2497 vec_cnttz((vector unsigned long long)__tmp2);
2499 vec_cntlz((vector unsigned long long)__tmp2);
2501 if (__res[0] == 64) {
2502 return (__res[1] + 64) >> 5;
2504 return __res[0] >> 5;
2507 /* vec_first_mismatch_index */
2509 static __inline__ unsigned __ATTRS_o_ai
2510 vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2511 vector unsigned long long __res =
2512 #ifdef __LITTLE_ENDIAN__
2513 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2515 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2517 if (__res[0] == 64) {
2518 return (__res[1] + 64) >> 3;
2520 return __res[0] >> 3;
2523 static __inline__ unsigned __ATTRS_o_ai
2524 vec_first_mismatch_index(vector unsigned char __a, vector unsigned 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 signed short __a, vector signed short __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) >> 4;
2548 return __res[0] >> 4;
2551 static __inline__ unsigned __ATTRS_o_ai
2552 vec_first_mismatch_index(vector unsigned short __a, vector unsigned 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 signed int __a, vector signed int __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) >> 5;
2576 return __res[0] >> 5;
2579 static __inline__ unsigned __ATTRS_o_ai
2580 vec_first_mismatch_index(vector unsigned int __a, vector unsigned 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 /* vec_first_mismatch_or_eos_index */
2595 static __inline__ unsigned __ATTRS_o_ai
2596 vec_first_mismatch_or_eos_index(vector signed char __a,
2597 vector signed char __b) {
2598 vector unsigned long long __res =
2599 #ifdef __LITTLE_ENDIAN__
2600 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2602 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2604 if (__res[0] == 64) {
2605 return (__res[1] + 64) >> 3;
2607 return __res[0] >> 3;
2610 static __inline__ unsigned __ATTRS_o_ai
2611 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2612 vector unsigned char __b) {
2613 vector unsigned long long __res =
2614 #ifdef __LITTLE_ENDIAN__
2615 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2617 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2619 if (__res[0] == 64) {
2620 return (__res[1] + 64) >> 3;
2622 return __res[0] >> 3;
2625 static __inline__ unsigned __ATTRS_o_ai
2626 vec_first_mismatch_or_eos_index(vector signed short __a,
2627 vector signed short __b) {
2628 vector unsigned long long __res =
2629 #ifdef __LITTLE_ENDIAN__
2630 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2632 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2634 if (__res[0] == 64) {
2635 return (__res[1] + 64) >> 4;
2637 return __res[0] >> 4;
2640 static __inline__ unsigned __ATTRS_o_ai
2641 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2642 vector unsigned short __b) {
2643 vector unsigned long long __res =
2644 #ifdef __LITTLE_ENDIAN__
2645 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2647 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2649 if (__res[0] == 64) {
2650 return (__res[1] + 64) >> 4;
2652 return __res[0] >> 4;
2655 static __inline__ unsigned __ATTRS_o_ai
2656 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __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) >> 5;
2666 return __res[0] >> 5;
2669 static __inline__ unsigned __ATTRS_o_ai
2670 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2671 vector unsigned int __b) {
2672 vector unsigned long long __res =
2673 #ifdef __LITTLE_ENDIAN__
2674 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2676 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2678 if (__res[0] == 64) {
2679 return (__res[1] + 64) >> 5;
2681 return __res[0] >> 5;
2684 static __inline__ vector double __ATTRS_o_ai
2685 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2686 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2689 static __inline__ vector double __ATTRS_o_ai
2690 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2691 return __builtin_vsx_xviexpdp(__a,__b);
2694 static __inline__ vector float __ATTRS_o_ai
2695 vec_insert_exp(vector float __a, vector unsigned int __b) {
2696 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2699 static __inline__ vector float __ATTRS_o_ai
2700 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2701 return __builtin_vsx_xviexpsp(__a,__b);
2704 #if defined(__powerpc64__)
2705 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(signed char *__a,
2707 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2710 static __inline__ vector unsigned char __ATTRS_o_ai
2711 vec_xl_len(unsigned char *__a, size_t __b) {
2712 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2715 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(signed short *__a,
2717 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2720 static __inline__ vector unsigned short __ATTRS_o_ai
2721 vec_xl_len(unsigned short *__a, size_t __b) {
2722 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2725 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(signed int *__a,
2727 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2730 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(unsigned int *__a,
2732 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2735 static __inline__ vector float __ATTRS_o_ai vec_xl_len(float *__a, size_t __b) {
2736 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2739 static __inline__ vector signed __int128 __ATTRS_o_ai
2740 vec_xl_len(signed __int128 *__a, size_t __b) {
2741 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2744 static __inline__ vector unsigned __int128 __ATTRS_o_ai
2745 vec_xl_len(unsigned __int128 *__a, size_t __b) {
2746 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2749 static __inline__ vector signed long long __ATTRS_o_ai
2750 vec_xl_len(signed long long *__a, size_t __b) {
2751 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2754 static __inline__ vector unsigned long long __ATTRS_o_ai
2755 vec_xl_len(unsigned long long *__a, size_t __b) {
2756 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2759 static __inline__ vector double __ATTRS_o_ai vec_xl_len(double *__a,
2761 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2764 static __inline__ vector double __ATTRS_o_ai vec_xl_len_r(unsigned char *__a,
2766 vector unsigned char __res =
2767 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2768 #ifdef __LITTLE_ENDIAN__
2769 vector unsigned char __mask =
2770 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2771 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2772 (vector int)__res, (vector int)__res, __mask);
2778 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2781 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2784 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2785 signed char *__b, size_t __c) {
2786 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2789 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2790 signed short *__b, size_t __c) {
2791 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2794 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2795 unsigned short *__b,
2797 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2800 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2801 signed int *__b, size_t __c) {
2802 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2805 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2806 unsigned int *__b, size_t __c) {
2807 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2810 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2812 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2815 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2816 signed __int128 *__b,
2818 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2821 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2822 unsigned __int128 *__b,
2824 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2827 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2828 signed long long *__b,
2830 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2833 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2834 unsigned long long *__b,
2836 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2839 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2841 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2844 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2847 #ifdef __LITTLE_ENDIAN__
2848 vector unsigned char __mask =
2849 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2850 vector unsigned char __res =
2851 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2852 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2854 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2863 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2865 return __builtin_vsx_xvcpsgnsp(__a, __b);
2868 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2869 vector double __b) {
2870 return __builtin_vsx_xvcpsgndp(__a, __b);
2877 #define vec_ctf(__a, __b) \
2878 _Generic((__a), vector int \
2879 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2880 vector unsigned int \
2881 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)), \
2882 vector unsigned long long \
2883 : (__builtin_convertvector((vector unsigned long long)(__a), \
2885 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2887 vector signed long long \
2888 : (__builtin_convertvector((vector signed long long)(__a), \
2890 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2893 #define vec_ctf(__a, __b) \
2894 _Generic((__a), vector int \
2895 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2896 vector unsigned int \
2897 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)))
2902 #define vec_vcfux __builtin_altivec_vcfux
2906 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2911 #define vec_cts(__a, __b) \
2912 _Generic((__a), vector float \
2913 : __builtin_altivec_vctsxs((__a), (__b)), vector double \
2915 vector double __ret = \
2917 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2919 __builtin_convertvector(__ret, vector signed long long); \
2922 #define vec_cts __builtin_altivec_vctsxs
2927 #define vec_vctsxs __builtin_altivec_vctsxs
2932 #define vec_ctu(__a, __b) \
2933 _Generic((__a), vector float \
2934 : __builtin_altivec_vctuxs((__a), (__b)), vector double \
2936 vector double __ret = \
2938 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2940 __builtin_convertvector(__ret, vector unsigned long long); \
2943 #define vec_ctu __builtin_altivec_vctuxs
2948 #define vec_vctuxs __builtin_altivec_vctuxs
2952 static __inline__ vector signed int __ATTRS_o_ai
2953 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2955 static __inline__ vector signed int __ATTRS_o_ai
2956 vec_signed(vector float __a) {
2957 return __builtin_convertvector(__a, vector signed int);
2961 static __inline__ vector signed long long __ATTRS_o_ai
2962 vec_signed(vector double __a) {
2963 return __builtin_convertvector(__a, vector signed long long);
2966 static __inline__ vector signed int __attribute__((__always_inline__))
2967 vec_signed2(vector double __a, vector double __b) {
2968 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2971 static __inline__ vector signed int __ATTRS_o_ai
2972 vec_signede(vector double __a) {
2973 #ifdef __LITTLE_ENDIAN__
2974 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2975 return vec_sld(__ret, __ret, 12);
2977 return __builtin_vsx_xvcvdpsxws(__a);
2981 static __inline__ vector signed int __ATTRS_o_ai
2982 vec_signedo(vector double __a) {
2983 #ifdef __LITTLE_ENDIAN__
2984 return __builtin_vsx_xvcvdpsxws(__a);
2986 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2987 return vec_sld(__ret, __ret, 12);
2994 static __inline__ vector unsigned int __ATTRS_o_ai
2995 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
2997 static __inline__ vector unsigned int __ATTRS_o_ai
2998 vec_unsigned(vector float __a) {
2999 return __builtin_convertvector(__a, vector unsigned int);
3003 static __inline__ vector unsigned long long __ATTRS_o_ai
3004 vec_unsigned(vector double __a) {
3005 return __builtin_convertvector(__a, vector unsigned long long);
3008 static __inline__ vector unsigned int __attribute__((__always_inline__))
3009 vec_unsigned2(vector double __a, vector double __b) {
3010 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3013 static __inline__ vector unsigned int __ATTRS_o_ai
3014 vec_unsignede(vector double __a) {
3015 #ifdef __LITTLE_ENDIAN__
3016 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3017 return vec_sld(__ret, __ret, 12);
3019 return __builtin_vsx_xvcvdpuxws(__a);
3023 static __inline__ vector unsigned int __ATTRS_o_ai
3024 vec_unsignedo(vector double __a) {
3025 #ifdef __LITTLE_ENDIAN__
3026 return __builtin_vsx_xvcvdpuxws(__a);
3028 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3029 return vec_sld(__ret, __ret, 12);
3036 static __inline__ vector float __ATTRS_o_ai
3037 vec_sld(vector float, vector float, unsigned const int __c);
3039 static __inline__ vector float __ATTRS_o_ai
3040 vec_float(vector signed int __a) {
3041 return __builtin_convertvector(__a, vector float);
3044 static __inline__ vector float __ATTRS_o_ai
3045 vec_float(vector unsigned int __a) {
3046 return __builtin_convertvector(__a, vector float);
3050 static __inline__ vector float __ATTRS_o_ai
3051 vec_float2(vector signed long long __a, vector signed long long __b) {
3052 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3055 static __inline__ vector float __ATTRS_o_ai
3056 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3057 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3060 static __inline__ vector float __ATTRS_o_ai
3061 vec_float2(vector double __a, vector double __b) {
3062 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3065 static __inline__ vector float __ATTRS_o_ai
3066 vec_floate(vector signed long long __a) {
3067 #ifdef __LITTLE_ENDIAN__
3068 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3069 return vec_sld(__ret, __ret, 12);
3071 return __builtin_vsx_xvcvsxdsp(__a);
3075 static __inline__ vector float __ATTRS_o_ai
3076 vec_floate(vector unsigned long long __a) {
3077 #ifdef __LITTLE_ENDIAN__
3078 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3079 return vec_sld(__ret, __ret, 12);
3081 return __builtin_vsx_xvcvuxdsp(__a);
3085 static __inline__ vector float __ATTRS_o_ai
3086 vec_floate(vector double __a) {
3087 #ifdef __LITTLE_ENDIAN__
3088 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3089 return vec_sld(__ret, __ret, 12);
3091 return __builtin_vsx_xvcvdpsp(__a);
3095 static __inline__ vector float __ATTRS_o_ai
3096 vec_floato(vector signed long long __a) {
3097 #ifdef __LITTLE_ENDIAN__
3098 return __builtin_vsx_xvcvsxdsp(__a);
3100 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3101 return vec_sld(__ret, __ret, 12);
3105 static __inline__ vector float __ATTRS_o_ai
3106 vec_floato(vector unsigned long long __a) {
3107 #ifdef __LITTLE_ENDIAN__
3108 return __builtin_vsx_xvcvuxdsp(__a);
3110 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3111 return vec_sld(__ret, __ret, 12);
3115 static __inline__ vector float __ATTRS_o_ai
3116 vec_floato(vector double __a) {
3117 #ifdef __LITTLE_ENDIAN__
3118 return __builtin_vsx_xvcvdpsp(__a);
3120 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3121 return vec_sld(__ret, __ret, 12);
3129 static __inline__ vector double __ATTRS_o_ai
3130 vec_double(vector signed long long __a) {
3131 return __builtin_convertvector(__a, vector double);
3134 static __inline__ vector double __ATTRS_o_ai
3135 vec_double(vector unsigned long long __a) {
3136 return __builtin_convertvector(__a, vector double);
3139 static __inline__ vector double __ATTRS_o_ai
3140 vec_doublee(vector signed int __a) {
3141 #ifdef __LITTLE_ENDIAN__
3142 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3144 return __builtin_vsx_xvcvsxwdp(__a);
3148 static __inline__ vector double __ATTRS_o_ai
3149 vec_doublee(vector unsigned int __a) {
3150 #ifdef __LITTLE_ENDIAN__
3151 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3153 return __builtin_vsx_xvcvuxwdp(__a);
3157 static __inline__ vector double __ATTRS_o_ai
3158 vec_doublee(vector float __a) {
3159 #ifdef __LITTLE_ENDIAN__
3160 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3162 return __builtin_vsx_xvcvspdp(__a);
3166 static __inline__ vector double __ATTRS_o_ai
3167 vec_doubleh(vector signed int __a) {
3168 vector double __ret = {__a[0], __a[1]};
3172 static __inline__ vector double __ATTRS_o_ai
3173 vec_doubleh(vector unsigned int __a) {
3174 vector double __ret = {__a[0], __a[1]};
3178 static __inline__ vector double __ATTRS_o_ai
3179 vec_doubleh(vector float __a) {
3180 vector double __ret = {__a[0], __a[1]};
3184 static __inline__ vector double __ATTRS_o_ai
3185 vec_doublel(vector signed int __a) {
3186 vector double __ret = {__a[2], __a[3]};
3190 static __inline__ vector double __ATTRS_o_ai
3191 vec_doublel(vector unsigned int __a) {
3192 vector double __ret = {__a[2], __a[3]};
3196 static __inline__ vector double __ATTRS_o_ai
3197 vec_doublel(vector float __a) {
3198 vector double __ret = {__a[2], __a[3]};
3202 static __inline__ vector double __ATTRS_o_ai
3203 vec_doubleo(vector signed int __a) {
3204 #ifdef __LITTLE_ENDIAN__
3205 return __builtin_vsx_xvcvsxwdp(__a);
3207 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3211 static __inline__ vector double __ATTRS_o_ai
3212 vec_doubleo(vector unsigned int __a) {
3213 #ifdef __LITTLE_ENDIAN__
3214 return __builtin_vsx_xvcvuxwdp(__a);
3216 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3220 static __inline__ vector double __ATTRS_o_ai
3221 vec_doubleo(vector float __a) {
3222 #ifdef __LITTLE_ENDIAN__
3223 return __builtin_vsx_xvcvspdp(__a);
3225 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3232 /* Integer vector divides (vectors are scalarized, elements divided
3233 and the vectors reassembled).
3235 static __inline__ vector signed char __ATTRS_o_ai
3236 vec_div(vector signed char __a, vector signed char __b) {
3240 static __inline__ vector unsigned char __ATTRS_o_ai
3241 vec_div(vector unsigned char __a, vector unsigned char __b) {
3245 static __inline__ vector signed short __ATTRS_o_ai
3246 vec_div(vector signed short __a, vector signed short __b) {
3250 static __inline__ vector unsigned short __ATTRS_o_ai
3251 vec_div(vector unsigned short __a, vector unsigned short __b) {
3255 static __inline__ vector signed int __ATTRS_o_ai
3256 vec_div(vector signed int __a, vector signed int __b) {
3260 static __inline__ vector unsigned int __ATTRS_o_ai
3261 vec_div(vector unsigned int __a, vector unsigned int __b) {
3266 static __inline__ vector signed long long __ATTRS_o_ai
3267 vec_div(vector signed long long __a, vector signed long long __b) {
3271 static __inline__ vector unsigned long long __ATTRS_o_ai
3272 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3276 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3281 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3282 vector double __b) {
3289 static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
3290 __builtin_altivec_dss(__a);
3295 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3296 __builtin_altivec_dssall();
3300 #define vec_dst(__PTR, __CW, __STR) \
3302 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3305 #define vec_dstst(__PTR, __CW, __STR) \
3307 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3310 #define vec_dststt(__PTR, __CW, __STR) \
3312 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3315 #define vec_dstt(__PTR, __CW, __STR) \
3317 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3321 #ifdef __POWER8_VECTOR__
3322 static __inline__ vector signed char __ATTRS_o_ai
3323 vec_eqv(vector signed char __a, vector signed char __b) {
3324 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3325 (vector unsigned int)__b);
3328 static __inline__ vector unsigned char __ATTRS_o_ai
3329 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3330 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3331 (vector unsigned int)__b);
3334 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3335 vector bool char __b) {
3336 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3337 (vector unsigned int)__b);
3340 static __inline__ vector signed short __ATTRS_o_ai
3341 vec_eqv(vector signed short __a, vector signed short __b) {
3342 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3343 (vector unsigned int)__b);
3346 static __inline__ vector unsigned short __ATTRS_o_ai
3347 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3348 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3349 (vector unsigned int)__b);
3352 static __inline__ vector bool short __ATTRS_o_ai
3353 vec_eqv(vector bool short __a, vector bool short __b) {
3354 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3355 (vector unsigned int)__b);
3358 static __inline__ vector signed int __ATTRS_o_ai
3359 vec_eqv(vector signed int __a, vector signed int __b) {
3360 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3361 (vector unsigned int)__b);
3364 static __inline__ vector unsigned int __ATTRS_o_ai
3365 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3366 return __builtin_vsx_xxleqv(__a, __b);
3369 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3370 vector bool int __b) {
3371 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3372 (vector unsigned int)__b);
3375 static __inline__ vector signed long long __ATTRS_o_ai
3376 vec_eqv(vector signed long long __a, vector signed long long __b) {
3377 return (vector signed long long)__builtin_vsx_xxleqv(
3378 (vector unsigned int)__a, (vector unsigned int)__b);
3381 static __inline__ vector unsigned long long __ATTRS_o_ai
3382 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3383 return (vector unsigned long long)__builtin_vsx_xxleqv(
3384 (vector unsigned int)__a, (vector unsigned int)__b);
3387 static __inline__ vector bool long long __ATTRS_o_ai
3388 vec_eqv(vector bool long long __a, vector bool long long __b) {
3389 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3390 (vector unsigned int)__b);
3393 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3395 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3396 (vector unsigned int)__b);
3399 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3400 vector double __b) {
3401 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3402 (vector unsigned int)__b);
3408 static __inline__ vector float __attribute__((__always_inline__))
3409 vec_expte(vector float __a) {
3410 return __builtin_altivec_vexptefp(__a);
3415 static __inline__ vector float __attribute__((__always_inline__))
3416 vec_vexptefp(vector float __a) {
3417 return __builtin_altivec_vexptefp(__a);
3422 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3424 return __builtin_vsx_xvrspim(__a);
3426 return __builtin_altivec_vrfim(__a);
3431 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3432 return __builtin_vsx_xvrdpim(__a);
3438 static __inline__ vector float __attribute__((__always_inline__))
3439 vec_vrfim(vector float __a) {
3440 return __builtin_altivec_vrfim(__a);
3445 static __inline__ vector signed char __ATTRS_o_ai
3446 vec_ld(int __a, const vector signed char *__b) {
3447 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3450 static __inline__ vector signed char __ATTRS_o_ai
3451 vec_ld(int __a, const signed char *__b) {
3452 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3455 static __inline__ vector unsigned char __ATTRS_o_ai
3456 vec_ld(int __a, const vector unsigned char *__b) {
3457 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3460 static __inline__ vector unsigned char __ATTRS_o_ai
3461 vec_ld(int __a, const unsigned char *__b) {
3462 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3465 static __inline__ vector bool char __ATTRS_o_ai
3466 vec_ld(int __a, const vector bool char *__b) {
3467 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3470 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3471 const vector short *__b) {
3472 return (vector short)__builtin_altivec_lvx(__a, __b);
3475 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3476 return (vector short)__builtin_altivec_lvx(__a, __b);
3479 static __inline__ vector unsigned short __ATTRS_o_ai
3480 vec_ld(int __a, const vector unsigned short *__b) {
3481 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3484 static __inline__ vector unsigned short __ATTRS_o_ai
3485 vec_ld(int __a, const unsigned short *__b) {
3486 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3489 static __inline__ vector bool short __ATTRS_o_ai
3490 vec_ld(int __a, const vector bool short *__b) {
3491 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3494 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3495 const vector pixel *__b) {
3496 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3499 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3500 const vector int *__b) {
3501 return (vector int)__builtin_altivec_lvx(__a, __b);
3504 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3505 return (vector int)__builtin_altivec_lvx(__a, __b);
3508 static __inline__ vector unsigned int __ATTRS_o_ai
3509 vec_ld(int __a, const vector unsigned int *__b) {
3510 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3513 static __inline__ vector unsigned int __ATTRS_o_ai
3514 vec_ld(int __a, const unsigned int *__b) {
3515 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3518 static __inline__ vector bool int __ATTRS_o_ai
3519 vec_ld(int __a, const vector bool int *__b) {
3520 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3523 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3524 const vector float *__b) {
3525 return (vector float)__builtin_altivec_lvx(__a, __b);
3528 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3529 return (vector float)__builtin_altivec_lvx(__a, __b);
3534 static __inline__ vector signed char __ATTRS_o_ai
3535 vec_lvx(int __a, const vector signed char *__b) {
3536 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3539 static __inline__ vector signed char __ATTRS_o_ai
3540 vec_lvx(int __a, const signed char *__b) {
3541 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3544 static __inline__ vector unsigned char __ATTRS_o_ai
3545 vec_lvx(int __a, const vector unsigned char *__b) {
3546 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3549 static __inline__ vector unsigned char __ATTRS_o_ai
3550 vec_lvx(int __a, const unsigned char *__b) {
3551 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3554 static __inline__ vector bool char __ATTRS_o_ai
3555 vec_lvx(int __a, const vector bool char *__b) {
3556 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3559 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3560 const vector short *__b) {
3561 return (vector short)__builtin_altivec_lvx(__a, __b);
3564 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3565 return (vector short)__builtin_altivec_lvx(__a, __b);
3568 static __inline__ vector unsigned short __ATTRS_o_ai
3569 vec_lvx(int __a, const vector unsigned short *__b) {
3570 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3573 static __inline__ vector unsigned short __ATTRS_o_ai
3574 vec_lvx(int __a, const unsigned short *__b) {
3575 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3578 static __inline__ vector bool short __ATTRS_o_ai
3579 vec_lvx(int __a, const vector bool short *__b) {
3580 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3583 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3584 const vector pixel *__b) {
3585 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3588 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3589 const vector int *__b) {
3590 return (vector int)__builtin_altivec_lvx(__a, __b);
3593 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3594 return (vector int)__builtin_altivec_lvx(__a, __b);
3597 static __inline__ vector unsigned int __ATTRS_o_ai
3598 vec_lvx(int __a, const vector unsigned int *__b) {
3599 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3602 static __inline__ vector unsigned int __ATTRS_o_ai
3603 vec_lvx(int __a, const unsigned int *__b) {
3604 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3607 static __inline__ vector bool int __ATTRS_o_ai
3608 vec_lvx(int __a, const vector bool int *__b) {
3609 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3612 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3613 const vector float *__b) {
3614 return (vector float)__builtin_altivec_lvx(__a, __b);
3617 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3618 return (vector float)__builtin_altivec_lvx(__a, __b);
3623 static __inline__ vector signed char __ATTRS_o_ai
3624 vec_lde(int __a, const signed char *__b) {
3625 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3628 static __inline__ vector unsigned char __ATTRS_o_ai
3629 vec_lde(int __a, const unsigned char *__b) {
3630 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3633 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3634 return (vector short)__builtin_altivec_lvehx(__a, __b);
3637 static __inline__ vector unsigned short __ATTRS_o_ai
3638 vec_lde(int __a, const unsigned short *__b) {
3639 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3642 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3643 return (vector int)__builtin_altivec_lvewx(__a, __b);
3646 static __inline__ vector unsigned int __ATTRS_o_ai
3647 vec_lde(int __a, const unsigned int *__b) {
3648 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3651 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3652 return (vector float)__builtin_altivec_lvewx(__a, __b);
3657 static __inline__ vector signed char __ATTRS_o_ai
3658 vec_lvebx(int __a, const signed char *__b) {
3659 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3662 static __inline__ vector unsigned char __ATTRS_o_ai
3663 vec_lvebx(int __a, const unsigned char *__b) {
3664 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3669 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3671 return (vector short)__builtin_altivec_lvehx(__a, __b);
3674 static __inline__ vector unsigned short __ATTRS_o_ai
3675 vec_lvehx(int __a, const unsigned short *__b) {
3676 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3681 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3682 return (vector int)__builtin_altivec_lvewx(__a, __b);
3685 static __inline__ vector unsigned int __ATTRS_o_ai
3686 vec_lvewx(int __a, const unsigned int *__b) {
3687 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3690 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3692 return (vector float)__builtin_altivec_lvewx(__a, __b);
3697 static __inline__ vector signed char __ATTRS_o_ai
3698 vec_ldl(int __a, const vector signed char *__b) {
3699 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3702 static __inline__ vector signed char __ATTRS_o_ai
3703 vec_ldl(int __a, const signed char *__b) {
3704 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3707 static __inline__ vector unsigned char __ATTRS_o_ai
3708 vec_ldl(int __a, const vector unsigned char *__b) {
3709 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3712 static __inline__ vector unsigned char __ATTRS_o_ai
3713 vec_ldl(int __a, const unsigned char *__b) {
3714 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3717 static __inline__ vector bool char __ATTRS_o_ai
3718 vec_ldl(int __a, const vector bool char *__b) {
3719 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3722 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3723 const vector short *__b) {
3724 return (vector short)__builtin_altivec_lvxl(__a, __b);
3727 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3728 return (vector short)__builtin_altivec_lvxl(__a, __b);
3731 static __inline__ vector unsigned short __ATTRS_o_ai
3732 vec_ldl(int __a, const vector unsigned short *__b) {
3733 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3736 static __inline__ vector unsigned short __ATTRS_o_ai
3737 vec_ldl(int __a, const unsigned short *__b) {
3738 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3741 static __inline__ vector bool short __ATTRS_o_ai
3742 vec_ldl(int __a, const vector bool short *__b) {
3743 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3746 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3747 const vector pixel *__b) {
3748 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3751 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3752 const vector int *__b) {
3753 return (vector int)__builtin_altivec_lvxl(__a, __b);
3756 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3757 return (vector int)__builtin_altivec_lvxl(__a, __b);
3760 static __inline__ vector unsigned int __ATTRS_o_ai
3761 vec_ldl(int __a, const vector unsigned int *__b) {
3762 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3765 static __inline__ vector unsigned int __ATTRS_o_ai
3766 vec_ldl(int __a, const unsigned int *__b) {
3767 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3770 static __inline__ vector bool int __ATTRS_o_ai
3771 vec_ldl(int __a, const vector bool int *__b) {
3772 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3775 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3776 const vector float *__b) {
3777 return (vector float)__builtin_altivec_lvxl(__a, __b);
3780 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3781 return (vector float)__builtin_altivec_lvxl(__a, __b);
3786 static __inline__ vector signed char __ATTRS_o_ai
3787 vec_lvxl(int __a, const vector signed char *__b) {
3788 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3791 static __inline__ vector signed char __ATTRS_o_ai
3792 vec_lvxl(int __a, const signed char *__b) {
3793 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3796 static __inline__ vector unsigned char __ATTRS_o_ai
3797 vec_lvxl(int __a, const vector unsigned char *__b) {
3798 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3801 static __inline__ vector unsigned char __ATTRS_o_ai
3802 vec_lvxl(int __a, const unsigned char *__b) {
3803 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3806 static __inline__ vector bool char __ATTRS_o_ai
3807 vec_lvxl(int __a, const vector bool char *__b) {
3808 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3811 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3812 const vector short *__b) {
3813 return (vector short)__builtin_altivec_lvxl(__a, __b);
3816 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3818 return (vector short)__builtin_altivec_lvxl(__a, __b);
3821 static __inline__ vector unsigned short __ATTRS_o_ai
3822 vec_lvxl(int __a, const vector unsigned short *__b) {
3823 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3826 static __inline__ vector unsigned short __ATTRS_o_ai
3827 vec_lvxl(int __a, const unsigned short *__b) {
3828 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3831 static __inline__ vector bool short __ATTRS_o_ai
3832 vec_lvxl(int __a, const vector bool short *__b) {
3833 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3836 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3837 const vector pixel *__b) {
3838 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3841 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3842 const vector int *__b) {
3843 return (vector int)__builtin_altivec_lvxl(__a, __b);
3846 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3847 return (vector int)__builtin_altivec_lvxl(__a, __b);
3850 static __inline__ vector unsigned int __ATTRS_o_ai
3851 vec_lvxl(int __a, const vector unsigned int *__b) {
3852 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3855 static __inline__ vector unsigned int __ATTRS_o_ai
3856 vec_lvxl(int __a, const unsigned int *__b) {
3857 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3860 static __inline__ vector bool int __ATTRS_o_ai
3861 vec_lvxl(int __a, const vector bool int *__b) {
3862 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3865 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3866 const vector float *__b) {
3867 return (vector float)__builtin_altivec_lvxl(__a, __b);
3870 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3872 return (vector float)__builtin_altivec_lvxl(__a, __b);
3877 static __inline__ vector float __attribute__((__always_inline__))
3878 vec_loge(vector float __a) {
3879 return __builtin_altivec_vlogefp(__a);
3884 static __inline__ vector float __attribute__((__always_inline__))
3885 vec_vlogefp(vector float __a) {
3886 return __builtin_altivec_vlogefp(__a);
3891 #ifdef __LITTLE_ENDIAN__
3892 static __inline__ vector unsigned char __ATTRS_o_ai
3893 __attribute__((__deprecated__("use assignment for unaligned little endian \
3894 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3895 vector unsigned char mask =
3896 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3897 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3898 7, 6, 5, 4, 3, 2, 1, 0};
3899 return vec_perm(mask, mask, reverse);
3902 static __inline__ vector unsigned char __ATTRS_o_ai
3903 vec_lvsl(int __a, const signed char *__b) {
3904 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3908 #ifdef __LITTLE_ENDIAN__
3909 static __inline__ vector unsigned char __ATTRS_o_ai
3910 __attribute__((__deprecated__("use assignment for unaligned little endian \
3911 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3912 vector unsigned char mask =
3913 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3914 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3915 7, 6, 5, 4, 3, 2, 1, 0};
3916 return vec_perm(mask, mask, reverse);
3919 static __inline__ vector unsigned char __ATTRS_o_ai
3920 vec_lvsl(int __a, const unsigned char *__b) {
3921 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3925 #ifdef __LITTLE_ENDIAN__
3926 static __inline__ vector unsigned char __ATTRS_o_ai
3927 __attribute__((__deprecated__("use assignment for unaligned little endian \
3928 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3929 vector unsigned char mask =
3930 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3931 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3932 7, 6, 5, 4, 3, 2, 1, 0};
3933 return vec_perm(mask, mask, reverse);
3936 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3938 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3942 #ifdef __LITTLE_ENDIAN__
3943 static __inline__ vector unsigned char __ATTRS_o_ai
3944 __attribute__((__deprecated__("use assignment for unaligned little endian \
3945 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3946 vector unsigned char mask =
3947 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3948 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3949 7, 6, 5, 4, 3, 2, 1, 0};
3950 return vec_perm(mask, mask, reverse);
3953 static __inline__ vector unsigned char __ATTRS_o_ai
3954 vec_lvsl(int __a, const unsigned short *__b) {
3955 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3959 #ifdef __LITTLE_ENDIAN__
3960 static __inline__ vector unsigned char __ATTRS_o_ai
3961 __attribute__((__deprecated__("use assignment for unaligned little endian \
3962 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3963 vector unsigned char mask =
3964 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3965 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3966 7, 6, 5, 4, 3, 2, 1, 0};
3967 return vec_perm(mask, mask, reverse);
3970 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3972 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3976 #ifdef __LITTLE_ENDIAN__
3977 static __inline__ vector unsigned char __ATTRS_o_ai
3978 __attribute__((__deprecated__("use assignment for unaligned little endian \
3979 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
3980 vector unsigned char mask =
3981 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3982 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3983 7, 6, 5, 4, 3, 2, 1, 0};
3984 return vec_perm(mask, mask, reverse);
3987 static __inline__ vector unsigned char __ATTRS_o_ai
3988 vec_lvsl(int __a, const unsigned int *__b) {
3989 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3993 #ifdef __LITTLE_ENDIAN__
3994 static __inline__ vector unsigned char __ATTRS_o_ai
3995 __attribute__((__deprecated__("use assignment for unaligned little endian \
3996 loads/stores"))) vec_lvsl(int __a, const float *__b) {
3997 vector unsigned char mask =
3998 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3999 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4000 7, 6, 5, 4, 3, 2, 1, 0};
4001 return vec_perm(mask, mask, reverse);
4004 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4006 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4012 #ifdef __LITTLE_ENDIAN__
4013 static __inline__ vector unsigned char __ATTRS_o_ai
4014 __attribute__((__deprecated__("use assignment for unaligned little endian \
4015 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4016 vector unsigned char mask =
4017 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4018 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4019 7, 6, 5, 4, 3, 2, 1, 0};
4020 return vec_perm(mask, mask, reverse);
4023 static __inline__ vector unsigned char __ATTRS_o_ai
4024 vec_lvsr(int __a, const signed char *__b) {
4025 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4029 #ifdef __LITTLE_ENDIAN__
4030 static __inline__ vector unsigned char __ATTRS_o_ai
4031 __attribute__((__deprecated__("use assignment for unaligned little endian \
4032 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4033 vector unsigned char mask =
4034 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4035 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4036 7, 6, 5, 4, 3, 2, 1, 0};
4037 return vec_perm(mask, mask, reverse);
4040 static __inline__ vector unsigned char __ATTRS_o_ai
4041 vec_lvsr(int __a, const unsigned char *__b) {
4042 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4046 #ifdef __LITTLE_ENDIAN__
4047 static __inline__ vector unsigned char __ATTRS_o_ai
4048 __attribute__((__deprecated__("use assignment for unaligned little endian \
4049 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4050 vector unsigned char mask =
4051 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4052 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4053 7, 6, 5, 4, 3, 2, 1, 0};
4054 return vec_perm(mask, mask, reverse);
4057 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4059 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4063 #ifdef __LITTLE_ENDIAN__
4064 static __inline__ vector unsigned char __ATTRS_o_ai
4065 __attribute__((__deprecated__("use assignment for unaligned little endian \
4066 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4067 vector unsigned char mask =
4068 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4069 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4070 7, 6, 5, 4, 3, 2, 1, 0};
4071 return vec_perm(mask, mask, reverse);
4074 static __inline__ vector unsigned char __ATTRS_o_ai
4075 vec_lvsr(int __a, const unsigned short *__b) {
4076 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4080 #ifdef __LITTLE_ENDIAN__
4081 static __inline__ vector unsigned char __ATTRS_o_ai
4082 __attribute__((__deprecated__("use assignment for unaligned little endian \
4083 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4084 vector unsigned char mask =
4085 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4086 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4087 7, 6, 5, 4, 3, 2, 1, 0};
4088 return vec_perm(mask, mask, reverse);
4091 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4093 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4097 #ifdef __LITTLE_ENDIAN__
4098 static __inline__ vector unsigned char __ATTRS_o_ai
4099 __attribute__((__deprecated__("use assignment for unaligned little endian \
4100 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4101 vector unsigned char mask =
4102 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4103 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4104 7, 6, 5, 4, 3, 2, 1, 0};
4105 return vec_perm(mask, mask, reverse);
4108 static __inline__ vector unsigned char __ATTRS_o_ai
4109 vec_lvsr(int __a, const unsigned int *__b) {
4110 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4114 #ifdef __LITTLE_ENDIAN__
4115 static __inline__ vector unsigned char __ATTRS_o_ai
4116 __attribute__((__deprecated__("use assignment for unaligned little endian \
4117 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4118 vector unsigned char mask =
4119 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4120 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4121 7, 6, 5, 4, 3, 2, 1, 0};
4122 return vec_perm(mask, mask, reverse);
4125 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4127 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4132 static __inline__ vector signed short __ATTRS_o_ai
4133 vec_mladd(vector signed short, vector signed short, vector signed short);
4134 static __inline__ vector signed short __ATTRS_o_ai
4135 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4136 static __inline__ vector signed short __ATTRS_o_ai
4137 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4138 static __inline__ vector unsigned short __ATTRS_o_ai
4139 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4141 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4142 vector signed short __a, vector signed short __b, vector signed short __c) {
4143 return vec_mladd(__a, __b, __c);
4146 static __inline__ vector signed short __ATTRS_o_ai
4147 vec_madd(vector signed short __a, vector unsigned short __b,
4148 vector unsigned short __c) {
4149 return vec_mladd(__a, __b, __c);
4152 static __inline__ vector signed short __ATTRS_o_ai
4153 vec_madd(vector unsigned short __a, vector signed short __b,
4154 vector signed short __c) {
4155 return vec_mladd(__a, __b, __c);
4158 static __inline__ vector unsigned short __ATTRS_o_ai
4159 vec_madd(vector unsigned short __a, vector unsigned short __b,
4160 vector unsigned short __c) {
4161 return vec_mladd(__a, __b, __c);
4164 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4168 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4170 return __builtin_altivec_vmaddfp(__a, __b, __c);
4175 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4177 vector double __c) {
4178 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4184 static __inline__ vector float __attribute__((__always_inline__))
4185 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4186 return __builtin_altivec_vmaddfp(__a, __b, __c);
4191 static __inline__ vector signed short __attribute__((__always_inline__))
4192 vec_madds(vector signed short __a, vector signed short __b,
4193 vector signed short __c) {
4194 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4198 static __inline__ vector signed short __attribute__((__always_inline__))
4199 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4200 vector signed short __c) {
4201 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4207 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4210 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4213 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4215 vector double __c) {
4216 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4222 static __inline__ vector signed char __ATTRS_o_ai
4223 vec_max(vector signed char __a, vector signed char __b) {
4224 return __builtin_altivec_vmaxsb(__a, __b);
4227 static __inline__ vector signed char __ATTRS_o_ai
4228 vec_max(vector bool char __a, vector signed char __b) {
4229 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4232 static __inline__ vector signed char __ATTRS_o_ai
4233 vec_max(vector signed char __a, vector bool char __b) {
4234 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4237 static __inline__ vector unsigned char __ATTRS_o_ai
4238 vec_max(vector unsigned char __a, vector unsigned char __b) {
4239 return __builtin_altivec_vmaxub(__a, __b);
4242 static __inline__ vector unsigned char __ATTRS_o_ai
4243 vec_max(vector bool char __a, vector unsigned char __b) {
4244 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4247 static __inline__ vector unsigned char __ATTRS_o_ai
4248 vec_max(vector unsigned char __a, vector bool char __b) {
4249 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4252 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4254 return __builtin_altivec_vmaxsh(__a, __b);
4257 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4259 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4262 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4263 vector bool short __b) {
4264 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4267 static __inline__ vector unsigned short __ATTRS_o_ai
4268 vec_max(vector unsigned short __a, vector unsigned short __b) {
4269 return __builtin_altivec_vmaxuh(__a, __b);
4272 static __inline__ vector unsigned short __ATTRS_o_ai
4273 vec_max(vector bool short __a, vector unsigned short __b) {
4274 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4277 static __inline__ vector unsigned short __ATTRS_o_ai
4278 vec_max(vector unsigned short __a, vector bool short __b) {
4279 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4282 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4284 return __builtin_altivec_vmaxsw(__a, __b);
4287 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4289 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4292 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4293 vector bool int __b) {
4294 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4297 static __inline__ vector unsigned int __ATTRS_o_ai
4298 vec_max(vector unsigned int __a, vector unsigned int __b) {
4299 return __builtin_altivec_vmaxuw(__a, __b);
4302 static __inline__ vector unsigned int __ATTRS_o_ai
4303 vec_max(vector bool int __a, vector unsigned int __b) {
4304 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4307 static __inline__ vector unsigned int __ATTRS_o_ai
4308 vec_max(vector unsigned int __a, vector bool int __b) {
4309 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4312 #ifdef __POWER8_VECTOR__
4313 static __inline__ vector signed long long __ATTRS_o_ai
4314 vec_max(vector signed long long __a, vector signed long long __b) {
4315 return __builtin_altivec_vmaxsd(__a, __b);
4318 static __inline__ vector signed long long __ATTRS_o_ai
4319 vec_max(vector bool long long __a, vector signed long long __b) {
4320 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4323 static __inline__ vector signed long long __ATTRS_o_ai
4324 vec_max(vector signed long long __a, vector bool long long __b) {
4325 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4328 static __inline__ vector unsigned long long __ATTRS_o_ai
4329 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4330 return __builtin_altivec_vmaxud(__a, __b);
4333 static __inline__ vector unsigned long long __ATTRS_o_ai
4334 vec_max(vector bool long long __a, vector unsigned long long __b) {
4335 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4338 static __inline__ vector unsigned long long __ATTRS_o_ai
4339 vec_max(vector unsigned long long __a, vector bool long long __b) {
4340 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4344 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4347 return __builtin_vsx_xvmaxsp(__a, __b);
4349 return __builtin_altivec_vmaxfp(__a, __b);
4354 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4355 vector double __b) {
4356 return __builtin_vsx_xvmaxdp(__a, __b);
4362 static __inline__ vector signed char __ATTRS_o_ai
4363 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4364 return __builtin_altivec_vmaxsb(__a, __b);
4367 static __inline__ vector signed char __ATTRS_o_ai
4368 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4369 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4372 static __inline__ vector signed char __ATTRS_o_ai
4373 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4374 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4379 static __inline__ vector unsigned char __ATTRS_o_ai
4380 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4381 return __builtin_altivec_vmaxub(__a, __b);
4384 static __inline__ vector unsigned char __ATTRS_o_ai
4385 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4386 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4389 static __inline__ vector unsigned char __ATTRS_o_ai
4390 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4391 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4396 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4398 return __builtin_altivec_vmaxsh(__a, __b);
4401 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4403 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4406 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4407 vector bool short __b) {
4408 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4413 static __inline__ vector unsigned short __ATTRS_o_ai
4414 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4415 return __builtin_altivec_vmaxuh(__a, __b);
4418 static __inline__ vector unsigned short __ATTRS_o_ai
4419 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4420 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4423 static __inline__ vector unsigned short __ATTRS_o_ai
4424 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4425 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4430 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4432 return __builtin_altivec_vmaxsw(__a, __b);
4435 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4437 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4440 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4441 vector bool int __b) {
4442 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4447 static __inline__ vector unsigned int __ATTRS_o_ai
4448 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4449 return __builtin_altivec_vmaxuw(__a, __b);
4452 static __inline__ vector unsigned int __ATTRS_o_ai
4453 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4454 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4457 static __inline__ vector unsigned int __ATTRS_o_ai
4458 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4459 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4464 static __inline__ vector float __attribute__((__always_inline__))
4465 vec_vmaxfp(vector float __a, vector float __b) {
4467 return __builtin_vsx_xvmaxsp(__a, __b);
4469 return __builtin_altivec_vmaxfp(__a, __b);
4475 static __inline__ vector signed char __ATTRS_o_ai
4476 vec_mergeh(vector signed char __a, vector signed char __b) {
4477 return vec_perm(__a, __b,
4478 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4479 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4480 0x06, 0x16, 0x07, 0x17));
4483 static __inline__ vector unsigned char __ATTRS_o_ai
4484 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4485 return vec_perm(__a, __b,
4486 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4487 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4488 0x06, 0x16, 0x07, 0x17));
4491 static __inline__ vector bool char __ATTRS_o_ai
4492 vec_mergeh(vector bool char __a, vector bool char __b) {
4493 return vec_perm(__a, __b,
4494 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4495 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4496 0x06, 0x16, 0x07, 0x17));
4499 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4501 return vec_perm(__a, __b,
4502 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4503 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4504 0x06, 0x07, 0x16, 0x17));
4507 static __inline__ vector unsigned short __ATTRS_o_ai
4508 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4509 return vec_perm(__a, __b,
4510 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4511 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4512 0x06, 0x07, 0x16, 0x17));
4515 static __inline__ vector bool short __ATTRS_o_ai
4516 vec_mergeh(vector bool short __a, vector bool short __b) {
4517 return vec_perm(__a, __b,
4518 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4519 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4520 0x06, 0x07, 0x16, 0x17));
4523 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4525 return vec_perm(__a, __b,
4526 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4527 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4528 0x06, 0x07, 0x16, 0x17));
4531 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4533 return vec_perm(__a, __b,
4534 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4535 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4536 0x14, 0x15, 0x16, 0x17));
4539 static __inline__ vector unsigned int __ATTRS_o_ai
4540 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4541 return vec_perm(__a, __b,
4542 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4543 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4544 0x14, 0x15, 0x16, 0x17));
4547 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4548 vector bool int __b) {
4549 return vec_perm(__a, __b,
4550 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4551 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4552 0x14, 0x15, 0x16, 0x17));
4555 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4557 return vec_perm(__a, __b,
4558 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4559 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4560 0x14, 0x15, 0x16, 0x17));
4564 static __inline__ vector signed long long __ATTRS_o_ai
4565 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4566 return vec_perm(__a, __b,
4567 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4568 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4569 0x14, 0x15, 0x16, 0x17));
4572 static __inline__ vector signed long long __ATTRS_o_ai
4573 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4574 return vec_perm(__a, (vector signed long long)__b,
4575 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4576 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4577 0x14, 0x15, 0x16, 0x17));
4580 static __inline__ vector signed long long __ATTRS_o_ai
4581 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4582 return vec_perm((vector signed long long)__a, __b,
4583 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4584 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4585 0x14, 0x15, 0x16, 0x17));
4588 static __inline__ vector unsigned long long __ATTRS_o_ai
4589 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4590 return vec_perm(__a, __b,
4591 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4592 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4593 0x14, 0x15, 0x16, 0x17));
4596 static __inline__ vector unsigned long long __ATTRS_o_ai
4597 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4598 return vec_perm(__a, (vector unsigned long long)__b,
4599 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4600 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4601 0x14, 0x15, 0x16, 0x17));
4604 static __inline__ vector unsigned long long __ATTRS_o_ai
4605 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4606 return vec_perm((vector unsigned long long)__a, __b,
4607 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4608 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4609 0x14, 0x15, 0x16, 0x17));
4612 static __inline__ vector bool long long __ATTRS_o_ai
4613 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4614 return vec_perm(__a, __b,
4615 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4616 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4617 0x14, 0x15, 0x16, 0x17));
4620 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4621 vector double __b) {
4622 return vec_perm(__a, __b,
4623 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4624 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4625 0x14, 0x15, 0x16, 0x17));
4627 static __inline__ vector double __ATTRS_o_ai
4628 vec_mergeh(vector double __a, vector bool long long __b) {
4629 return vec_perm(__a, (vector double)__b,
4630 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4631 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4632 0x14, 0x15, 0x16, 0x17));
4634 static __inline__ vector double __ATTRS_o_ai
4635 vec_mergeh(vector bool long long __a, vector double __b) {
4636 return vec_perm((vector double)__a, __b,
4637 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4638 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4639 0x14, 0x15, 0x16, 0x17));
4645 #define __builtin_altivec_vmrghb vec_vmrghb
4647 static __inline__ vector signed char __ATTRS_o_ai
4648 vec_vmrghb(vector signed char __a, vector signed char __b) {
4649 return vec_perm(__a, __b,
4650 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4651 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4652 0x06, 0x16, 0x07, 0x17));
4655 static __inline__ vector unsigned char __ATTRS_o_ai
4656 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4657 return vec_perm(__a, __b,
4658 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4659 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4660 0x06, 0x16, 0x07, 0x17));
4663 static __inline__ vector bool char __ATTRS_o_ai
4664 vec_vmrghb(vector bool char __a, vector bool char __b) {
4665 return vec_perm(__a, __b,
4666 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4667 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4668 0x06, 0x16, 0x07, 0x17));
4673 #define __builtin_altivec_vmrghh vec_vmrghh
4675 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4677 return vec_perm(__a, __b,
4678 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4679 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4680 0x06, 0x07, 0x16, 0x17));
4683 static __inline__ vector unsigned short __ATTRS_o_ai
4684 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4685 return vec_perm(__a, __b,
4686 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4687 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4688 0x06, 0x07, 0x16, 0x17));
4691 static __inline__ vector bool short __ATTRS_o_ai
4692 vec_vmrghh(vector bool short __a, vector bool short __b) {
4693 return vec_perm(__a, __b,
4694 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4695 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4696 0x06, 0x07, 0x16, 0x17));
4699 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4701 return vec_perm(__a, __b,
4702 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4703 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4704 0x06, 0x07, 0x16, 0x17));
4709 #define __builtin_altivec_vmrghw vec_vmrghw
4711 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4713 return vec_perm(__a, __b,
4714 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4715 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4716 0x14, 0x15, 0x16, 0x17));
4719 static __inline__ vector unsigned int __ATTRS_o_ai
4720 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4721 return vec_perm(__a, __b,
4722 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4723 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4724 0x14, 0x15, 0x16, 0x17));
4727 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4728 vector bool int __b) {
4729 return vec_perm(__a, __b,
4730 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4731 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4732 0x14, 0x15, 0x16, 0x17));
4735 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4737 return vec_perm(__a, __b,
4738 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4739 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4740 0x14, 0x15, 0x16, 0x17));
4745 static __inline__ vector signed char __ATTRS_o_ai
4746 vec_mergel(vector signed char __a, vector signed char __b) {
4747 return vec_perm(__a, __b,
4748 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4749 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4750 0x0E, 0x1E, 0x0F, 0x1F));
4753 static __inline__ vector unsigned char __ATTRS_o_ai
4754 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4755 return vec_perm(__a, __b,
4756 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4757 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4758 0x0E, 0x1E, 0x0F, 0x1F));
4761 static __inline__ vector bool char __ATTRS_o_ai
4762 vec_mergel(vector bool char __a, vector bool char __b) {
4763 return vec_perm(__a, __b,
4764 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4765 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4766 0x0E, 0x1E, 0x0F, 0x1F));
4769 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4771 return vec_perm(__a, __b,
4772 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4773 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4774 0x0E, 0x0F, 0x1E, 0x1F));
4777 static __inline__ vector unsigned short __ATTRS_o_ai
4778 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4779 return vec_perm(__a, __b,
4780 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4781 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4782 0x0E, 0x0F, 0x1E, 0x1F));
4785 static __inline__ vector bool short __ATTRS_o_ai
4786 vec_mergel(vector bool short __a, vector bool short __b) {
4787 return vec_perm(__a, __b,
4788 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4789 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4790 0x0E, 0x0F, 0x1E, 0x1F));
4793 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4795 return vec_perm(__a, __b,
4796 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4797 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4798 0x0E, 0x0F, 0x1E, 0x1F));
4801 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4803 return vec_perm(__a, __b,
4804 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4805 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4806 0x1C, 0x1D, 0x1E, 0x1F));
4809 static __inline__ vector unsigned int __ATTRS_o_ai
4810 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4811 return vec_perm(__a, __b,
4812 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4813 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4814 0x1C, 0x1D, 0x1E, 0x1F));
4817 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4818 vector bool int __b) {
4819 return vec_perm(__a, __b,
4820 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4821 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4822 0x1C, 0x1D, 0x1E, 0x1F));
4825 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4827 return vec_perm(__a, __b,
4828 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4829 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4830 0x1C, 0x1D, 0x1E, 0x1F));
4834 static __inline__ vector signed long long __ATTRS_o_ai
4835 vec_mergel(vector signed long long __a, vector signed long long __b) {
4836 return vec_perm(__a, __b,
4837 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4838 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4839 0x1C, 0x1D, 0x1E, 0x1F));
4841 static __inline__ vector signed long long __ATTRS_o_ai
4842 vec_mergel(vector signed long long __a, vector bool long long __b) {
4843 return vec_perm(__a, (vector signed long long)__b,
4844 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4845 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4846 0x1C, 0x1D, 0x1E, 0x1F));
4848 static __inline__ vector signed long long __ATTRS_o_ai
4849 vec_mergel(vector bool long long __a, vector signed long long __b) {
4850 return vec_perm((vector signed long long)__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 unsigned long long __ATTRS_o_ai
4856 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4857 return vec_perm(__a, __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 unsigned long long __ATTRS_o_ai
4863 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4864 return vec_perm(__a, (vector unsigned long long)__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 bool long long __a, vector unsigned long long __b) {
4871 return vec_perm((vector unsigned long long)__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 bool long long __ATTRS_o_ai
4877 vec_mergel(vector bool long long __a, vector bool long long __b) {
4878 return vec_perm(__a, __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 double __ATTRS_o_ai vec_mergel(vector double __a,
4884 vector double __b) {
4885 return vec_perm(__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 double __ATTRS_o_ai
4891 vec_mergel(vector double __a, vector bool long long __b) {
4892 return vec_perm(__a, (vector double)__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
4898 vec_mergel(vector bool long long __a, vector double __b) {
4899 return vec_perm((vector double)__a, __b,
4900 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4901 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4902 0x1C, 0x1D, 0x1E, 0x1F));
4908 #define __builtin_altivec_vmrglb vec_vmrglb
4910 static __inline__ vector signed char __ATTRS_o_ai
4911 vec_vmrglb(vector signed char __a, vector signed char __b) {
4912 return vec_perm(__a, __b,
4913 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4914 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4915 0x0E, 0x1E, 0x0F, 0x1F));
4918 static __inline__ vector unsigned char __ATTRS_o_ai
4919 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4920 return vec_perm(__a, __b,
4921 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4922 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4923 0x0E, 0x1E, 0x0F, 0x1F));
4926 static __inline__ vector bool char __ATTRS_o_ai
4927 vec_vmrglb(vector bool char __a, vector bool char __b) {
4928 return vec_perm(__a, __b,
4929 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4930 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4931 0x0E, 0x1E, 0x0F, 0x1F));
4936 #define __builtin_altivec_vmrglh vec_vmrglh
4938 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4940 return vec_perm(__a, __b,
4941 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4942 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4943 0x0E, 0x0F, 0x1E, 0x1F));
4946 static __inline__ vector unsigned short __ATTRS_o_ai
4947 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4948 return vec_perm(__a, __b,
4949 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4950 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4951 0x0E, 0x0F, 0x1E, 0x1F));
4954 static __inline__ vector bool short __ATTRS_o_ai
4955 vec_vmrglh(vector bool short __a, vector bool short __b) {
4956 return vec_perm(__a, __b,
4957 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4958 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4959 0x0E, 0x0F, 0x1E, 0x1F));
4962 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4964 return vec_perm(__a, __b,
4965 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4966 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4967 0x0E, 0x0F, 0x1E, 0x1F));
4972 #define __builtin_altivec_vmrglw vec_vmrglw
4974 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4976 return vec_perm(__a, __b,
4977 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4978 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4979 0x1C, 0x1D, 0x1E, 0x1F));
4982 static __inline__ vector unsigned int __ATTRS_o_ai
4983 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
4984 return vec_perm(__a, __b,
4985 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4986 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4987 0x1C, 0x1D, 0x1E, 0x1F));
4990 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
4991 vector bool int __b) {
4992 return vec_perm(__a, __b,
4993 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4994 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4995 0x1C, 0x1D, 0x1E, 0x1F));
4998 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5000 return vec_perm(__a, __b,
5001 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5002 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5003 0x1C, 0x1D, 0x1E, 0x1F));
5006 #ifdef __POWER8_VECTOR__
5009 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5010 vector bool int __b) {
5011 return vec_perm(__a, __b,
5012 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5013 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5014 0x18, 0x19, 0x1A, 0x1B));
5017 static __inline__ vector signed int __ATTRS_o_ai
5018 vec_mergee(vector signed int __a, vector signed int __b) {
5019 return vec_perm(__a, __b,
5020 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5021 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5022 0x18, 0x19, 0x1A, 0x1B));
5025 static __inline__ vector unsigned int __ATTRS_o_ai
5026 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5027 return vec_perm(__a, __b,
5028 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5029 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5030 0x18, 0x19, 0x1A, 0x1B));
5033 static __inline__ vector bool long long __ATTRS_o_ai
5034 vec_mergee(vector bool long long __a, vector bool long long __b) {
5035 return vec_mergeh(__a, __b);
5038 static __inline__ vector signed long long __ATTRS_o_ai
5039 vec_mergee(vector signed long long __a, vector signed long long __b) {
5040 return vec_mergeh(__a, __b);
5043 static __inline__ vector unsigned long long __ATTRS_o_ai
5044 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5045 return vec_mergeh(__a, __b);
5048 static __inline__ vector float __ATTRS_o_ai
5049 vec_mergee(vector float __a, vector float __b) {
5050 return vec_perm(__a, __b,
5051 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5052 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5053 0x18, 0x19, 0x1A, 0x1B));
5056 static __inline__ vector double __ATTRS_o_ai
5057 vec_mergee(vector double __a, vector double __b) {
5058 return vec_mergeh(__a, __b);
5063 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5064 vector bool int __b) {
5065 return vec_perm(__a, __b,
5066 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5067 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5068 0x1C, 0x1D, 0x1E, 0x1F));
5071 static __inline__ vector signed int __ATTRS_o_ai
5072 vec_mergeo(vector signed int __a, vector signed int __b) {
5073 return vec_perm(__a, __b,
5074 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5075 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5076 0x1C, 0x1D, 0x1E, 0x1F));
5079 static __inline__ vector unsigned int __ATTRS_o_ai
5080 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5081 return vec_perm(__a, __b,
5082 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5083 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5084 0x1C, 0x1D, 0x1E, 0x1F));
5087 static __inline__ vector bool long long __ATTRS_o_ai
5088 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5089 return vec_mergel(__a, __b);
5092 static __inline__ vector signed long long __ATTRS_o_ai
5093 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5094 return vec_mergel(__a, __b);
5097 static __inline__ vector unsigned long long __ATTRS_o_ai
5098 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5099 return vec_mergel(__a, __b);
5102 static __inline__ vector float __ATTRS_o_ai
5103 vec_mergeo(vector float __a, vector float __b) {
5104 return vec_perm(__a, __b,
5105 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5106 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5107 0x1C, 0x1D, 0x1E, 0x1F));
5110 static __inline__ vector double __ATTRS_o_ai
5111 vec_mergeo(vector double __a, vector double __b) {
5112 return vec_mergel(__a, __b);
5119 static __inline__ vector unsigned short __attribute__((__always_inline__))
5121 return __builtin_altivec_mfvscr();
5126 static __inline__ vector signed char __ATTRS_o_ai
5127 vec_min(vector signed char __a, vector signed char __b) {
5128 return __builtin_altivec_vminsb(__a, __b);
5131 static __inline__ vector signed char __ATTRS_o_ai
5132 vec_min(vector bool char __a, vector signed char __b) {
5133 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5136 static __inline__ vector signed char __ATTRS_o_ai
5137 vec_min(vector signed char __a, vector bool char __b) {
5138 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5141 static __inline__ vector unsigned char __ATTRS_o_ai
5142 vec_min(vector unsigned char __a, vector unsigned char __b) {
5143 return __builtin_altivec_vminub(__a, __b);
5146 static __inline__ vector unsigned char __ATTRS_o_ai
5147 vec_min(vector bool char __a, vector unsigned char __b) {
5148 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5151 static __inline__ vector unsigned char __ATTRS_o_ai
5152 vec_min(vector unsigned char __a, vector bool char __b) {
5153 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5156 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5158 return __builtin_altivec_vminsh(__a, __b);
5161 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5163 return __builtin_altivec_vminsh((vector short)__a, __b);
5166 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5167 vector bool short __b) {
5168 return __builtin_altivec_vminsh(__a, (vector short)__b);
5171 static __inline__ vector unsigned short __ATTRS_o_ai
5172 vec_min(vector unsigned short __a, vector unsigned short __b) {
5173 return __builtin_altivec_vminuh(__a, __b);
5176 static __inline__ vector unsigned short __ATTRS_o_ai
5177 vec_min(vector bool short __a, vector unsigned short __b) {
5178 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5181 static __inline__ vector unsigned short __ATTRS_o_ai
5182 vec_min(vector unsigned short __a, vector bool short __b) {
5183 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5186 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5188 return __builtin_altivec_vminsw(__a, __b);
5191 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5193 return __builtin_altivec_vminsw((vector int)__a, __b);
5196 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5197 vector bool int __b) {
5198 return __builtin_altivec_vminsw(__a, (vector int)__b);
5201 static __inline__ vector unsigned int __ATTRS_o_ai
5202 vec_min(vector unsigned int __a, vector unsigned int __b) {
5203 return __builtin_altivec_vminuw(__a, __b);
5206 static __inline__ vector unsigned int __ATTRS_o_ai
5207 vec_min(vector bool int __a, vector unsigned int __b) {
5208 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5211 static __inline__ vector unsigned int __ATTRS_o_ai
5212 vec_min(vector unsigned int __a, vector bool int __b) {
5213 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5216 #ifdef __POWER8_VECTOR__
5217 static __inline__ vector signed long long __ATTRS_o_ai
5218 vec_min(vector signed long long __a, vector signed long long __b) {
5219 return __builtin_altivec_vminsd(__a, __b);
5222 static __inline__ vector signed long long __ATTRS_o_ai
5223 vec_min(vector bool long long __a, vector signed long long __b) {
5224 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5227 static __inline__ vector signed long long __ATTRS_o_ai
5228 vec_min(vector signed long long __a, vector bool long long __b) {
5229 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5232 static __inline__ vector unsigned long long __ATTRS_o_ai
5233 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5234 return __builtin_altivec_vminud(__a, __b);
5237 static __inline__ vector unsigned long long __ATTRS_o_ai
5238 vec_min(vector bool long long __a, vector unsigned long long __b) {
5239 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5242 static __inline__ vector unsigned long long __ATTRS_o_ai
5243 vec_min(vector unsigned long long __a, vector bool long long __b) {
5244 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5248 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5251 return __builtin_vsx_xvminsp(__a, __b);
5253 return __builtin_altivec_vminfp(__a, __b);
5258 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5259 vector double __b) {
5260 return __builtin_vsx_xvmindp(__a, __b);
5266 static __inline__ vector signed char __ATTRS_o_ai
5267 vec_vminsb(vector signed char __a, vector signed char __b) {
5268 return __builtin_altivec_vminsb(__a, __b);
5271 static __inline__ vector signed char __ATTRS_o_ai
5272 vec_vminsb(vector bool char __a, vector signed char __b) {
5273 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5276 static __inline__ vector signed char __ATTRS_o_ai
5277 vec_vminsb(vector signed char __a, vector bool char __b) {
5278 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5283 static __inline__ vector unsigned char __ATTRS_o_ai
5284 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5285 return __builtin_altivec_vminub(__a, __b);
5288 static __inline__ vector unsigned char __ATTRS_o_ai
5289 vec_vminub(vector bool char __a, vector unsigned char __b) {
5290 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5293 static __inline__ vector unsigned char __ATTRS_o_ai
5294 vec_vminub(vector unsigned char __a, vector bool char __b) {
5295 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5300 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5302 return __builtin_altivec_vminsh(__a, __b);
5305 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5307 return __builtin_altivec_vminsh((vector short)__a, __b);
5310 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5311 vector bool short __b) {
5312 return __builtin_altivec_vminsh(__a, (vector short)__b);
5317 static __inline__ vector unsigned short __ATTRS_o_ai
5318 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5319 return __builtin_altivec_vminuh(__a, __b);
5322 static __inline__ vector unsigned short __ATTRS_o_ai
5323 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5324 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5327 static __inline__ vector unsigned short __ATTRS_o_ai
5328 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5329 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5334 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5336 return __builtin_altivec_vminsw(__a, __b);
5339 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5341 return __builtin_altivec_vminsw((vector int)__a, __b);
5344 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5345 vector bool int __b) {
5346 return __builtin_altivec_vminsw(__a, (vector int)__b);
5351 static __inline__ vector unsigned int __ATTRS_o_ai
5352 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5353 return __builtin_altivec_vminuw(__a, __b);
5356 static __inline__ vector unsigned int __ATTRS_o_ai
5357 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5358 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5361 static __inline__ vector unsigned int __ATTRS_o_ai
5362 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5363 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5368 static __inline__ vector float __attribute__((__always_inline__))
5369 vec_vminfp(vector float __a, vector float __b) {
5371 return __builtin_vsx_xvminsp(__a, __b);
5373 return __builtin_altivec_vminfp(__a, __b);
5379 #define __builtin_altivec_vmladduhm vec_mladd
5381 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5384 return __a * __b + __c;
5387 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5388 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5389 return __a * (vector short)__b + (vector short)__c;
5392 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5395 return (vector short)__a * __b + __c;
5398 static __inline__ vector unsigned short __ATTRS_o_ai
5399 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5400 vector unsigned short __c) {
5401 return __a * __b + __c;
5406 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5409 return __a * __b + __c;
5412 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5413 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5414 return __a * (vector short)__b + (vector short)__c;
5417 static __inline__ vector short __ATTRS_o_ai
5418 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5419 return (vector short)__a * __b + __c;
5422 static __inline__ vector unsigned short __ATTRS_o_ai
5423 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5424 vector unsigned short __c) {
5425 return __a * __b + __c;
5430 static __inline__ vector short __attribute__((__always_inline__))
5431 vec_mradds(vector short __a, vector short __b, vector short __c) {
5432 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5435 /* vec_vmhraddshs */
5437 static __inline__ vector short __attribute__((__always_inline__))
5438 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5439 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5444 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5445 vector unsigned char __b,
5447 return __builtin_altivec_vmsummbm(__a, __b, __c);
5450 static __inline__ vector unsigned int __ATTRS_o_ai
5451 vec_msum(vector unsigned char __a, vector unsigned char __b,
5452 vector unsigned int __c) {
5453 return __builtin_altivec_vmsumubm(__a, __b, __c);
5456 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5459 return __builtin_altivec_vmsumshm(__a, __b, __c);
5462 static __inline__ vector unsigned int __ATTRS_o_ai
5463 vec_msum(vector unsigned short __a, vector unsigned short __b,
5464 vector unsigned int __c) {
5465 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5470 static __inline__ vector int __attribute__((__always_inline__))
5471 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5472 return __builtin_altivec_vmsummbm(__a, __b, __c);
5477 static __inline__ vector unsigned int __attribute__((__always_inline__))
5478 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5479 vector unsigned int __c) {
5480 return __builtin_altivec_vmsumubm(__a, __b, __c);
5485 static __inline__ vector int __attribute__((__always_inline__))
5486 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5487 return __builtin_altivec_vmsumshm(__a, __b, __c);
5492 static __inline__ vector unsigned int __attribute__((__always_inline__))
5493 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5494 vector unsigned int __c) {
5495 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5500 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5503 return __builtin_altivec_vmsumshs(__a, __b, __c);
5506 static __inline__ vector unsigned int __ATTRS_o_ai
5507 vec_msums(vector unsigned short __a, vector unsigned short __b,
5508 vector unsigned int __c) {
5509 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5514 static __inline__ vector int __attribute__((__always_inline__))
5515 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5516 return __builtin_altivec_vmsumshs(__a, __b, __c);
5521 static __inline__ vector unsigned int __attribute__((__always_inline__))
5522 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5523 vector unsigned int __c) {
5524 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5529 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5530 __builtin_altivec_mtvscr((vector int)__a);
5533 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5534 __builtin_altivec_mtvscr((vector int)__a);
5537 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5538 __builtin_altivec_mtvscr((vector int)__a);
5541 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5542 __builtin_altivec_mtvscr((vector int)__a);
5545 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5546 __builtin_altivec_mtvscr((vector int)__a);
5549 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5550 __builtin_altivec_mtvscr((vector int)__a);
5553 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5554 __builtin_altivec_mtvscr((vector int)__a);
5557 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5558 __builtin_altivec_mtvscr((vector int)__a);
5561 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5562 __builtin_altivec_mtvscr((vector int)__a);
5565 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5566 __builtin_altivec_mtvscr((vector int)__a);
5569 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5570 __builtin_altivec_mtvscr((vector int)__a);
5575 /* Integer vector multiplication will involve multiplication of the odd/even
5576 elements separately, then truncating the results and moving to the
5579 static __inline__ vector signed char __ATTRS_o_ai
5580 vec_mul(vector signed char __a, vector signed char __b) {
5584 static __inline__ vector unsigned char __ATTRS_o_ai
5585 vec_mul(vector unsigned char __a, vector unsigned char __b) {
5589 static __inline__ vector signed short __ATTRS_o_ai
5590 vec_mul(vector signed short __a, vector signed short __b) {
5594 static __inline__ vector unsigned short __ATTRS_o_ai
5595 vec_mul(vector unsigned short __a, vector unsigned short __b) {
5599 static __inline__ vector signed int __ATTRS_o_ai
5600 vec_mul(vector signed int __a, vector signed int __b) {
5604 static __inline__ vector unsigned int __ATTRS_o_ai
5605 vec_mul(vector unsigned int __a, vector unsigned int __b) {
5610 static __inline__ vector signed long long __ATTRS_o_ai
5611 vec_mul(vector signed long long __a, vector signed long long __b) {
5615 static __inline__ vector unsigned long long __ATTRS_o_ai
5616 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5621 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5627 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5628 vector double __b) {
5633 /* The vmulos* and vmules* instructions have a big endian bias, so
5634 we must reverse the meaning of "even" and "odd" for little endian. */
5638 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5639 vector signed char __b) {
5640 #ifdef __LITTLE_ENDIAN__
5641 return __builtin_altivec_vmulosb(__a, __b);
5643 return __builtin_altivec_vmulesb(__a, __b);
5647 static __inline__ vector unsigned short __ATTRS_o_ai
5648 vec_mule(vector unsigned char __a, vector unsigned char __b) {
5649 #ifdef __LITTLE_ENDIAN__
5650 return __builtin_altivec_vmuloub(__a, __b);
5652 return __builtin_altivec_vmuleub(__a, __b);
5656 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5658 #ifdef __LITTLE_ENDIAN__
5659 return __builtin_altivec_vmulosh(__a, __b);
5661 return __builtin_altivec_vmulesh(__a, __b);
5665 static __inline__ vector unsigned int __ATTRS_o_ai
5666 vec_mule(vector unsigned short __a, vector unsigned short __b) {
5667 #ifdef __LITTLE_ENDIAN__
5668 return __builtin_altivec_vmulouh(__a, __b);
5670 return __builtin_altivec_vmuleuh(__a, __b);
5674 #ifdef __POWER8_VECTOR__
5675 static __inline__ vector signed long long __ATTRS_o_ai
5676 vec_mule(vector signed int __a, vector signed int __b) {
5677 #ifdef __LITTLE_ENDIAN__
5678 return __builtin_altivec_vmulosw(__a, __b);
5680 return __builtin_altivec_vmulesw(__a, __b);
5684 static __inline__ vector unsigned long long __ATTRS_o_ai
5685 vec_mule(vector unsigned int __a, vector unsigned int __b) {
5686 #ifdef __LITTLE_ENDIAN__
5687 return __builtin_altivec_vmulouw(__a, __b);
5689 return __builtin_altivec_vmuleuw(__a, __b);
5696 static __inline__ vector short __attribute__((__always_inline__))
5697 vec_vmulesb(vector signed char __a, vector signed char __b) {
5698 #ifdef __LITTLE_ENDIAN__
5699 return __builtin_altivec_vmulosb(__a, __b);
5701 return __builtin_altivec_vmulesb(__a, __b);
5707 static __inline__ vector unsigned short __attribute__((__always_inline__))
5708 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5709 #ifdef __LITTLE_ENDIAN__
5710 return __builtin_altivec_vmuloub(__a, __b);
5712 return __builtin_altivec_vmuleub(__a, __b);
5718 static __inline__ vector int __attribute__((__always_inline__))
5719 vec_vmulesh(vector short __a, vector short __b) {
5720 #ifdef __LITTLE_ENDIAN__
5721 return __builtin_altivec_vmulosh(__a, __b);
5723 return __builtin_altivec_vmulesh(__a, __b);
5729 static __inline__ vector unsigned int __attribute__((__always_inline__))
5730 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5731 #ifdef __LITTLE_ENDIAN__
5732 return __builtin_altivec_vmulouh(__a, __b);
5734 return __builtin_altivec_vmuleuh(__a, __b);
5740 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5741 vector signed char __b) {
5742 #ifdef __LITTLE_ENDIAN__
5743 return __builtin_altivec_vmulesb(__a, __b);
5745 return __builtin_altivec_vmulosb(__a, __b);
5749 static __inline__ vector unsigned short __ATTRS_o_ai
5750 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5751 #ifdef __LITTLE_ENDIAN__
5752 return __builtin_altivec_vmuleub(__a, __b);
5754 return __builtin_altivec_vmuloub(__a, __b);
5758 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5760 #ifdef __LITTLE_ENDIAN__
5761 return __builtin_altivec_vmulesh(__a, __b);
5763 return __builtin_altivec_vmulosh(__a, __b);
5767 static __inline__ vector unsigned int __ATTRS_o_ai
5768 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5769 #ifdef __LITTLE_ENDIAN__
5770 return __builtin_altivec_vmuleuh(__a, __b);
5772 return __builtin_altivec_vmulouh(__a, __b);
5776 #ifdef __POWER8_VECTOR__
5777 static __inline__ vector signed long long __ATTRS_o_ai
5778 vec_mulo(vector signed int __a, vector signed int __b) {
5779 #ifdef __LITTLE_ENDIAN__
5780 return __builtin_altivec_vmulesw(__a, __b);
5782 return __builtin_altivec_vmulosw(__a, __b);
5786 static __inline__ vector unsigned long long __ATTRS_o_ai
5787 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5788 #ifdef __LITTLE_ENDIAN__
5789 return __builtin_altivec_vmuleuw(__a, __b);
5791 return __builtin_altivec_vmulouw(__a, __b);
5798 static __inline__ vector short __attribute__((__always_inline__))
5799 vec_vmulosb(vector signed char __a, vector signed char __b) {
5800 #ifdef __LITTLE_ENDIAN__
5801 return __builtin_altivec_vmulesb(__a, __b);
5803 return __builtin_altivec_vmulosb(__a, __b);
5809 static __inline__ vector unsigned short __attribute__((__always_inline__))
5810 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5811 #ifdef __LITTLE_ENDIAN__
5812 return __builtin_altivec_vmuleub(__a, __b);
5814 return __builtin_altivec_vmuloub(__a, __b);
5820 static __inline__ vector int __attribute__((__always_inline__))
5821 vec_vmulosh(vector short __a, vector short __b) {
5822 #ifdef __LITTLE_ENDIAN__
5823 return __builtin_altivec_vmulesh(__a, __b);
5825 return __builtin_altivec_vmulosh(__a, __b);
5831 static __inline__ vector unsigned int __attribute__((__always_inline__))
5832 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5833 #ifdef __LITTLE_ENDIAN__
5834 return __builtin_altivec_vmuleuh(__a, __b);
5836 return __builtin_altivec_vmulouh(__a, __b);
5842 #ifdef __POWER8_VECTOR__
5843 static __inline__ vector signed char __ATTRS_o_ai
5844 vec_nand(vector signed char __a, vector signed char __b) {
5845 return ~(__a & __b);
5848 static __inline__ vector signed char __ATTRS_o_ai
5849 vec_nand(vector signed char __a, vector bool char __b) {
5850 return ~(__a & __b);
5853 static __inline__ vector signed char __ATTRS_o_ai
5854 vec_nand(vector bool char __a, vector signed char __b) {
5855 return ~(__a & __b);
5858 static __inline__ vector unsigned char __ATTRS_o_ai
5859 vec_nand(vector unsigned char __a, vector unsigned char __b) {
5860 return ~(__a & __b);
5863 static __inline__ vector unsigned char __ATTRS_o_ai
5864 vec_nand(vector unsigned char __a, vector bool char __b) {
5865 return ~(__a & __b);
5868 static __inline__ vector unsigned char __ATTRS_o_ai
5869 vec_nand(vector bool char __a, vector unsigned char __b) {
5870 return ~(__a & __b);
5873 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5874 vector bool char __b) {
5875 return ~(__a & __b);
5878 static __inline__ vector signed short __ATTRS_o_ai
5879 vec_nand(vector signed short __a, vector signed short __b) {
5880 return ~(__a & __b);
5883 static __inline__ vector signed short __ATTRS_o_ai
5884 vec_nand(vector signed short __a, vector bool short __b) {
5885 return ~(__a & __b);
5888 static __inline__ vector signed short __ATTRS_o_ai
5889 vec_nand(vector bool short __a, vector signed short __b) {
5890 return ~(__a & __b);
5893 static __inline__ vector unsigned short __ATTRS_o_ai
5894 vec_nand(vector unsigned short __a, vector unsigned short __b) {
5895 return ~(__a & __b);
5898 static __inline__ vector unsigned short __ATTRS_o_ai
5899 vec_nand(vector unsigned short __a, vector bool short __b) {
5900 return ~(__a & __b);
5903 static __inline__ vector bool short __ATTRS_o_ai
5904 vec_nand(vector bool short __a, vector bool short __b) {
5905 return ~(__a & __b);
5908 static __inline__ vector signed int __ATTRS_o_ai
5909 vec_nand(vector signed int __a, vector signed int __b) {
5910 return ~(__a & __b);
5913 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5914 vector bool int __b) {
5915 return ~(__a & __b);
5918 static __inline__ vector signed int __ATTRS_o_ai
5919 vec_nand(vector bool int __a, vector signed int __b) {
5920 return ~(__a & __b);
5923 static __inline__ vector unsigned int __ATTRS_o_ai
5924 vec_nand(vector unsigned int __a, vector unsigned int __b) {
5925 return ~(__a & __b);
5928 static __inline__ vector unsigned int __ATTRS_o_ai
5929 vec_nand(vector unsigned int __a, vector bool int __b) {
5930 return ~(__a & __b);
5933 static __inline__ vector unsigned int __ATTRS_o_ai
5934 vec_nand(vector bool int __a, vector unsigned int __b) {
5935 return ~(__a & __b);
5938 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5939 vector bool int __b) {
5940 return ~(__a & __b);
5943 static __inline__ vector float __ATTRS_o_ai
5944 vec_nand(vector float __a, vector float __b) {
5945 return (vector float)(~((vector unsigned int)__a &
5946 (vector unsigned int)__b));
5949 static __inline__ vector signed long long __ATTRS_o_ai
5950 vec_nand(vector signed long long __a, vector signed long long __b) {
5951 return ~(__a & __b);
5954 static __inline__ vector signed long long __ATTRS_o_ai
5955 vec_nand(vector signed long long __a, vector bool long long __b) {
5956 return ~(__a & __b);
5959 static __inline__ vector signed long long __ATTRS_o_ai
5960 vec_nand(vector bool long long __a, vector signed long long __b) {
5961 return ~(__a & __b);
5964 static __inline__ vector unsigned long long __ATTRS_o_ai
5965 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
5966 return ~(__a & __b);
5969 static __inline__ vector unsigned long long __ATTRS_o_ai
5970 vec_nand(vector unsigned long long __a, vector bool long long __b) {
5971 return ~(__a & __b);
5974 static __inline__ vector unsigned long long __ATTRS_o_ai
5975 vec_nand(vector bool long long __a, vector unsigned long long __b) {
5976 return ~(__a & __b);
5979 static __inline__ vector bool long long __ATTRS_o_ai
5980 vec_nand(vector bool long long __a, vector bool long long __b) {
5981 return ~(__a & __b);
5984 static __inline__ vector double __ATTRS_o_ai
5985 vec_nand(vector double __a, vector double __b) {
5986 return (vector double)(~((vector unsigned long long)__a &
5987 (vector unsigned long long)__b));
5995 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
5998 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6001 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6003 vector double __c) {
6004 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6010 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6014 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6016 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6021 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6023 vector double __c) {
6024 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6030 static __inline__ vector float __attribute__((__always_inline__))
6031 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6032 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6037 #define __builtin_altivec_vnor vec_nor
6039 static __inline__ vector signed char __ATTRS_o_ai
6040 vec_nor(vector signed char __a, vector signed char __b) {
6041 return ~(__a | __b);
6044 static __inline__ vector unsigned char __ATTRS_o_ai
6045 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6046 return ~(__a | __b);
6049 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6050 vector bool char __b) {
6051 return ~(__a | __b);
6054 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6056 return ~(__a | __b);
6059 static __inline__ vector unsigned short __ATTRS_o_ai
6060 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6061 return ~(__a | __b);
6064 static __inline__ vector bool short __ATTRS_o_ai
6065 vec_nor(vector bool short __a, vector bool short __b) {
6066 return ~(__a | __b);
6069 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6071 return ~(__a | __b);
6074 static __inline__ vector unsigned int __ATTRS_o_ai
6075 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6076 return ~(__a | __b);
6079 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6080 vector bool int __b) {
6081 return ~(__a | __b);
6084 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6086 vector unsigned int __res =
6087 ~((vector unsigned int)__a | (vector unsigned int)__b);
6088 return (vector float)__res;
6092 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6093 vector double __b) {
6094 vector unsigned long long __res =
6095 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6096 return (vector double)__res;
6102 static __inline__ vector signed char __ATTRS_o_ai
6103 vec_vnor(vector signed char __a, vector signed char __b) {
6104 return ~(__a | __b);
6107 static __inline__ vector unsigned char __ATTRS_o_ai
6108 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6109 return ~(__a | __b);
6112 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6113 vector bool char __b) {
6114 return ~(__a | __b);
6117 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6119 return ~(__a | __b);
6122 static __inline__ vector unsigned short __ATTRS_o_ai
6123 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6124 return ~(__a | __b);
6127 static __inline__ vector bool short __ATTRS_o_ai
6128 vec_vnor(vector bool short __a, vector bool short __b) {
6129 return ~(__a | __b);
6132 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6134 return ~(__a | __b);
6137 static __inline__ vector unsigned int __ATTRS_o_ai
6138 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6139 return ~(__a | __b);
6142 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6143 vector bool int __b) {
6144 return ~(__a | __b);
6147 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6149 vector unsigned int __res =
6150 ~((vector unsigned int)__a | (vector unsigned int)__b);
6151 return (vector float)__res;
6155 static __inline__ vector signed long long __ATTRS_o_ai
6156 vec_nor(vector signed long long __a, vector signed long long __b) {
6157 return ~(__a | __b);
6160 static __inline__ vector unsigned long long __ATTRS_o_ai
6161 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6162 return ~(__a | __b);
6165 static __inline__ vector bool long long __ATTRS_o_ai
6166 vec_nor(vector bool long long __a, vector bool long long __b) {
6167 return ~(__a | __b);
6173 #define __builtin_altivec_vor vec_or
6175 static __inline__ vector signed char __ATTRS_o_ai
6176 vec_or(vector signed char __a, vector signed char __b) {
6180 static __inline__ vector signed char __ATTRS_o_ai
6181 vec_or(vector bool char __a, vector signed char __b) {
6182 return (vector signed char)__a | __b;
6185 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6186 vector bool char __b) {
6187 return __a | (vector signed char)__b;
6190 static __inline__ vector unsigned char __ATTRS_o_ai
6191 vec_or(vector unsigned char __a, vector unsigned char __b) {
6195 static __inline__ vector unsigned char __ATTRS_o_ai
6196 vec_or(vector bool char __a, vector unsigned char __b) {
6197 return (vector unsigned char)__a | __b;
6200 static __inline__ vector unsigned char __ATTRS_o_ai
6201 vec_or(vector unsigned char __a, vector bool char __b) {
6202 return __a | (vector unsigned char)__b;
6205 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6206 vector bool char __b) {
6210 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6215 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6217 return (vector short)__a | __b;
6220 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6221 vector bool short __b) {
6222 return __a | (vector short)__b;
6225 static __inline__ vector unsigned short __ATTRS_o_ai
6226 vec_or(vector unsigned short __a, vector unsigned short __b) {
6230 static __inline__ vector unsigned short __ATTRS_o_ai
6231 vec_or(vector bool short __a, vector unsigned short __b) {
6232 return (vector unsigned short)__a | __b;
6235 static __inline__ vector unsigned short __ATTRS_o_ai
6236 vec_or(vector unsigned short __a, vector bool short __b) {
6237 return __a | (vector unsigned short)__b;
6240 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6241 vector bool short __b) {
6245 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6250 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6252 return (vector int)__a | __b;
6255 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6256 vector bool int __b) {
6257 return __a | (vector int)__b;
6260 static __inline__ vector unsigned int __ATTRS_o_ai
6261 vec_or(vector unsigned int __a, vector unsigned int __b) {
6265 static __inline__ vector unsigned int __ATTRS_o_ai
6266 vec_or(vector bool int __a, vector unsigned int __b) {
6267 return (vector unsigned int)__a | __b;
6270 static __inline__ vector unsigned int __ATTRS_o_ai
6271 vec_or(vector unsigned int __a, vector bool int __b) {
6272 return __a | (vector unsigned int)__b;
6275 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6276 vector bool int __b) {
6280 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6282 vector unsigned int __res =
6283 (vector unsigned int)__a | (vector unsigned int)__b;
6284 return (vector float)__res;
6287 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6289 vector unsigned int __res =
6290 (vector unsigned int)__a | (vector unsigned int)__b;
6291 return (vector float)__res;
6294 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6295 vector bool int __b) {
6296 vector unsigned int __res =
6297 (vector unsigned int)__a | (vector unsigned int)__b;
6298 return (vector float)__res;
6302 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6303 vector double __b) {
6304 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6307 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6308 vector bool long long __b) {
6309 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6312 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6313 vector double __b) {
6314 vector unsigned long long __res =
6315 (vector unsigned long long)__a | (vector unsigned long long)__b;
6316 return (vector double)__res;
6319 static __inline__ vector signed long long __ATTRS_o_ai
6320 vec_or(vector signed long long __a, vector signed long long __b) {
6324 static __inline__ vector signed long long __ATTRS_o_ai
6325 vec_or(vector bool long long __a, vector signed long long __b) {
6326 return (vector signed long long)__a | __b;
6329 static __inline__ vector signed long long __ATTRS_o_ai
6330 vec_or(vector signed long long __a, vector bool long long __b) {
6331 return __a | (vector signed long long)__b;
6334 static __inline__ vector unsigned long long __ATTRS_o_ai
6335 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6339 static __inline__ vector unsigned long long __ATTRS_o_ai
6340 vec_or(vector bool long long __a, vector unsigned long long __b) {
6341 return (vector unsigned long long)__a | __b;
6344 static __inline__ vector unsigned long long __ATTRS_o_ai
6345 vec_or(vector unsigned long long __a, vector bool long long __b) {
6346 return __a | (vector unsigned long long)__b;
6349 static __inline__ vector bool long long __ATTRS_o_ai
6350 vec_or(vector bool long long __a, vector bool long long __b) {
6355 #ifdef __POWER8_VECTOR__
6356 static __inline__ vector signed char __ATTRS_o_ai
6357 vec_orc(vector signed char __a, vector signed char __b) {
6361 static __inline__ vector signed char __ATTRS_o_ai
6362 vec_orc(vector signed char __a, vector bool char __b) {
6366 static __inline__ vector signed char __ATTRS_o_ai
6367 vec_orc(vector bool char __a, vector signed char __b) {
6371 static __inline__ vector unsigned char __ATTRS_o_ai
6372 vec_orc(vector unsigned char __a, vector unsigned char __b) {
6376 static __inline__ vector unsigned char __ATTRS_o_ai
6377 vec_orc(vector unsigned char __a, vector bool char __b) {
6381 static __inline__ vector unsigned char __ATTRS_o_ai
6382 vec_orc(vector bool char __a, vector unsigned char __b) {
6386 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6387 vector bool char __b) {
6391 static __inline__ vector signed short __ATTRS_o_ai
6392 vec_orc(vector signed short __a, vector signed short __b) {
6396 static __inline__ vector signed short __ATTRS_o_ai
6397 vec_orc(vector signed short __a, vector bool short __b) {
6401 static __inline__ vector signed short __ATTRS_o_ai
6402 vec_orc(vector bool short __a, vector signed short __b) {
6406 static __inline__ vector unsigned short __ATTRS_o_ai
6407 vec_orc(vector unsigned short __a, vector unsigned short __b) {
6411 static __inline__ vector unsigned short __ATTRS_o_ai
6412 vec_orc(vector unsigned short __a, vector bool short __b) {
6416 static __inline__ vector unsigned short __ATTRS_o_ai
6417 vec_orc(vector bool short __a, vector unsigned short __b) {
6421 static __inline__ vector bool short __ATTRS_o_ai
6422 vec_orc(vector bool short __a, vector bool short __b) {
6426 static __inline__ vector signed int __ATTRS_o_ai
6427 vec_orc(vector signed int __a, vector signed int __b) {
6431 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6432 vector bool int __b) {
6436 static __inline__ vector signed int __ATTRS_o_ai
6437 vec_orc(vector bool int __a, vector signed int __b) {
6441 static __inline__ vector unsigned int __ATTRS_o_ai
6442 vec_orc(vector unsigned int __a, vector unsigned int __b) {
6446 static __inline__ vector unsigned int __ATTRS_o_ai
6447 vec_orc(vector unsigned int __a, vector bool int __b) {
6451 static __inline__ vector unsigned int __ATTRS_o_ai
6452 vec_orc(vector bool int __a, vector unsigned int __b) {
6456 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6457 vector bool int __b) {
6461 static __inline__ vector float __ATTRS_o_ai
6462 vec_orc(vector bool int __a, vector float __b) {
6463 return (vector float)(__a | ~(vector unsigned int)__b);
6466 static __inline__ vector float __ATTRS_o_ai
6467 vec_orc(vector float __a, vector bool int __b) {
6468 return (vector float)((vector unsigned int)__a | ~__b);
6471 static __inline__ vector signed long long __ATTRS_o_ai
6472 vec_orc(vector signed long long __a, vector signed long long __b) {
6476 static __inline__ vector signed long long __ATTRS_o_ai
6477 vec_orc(vector signed long long __a, vector bool long long __b) {
6481 static __inline__ vector signed long long __ATTRS_o_ai
6482 vec_orc(vector bool long long __a, vector signed long long __b) {
6486 static __inline__ vector unsigned long long __ATTRS_o_ai
6487 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6491 static __inline__ vector unsigned long long __ATTRS_o_ai
6492 vec_orc(vector unsigned long long __a, vector bool long long __b) {
6496 static __inline__ vector unsigned long long __ATTRS_o_ai
6497 vec_orc(vector bool long long __a, vector unsigned long long __b) {
6501 static __inline__ vector bool long long __ATTRS_o_ai
6502 vec_orc(vector bool long long __a, vector bool long long __b) {
6506 static __inline__ vector double __ATTRS_o_ai
6507 vec_orc(vector double __a, vector bool long long __b) {
6508 return (vector double)((vector unsigned long long)__a | ~__b);
6511 static __inline__ vector double __ATTRS_o_ai
6512 vec_orc(vector bool long long __a, vector double __b) {
6513 return (vector double)(__a | ~(vector unsigned long long)__b);
6519 static __inline__ vector signed char __ATTRS_o_ai
6520 vec_vor(vector signed char __a, vector signed char __b) {
6524 static __inline__ vector signed char __ATTRS_o_ai
6525 vec_vor(vector bool char __a, vector signed char __b) {
6526 return (vector signed char)__a | __b;
6529 static __inline__ vector signed char __ATTRS_o_ai
6530 vec_vor(vector signed char __a, vector bool char __b) {
6531 return __a | (vector signed char)__b;
6534 static __inline__ vector unsigned char __ATTRS_o_ai
6535 vec_vor(vector unsigned char __a, vector unsigned char __b) {
6539 static __inline__ vector unsigned char __ATTRS_o_ai
6540 vec_vor(vector bool char __a, vector unsigned char __b) {
6541 return (vector unsigned char)__a | __b;
6544 static __inline__ vector unsigned char __ATTRS_o_ai
6545 vec_vor(vector unsigned char __a, vector bool char __b) {
6546 return __a | (vector unsigned char)__b;
6549 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6550 vector bool char __b) {
6554 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6559 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6561 return (vector short)__a | __b;
6564 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6565 vector bool short __b) {
6566 return __a | (vector short)__b;
6569 static __inline__ vector unsigned short __ATTRS_o_ai
6570 vec_vor(vector unsigned short __a, vector unsigned short __b) {
6574 static __inline__ vector unsigned short __ATTRS_o_ai
6575 vec_vor(vector bool short __a, vector unsigned short __b) {
6576 return (vector unsigned short)__a | __b;
6579 static __inline__ vector unsigned short __ATTRS_o_ai
6580 vec_vor(vector unsigned short __a, vector bool short __b) {
6581 return __a | (vector unsigned short)__b;
6584 static __inline__ vector bool short __ATTRS_o_ai
6585 vec_vor(vector bool short __a, vector bool short __b) {
6589 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6594 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6596 return (vector int)__a | __b;
6599 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6600 vector bool int __b) {
6601 return __a | (vector int)__b;
6604 static __inline__ vector unsigned int __ATTRS_o_ai
6605 vec_vor(vector unsigned int __a, vector unsigned int __b) {
6609 static __inline__ vector unsigned int __ATTRS_o_ai
6610 vec_vor(vector bool int __a, vector unsigned int __b) {
6611 return (vector unsigned int)__a | __b;
6614 static __inline__ vector unsigned int __ATTRS_o_ai
6615 vec_vor(vector unsigned int __a, vector bool int __b) {
6616 return __a | (vector unsigned int)__b;
6619 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6620 vector bool int __b) {
6624 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6626 vector unsigned int __res =
6627 (vector unsigned int)__a | (vector unsigned int)__b;
6628 return (vector float)__res;
6631 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6633 vector unsigned int __res =
6634 (vector unsigned int)__a | (vector unsigned int)__b;
6635 return (vector float)__res;
6638 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6639 vector bool int __b) {
6640 vector unsigned int __res =
6641 (vector unsigned int)__a | (vector unsigned int)__b;
6642 return (vector float)__res;
6646 static __inline__ vector signed long long __ATTRS_o_ai
6647 vec_vor(vector signed long long __a, vector signed long long __b) {
6651 static __inline__ vector signed long long __ATTRS_o_ai
6652 vec_vor(vector bool long long __a, vector signed long long __b) {
6653 return (vector signed long long)__a | __b;
6656 static __inline__ vector signed long long __ATTRS_o_ai
6657 vec_vor(vector signed long long __a, vector bool long long __b) {
6658 return __a | (vector signed long long)__b;
6661 static __inline__ vector unsigned long long __ATTRS_o_ai
6662 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6666 static __inline__ vector unsigned long long __ATTRS_o_ai
6667 vec_vor(vector bool long long __a, vector unsigned long long __b) {
6668 return (vector unsigned long long)__a | __b;
6671 static __inline__ vector unsigned long long __ATTRS_o_ai
6672 vec_vor(vector unsigned long long __a, vector bool long long __b) {
6673 return __a | (vector unsigned long long)__b;
6676 static __inline__ vector bool long long __ATTRS_o_ai
6677 vec_vor(vector bool long long __a, vector bool long long __b) {
6684 /* The various vector pack instructions have a big-endian bias, so for
6685 little endian we must handle reversed element numbering. */
6687 static __inline__ vector signed char __ATTRS_o_ai
6688 vec_pack(vector signed short __a, vector signed short __b) {
6689 #ifdef __LITTLE_ENDIAN__
6690 return (vector signed char)vec_perm(
6692 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6693 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6695 return (vector signed char)vec_perm(
6697 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6698 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6702 static __inline__ vector unsigned char __ATTRS_o_ai
6703 vec_pack(vector unsigned short __a, vector unsigned short __b) {
6704 #ifdef __LITTLE_ENDIAN__
6705 return (vector unsigned char)vec_perm(
6707 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6708 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6710 return (vector unsigned char)vec_perm(
6712 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6713 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6717 static __inline__ vector bool char __ATTRS_o_ai
6718 vec_pack(vector bool short __a, vector bool short __b) {
6719 #ifdef __LITTLE_ENDIAN__
6720 return (vector bool char)vec_perm(
6722 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6723 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6725 return (vector bool char)vec_perm(
6727 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6728 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6732 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6734 #ifdef __LITTLE_ENDIAN__
6735 return (vector short)vec_perm(
6737 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6738 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6740 return (vector short)vec_perm(
6742 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6743 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6747 static __inline__ vector unsigned short __ATTRS_o_ai
6748 vec_pack(vector unsigned int __a, vector unsigned int __b) {
6749 #ifdef __LITTLE_ENDIAN__
6750 return (vector unsigned short)vec_perm(
6752 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6753 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6755 return (vector unsigned short)vec_perm(
6757 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6758 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6762 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6763 vector bool int __b) {
6764 #ifdef __LITTLE_ENDIAN__
6765 return (vector bool short)vec_perm(
6767 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6768 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6770 return (vector bool short)vec_perm(
6772 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6773 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6778 static __inline__ vector signed int __ATTRS_o_ai
6779 vec_pack(vector signed long long __a, vector signed long long __b) {
6780 #ifdef __LITTLE_ENDIAN__
6781 return (vector signed int)vec_perm(
6783 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6784 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6786 return (vector signed int)vec_perm(
6788 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6789 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6792 static __inline__ vector unsigned int __ATTRS_o_ai
6793 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6794 #ifdef __LITTLE_ENDIAN__
6795 return (vector unsigned 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 unsigned int)vec_perm(
6802 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6803 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6807 static __inline__ vector bool int __ATTRS_o_ai
6808 vec_pack(vector bool long long __a, vector bool long long __b) {
6809 #ifdef __LITTLE_ENDIAN__
6810 return (vector bool int)vec_perm(
6812 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6813 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6815 return (vector bool int)vec_perm(
6817 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6818 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6822 static __inline__ vector float __ATTRS_o_ai
6823 vec_pack(vector double __a, vector double __b) {
6824 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6828 #ifdef __POWER9_VECTOR__
6829 static __inline__ vector unsigned short __ATTRS_o_ai
6830 vec_pack_to_short_fp32(vector float __a, vector float __b) {
6831 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6832 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6833 #ifdef __LITTLE_ENDIAN__
6834 return (vector unsigned short)vec_mergee(__resa, __resb);
6836 return (vector unsigned short)vec_mergeo(__resa, __resb);
6843 #define __builtin_altivec_vpkuhum vec_vpkuhum
6845 static __inline__ vector signed char __ATTRS_o_ai
6846 vec_vpkuhum(vector signed short __a, vector signed short __b) {
6847 #ifdef __LITTLE_ENDIAN__
6848 return (vector signed char)vec_perm(
6850 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6851 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6853 return (vector signed char)vec_perm(
6855 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6856 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6860 static __inline__ vector unsigned char __ATTRS_o_ai
6861 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6862 #ifdef __LITTLE_ENDIAN__
6863 return (vector unsigned char)vec_perm(
6865 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6866 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6868 return (vector unsigned char)vec_perm(
6870 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6871 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6875 static __inline__ vector bool char __ATTRS_o_ai
6876 vec_vpkuhum(vector bool short __a, vector bool short __b) {
6877 #ifdef __LITTLE_ENDIAN__
6878 return (vector bool char)vec_perm(
6880 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6881 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6883 return (vector bool char)vec_perm(
6885 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6886 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6892 #define __builtin_altivec_vpkuwum vec_vpkuwum
6894 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6896 #ifdef __LITTLE_ENDIAN__
6897 return (vector short)vec_perm(
6899 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6900 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6902 return (vector short)vec_perm(
6904 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6905 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6909 static __inline__ vector unsigned short __ATTRS_o_ai
6910 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6911 #ifdef __LITTLE_ENDIAN__
6912 return (vector unsigned short)vec_perm(
6914 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6915 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6917 return (vector unsigned short)vec_perm(
6919 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6920 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6924 static __inline__ vector bool short __ATTRS_o_ai
6925 vec_vpkuwum(vector bool int __a, vector bool int __b) {
6926 #ifdef __LITTLE_ENDIAN__
6927 return (vector bool short)vec_perm(
6929 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6930 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6932 return (vector bool short)vec_perm(
6934 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6935 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6941 #ifdef __POWER8_VECTOR__
6942 #define __builtin_altivec_vpkudum vec_vpkudum
6944 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
6945 vector long long __b) {
6946 #ifdef __LITTLE_ENDIAN__
6947 return (vector int)vec_perm(
6949 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6950 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6952 return (vector int)vec_perm(
6954 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6955 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6959 static __inline__ vector unsigned int __ATTRS_o_ai
6960 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
6961 #ifdef __LITTLE_ENDIAN__
6962 return (vector unsigned int)vec_perm(
6964 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6965 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6967 return (vector unsigned int)vec_perm(
6969 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6970 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6974 static __inline__ vector bool int __ATTRS_o_ai
6975 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
6976 #ifdef __LITTLE_ENDIAN__
6977 return (vector bool int)vec_perm(
6978 (vector long long)__a, (vector long long)__b,
6979 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6980 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6982 return (vector bool int)vec_perm(
6983 (vector long long)__a, (vector long long)__b,
6984 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6985 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6992 static __inline__ vector pixel __attribute__((__always_inline__))
6993 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
6994 #ifdef __LITTLE_ENDIAN__
6995 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
6997 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7003 static __inline__ vector pixel __attribute__((__always_inline__))
7004 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7005 #ifdef __LITTLE_ENDIAN__
7006 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7008 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7014 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7016 #ifdef __LITTLE_ENDIAN__
7017 return __builtin_altivec_vpkshss(__b, __a);
7019 return __builtin_altivec_vpkshss(__a, __b);
7023 static __inline__ vector unsigned char __ATTRS_o_ai
7024 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7025 #ifdef __LITTLE_ENDIAN__
7026 return __builtin_altivec_vpkuhus(__b, __a);
7028 return __builtin_altivec_vpkuhus(__a, __b);
7032 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7034 #ifdef __LITTLE_ENDIAN__
7035 return __builtin_altivec_vpkswss(__b, __a);
7037 return __builtin_altivec_vpkswss(__a, __b);
7041 static __inline__ vector unsigned short __ATTRS_o_ai
7042 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7043 #ifdef __LITTLE_ENDIAN__
7044 return __builtin_altivec_vpkuwus(__b, __a);
7046 return __builtin_altivec_vpkuwus(__a, __b);
7050 #ifdef __POWER8_VECTOR__
7051 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7052 vector long long __b) {
7053 #ifdef __LITTLE_ENDIAN__
7054 return __builtin_altivec_vpksdss(__b, __a);
7056 return __builtin_altivec_vpksdss(__a, __b);
7060 static __inline__ vector unsigned int __ATTRS_o_ai
7061 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7062 #ifdef __LITTLE_ENDIAN__
7063 return __builtin_altivec_vpkudus(__b, __a);
7065 return __builtin_altivec_vpkudus(__a, __b);
7072 static __inline__ vector signed char __attribute__((__always_inline__))
7073 vec_vpkshss(vector short __a, vector short __b) {
7074 #ifdef __LITTLE_ENDIAN__
7075 return __builtin_altivec_vpkshss(__b, __a);
7077 return __builtin_altivec_vpkshss(__a, __b);
7083 #ifdef __POWER8_VECTOR__
7084 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7085 vector long long __b) {
7086 #ifdef __LITTLE_ENDIAN__
7087 return __builtin_altivec_vpksdss(__b, __a);
7089 return __builtin_altivec_vpksdss(__a, __b);
7096 static __inline__ vector unsigned char __attribute__((__always_inline__))
7097 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7098 #ifdef __LITTLE_ENDIAN__
7099 return __builtin_altivec_vpkuhus(__b, __a);
7101 return __builtin_altivec_vpkuhus(__a, __b);
7107 #ifdef __POWER8_VECTOR__
7108 static __inline__ vector unsigned int __attribute__((__always_inline__))
7109 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7110 #ifdef __LITTLE_ENDIAN__
7111 return __builtin_altivec_vpkudus(__b, __a);
7113 return __builtin_altivec_vpkudus(__a, __b);
7120 static __inline__ vector signed short __attribute__((__always_inline__))
7121 vec_vpkswss(vector int __a, vector int __b) {
7122 #ifdef __LITTLE_ENDIAN__
7123 return __builtin_altivec_vpkswss(__b, __a);
7125 return __builtin_altivec_vpkswss(__a, __b);
7131 static __inline__ vector unsigned short __attribute__((__always_inline__))
7132 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7133 #ifdef __LITTLE_ENDIAN__
7134 return __builtin_altivec_vpkuwus(__b, __a);
7136 return __builtin_altivec_vpkuwus(__a, __b);
7142 static __inline__ vector unsigned char __ATTRS_o_ai
7143 vec_packsu(vector short __a, vector short __b) {
7144 #ifdef __LITTLE_ENDIAN__
7145 return __builtin_altivec_vpkshus(__b, __a);
7147 return __builtin_altivec_vpkshus(__a, __b);
7151 static __inline__ vector unsigned char __ATTRS_o_ai
7152 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7153 #ifdef __LITTLE_ENDIAN__
7154 return __builtin_altivec_vpkuhus(__b, __a);
7156 return __builtin_altivec_vpkuhus(__a, __b);
7160 static __inline__ vector unsigned short __ATTRS_o_ai
7161 vec_packsu(vector int __a, vector int __b) {
7162 #ifdef __LITTLE_ENDIAN__
7163 return __builtin_altivec_vpkswus(__b, __a);
7165 return __builtin_altivec_vpkswus(__a, __b);
7169 static __inline__ vector unsigned short __ATTRS_o_ai
7170 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7171 #ifdef __LITTLE_ENDIAN__
7172 return __builtin_altivec_vpkuwus(__b, __a);
7174 return __builtin_altivec_vpkuwus(__a, __b);
7178 #ifdef __POWER8_VECTOR__
7179 static __inline__ vector unsigned int __ATTRS_o_ai
7180 vec_packsu(vector long long __a, vector long long __b) {
7181 #ifdef __LITTLE_ENDIAN__
7182 return __builtin_altivec_vpksdus(__b, __a);
7184 return __builtin_altivec_vpksdus(__a, __b);
7188 static __inline__ vector unsigned int __ATTRS_o_ai
7189 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7190 #ifdef __LITTLE_ENDIAN__
7191 return __builtin_altivec_vpkudus(__b, __a);
7193 return __builtin_altivec_vpkudus(__a, __b);
7200 static __inline__ vector unsigned char __ATTRS_o_ai
7201 vec_vpkshus(vector short __a, vector short __b) {
7202 #ifdef __LITTLE_ENDIAN__
7203 return __builtin_altivec_vpkshus(__b, __a);
7205 return __builtin_altivec_vpkshus(__a, __b);
7209 static __inline__ vector unsigned char __ATTRS_o_ai
7210 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7211 #ifdef __LITTLE_ENDIAN__
7212 return __builtin_altivec_vpkuhus(__b, __a);
7214 return __builtin_altivec_vpkuhus(__a, __b);
7220 static __inline__ vector unsigned short __ATTRS_o_ai
7221 vec_vpkswus(vector int __a, vector int __b) {
7222 #ifdef __LITTLE_ENDIAN__
7223 return __builtin_altivec_vpkswus(__b, __a);
7225 return __builtin_altivec_vpkswus(__a, __b);
7229 static __inline__ vector unsigned short __ATTRS_o_ai
7230 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7231 #ifdef __LITTLE_ENDIAN__
7232 return __builtin_altivec_vpkuwus(__b, __a);
7234 return __builtin_altivec_vpkuwus(__a, __b);
7240 #ifdef __POWER8_VECTOR__
7241 static __inline__ vector unsigned int __ATTRS_o_ai
7242 vec_vpksdus(vector long long __a, vector long long __b) {
7243 #ifdef __LITTLE_ENDIAN__
7244 return __builtin_altivec_vpksdus(__b, __a);
7246 return __builtin_altivec_vpksdus(__a, __b);
7253 // The vperm instruction is defined architecturally with a big-endian bias.
7254 // For little endian, we swap the input operands and invert the permute
7255 // control vector. Only the rightmost 5 bits matter, so we could use
7256 // a vector of all 31s instead of all 255s to perform the inversion.
7257 // However, when the PCV is not a constant, using 255 has an advantage
7258 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7259 // later, possibly a vec_nand).
7261 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7262 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7263 #ifdef __LITTLE_ENDIAN__
7264 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7265 255, 255, 255, 255, 255, 255, 255, 255};
7266 __d = vec_xor(__c, __d);
7267 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7268 (vector int)__a, __d);
7270 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7271 (vector int)__b, __c);
7275 static __inline__ vector unsigned char __ATTRS_o_ai
7276 vec_perm(vector unsigned char __a, vector unsigned char __b,
7277 vector unsigned char __c) {
7278 #ifdef __LITTLE_ENDIAN__
7279 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7280 255, 255, 255, 255, 255, 255, 255, 255};
7281 __d = vec_xor(__c, __d);
7282 return (vector unsigned char)__builtin_altivec_vperm_4si(
7283 (vector int)__b, (vector int)__a, __d);
7285 return (vector unsigned char)__builtin_altivec_vperm_4si(
7286 (vector int)__a, (vector int)__b, __c);
7290 static __inline__ vector bool char __ATTRS_o_ai
7291 vec_perm(vector bool char __a, vector bool char __b, 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 bool char)__builtin_altivec_vperm_4si((vector int)__b,
7297 (vector int)__a, __d);
7299 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7300 (vector int)__b, __c);
7304 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7305 vector signed short __b,
7306 vector unsigned char __c) {
7307 #ifdef __LITTLE_ENDIAN__
7308 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7309 255, 255, 255, 255, 255, 255, 255, 255};
7310 __d = vec_xor(__c, __d);
7311 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7312 (vector int)__a, __d);
7314 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7315 (vector int)__b, __c);
7319 static __inline__ vector unsigned short __ATTRS_o_ai
7320 vec_perm(vector unsigned short __a, vector unsigned short __b,
7321 vector unsigned char __c) {
7322 #ifdef __LITTLE_ENDIAN__
7323 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7324 255, 255, 255, 255, 255, 255, 255, 255};
7325 __d = vec_xor(__c, __d);
7326 return (vector unsigned short)__builtin_altivec_vperm_4si(
7327 (vector int)__b, (vector int)__a, __d);
7329 return (vector unsigned short)__builtin_altivec_vperm_4si(
7330 (vector int)__a, (vector int)__b, __c);
7334 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7335 vector bool short __a, vector bool short __b, 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 bool short)__builtin_altivec_vperm_4si((vector int)__b,
7341 (vector int)__a, __d);
7343 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7344 (vector int)__b, __c);
7348 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7350 vector unsigned char __c) {
7351 #ifdef __LITTLE_ENDIAN__
7352 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7353 255, 255, 255, 255, 255, 255, 255, 255};
7354 __d = vec_xor(__c, __d);
7355 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7356 (vector int)__a, __d);
7358 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7359 (vector int)__b, __c);
7363 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7364 vector signed int __b,
7365 vector unsigned char __c) {
7366 #ifdef __LITTLE_ENDIAN__
7367 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7368 255, 255, 255, 255, 255, 255, 255, 255};
7369 __d = vec_xor(__c, __d);
7370 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7372 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7376 static __inline__ vector unsigned int __ATTRS_o_ai
7377 vec_perm(vector unsigned int __a, vector unsigned int __b,
7378 vector unsigned char __c) {
7379 #ifdef __LITTLE_ENDIAN__
7380 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7381 255, 255, 255, 255, 255, 255, 255, 255};
7382 __d = vec_xor(__c, __d);
7383 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7384 (vector int)__a, __d);
7386 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7387 (vector int)__b, __c);
7391 static __inline__ vector bool int __ATTRS_o_ai
7392 vec_perm(vector bool int __a, vector bool int __b, 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 bool int)__builtin_altivec_vperm_4si((vector int)__b,
7398 (vector int)__a, __d);
7400 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7401 (vector int)__b, __c);
7405 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7407 vector unsigned char __c) {
7408 #ifdef __LITTLE_ENDIAN__
7409 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7410 255, 255, 255, 255, 255, 255, 255, 255};
7411 __d = vec_xor(__c, __d);
7412 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7413 (vector int)__a, __d);
7415 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7416 (vector int)__b, __c);
7421 static __inline__ vector long long __ATTRS_o_ai
7422 vec_perm(vector signed long long __a, vector signed long long __b,
7423 vector unsigned char __c) {
7424 #ifdef __LITTLE_ENDIAN__
7425 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7426 255, 255, 255, 255, 255, 255, 255, 255};
7427 __d = vec_xor(__c, __d);
7428 return (vector signed long long)__builtin_altivec_vperm_4si(
7429 (vector int)__b, (vector int)__a, __d);
7431 return (vector signed long long)__builtin_altivec_vperm_4si(
7432 (vector int)__a, (vector int)__b, __c);
7436 static __inline__ vector unsigned long long __ATTRS_o_ai
7437 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7438 vector unsigned char __c) {
7439 #ifdef __LITTLE_ENDIAN__
7440 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7441 255, 255, 255, 255, 255, 255, 255, 255};
7442 __d = vec_xor(__c, __d);
7443 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7444 (vector int)__b, (vector int)__a, __d);
7446 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7447 (vector int)__a, (vector int)__b, __c);
7451 static __inline__ vector bool long long __ATTRS_o_ai
7452 vec_perm(vector bool long long __a, vector bool long long __b,
7453 vector unsigned char __c) {
7454 #ifdef __LITTLE_ENDIAN__
7455 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7456 255, 255, 255, 255, 255, 255, 255, 255};
7457 __d = vec_xor(__c, __d);
7458 return (vector bool long long)__builtin_altivec_vperm_4si(
7459 (vector int)__b, (vector int)__a, __d);
7461 return (vector bool long long)__builtin_altivec_vperm_4si(
7462 (vector int)__a, (vector int)__b, __c);
7466 static __inline__ vector double __ATTRS_o_ai
7467 vec_perm(vector double __a, vector double __b, 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 double)__builtin_altivec_vperm_4si((vector int)__b,
7473 (vector int)__a, __d);
7475 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7476 (vector int)__b, __c);
7483 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7484 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7485 return vec_perm(__a, __b, __c);
7488 static __inline__ vector unsigned char __ATTRS_o_ai
7489 vec_vperm(vector unsigned char __a, vector unsigned char __b,
7490 vector unsigned char __c) {
7491 return vec_perm(__a, __b, __c);
7494 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7495 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7496 return vec_perm(__a, __b, __c);
7499 static __inline__ vector short __ATTRS_o_ai
7500 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7501 return vec_perm(__a, __b, __c);
7504 static __inline__ vector unsigned short __ATTRS_o_ai
7505 vec_vperm(vector unsigned short __a, vector unsigned short __b,
7506 vector unsigned char __c) {
7507 return vec_perm(__a, __b, __c);
7510 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7511 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7512 return vec_perm(__a, __b, __c);
7515 static __inline__ vector pixel __ATTRS_o_ai
7516 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7517 return vec_perm(__a, __b, __c);
7520 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7522 vector unsigned char __c) {
7523 return vec_perm(__a, __b, __c);
7526 static __inline__ vector unsigned int __ATTRS_o_ai
7527 vec_vperm(vector unsigned int __a, vector unsigned int __b,
7528 vector unsigned char __c) {
7529 return vec_perm(__a, __b, __c);
7532 static __inline__ vector bool int __ATTRS_o_ai
7533 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7534 return vec_perm(__a, __b, __c);
7537 static __inline__ vector float __ATTRS_o_ai
7538 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7539 return vec_perm(__a, __b, __c);
7543 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7544 vector long long __a, vector long long __b, vector unsigned char __c) {
7545 return vec_perm(__a, __b, __c);
7548 static __inline__ vector unsigned long long __ATTRS_o_ai
7549 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7550 vector unsigned char __c) {
7551 return vec_perm(__a, __b, __c);
7554 static __inline__ vector double __ATTRS_o_ai
7555 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7556 return vec_perm(__a, __b, __c);
7562 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7564 return __builtin_vsx_xvresp(__a);
7566 return __builtin_altivec_vrefp(__a);
7571 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7572 return __builtin_vsx_xvredp(__a);
7578 static __inline__ vector float __attribute__((__always_inline__))
7579 vec_vrefp(vector float __a) {
7580 return __builtin_altivec_vrefp(__a);
7585 static __inline__ vector signed char __ATTRS_o_ai
7586 vec_rl(vector signed char __a, vector unsigned char __b) {
7587 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7590 static __inline__ vector unsigned char __ATTRS_o_ai
7591 vec_rl(vector unsigned char __a, vector unsigned char __b) {
7592 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7595 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7596 vector unsigned short __b) {
7597 return __builtin_altivec_vrlh(__a, __b);
7600 static __inline__ vector unsigned short __ATTRS_o_ai
7601 vec_rl(vector unsigned short __a, vector unsigned short __b) {
7602 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7605 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7606 vector unsigned int __b) {
7607 return __builtin_altivec_vrlw(__a, __b);
7610 static __inline__ vector unsigned int __ATTRS_o_ai
7611 vec_rl(vector unsigned int __a, vector unsigned int __b) {
7612 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7615 #ifdef __POWER8_VECTOR__
7616 static __inline__ vector signed long long __ATTRS_o_ai
7617 vec_rl(vector signed long long __a, vector unsigned long long __b) {
7618 return __builtin_altivec_vrld(__a, __b);
7621 static __inline__ vector unsigned long long __ATTRS_o_ai
7622 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7623 return __builtin_altivec_vrld(__a, __b);
7628 #ifdef __POWER9_VECTOR__
7629 static __inline__ vector unsigned int __ATTRS_o_ai
7630 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7631 vector unsigned int __c) {
7632 return __builtin_altivec_vrlwmi(__a, __c, __b);
7635 static __inline__ vector unsigned long long __ATTRS_o_ai
7636 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7637 vector unsigned long long __c) {
7638 return __builtin_altivec_vrldmi(__a, __c, __b);
7642 static __inline__ vector unsigned int __ATTRS_o_ai
7643 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7644 vector unsigned int __c) {
7645 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7646 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7649 static __inline__ vector unsigned long long __ATTRS_o_ai
7650 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7651 vector unsigned long long __c) {
7652 vector unsigned long long OneByte = { 0x8, 0x8 };
7653 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7659 static __inline__ vector signed char __ATTRS_o_ai
7660 vec_vrlb(vector signed char __a, vector unsigned char __b) {
7661 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7664 static __inline__ vector unsigned char __ATTRS_o_ai
7665 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7666 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7671 static __inline__ vector short __ATTRS_o_ai
7672 vec_vrlh(vector short __a, vector unsigned short __b) {
7673 return __builtin_altivec_vrlh(__a, __b);
7676 static __inline__ vector unsigned short __ATTRS_o_ai
7677 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7678 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7683 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7684 vector unsigned int __b) {
7685 return __builtin_altivec_vrlw(__a, __b);
7688 static __inline__ vector unsigned int __ATTRS_o_ai
7689 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7690 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7695 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7697 return __builtin_vsx_xvrspi(__a);
7699 return __builtin_altivec_vrfin(__a);
7704 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7705 return __builtin_vsx_xvrdpi(__a);
7710 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7711 return __builtin_vsx_xvrspic(__a);
7714 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7715 return __builtin_vsx_xvrdpic(__a);
7720 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7721 return __builtin_vsx_xvrspi(__a);
7724 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7725 return __builtin_vsx_xvrdpi(__a);
7731 static __inline__ vector float __attribute__((__always_inline__))
7732 vec_vrfin(vector float __a) {
7733 return __builtin_altivec_vrfin(__a);
7739 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7740 return __builtin_vsx_xvsqrtsp(__a);
7743 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7744 return __builtin_vsx_xvsqrtdp(__a);
7750 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7752 return __builtin_vsx_xvrsqrtesp(__a);
7754 return __builtin_altivec_vrsqrtefp(__a);
7759 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7760 return __builtin_vsx_xvrsqrtedp(__a);
7766 static __inline__ __vector float __attribute__((__always_inline__))
7767 vec_vrsqrtefp(vector float __a) {
7768 return __builtin_altivec_vrsqrtefp(__a);
7773 #define __builtin_altivec_vsel_4si vec_sel
7775 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7776 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7777 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7780 static __inline__ vector signed char __ATTRS_o_ai
7781 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7782 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7785 static __inline__ vector unsigned char __ATTRS_o_ai
7786 vec_sel(vector unsigned char __a, vector unsigned char __b,
7787 vector unsigned char __c) {
7788 return (__a & ~__c) | (__b & __c);
7791 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7792 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7793 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7796 static __inline__ vector bool char __ATTRS_o_ai
7797 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7798 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7801 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7802 vector bool char __b,
7803 vector bool char __c) {
7804 return (__a & ~__c) | (__b & __c);
7807 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7809 vector unsigned short __c) {
7810 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7813 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7815 vector bool short __c) {
7816 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7819 static __inline__ vector unsigned short __ATTRS_o_ai
7820 vec_sel(vector unsigned short __a, vector unsigned short __b,
7821 vector unsigned short __c) {
7822 return (__a & ~__c) | (__b & __c);
7825 static __inline__ vector unsigned short __ATTRS_o_ai
7826 vec_sel(vector unsigned short __a, vector unsigned short __b,
7827 vector bool short __c) {
7828 return (__a & ~(vector unsigned short)__c) |
7829 (__b & (vector unsigned short)__c);
7832 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7833 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7834 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7837 static __inline__ vector bool short __ATTRS_o_ai
7838 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7839 return (__a & ~__c) | (__b & __c);
7842 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7844 vector unsigned int __c) {
7845 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7848 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7850 vector bool int __c) {
7851 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7854 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7855 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7856 return (__a & ~__c) | (__b & __c);
7859 static __inline__ vector unsigned int __ATTRS_o_ai
7860 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7861 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7864 static __inline__ vector bool int __ATTRS_o_ai
7865 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7866 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7869 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7870 vector bool int __b,
7871 vector bool int __c) {
7872 return (__a & ~__c) | (__b & __c);
7875 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7877 vector unsigned int __c) {
7878 vector int __res = ((vector int)__a & ~(vector int)__c) |
7879 ((vector int)__b & (vector int)__c);
7880 return (vector float)__res;
7883 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7885 vector bool int __c) {
7886 vector int __res = ((vector int)__a & ~(vector int)__c) |
7887 ((vector int)__b & (vector int)__c);
7888 return (vector float)__res;
7892 static __inline__ vector double __ATTRS_o_ai
7893 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7894 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7895 ((vector long long)__b & (vector long long)__c);
7896 return (vector double)__res;
7899 static __inline__ vector double __ATTRS_o_ai
7900 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7901 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7902 ((vector long long)__b & (vector long long)__c);
7903 return (vector double)__res;
7909 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7910 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7911 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7914 static __inline__ vector signed char __ATTRS_o_ai
7915 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7916 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7919 static __inline__ vector unsigned char __ATTRS_o_ai
7920 vec_vsel(vector unsigned char __a, vector unsigned char __b,
7921 vector unsigned char __c) {
7922 return (__a & ~__c) | (__b & __c);
7925 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7926 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7927 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7930 static __inline__ vector bool char __ATTRS_o_ai
7931 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7932 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7935 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7936 vector bool char __b,
7937 vector bool char __c) {
7938 return (__a & ~__c) | (__b & __c);
7941 static __inline__ vector short __ATTRS_o_ai
7942 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
7943 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7946 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
7948 vector bool short __c) {
7949 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7952 static __inline__ vector unsigned short __ATTRS_o_ai
7953 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7954 vector unsigned short __c) {
7955 return (__a & ~__c) | (__b & __c);
7958 static __inline__ vector unsigned short __ATTRS_o_ai
7959 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7960 vector bool short __c) {
7961 return (__a & ~(vector unsigned short)__c) |
7962 (__b & (vector unsigned short)__c);
7965 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
7966 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7967 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7970 static __inline__ vector bool short __ATTRS_o_ai
7971 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
7972 return (__a & ~__c) | (__b & __c);
7975 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7977 vector unsigned int __c) {
7978 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7981 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7983 vector bool int __c) {
7984 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7987 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
7988 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7989 return (__a & ~__c) | (__b & __c);
7992 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
7993 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7994 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7997 static __inline__ vector bool int __ATTRS_o_ai
7998 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7999 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8002 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8003 vector bool int __b,
8004 vector bool int __c) {
8005 return (__a & ~__c) | (__b & __c);
8008 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8010 vector unsigned int __c) {
8011 vector int __res = ((vector int)__a & ~(vector int)__c) |
8012 ((vector int)__b & (vector int)__c);
8013 return (vector float)__res;
8016 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8018 vector bool int __c) {
8019 vector int __res = ((vector int)__a & ~(vector int)__c) |
8020 ((vector int)__b & (vector int)__c);
8021 return (vector float)__res;
8026 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8027 // than the length of __a.
8028 static __inline__ vector unsigned char __ATTRS_o_ai
8029 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8030 return __a << (__b %
8031 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8034 static __inline__ vector signed char __ATTRS_o_ai
8035 vec_sl(vector signed char __a, vector unsigned char __b) {
8036 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8039 static __inline__ vector unsigned short __ATTRS_o_ai
8040 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8041 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8045 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8046 vector unsigned short __b) {
8047 return (vector short)vec_sl((vector unsigned short)__a, __b);
8050 static __inline__ vector unsigned int __ATTRS_o_ai
8051 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8052 return __a << (__b %
8053 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8056 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8057 vector unsigned int __b) {
8058 return (vector int)vec_sl((vector unsigned int)__a, __b);
8061 #ifdef __POWER8_VECTOR__
8062 static __inline__ vector unsigned long long __ATTRS_o_ai
8063 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8064 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8068 static __inline__ vector long long __ATTRS_o_ai
8069 vec_sl(vector long long __a, vector unsigned long long __b) {
8070 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8076 #define __builtin_altivec_vslb vec_vslb
8078 static __inline__ vector signed char __ATTRS_o_ai
8079 vec_vslb(vector signed char __a, vector unsigned char __b) {
8080 return vec_sl(__a, __b);
8083 static __inline__ vector unsigned char __ATTRS_o_ai
8084 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8085 return vec_sl(__a, __b);
8090 #define __builtin_altivec_vslh vec_vslh
8092 static __inline__ vector short __ATTRS_o_ai
8093 vec_vslh(vector short __a, vector unsigned short __b) {
8094 return vec_sl(__a, __b);
8097 static __inline__ vector unsigned short __ATTRS_o_ai
8098 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8099 return vec_sl(__a, __b);
8104 #define __builtin_altivec_vslw vec_vslw
8106 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8107 vector unsigned int __b) {
8108 return vec_sl(__a, __b);
8111 static __inline__ vector unsigned int __ATTRS_o_ai
8112 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8113 return vec_sl(__a, __b);
8118 #define __builtin_altivec_vsldoi_4si vec_sld
8120 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8121 vector signed char __a, vector signed char __b, unsigned const int __c) {
8122 unsigned char __d = __c & 0x0F;
8123 #ifdef __LITTLE_ENDIAN__
8125 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8126 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8127 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8128 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8132 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8133 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8134 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8138 static __inline__ vector unsigned char __ATTRS_o_ai
8139 vec_sld(vector unsigned char __a, vector unsigned char __b,
8140 unsigned const int __c) {
8141 unsigned char __d = __c & 0x0F;
8142 #ifdef __LITTLE_ENDIAN__
8144 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8145 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8146 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8147 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8151 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8152 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8153 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8157 static __inline__ vector bool char __ATTRS_o_ai
8158 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8159 unsigned char __d = __c & 0x0F;
8160 #ifdef __LITTLE_ENDIAN__
8162 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8163 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8164 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8165 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8169 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8170 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8171 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8175 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8176 vector signed short __a, vector signed short __b, unsigned const int __c) {
8177 unsigned char __d = __c & 0x0F;
8178 #ifdef __LITTLE_ENDIAN__
8180 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8181 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8182 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8183 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8187 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8188 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8189 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8193 static __inline__ vector unsigned short __ATTRS_o_ai
8194 vec_sld(vector unsigned short __a, vector unsigned short __b,
8195 unsigned const int __c) {
8196 unsigned char __d = __c & 0x0F;
8197 #ifdef __LITTLE_ENDIAN__
8199 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8200 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8201 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8202 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8206 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8207 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8208 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8212 static __inline__ vector bool short __ATTRS_o_ai
8213 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8214 unsigned char __d = __c & 0x0F;
8215 #ifdef __LITTLE_ENDIAN__
8217 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8218 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8219 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8220 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8224 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8225 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8226 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8230 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8232 unsigned const int __c) {
8233 unsigned char __d = __c & 0x0F;
8234 #ifdef __LITTLE_ENDIAN__
8236 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8237 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8238 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8239 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8243 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8244 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8245 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8249 static __inline__ vector signed int __ATTRS_o_ai
8250 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
8251 unsigned char __d = __c & 0x0F;
8252 #ifdef __LITTLE_ENDIAN__
8254 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8255 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8256 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8257 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8261 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8262 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8263 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8267 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8268 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8269 unsigned char __d = __c & 0x0F;
8270 #ifdef __LITTLE_ENDIAN__
8272 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8273 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8274 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8275 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8279 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8280 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8281 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8285 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8286 vector bool int __b,
8287 unsigned const int __c) {
8288 unsigned char __d = __c & 0x0F;
8289 #ifdef __LITTLE_ENDIAN__
8291 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8292 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8293 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8294 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8298 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8299 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8300 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8304 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8306 unsigned const int __c) {
8307 unsigned char __d = __c & 0x0F;
8308 #ifdef __LITTLE_ENDIAN__
8310 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8311 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8312 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8313 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8317 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8318 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8319 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8324 static __inline__ vector bool long long __ATTRS_o_ai
8325 vec_sld(vector bool long long __a, vector bool long long __b,
8326 unsigned const int __c) {
8327 unsigned char __d = __c & 0x0F;
8328 #ifdef __LITTLE_ENDIAN__
8330 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8331 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8332 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8333 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8337 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8338 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8339 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8343 static __inline__ vector signed long long __ATTRS_o_ai
8344 vec_sld(vector signed long long __a, vector signed long long __b,
8345 unsigned const int __c) {
8346 unsigned char __d = __c & 0x0F;
8347 #ifdef __LITTLE_ENDIAN__
8349 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8350 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8351 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8352 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8356 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8357 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8358 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8362 static __inline__ vector unsigned long long __ATTRS_o_ai
8363 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8364 unsigned const int __c) {
8365 unsigned char __d = __c & 0x0F;
8366 #ifdef __LITTLE_ENDIAN__
8368 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8369 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8370 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8371 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8375 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8376 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8377 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8381 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8383 unsigned const int __c) {
8384 unsigned char __d = __c & 0x0F;
8385 #ifdef __LITTLE_ENDIAN__
8387 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8388 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8389 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8390 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8394 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8395 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8396 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8402 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8403 vector signed char __a, vector signed char __b, unsigned const int __c) {
8404 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8407 static __inline__ vector unsigned char __ATTRS_o_ai
8408 vec_sldw(vector unsigned char __a, vector unsigned char __b,
8409 unsigned const int __c) {
8410 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8413 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8414 vector signed short __a, vector signed short __b, unsigned const int __c) {
8415 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8418 static __inline__ vector unsigned short __ATTRS_o_ai
8419 vec_sldw(vector unsigned short __a, vector unsigned short __b,
8420 unsigned const int __c) {
8421 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8424 static __inline__ vector signed int __ATTRS_o_ai
8425 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8426 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8429 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8430 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8431 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8435 static __inline__ vector signed long long __ATTRS_o_ai
8436 vec_sldw(vector signed long long __a, vector signed long long __b,
8437 unsigned const int __c) {
8438 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8441 static __inline__ vector unsigned long long __ATTRS_o_ai
8442 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8443 unsigned const int __c) {
8444 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8448 #ifdef __POWER9_VECTOR__
8450 static __inline__ vector unsigned char __ATTRS_o_ai
8451 vec_slv(vector unsigned char __a, vector unsigned char __b) {
8452 return __builtin_altivec_vslv(__a, __b);
8456 static __inline__ vector unsigned char __ATTRS_o_ai
8457 vec_srv(vector unsigned char __a, vector unsigned char __b) {
8458 return __builtin_altivec_vsrv(__a, __b);
8464 static __inline__ vector signed char __ATTRS_o_ai
8465 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8466 unsigned char __d = __c & 0x0F;
8467 #ifdef __LITTLE_ENDIAN__
8469 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8470 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8471 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8472 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8476 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8477 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8478 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8482 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8483 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
8484 unsigned char __d = __c & 0x0F;
8485 #ifdef __LITTLE_ENDIAN__
8487 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8488 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8489 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8490 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8494 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8495 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8496 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8500 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
8502 unsigned char __c) {
8503 unsigned char __d = __c & 0x0F;
8504 #ifdef __LITTLE_ENDIAN__
8506 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8507 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8508 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8509 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8513 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8514 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8515 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8519 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
8520 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
8521 unsigned char __d = __c & 0x0F;
8522 #ifdef __LITTLE_ENDIAN__
8524 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8525 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8526 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8527 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8531 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8532 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8533 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8537 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
8539 unsigned char __c) {
8540 unsigned char __d = __c & 0x0F;
8541 #ifdef __LITTLE_ENDIAN__
8543 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8544 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8545 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8546 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8550 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8551 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8552 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8556 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8558 unsigned char __c) {
8559 unsigned char __d = __c & 0x0F;
8560 #ifdef __LITTLE_ENDIAN__
8562 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8563 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8564 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8565 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8569 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8570 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8571 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8575 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8576 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8577 unsigned char __d = __c & 0x0F;
8578 #ifdef __LITTLE_ENDIAN__
8580 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8581 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8582 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8583 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8587 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8588 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8589 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8593 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8595 unsigned char __c) {
8596 unsigned char __d = __c & 0x0F;
8597 #ifdef __LITTLE_ENDIAN__
8599 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8600 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8601 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8602 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8606 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8607 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8608 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8614 static __inline__ vector signed char __ATTRS_o_ai
8615 vec_sll(vector signed char __a, vector unsigned char __b) {
8616 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8620 static __inline__ vector signed char __ATTRS_o_ai
8621 vec_sll(vector signed char __a, vector unsigned short __b) {
8622 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8626 static __inline__ vector signed char __ATTRS_o_ai
8627 vec_sll(vector signed char __a, vector unsigned int __b) {
8628 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8632 static __inline__ vector unsigned char __ATTRS_o_ai
8633 vec_sll(vector unsigned char __a, vector unsigned char __b) {
8634 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8638 static __inline__ vector unsigned char __ATTRS_o_ai
8639 vec_sll(vector unsigned char __a, vector unsigned short __b) {
8640 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8644 static __inline__ vector unsigned char __ATTRS_o_ai
8645 vec_sll(vector unsigned char __a, vector unsigned int __b) {
8646 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8650 static __inline__ vector bool char __ATTRS_o_ai
8651 vec_sll(vector bool char __a, vector unsigned char __b) {
8652 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8656 static __inline__ vector bool char __ATTRS_o_ai
8657 vec_sll(vector bool char __a, vector unsigned short __b) {
8658 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8662 static __inline__ vector bool char __ATTRS_o_ai
8663 vec_sll(vector bool char __a, vector unsigned int __b) {
8664 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8668 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8669 vector unsigned char __b) {
8670 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8673 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8674 vector unsigned short __b) {
8675 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8678 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8679 vector unsigned int __b) {
8680 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8683 static __inline__ vector unsigned short __ATTRS_o_ai
8684 vec_sll(vector unsigned short __a, vector unsigned char __b) {
8685 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8689 static __inline__ vector unsigned short __ATTRS_o_ai
8690 vec_sll(vector unsigned short __a, vector unsigned short __b) {
8691 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8695 static __inline__ vector unsigned short __ATTRS_o_ai
8696 vec_sll(vector unsigned short __a, vector unsigned int __b) {
8697 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8701 static __inline__ vector bool short __ATTRS_o_ai
8702 vec_sll(vector bool short __a, vector unsigned char __b) {
8703 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8707 static __inline__ vector bool short __ATTRS_o_ai
8708 vec_sll(vector bool short __a, vector unsigned short __b) {
8709 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8713 static __inline__ vector bool short __ATTRS_o_ai
8714 vec_sll(vector bool short __a, vector unsigned int __b) {
8715 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8719 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8720 vector unsigned char __b) {
8721 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8724 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8725 vector unsigned short __b) {
8726 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8729 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8730 vector unsigned int __b) {
8731 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8734 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8735 vector unsigned char __b) {
8736 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8739 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8740 vector unsigned short __b) {
8741 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8744 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8745 vector unsigned int __b) {
8746 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8749 static __inline__ vector unsigned int __ATTRS_o_ai
8750 vec_sll(vector unsigned int __a, vector unsigned char __b) {
8751 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8755 static __inline__ vector unsigned int __ATTRS_o_ai
8756 vec_sll(vector unsigned int __a, vector unsigned short __b) {
8757 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8761 static __inline__ vector unsigned int __ATTRS_o_ai
8762 vec_sll(vector unsigned int __a, vector unsigned int __b) {
8763 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8767 static __inline__ vector bool int __ATTRS_o_ai
8768 vec_sll(vector bool int __a, vector unsigned char __b) {
8769 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8773 static __inline__ vector bool int __ATTRS_o_ai
8774 vec_sll(vector bool int __a, vector unsigned short __b) {
8775 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8779 static __inline__ vector bool int __ATTRS_o_ai
8780 vec_sll(vector bool int __a, vector unsigned int __b) {
8781 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8786 static __inline__ vector signed long long __ATTRS_o_ai
8787 vec_sll(vector signed long long __a, vector unsigned char __b) {
8788 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8792 static __inline__ vector unsigned long long __ATTRS_o_ai
8793 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8794 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8801 static __inline__ vector signed char __ATTRS_o_ai
8802 vec_vsl(vector signed char __a, vector unsigned char __b) {
8803 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8807 static __inline__ vector signed char __ATTRS_o_ai
8808 vec_vsl(vector signed char __a, vector unsigned short __b) {
8809 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8813 static __inline__ vector signed char __ATTRS_o_ai
8814 vec_vsl(vector signed char __a, vector unsigned int __b) {
8815 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8819 static __inline__ vector unsigned char __ATTRS_o_ai
8820 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8821 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8825 static __inline__ vector unsigned char __ATTRS_o_ai
8826 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8827 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8831 static __inline__ vector unsigned char __ATTRS_o_ai
8832 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8833 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8837 static __inline__ vector bool char __ATTRS_o_ai
8838 vec_vsl(vector bool char __a, vector unsigned char __b) {
8839 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8843 static __inline__ vector bool char __ATTRS_o_ai
8844 vec_vsl(vector bool char __a, vector unsigned short __b) {
8845 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8849 static __inline__ vector bool char __ATTRS_o_ai
8850 vec_vsl(vector bool char __a, vector unsigned int __b) {
8851 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8855 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8856 vector unsigned char __b) {
8857 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8860 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8861 vector unsigned short __b) {
8862 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8865 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8866 vector unsigned int __b) {
8867 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8870 static __inline__ vector unsigned short __ATTRS_o_ai
8871 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8872 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8876 static __inline__ vector unsigned short __ATTRS_o_ai
8877 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8878 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8882 static __inline__ vector unsigned short __ATTRS_o_ai
8883 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8884 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8888 static __inline__ vector bool short __ATTRS_o_ai
8889 vec_vsl(vector bool short __a, vector unsigned char __b) {
8890 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8894 static __inline__ vector bool short __ATTRS_o_ai
8895 vec_vsl(vector bool short __a, vector unsigned short __b) {
8896 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8900 static __inline__ vector bool short __ATTRS_o_ai
8901 vec_vsl(vector bool short __a, vector unsigned int __b) {
8902 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8906 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8907 vector unsigned char __b) {
8908 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8911 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8912 vector unsigned short __b) {
8913 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8916 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8917 vector unsigned int __b) {
8918 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8921 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8922 vector unsigned char __b) {
8923 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8926 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8927 vector unsigned short __b) {
8928 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8931 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8932 vector unsigned int __b) {
8933 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8936 static __inline__ vector unsigned int __ATTRS_o_ai
8937 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8938 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8942 static __inline__ vector unsigned int __ATTRS_o_ai
8943 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
8944 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8948 static __inline__ vector unsigned int __ATTRS_o_ai
8949 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
8950 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8954 static __inline__ vector bool int __ATTRS_o_ai
8955 vec_vsl(vector bool int __a, vector unsigned char __b) {
8956 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8960 static __inline__ vector bool int __ATTRS_o_ai
8961 vec_vsl(vector bool int __a, vector unsigned short __b) {
8962 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8966 static __inline__ vector bool int __ATTRS_o_ai
8967 vec_vsl(vector bool int __a, vector unsigned int __b) {
8968 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8974 static __inline__ vector signed char __ATTRS_o_ai
8975 vec_slo(vector signed char __a, vector signed char __b) {
8976 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8980 static __inline__ vector signed char __ATTRS_o_ai
8981 vec_slo(vector signed char __a, vector unsigned char __b) {
8982 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8986 static __inline__ vector unsigned char __ATTRS_o_ai
8987 vec_slo(vector unsigned char __a, vector signed char __b) {
8988 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
8992 static __inline__ vector unsigned char __ATTRS_o_ai
8993 vec_slo(vector unsigned char __a, vector unsigned char __b) {
8994 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
8998 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
8999 vector signed char __b) {
9000 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9003 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9004 vector unsigned char __b) {
9005 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9008 static __inline__ vector unsigned short __ATTRS_o_ai
9009 vec_slo(vector unsigned short __a, vector signed char __b) {
9010 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9014 static __inline__ vector unsigned short __ATTRS_o_ai
9015 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9016 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9020 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9021 vector signed char __b) {
9022 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9025 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9026 vector unsigned char __b) {
9027 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9030 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9031 vector signed char __b) {
9032 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9035 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9036 vector unsigned char __b) {
9037 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9040 static __inline__ vector unsigned int __ATTRS_o_ai
9041 vec_slo(vector unsigned int __a, vector signed char __b) {
9042 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9046 static __inline__ vector unsigned int __ATTRS_o_ai
9047 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9048 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9052 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9053 vector signed char __b) {
9054 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9057 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9058 vector unsigned char __b) {
9059 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9063 static __inline__ vector signed long long __ATTRS_o_ai
9064 vec_slo(vector signed long long __a, vector signed char __b) {
9065 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9069 static __inline__ vector signed long long __ATTRS_o_ai
9070 vec_slo(vector signed long long __a, vector unsigned char __b) {
9071 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9075 static __inline__ vector unsigned long long __ATTRS_o_ai
9076 vec_slo(vector unsigned long long __a, vector signed char __b) {
9077 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9081 static __inline__ vector unsigned long long __ATTRS_o_ai
9082 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9083 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9090 static __inline__ vector signed char __ATTRS_o_ai
9091 vec_vslo(vector signed char __a, vector signed char __b) {
9092 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9096 static __inline__ vector signed char __ATTRS_o_ai
9097 vec_vslo(vector signed char __a, vector unsigned char __b) {
9098 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9102 static __inline__ vector unsigned char __ATTRS_o_ai
9103 vec_vslo(vector unsigned char __a, vector signed char __b) {
9104 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9108 static __inline__ vector unsigned char __ATTRS_o_ai
9109 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9110 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9114 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9115 vector signed char __b) {
9116 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9119 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9120 vector unsigned char __b) {
9121 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9124 static __inline__ vector unsigned short __ATTRS_o_ai
9125 vec_vslo(vector unsigned short __a, vector signed char __b) {
9126 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9130 static __inline__ vector unsigned short __ATTRS_o_ai
9131 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9132 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9136 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9137 vector signed char __b) {
9138 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9141 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9142 vector unsigned char __b) {
9143 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9146 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9147 vector signed char __b) {
9148 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9151 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9152 vector unsigned char __b) {
9153 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9156 static __inline__ vector unsigned int __ATTRS_o_ai
9157 vec_vslo(vector unsigned int __a, vector signed char __b) {
9158 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9162 static __inline__ vector unsigned int __ATTRS_o_ai
9163 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9164 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9168 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9169 vector signed char __b) {
9170 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9173 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9174 vector unsigned char __b) {
9175 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9180 static __inline__ vector signed char __ATTRS_o_ai
9181 vec_splat(vector signed char __a, unsigned const int __b) {
9182 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9185 static __inline__ vector unsigned char __ATTRS_o_ai
9186 vec_splat(vector unsigned char __a, unsigned const int __b) {
9187 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9190 static __inline__ vector bool char __ATTRS_o_ai
9191 vec_splat(vector bool char __a, unsigned const int __b) {
9192 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9195 static __inline__ vector signed short __ATTRS_o_ai
9196 vec_splat(vector signed short __a, unsigned const int __b) {
9197 unsigned char b0 = (__b & 0x07) * 2;
9198 unsigned char b1 = b0 + 1;
9199 return vec_perm(__a, __a,
9200 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9201 b0, b1, b0, b1, b0, b1));
9204 static __inline__ vector unsigned short __ATTRS_o_ai
9205 vec_splat(vector unsigned short __a, unsigned const int __b) {
9206 unsigned char b0 = (__b & 0x07) * 2;
9207 unsigned char b1 = b0 + 1;
9208 return vec_perm(__a, __a,
9209 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9210 b0, b1, b0, b1, b0, b1));
9213 static __inline__ vector bool short __ATTRS_o_ai
9214 vec_splat(vector bool short __a, unsigned const int __b) {
9215 unsigned char b0 = (__b & 0x07) * 2;
9216 unsigned char b1 = b0 + 1;
9217 return vec_perm(__a, __a,
9218 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9219 b0, b1, b0, b1, b0, b1));
9222 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9223 unsigned const int __b) {
9224 unsigned char b0 = (__b & 0x07) * 2;
9225 unsigned char b1 = b0 + 1;
9226 return vec_perm(__a, __a,
9227 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9228 b0, b1, b0, b1, b0, b1));
9231 static __inline__ vector signed int __ATTRS_o_ai
9232 vec_splat(vector signed int __a, unsigned const int __b) {
9233 unsigned char b0 = (__b & 0x03) * 4;
9234 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9235 return vec_perm(__a, __a,
9236 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9237 b2, b3, b0, b1, b2, b3));
9240 static __inline__ vector unsigned int __ATTRS_o_ai
9241 vec_splat(vector unsigned int __a, unsigned const int __b) {
9242 unsigned char b0 = (__b & 0x03) * 4;
9243 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9244 return vec_perm(__a, __a,
9245 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9246 b2, b3, b0, b1, b2, b3));
9249 static __inline__ vector bool int __ATTRS_o_ai
9250 vec_splat(vector bool int __a, unsigned const int __b) {
9251 unsigned char b0 = (__b & 0x03) * 4;
9252 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9253 return vec_perm(__a, __a,
9254 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9255 b2, b3, b0, b1, b2, b3));
9258 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9259 unsigned const int __b) {
9260 unsigned char b0 = (__b & 0x03) * 4;
9261 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9262 return vec_perm(__a, __a,
9263 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9264 b2, b3, b0, b1, b2, b3));
9268 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9269 unsigned const int __b) {
9270 unsigned char b0 = (__b & 0x01) * 8;
9271 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9272 b6 = b0 + 6, b7 = b0 + 7;
9273 return vec_perm(__a, __a,
9274 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9275 b2, b3, b4, b5, b6, b7));
9277 static __inline__ vector bool long long __ATTRS_o_ai
9278 vec_splat(vector bool long long __a, unsigned const int __b) {
9279 unsigned char b0 = (__b & 0x01) * 8;
9280 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9281 b6 = b0 + 6, b7 = b0 + 7;
9282 return vec_perm(__a, __a,
9283 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9284 b2, b3, b4, b5, b6, b7));
9286 static __inline__ vector signed long long __ATTRS_o_ai
9287 vec_splat(vector signed long long __a, unsigned const int __b) {
9288 unsigned char b0 = (__b & 0x01) * 8;
9289 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9290 b6 = b0 + 6, b7 = b0 + 7;
9291 return vec_perm(__a, __a,
9292 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9293 b2, b3, b4, b5, b6, b7));
9295 static __inline__ vector unsigned long long __ATTRS_o_ai
9296 vec_splat(vector unsigned long long __a, unsigned const int __b) {
9297 unsigned char b0 = (__b & 0x01) * 8;
9298 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9299 b6 = b0 + 6, b7 = b0 + 7;
9300 return vec_perm(__a, __a,
9301 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9302 b2, b3, b4, b5, b6, b7));
9308 #define __builtin_altivec_vspltb vec_vspltb
9310 static __inline__ vector signed char __ATTRS_o_ai
9311 vec_vspltb(vector signed char __a, unsigned char __b) {
9312 return vec_perm(__a, __a, (vector unsigned char)(__b));
9315 static __inline__ vector unsigned char __ATTRS_o_ai
9316 vec_vspltb(vector unsigned char __a, unsigned char __b) {
9317 return vec_perm(__a, __a, (vector unsigned char)(__b));
9320 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9321 unsigned char __b) {
9322 return vec_perm(__a, __a, (vector unsigned char)(__b));
9327 #define __builtin_altivec_vsplth vec_vsplth
9329 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9330 unsigned char __b) {
9332 unsigned char b1 = __b + 1;
9333 return vec_perm(__a, __a,
9334 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9335 __b, b1, __b, b1, __b, b1, __b, b1));
9338 static __inline__ vector unsigned short __ATTRS_o_ai
9339 vec_vsplth(vector unsigned short __a, unsigned char __b) {
9341 unsigned char b1 = __b + 1;
9342 return vec_perm(__a, __a,
9343 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9344 __b, b1, __b, b1, __b, b1, __b, b1));
9347 static __inline__ vector bool short __ATTRS_o_ai
9348 vec_vsplth(vector bool short __a, unsigned char __b) {
9350 unsigned char b1 = __b + 1;
9351 return vec_perm(__a, __a,
9352 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9353 __b, b1, __b, b1, __b, b1, __b, b1));
9356 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9357 unsigned char __b) {
9359 unsigned char b1 = __b + 1;
9360 return vec_perm(__a, __a,
9361 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9362 __b, b1, __b, b1, __b, b1, __b, b1));
9367 #define __builtin_altivec_vspltw vec_vspltw
9369 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9370 unsigned char __b) {
9372 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9373 return vec_perm(__a, __a,
9374 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9375 b1, b2, b3, __b, b1, b2, b3));
9378 static __inline__ vector unsigned int __ATTRS_o_ai
9379 vec_vspltw(vector unsigned int __a, unsigned char __b) {
9381 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9382 return vec_perm(__a, __a,
9383 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9384 b1, b2, b3, __b, b1, b2, b3));
9387 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9388 unsigned char __b) {
9390 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9391 return vec_perm(__a, __a,
9392 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9393 b1, b2, b3, __b, b1, b2, b3));
9396 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9397 unsigned char __b) {
9399 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9400 return vec_perm(__a, __a,
9401 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9402 b1, b2, b3, __b, b1, b2, b3));
9407 #define __builtin_altivec_vspltisb vec_splat_s8
9409 // FIXME: parameter should be treated as 5-bit signed literal
9410 static __inline__ vector signed char __ATTRS_o_ai
9411 vec_splat_s8(signed char __a) {
9412 return (vector signed char)(__a);
9417 // FIXME: parameter should be treated as 5-bit signed literal
9418 static __inline__ vector signed char __ATTRS_o_ai
9419 vec_vspltisb(signed char __a) {
9420 return (vector signed char)(__a);
9425 #define __builtin_altivec_vspltish vec_splat_s16
9427 // FIXME: parameter should be treated as 5-bit signed literal
9428 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9429 return (vector short)(__a);
9434 // FIXME: parameter should be treated as 5-bit signed literal
9435 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9436 return (vector short)(__a);
9441 #define __builtin_altivec_vspltisw vec_splat_s32
9443 // FIXME: parameter should be treated as 5-bit signed literal
9444 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9445 return (vector int)(__a);
9450 // FIXME: parameter should be treated as 5-bit signed literal
9451 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9452 return (vector int)(__a);
9457 // FIXME: parameter should be treated as 5-bit signed literal
9458 static __inline__ vector unsigned char __ATTRS_o_ai
9459 vec_splat_u8(unsigned char __a) {
9460 return (vector unsigned char)(__a);
9465 // FIXME: parameter should be treated as 5-bit signed literal
9466 static __inline__ vector unsigned short __ATTRS_o_ai
9467 vec_splat_u16(signed char __a) {
9468 return (vector unsigned short)(__a);
9473 // FIXME: parameter should be treated as 5-bit signed literal
9474 static __inline__ vector unsigned int __ATTRS_o_ai
9475 vec_splat_u32(signed char __a) {
9476 return (vector unsigned int)(__a);
9481 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
9482 // than the length of __a.
9483 static __inline__ vector unsigned char __ATTRS_o_ai
9484 vec_sr(vector unsigned char __a, vector unsigned char __b) {
9486 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
9489 static __inline__ vector signed char __ATTRS_o_ai
9490 vec_sr(vector signed char __a, vector unsigned char __b) {
9491 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
9494 static __inline__ vector unsigned short __ATTRS_o_ai
9495 vec_sr(vector unsigned short __a, vector unsigned short __b) {
9497 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
9500 static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
9501 vector unsigned short __b) {
9502 return (vector short)vec_sr((vector unsigned short)__a, __b);
9505 static __inline__ vector unsigned int __ATTRS_o_ai
9506 vec_sr(vector unsigned int __a, vector unsigned int __b) {
9508 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
9511 static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
9512 vector unsigned int __b) {
9513 return (vector int)vec_sr((vector unsigned int)__a, __b);
9516 #ifdef __POWER8_VECTOR__
9517 static __inline__ vector unsigned long long __ATTRS_o_ai
9518 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9519 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
9523 static __inline__ vector long long __ATTRS_o_ai
9524 vec_sr(vector long long __a, vector unsigned long long __b) {
9525 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9531 #define __builtin_altivec_vsrb vec_vsrb
9533 static __inline__ vector signed char __ATTRS_o_ai
9534 vec_vsrb(vector signed char __a, vector unsigned char __b) {
9535 return vec_sr(__a, __b);
9538 static __inline__ vector unsigned char __ATTRS_o_ai
9539 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9540 return vec_sr(__a, __b);
9545 #define __builtin_altivec_vsrh vec_vsrh
9547 static __inline__ vector short __ATTRS_o_ai
9548 vec_vsrh(vector short __a, vector unsigned short __b) {
9549 return vec_sr(__a, __b);
9552 static __inline__ vector unsigned short __ATTRS_o_ai
9553 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9554 return vec_sr(__a, __b);
9559 #define __builtin_altivec_vsrw vec_vsrw
9561 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9562 vector unsigned int __b) {
9563 return vec_sr(__a, __b);
9566 static __inline__ vector unsigned int __ATTRS_o_ai
9567 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9568 return vec_sr(__a, __b);
9573 static __inline__ vector signed char __ATTRS_o_ai
9574 vec_sra(vector signed char __a, vector unsigned char __b) {
9575 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9578 static __inline__ vector unsigned char __ATTRS_o_ai
9579 vec_sra(vector unsigned char __a, vector unsigned char __b) {
9580 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9583 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9584 vector unsigned short __b) {
9585 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9588 static __inline__ vector unsigned short __ATTRS_o_ai
9589 vec_sra(vector unsigned short __a, vector unsigned short __b) {
9590 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9593 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9594 vector unsigned int __b) {
9595 return __builtin_altivec_vsraw(__a, __b);
9598 static __inline__ vector unsigned int __ATTRS_o_ai
9599 vec_sra(vector unsigned int __a, vector unsigned int __b) {
9600 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9603 #ifdef __POWER8_VECTOR__
9604 static __inline__ vector signed long long __ATTRS_o_ai
9605 vec_sra(vector signed long long __a, vector unsigned long long __b) {
9609 static __inline__ vector unsigned long long __ATTRS_o_ai
9610 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9611 return (vector unsigned long long)((vector signed long long)__a >> __b);
9617 static __inline__ vector signed char __ATTRS_o_ai
9618 vec_vsrab(vector signed char __a, vector unsigned char __b) {
9619 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9622 static __inline__ vector unsigned char __ATTRS_o_ai
9623 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9624 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9629 static __inline__ vector short __ATTRS_o_ai
9630 vec_vsrah(vector short __a, vector unsigned short __b) {
9631 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9634 static __inline__ vector unsigned short __ATTRS_o_ai
9635 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9636 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9641 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9642 vector unsigned int __b) {
9643 return __builtin_altivec_vsraw(__a, __b);
9646 static __inline__ vector unsigned int __ATTRS_o_ai
9647 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9648 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9653 static __inline__ vector signed char __ATTRS_o_ai
9654 vec_srl(vector signed char __a, vector unsigned char __b) {
9655 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9659 static __inline__ vector signed char __ATTRS_o_ai
9660 vec_srl(vector signed char __a, vector unsigned short __b) {
9661 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9665 static __inline__ vector signed char __ATTRS_o_ai
9666 vec_srl(vector signed char __a, vector unsigned int __b) {
9667 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9671 static __inline__ vector unsigned char __ATTRS_o_ai
9672 vec_srl(vector unsigned char __a, vector unsigned char __b) {
9673 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9677 static __inline__ vector unsigned char __ATTRS_o_ai
9678 vec_srl(vector unsigned char __a, vector unsigned short __b) {
9679 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9683 static __inline__ vector unsigned char __ATTRS_o_ai
9684 vec_srl(vector unsigned char __a, vector unsigned int __b) {
9685 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9689 static __inline__ vector bool char __ATTRS_o_ai
9690 vec_srl(vector bool char __a, vector unsigned char __b) {
9691 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9695 static __inline__ vector bool char __ATTRS_o_ai
9696 vec_srl(vector bool char __a, vector unsigned short __b) {
9697 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9701 static __inline__ vector bool char __ATTRS_o_ai
9702 vec_srl(vector bool char __a, vector unsigned int __b) {
9703 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9707 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9708 vector unsigned char __b) {
9709 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9712 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9713 vector unsigned short __b) {
9714 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9717 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9718 vector unsigned int __b) {
9719 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9722 static __inline__ vector unsigned short __ATTRS_o_ai
9723 vec_srl(vector unsigned short __a, vector unsigned char __b) {
9724 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9728 static __inline__ vector unsigned short __ATTRS_o_ai
9729 vec_srl(vector unsigned short __a, vector unsigned short __b) {
9730 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9734 static __inline__ vector unsigned short __ATTRS_o_ai
9735 vec_srl(vector unsigned short __a, vector unsigned int __b) {
9736 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9740 static __inline__ vector bool short __ATTRS_o_ai
9741 vec_srl(vector bool short __a, vector unsigned char __b) {
9742 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9746 static __inline__ vector bool short __ATTRS_o_ai
9747 vec_srl(vector bool short __a, vector unsigned short __b) {
9748 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9752 static __inline__ vector bool short __ATTRS_o_ai
9753 vec_srl(vector bool short __a, vector unsigned int __b) {
9754 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9758 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9759 vector unsigned char __b) {
9760 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9763 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9764 vector unsigned short __b) {
9765 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9768 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9769 vector unsigned int __b) {
9770 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9773 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9774 vector unsigned char __b) {
9775 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9778 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9779 vector unsigned short __b) {
9780 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9783 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9784 vector unsigned int __b) {
9785 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9788 static __inline__ vector unsigned int __ATTRS_o_ai
9789 vec_srl(vector unsigned int __a, vector unsigned char __b) {
9790 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9794 static __inline__ vector unsigned int __ATTRS_o_ai
9795 vec_srl(vector unsigned int __a, vector unsigned short __b) {
9796 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9800 static __inline__ vector unsigned int __ATTRS_o_ai
9801 vec_srl(vector unsigned int __a, vector unsigned int __b) {
9802 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9806 static __inline__ vector bool int __ATTRS_o_ai
9807 vec_srl(vector bool int __a, vector unsigned char __b) {
9808 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9812 static __inline__ vector bool int __ATTRS_o_ai
9813 vec_srl(vector bool int __a, vector unsigned short __b) {
9814 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9818 static __inline__ vector bool int __ATTRS_o_ai
9819 vec_srl(vector bool int __a, vector unsigned int __b) {
9820 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9825 static __inline__ vector signed long long __ATTRS_o_ai
9826 vec_srl(vector signed long long __a, vector unsigned char __b) {
9827 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9831 static __inline__ vector unsigned long long __ATTRS_o_ai
9832 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9833 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9840 static __inline__ vector signed char __ATTRS_o_ai
9841 vec_vsr(vector signed char __a, vector unsigned char __b) {
9842 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9846 static __inline__ vector signed char __ATTRS_o_ai
9847 vec_vsr(vector signed char __a, vector unsigned short __b) {
9848 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9852 static __inline__ vector signed char __ATTRS_o_ai
9853 vec_vsr(vector signed char __a, vector unsigned int __b) {
9854 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9858 static __inline__ vector unsigned char __ATTRS_o_ai
9859 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9860 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9864 static __inline__ vector unsigned char __ATTRS_o_ai
9865 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9866 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9870 static __inline__ vector unsigned char __ATTRS_o_ai
9871 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9872 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9876 static __inline__ vector bool char __ATTRS_o_ai
9877 vec_vsr(vector bool char __a, vector unsigned char __b) {
9878 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9882 static __inline__ vector bool char __ATTRS_o_ai
9883 vec_vsr(vector bool char __a, vector unsigned short __b) {
9884 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9888 static __inline__ vector bool char __ATTRS_o_ai
9889 vec_vsr(vector bool char __a, vector unsigned int __b) {
9890 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9894 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9895 vector unsigned char __b) {
9896 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9899 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9900 vector unsigned short __b) {
9901 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9904 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9905 vector unsigned int __b) {
9906 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9909 static __inline__ vector unsigned short __ATTRS_o_ai
9910 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9911 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9915 static __inline__ vector unsigned short __ATTRS_o_ai
9916 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9917 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9921 static __inline__ vector unsigned short __ATTRS_o_ai
9922 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9923 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9927 static __inline__ vector bool short __ATTRS_o_ai
9928 vec_vsr(vector bool short __a, vector unsigned char __b) {
9929 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9933 static __inline__ vector bool short __ATTRS_o_ai
9934 vec_vsr(vector bool short __a, vector unsigned short __b) {
9935 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9939 static __inline__ vector bool short __ATTRS_o_ai
9940 vec_vsr(vector bool short __a, vector unsigned int __b) {
9941 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9945 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9946 vector unsigned char __b) {
9947 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9950 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9951 vector unsigned short __b) {
9952 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9955 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9956 vector unsigned int __b) {
9957 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9960 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9961 vector unsigned char __b) {
9962 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9965 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9966 vector unsigned short __b) {
9967 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9970 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9971 vector unsigned int __b) {
9972 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9975 static __inline__ vector unsigned int __ATTRS_o_ai
9976 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
9977 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9981 static __inline__ vector unsigned int __ATTRS_o_ai
9982 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
9983 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9987 static __inline__ vector unsigned int __ATTRS_o_ai
9988 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
9989 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9993 static __inline__ vector bool int __ATTRS_o_ai
9994 vec_vsr(vector bool int __a, vector unsigned char __b) {
9995 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9999 static __inline__ vector bool int __ATTRS_o_ai
10000 vec_vsr(vector bool int __a, vector unsigned short __b) {
10001 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10005 static __inline__ vector bool int __ATTRS_o_ai
10006 vec_vsr(vector bool int __a, vector unsigned int __b) {
10007 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10013 static __inline__ vector signed char __ATTRS_o_ai
10014 vec_sro(vector signed char __a, vector signed char __b) {
10015 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10019 static __inline__ vector signed char __ATTRS_o_ai
10020 vec_sro(vector signed char __a, vector unsigned char __b) {
10021 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10025 static __inline__ vector unsigned char __ATTRS_o_ai
10026 vec_sro(vector unsigned char __a, vector signed char __b) {
10027 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10031 static __inline__ vector unsigned char __ATTRS_o_ai
10032 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10033 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10037 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10038 vector signed char __b) {
10039 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10042 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10043 vector unsigned char __b) {
10044 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10047 static __inline__ vector unsigned short __ATTRS_o_ai
10048 vec_sro(vector unsigned short __a, vector signed char __b) {
10049 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10053 static __inline__ vector unsigned short __ATTRS_o_ai
10054 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10055 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10059 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10060 vector signed char __b) {
10061 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10064 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10065 vector unsigned char __b) {
10066 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10069 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10070 vector signed char __b) {
10071 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10074 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10075 vector unsigned char __b) {
10076 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10079 static __inline__ vector unsigned int __ATTRS_o_ai
10080 vec_sro(vector unsigned int __a, vector signed char __b) {
10081 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10085 static __inline__ vector unsigned int __ATTRS_o_ai
10086 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10087 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10091 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10092 vector signed char __b) {
10093 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10096 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10097 vector unsigned char __b) {
10098 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10102 static __inline__ vector signed long long __ATTRS_o_ai
10103 vec_sro(vector signed long long __a, vector signed char __b) {
10104 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10108 static __inline__ vector signed long long __ATTRS_o_ai
10109 vec_sro(vector signed long long __a, vector unsigned char __b) {
10110 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10114 static __inline__ vector unsigned long long __ATTRS_o_ai
10115 vec_sro(vector unsigned long long __a, vector signed char __b) {
10116 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10120 static __inline__ vector unsigned long long __ATTRS_o_ai
10121 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10122 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10129 static __inline__ vector signed char __ATTRS_o_ai
10130 vec_vsro(vector signed char __a, vector signed char __b) {
10131 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10135 static __inline__ vector signed char __ATTRS_o_ai
10136 vec_vsro(vector signed char __a, vector unsigned char __b) {
10137 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10141 static __inline__ vector unsigned char __ATTRS_o_ai
10142 vec_vsro(vector unsigned char __a, vector signed char __b) {
10143 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10147 static __inline__ vector unsigned char __ATTRS_o_ai
10148 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10149 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10153 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10154 vector signed char __b) {
10155 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10158 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10159 vector unsigned char __b) {
10160 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10163 static __inline__ vector unsigned short __ATTRS_o_ai
10164 vec_vsro(vector unsigned short __a, vector signed char __b) {
10165 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10169 static __inline__ vector unsigned short __ATTRS_o_ai
10170 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10171 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10175 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10176 vector signed char __b) {
10177 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10180 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10181 vector unsigned char __b) {
10182 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10185 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10186 vector signed char __b) {
10187 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10190 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10191 vector unsigned char __b) {
10192 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10195 static __inline__ vector unsigned int __ATTRS_o_ai
10196 vec_vsro(vector unsigned int __a, vector signed char __b) {
10197 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10201 static __inline__ vector unsigned int __ATTRS_o_ai
10202 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10203 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10207 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10208 vector signed char __b) {
10209 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10212 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10213 vector unsigned char __b) {
10214 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10219 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10220 vector signed char *__c) {
10221 __builtin_altivec_stvx((vector int)__a, __b, __c);
10224 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10225 signed char *__c) {
10226 __builtin_altivec_stvx((vector int)__a, __b, __c);
10229 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10230 vector unsigned char *__c) {
10231 __builtin_altivec_stvx((vector int)__a, __b, __c);
10234 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10235 unsigned char *__c) {
10236 __builtin_altivec_stvx((vector int)__a, __b, __c);
10239 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10240 signed char *__c) {
10241 __builtin_altivec_stvx((vector int)__a, __b, __c);
10244 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10245 unsigned char *__c) {
10246 __builtin_altivec_stvx((vector int)__a, __b, __c);
10249 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10250 vector bool char *__c) {
10251 __builtin_altivec_stvx((vector int)__a, __b, __c);
10254 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10255 vector short *__c) {
10256 __builtin_altivec_stvx((vector int)__a, __b, __c);
10259 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10261 __builtin_altivec_stvx((vector int)__a, __b, __c);
10264 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10265 vector unsigned short *__c) {
10266 __builtin_altivec_stvx((vector int)__a, __b, __c);
10269 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10270 unsigned short *__c) {
10271 __builtin_altivec_stvx((vector int)__a, __b, __c);
10274 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10276 __builtin_altivec_stvx((vector int)__a, __b, __c);
10279 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10280 unsigned short *__c) {
10281 __builtin_altivec_stvx((vector int)__a, __b, __c);
10284 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10285 vector bool short *__c) {
10286 __builtin_altivec_stvx((vector int)__a, __b, __c);
10289 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10291 __builtin_altivec_stvx((vector int)__a, __b, __c);
10294 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10295 unsigned short *__c) {
10296 __builtin_altivec_stvx((vector int)__a, __b, __c);
10299 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10300 vector pixel *__c) {
10301 __builtin_altivec_stvx((vector int)__a, __b, __c);
10304 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10306 __builtin_altivec_stvx(__a, __b, __c);
10309 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10310 __builtin_altivec_stvx(__a, __b, __c);
10313 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10314 vector unsigned int *__c) {
10315 __builtin_altivec_stvx((vector int)__a, __b, __c);
10318 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10319 unsigned int *__c) {
10320 __builtin_altivec_stvx((vector int)__a, __b, __c);
10323 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10325 __builtin_altivec_stvx((vector int)__a, __b, __c);
10328 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10329 unsigned int *__c) {
10330 __builtin_altivec_stvx((vector int)__a, __b, __c);
10333 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10334 vector bool int *__c) {
10335 __builtin_altivec_stvx((vector int)__a, __b, __c);
10338 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10339 vector float *__c) {
10340 __builtin_altivec_stvx((vector int)__a, __b, __c);
10343 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10345 __builtin_altivec_stvx((vector int)__a, __b, __c);
10350 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10351 vector signed char *__c) {
10352 __builtin_altivec_stvx((vector int)__a, __b, __c);
10355 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10356 signed char *__c) {
10357 __builtin_altivec_stvx((vector int)__a, __b, __c);
10360 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10361 vector unsigned char *__c) {
10362 __builtin_altivec_stvx((vector int)__a, __b, __c);
10365 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10366 unsigned char *__c) {
10367 __builtin_altivec_stvx((vector int)__a, __b, __c);
10370 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10371 signed char *__c) {
10372 __builtin_altivec_stvx((vector int)__a, __b, __c);
10375 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10376 unsigned char *__c) {
10377 __builtin_altivec_stvx((vector int)__a, __b, __c);
10380 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10381 vector bool char *__c) {
10382 __builtin_altivec_stvx((vector int)__a, __b, __c);
10385 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10386 vector short *__c) {
10387 __builtin_altivec_stvx((vector int)__a, __b, __c);
10390 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10392 __builtin_altivec_stvx((vector int)__a, __b, __c);
10395 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10396 vector unsigned short *__c) {
10397 __builtin_altivec_stvx((vector int)__a, __b, __c);
10400 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10401 unsigned short *__c) {
10402 __builtin_altivec_stvx((vector int)__a, __b, __c);
10405 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10407 __builtin_altivec_stvx((vector int)__a, __b, __c);
10410 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10411 unsigned short *__c) {
10412 __builtin_altivec_stvx((vector int)__a, __b, __c);
10415 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10416 vector bool short *__c) {
10417 __builtin_altivec_stvx((vector int)__a, __b, __c);
10420 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10422 __builtin_altivec_stvx((vector int)__a, __b, __c);
10425 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10426 unsigned short *__c) {
10427 __builtin_altivec_stvx((vector int)__a, __b, __c);
10430 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10431 vector pixel *__c) {
10432 __builtin_altivec_stvx((vector int)__a, __b, __c);
10435 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10437 __builtin_altivec_stvx(__a, __b, __c);
10440 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10442 __builtin_altivec_stvx(__a, __b, __c);
10445 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10446 vector unsigned int *__c) {
10447 __builtin_altivec_stvx((vector int)__a, __b, __c);
10450 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10451 unsigned int *__c) {
10452 __builtin_altivec_stvx((vector int)__a, __b, __c);
10455 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10457 __builtin_altivec_stvx((vector int)__a, __b, __c);
10460 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10461 unsigned int *__c) {
10462 __builtin_altivec_stvx((vector int)__a, __b, __c);
10465 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10466 vector bool int *__c) {
10467 __builtin_altivec_stvx((vector int)__a, __b, __c);
10470 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10471 vector float *__c) {
10472 __builtin_altivec_stvx((vector int)__a, __b, __c);
10475 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10477 __builtin_altivec_stvx((vector int)__a, __b, __c);
10482 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10483 signed char *__c) {
10484 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10487 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10488 unsigned char *__c) {
10489 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10492 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10493 signed char *__c) {
10494 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10497 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10498 unsigned char *__c) {
10499 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10502 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10504 __builtin_altivec_stvehx(__a, __b, __c);
10507 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10508 unsigned short *__c) {
10509 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10512 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10514 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10517 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10518 unsigned short *__c) {
10519 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10522 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10524 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10527 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10528 unsigned short *__c) {
10529 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10532 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10533 __builtin_altivec_stvewx(__a, __b, __c);
10536 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10537 unsigned int *__c) {
10538 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10541 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10543 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10546 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10547 unsigned int *__c) {
10548 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10551 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10553 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10558 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10559 signed char *__c) {
10560 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10563 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10564 int __b, unsigned char *__c) {
10565 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10568 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10569 signed char *__c) {
10570 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10573 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10574 unsigned char *__c) {
10575 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10580 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10582 __builtin_altivec_stvehx(__a, __b, __c);
10585 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10586 int __b, unsigned short *__c) {
10587 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10590 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10592 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10595 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10596 unsigned short *__c) {
10597 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10600 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10602 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10605 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10606 unsigned short *__c) {
10607 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10612 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10614 __builtin_altivec_stvewx(__a, __b, __c);
10617 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10618 unsigned int *__c) {
10619 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10622 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10624 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10627 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10628 unsigned int *__c) {
10629 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10632 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10634 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10639 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10640 vector signed char *__c) {
10641 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10644 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10645 signed char *__c) {
10646 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10649 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10650 vector unsigned char *__c) {
10651 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10654 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10655 unsigned char *__c) {
10656 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10659 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10660 signed char *__c) {
10661 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10664 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10665 unsigned char *__c) {
10666 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10669 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10670 vector bool char *__c) {
10671 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10674 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10675 vector short *__c) {
10676 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10679 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10681 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10684 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10685 vector unsigned short *__c) {
10686 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10689 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10690 unsigned short *__c) {
10691 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10694 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10696 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10699 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10700 unsigned short *__c) {
10701 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10704 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10705 vector bool short *__c) {
10706 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10709 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10711 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10714 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10715 unsigned short *__c) {
10716 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10719 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10720 vector pixel *__c) {
10721 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10724 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10726 __builtin_altivec_stvxl(__a, __b, __c);
10729 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10730 __builtin_altivec_stvxl(__a, __b, __c);
10733 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10734 vector unsigned int *__c) {
10735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10738 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10739 unsigned int *__c) {
10740 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10743 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10745 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10748 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10749 unsigned int *__c) {
10750 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10753 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10754 vector bool int *__c) {
10755 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10758 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10759 vector float *__c) {
10760 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10763 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10765 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10770 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10771 vector signed char *__c) {
10772 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10775 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10776 signed char *__c) {
10777 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10780 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10781 vector unsigned char *__c) {
10782 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10785 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10786 unsigned char *__c) {
10787 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10790 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10791 signed char *__c) {
10792 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10795 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10796 unsigned char *__c) {
10797 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10800 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10801 vector bool char *__c) {
10802 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10805 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10806 vector short *__c) {
10807 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10810 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10812 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10815 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10817 vector unsigned short *__c) {
10818 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10821 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10822 int __b, unsigned short *__c) {
10823 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10826 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10828 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10831 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10832 unsigned short *__c) {
10833 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10836 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10837 vector bool short *__c) {
10838 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10841 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10843 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10846 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10847 unsigned short *__c) {
10848 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10851 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10852 vector pixel *__c) {
10853 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10856 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10858 __builtin_altivec_stvxl(__a, __b, __c);
10861 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10863 __builtin_altivec_stvxl(__a, __b, __c);
10866 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10867 vector unsigned int *__c) {
10868 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10871 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10872 unsigned int *__c) {
10873 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10876 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10878 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10881 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10882 unsigned int *__c) {
10883 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10886 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10887 vector bool int *__c) {
10888 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10891 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10892 vector float *__c) {
10893 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10896 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10898 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10903 static __inline__ vector signed char __ATTRS_o_ai
10904 vec_sub(vector signed char __a, vector signed char __b) {
10908 static __inline__ vector signed char __ATTRS_o_ai
10909 vec_sub(vector bool char __a, vector signed char __b) {
10910 return (vector signed char)__a - __b;
10913 static __inline__ vector signed char __ATTRS_o_ai
10914 vec_sub(vector signed char __a, vector bool char __b) {
10915 return __a - (vector signed char)__b;
10918 static __inline__ vector unsigned char __ATTRS_o_ai
10919 vec_sub(vector unsigned char __a, vector unsigned char __b) {
10923 static __inline__ vector unsigned char __ATTRS_o_ai
10924 vec_sub(vector bool char __a, vector unsigned char __b) {
10925 return (vector unsigned char)__a - __b;
10928 static __inline__ vector unsigned char __ATTRS_o_ai
10929 vec_sub(vector unsigned char __a, vector bool char __b) {
10930 return __a - (vector unsigned char)__b;
10933 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10934 vector short __b) {
10938 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10939 vector short __b) {
10940 return (vector short)__a - __b;
10943 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10944 vector bool short __b) {
10945 return __a - (vector short)__b;
10948 static __inline__ vector unsigned short __ATTRS_o_ai
10949 vec_sub(vector unsigned short __a, vector unsigned short __b) {
10953 static __inline__ vector unsigned short __ATTRS_o_ai
10954 vec_sub(vector bool short __a, vector unsigned short __b) {
10955 return (vector unsigned short)__a - __b;
10958 static __inline__ vector unsigned short __ATTRS_o_ai
10959 vec_sub(vector unsigned short __a, vector bool short __b) {
10960 return __a - (vector unsigned short)__b;
10963 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10968 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
10970 return (vector int)__a - __b;
10973 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10974 vector bool int __b) {
10975 return __a - (vector int)__b;
10978 static __inline__ vector unsigned int __ATTRS_o_ai
10979 vec_sub(vector unsigned int __a, vector unsigned int __b) {
10983 static __inline__ vector unsigned int __ATTRS_o_ai
10984 vec_sub(vector bool int __a, vector unsigned int __b) {
10985 return (vector unsigned int)__a - __b;
10988 static __inline__ vector unsigned int __ATTRS_o_ai
10989 vec_sub(vector unsigned int __a, vector bool int __b) {
10990 return __a - (vector unsigned int)__b;
10993 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
10994 static __inline__ vector signed __int128 __ATTRS_o_ai
10995 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
10999 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11000 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11003 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11006 static __inline__ vector signed long long __ATTRS_o_ai
11007 vec_sub(vector signed long long __a, vector signed long long __b) {
11011 static __inline__ vector unsigned long long __ATTRS_o_ai
11012 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11016 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11017 vector double __b) {
11022 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11023 vector float __b) {
11029 #define __builtin_altivec_vsububm vec_vsububm
11031 static __inline__ vector signed char __ATTRS_o_ai
11032 vec_vsububm(vector signed char __a, vector signed char __b) {
11036 static __inline__ vector signed char __ATTRS_o_ai
11037 vec_vsububm(vector bool char __a, vector signed char __b) {
11038 return (vector signed char)__a - __b;
11041 static __inline__ vector signed char __ATTRS_o_ai
11042 vec_vsububm(vector signed char __a, vector bool char __b) {
11043 return __a - (vector signed char)__b;
11046 static __inline__ vector unsigned char __ATTRS_o_ai
11047 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11051 static __inline__ vector unsigned char __ATTRS_o_ai
11052 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11053 return (vector unsigned char)__a - __b;
11056 static __inline__ vector unsigned char __ATTRS_o_ai
11057 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11058 return __a - (vector unsigned char)__b;
11063 #define __builtin_altivec_vsubuhm vec_vsubuhm
11065 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11066 vector short __b) {
11070 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11071 vector short __b) {
11072 return (vector short)__a - __b;
11075 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11076 vector bool short __b) {
11077 return __a - (vector short)__b;
11080 static __inline__ vector unsigned short __ATTRS_o_ai
11081 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11085 static __inline__ vector unsigned short __ATTRS_o_ai
11086 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11087 return (vector unsigned short)__a - __b;
11090 static __inline__ vector unsigned short __ATTRS_o_ai
11091 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11092 return __a - (vector unsigned short)__b;
11097 #define __builtin_altivec_vsubuwm vec_vsubuwm
11099 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11104 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11106 return (vector int)__a - __b;
11109 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11110 vector bool int __b) {
11111 return __a - (vector int)__b;
11114 static __inline__ vector unsigned int __ATTRS_o_ai
11115 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11119 static __inline__ vector unsigned int __ATTRS_o_ai
11120 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11121 return (vector unsigned int)__a - __b;
11124 static __inline__ vector unsigned int __ATTRS_o_ai
11125 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11126 return __a - (vector unsigned int)__b;
11131 #define __builtin_altivec_vsubfp vec_vsubfp
11133 static __inline__ vector float __attribute__((__always_inline__))
11134 vec_vsubfp(vector float __a, vector float __b) {
11140 static __inline__ vector signed int __ATTRS_o_ai
11141 vec_subc(vector signed int __a, vector signed int __b) {
11142 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11143 (vector unsigned int) __b);
11146 static __inline__ vector unsigned int __ATTRS_o_ai
11147 vec_subc(vector unsigned int __a, vector unsigned int __b) {
11148 return __builtin_altivec_vsubcuw(__a, __b);
11151 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11152 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11153 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11154 return __builtin_altivec_vsubcuq(__a, __b);
11157 static __inline__ vector signed __int128 __ATTRS_o_ai
11158 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11159 return __builtin_altivec_vsubcuq(__a, __b);
11161 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11165 static __inline__ vector unsigned int __attribute__((__always_inline__))
11166 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11167 return __builtin_altivec_vsubcuw(__a, __b);
11172 static __inline__ vector signed char __ATTRS_o_ai
11173 vec_subs(vector signed char __a, vector signed char __b) {
11174 return __builtin_altivec_vsubsbs(__a, __b);
11177 static __inline__ vector signed char __ATTRS_o_ai
11178 vec_subs(vector bool char __a, vector signed char __b) {
11179 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11182 static __inline__ vector signed char __ATTRS_o_ai
11183 vec_subs(vector signed char __a, vector bool char __b) {
11184 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11187 static __inline__ vector unsigned char __ATTRS_o_ai
11188 vec_subs(vector unsigned char __a, vector unsigned char __b) {
11189 return __builtin_altivec_vsububs(__a, __b);
11192 static __inline__ vector unsigned char __ATTRS_o_ai
11193 vec_subs(vector bool char __a, vector unsigned char __b) {
11194 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11197 static __inline__ vector unsigned char __ATTRS_o_ai
11198 vec_subs(vector unsigned char __a, vector bool char __b) {
11199 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11202 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11203 vector short __b) {
11204 return __builtin_altivec_vsubshs(__a, __b);
11207 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11208 vector short __b) {
11209 return __builtin_altivec_vsubshs((vector short)__a, __b);
11212 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11213 vector bool short __b) {
11214 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11217 static __inline__ vector unsigned short __ATTRS_o_ai
11218 vec_subs(vector unsigned short __a, vector unsigned short __b) {
11219 return __builtin_altivec_vsubuhs(__a, __b);
11222 static __inline__ vector unsigned short __ATTRS_o_ai
11223 vec_subs(vector bool short __a, vector unsigned short __b) {
11224 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11227 static __inline__ vector unsigned short __ATTRS_o_ai
11228 vec_subs(vector unsigned short __a, vector bool short __b) {
11229 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11232 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11234 return __builtin_altivec_vsubsws(__a, __b);
11237 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11239 return __builtin_altivec_vsubsws((vector int)__a, __b);
11242 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11243 vector bool int __b) {
11244 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11247 static __inline__ vector unsigned int __ATTRS_o_ai
11248 vec_subs(vector unsigned int __a, vector unsigned int __b) {
11249 return __builtin_altivec_vsubuws(__a, __b);
11252 static __inline__ vector unsigned int __ATTRS_o_ai
11253 vec_subs(vector bool int __a, vector unsigned int __b) {
11254 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11257 static __inline__ vector unsigned int __ATTRS_o_ai
11258 vec_subs(vector unsigned int __a, vector bool int __b) {
11259 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11264 static __inline__ vector signed char __ATTRS_o_ai
11265 vec_vsubsbs(vector signed char __a, vector signed char __b) {
11266 return __builtin_altivec_vsubsbs(__a, __b);
11269 static __inline__ vector signed char __ATTRS_o_ai
11270 vec_vsubsbs(vector bool char __a, vector signed char __b) {
11271 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11274 static __inline__ vector signed char __ATTRS_o_ai
11275 vec_vsubsbs(vector signed char __a, vector bool char __b) {
11276 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11281 static __inline__ vector unsigned char __ATTRS_o_ai
11282 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11283 return __builtin_altivec_vsububs(__a, __b);
11286 static __inline__ vector unsigned char __ATTRS_o_ai
11287 vec_vsububs(vector bool char __a, vector unsigned char __b) {
11288 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11291 static __inline__ vector unsigned char __ATTRS_o_ai
11292 vec_vsububs(vector unsigned char __a, vector bool char __b) {
11293 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11298 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11299 vector short __b) {
11300 return __builtin_altivec_vsubshs(__a, __b);
11303 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11304 vector short __b) {
11305 return __builtin_altivec_vsubshs((vector short)__a, __b);
11308 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11309 vector bool short __b) {
11310 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11315 static __inline__ vector unsigned short __ATTRS_o_ai
11316 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11317 return __builtin_altivec_vsubuhs(__a, __b);
11320 static __inline__ vector unsigned short __ATTRS_o_ai
11321 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11322 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11325 static __inline__ vector unsigned short __ATTRS_o_ai
11326 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11327 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11332 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11334 return __builtin_altivec_vsubsws(__a, __b);
11337 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11339 return __builtin_altivec_vsubsws((vector int)__a, __b);
11342 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11343 vector bool int __b) {
11344 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11349 static __inline__ vector unsigned int __ATTRS_o_ai
11350 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11351 return __builtin_altivec_vsubuws(__a, __b);
11354 static __inline__ vector unsigned int __ATTRS_o_ai
11355 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11356 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11359 static __inline__ vector unsigned int __ATTRS_o_ai
11360 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11361 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11364 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11367 static __inline__ vector signed __int128 __ATTRS_o_ai
11368 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11372 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11373 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11380 static __inline__ vector signed __int128 __ATTRS_o_ai
11381 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11382 vector signed __int128 __c) {
11383 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11386 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11387 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11388 vector unsigned __int128 __c) {
11389 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11392 static __inline__ vector signed __int128 __ATTRS_o_ai
11393 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11394 vector signed __int128 __c) {
11395 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11398 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11399 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11400 vector unsigned __int128 __c) {
11401 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11406 static __inline__ vector signed __int128 __ATTRS_o_ai
11407 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11408 return __builtin_altivec_vsubcuq(__a, __b);
11411 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11412 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11413 return __builtin_altivec_vsubcuq(__a, __b);
11418 static __inline__ vector signed __int128 __ATTRS_o_ai
11419 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11420 vector signed __int128 __c) {
11421 return __builtin_altivec_vsubecuq(__a, __b, __c);
11424 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11425 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11426 vector unsigned __int128 __c) {
11427 return __builtin_altivec_vsubecuq(__a, __b, __c);
11430 static __inline__ vector signed int __ATTRS_o_ai
11431 vec_subec(vector signed int __a, vector signed int __b,
11432 vector signed int __c) {
11433 return vec_addec(__a, ~__b, __c);
11436 static __inline__ vector unsigned int __ATTRS_o_ai
11437 vec_subec(vector unsigned int __a, vector unsigned int __b,
11438 vector unsigned int __c) {
11439 return vec_addec(__a, ~__b, __c);
11442 static __inline__ vector signed __int128 __ATTRS_o_ai
11443 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11444 vector signed __int128 __c) {
11445 return __builtin_altivec_vsubecuq(__a, __b, __c);
11448 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11449 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11450 vector unsigned __int128 __c) {
11451 return __builtin_altivec_vsubecuq(__a, __b, __c);
11453 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11455 static __inline__ vector signed int __ATTRS_o_ai
11456 vec_sube(vector signed int __a, vector signed int __b,
11457 vector signed int __c) {
11458 vector signed int __mask = {1, 1, 1, 1};
11459 vector signed int __carry = __c & __mask;
11460 return vec_adde(__a, ~__b, __carry);
11463 static __inline__ vector unsigned int __ATTRS_o_ai
11464 vec_sube(vector unsigned int __a, vector unsigned int __b,
11465 vector unsigned int __c) {
11466 vector unsigned int __mask = {1, 1, 1, 1};
11467 vector unsigned int __carry = __c & __mask;
11468 return vec_adde(__a, ~__b, __carry);
11472 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11474 return __builtin_altivec_vsum4sbs(__a, __b);
11477 static __inline__ vector unsigned int __ATTRS_o_ai
11478 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11479 return __builtin_altivec_vsum4ubs(__a, __b);
11482 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11484 return __builtin_altivec_vsum4shs(__a, __b);
11489 static __inline__ vector int __attribute__((__always_inline__))
11490 vec_vsum4sbs(vector signed char __a, vector int __b) {
11491 return __builtin_altivec_vsum4sbs(__a, __b);
11496 static __inline__ vector unsigned int __attribute__((__always_inline__))
11497 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11498 return __builtin_altivec_vsum4ubs(__a, __b);
11503 static __inline__ vector int __attribute__((__always_inline__))
11504 vec_vsum4shs(vector signed short __a, vector int __b) {
11505 return __builtin_altivec_vsum4shs(__a, __b);
11510 /* The vsum2sws instruction has a big-endian bias, so that the second
11511 input vector and the result always reference big-endian elements
11512 1 and 3 (little-endian element 0 and 2). For ease of porting the
11513 programmer wants elements 1 and 3 in both cases, so for little
11514 endian we must perform some permutes. */
11516 static __inline__ vector signed int __attribute__((__always_inline__))
11517 vec_sum2s(vector int __a, vector int __b) {
11518 #ifdef __LITTLE_ENDIAN__
11519 vector int __c = (vector signed int)vec_perm(
11520 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11522 __c = __builtin_altivec_vsum2sws(__a, __c);
11523 return (vector signed int)vec_perm(
11524 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11527 return __builtin_altivec_vsum2sws(__a, __b);
11533 static __inline__ vector signed int __attribute__((__always_inline__))
11534 vec_vsum2sws(vector int __a, vector int __b) {
11535 #ifdef __LITTLE_ENDIAN__
11536 vector int __c = (vector signed int)vec_perm(
11537 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11539 __c = __builtin_altivec_vsum2sws(__a, __c);
11540 return (vector signed int)vec_perm(
11541 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11544 return __builtin_altivec_vsum2sws(__a, __b);
11550 /* The vsumsws instruction has a big-endian bias, so that the second
11551 input vector and the result always reference big-endian element 3
11552 (little-endian element 0). For ease of porting the programmer
11553 wants element 3 in both cases, so for little endian we must perform
11556 static __inline__ vector signed int __attribute__((__always_inline__))
11557 vec_sums(vector signed int __a, vector signed int __b) {
11558 #ifdef __LITTLE_ENDIAN__
11559 __b = (vector signed int)vec_splat(__b, 3);
11560 __b = __builtin_altivec_vsumsws(__a, __b);
11561 return (vector signed int)(0, 0, 0, __b[0]);
11563 return __builtin_altivec_vsumsws(__a, __b);
11569 static __inline__ vector signed int __attribute__((__always_inline__))
11570 vec_vsumsws(vector signed int __a, vector signed int __b) {
11571 #ifdef __LITTLE_ENDIAN__
11572 __b = (vector signed int)vec_splat(__b, 3);
11573 __b = __builtin_altivec_vsumsws(__a, __b);
11574 return (vector signed int)(0, 0, 0, __b[0]);
11576 return __builtin_altivec_vsumsws(__a, __b);
11582 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11584 return __builtin_vsx_xvrspiz(__a);
11586 return __builtin_altivec_vrfiz(__a);
11591 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11592 return __builtin_vsx_xvrdpiz(__a);
11598 static __inline__ vector float __attribute__((__always_inline__))
11599 vec_vrfiz(vector float __a) {
11600 return __builtin_altivec_vrfiz(__a);
11605 /* The vector unpack instructions all have a big-endian bias, so for
11606 little endian we must reverse the meanings of "high" and "low." */
11608 static __inline__ vector short __ATTRS_o_ai
11609 vec_unpackh(vector signed char __a) {
11610 #ifdef __LITTLE_ENDIAN__
11611 return __builtin_altivec_vupklsb((vector char)__a);
11613 return __builtin_altivec_vupkhsb((vector char)__a);
11617 static __inline__ vector bool short __ATTRS_o_ai
11618 vec_unpackh(vector bool char __a) {
11619 #ifdef __LITTLE_ENDIAN__
11620 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11622 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11626 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11627 #ifdef __LITTLE_ENDIAN__
11628 return __builtin_altivec_vupklsh(__a);
11630 return __builtin_altivec_vupkhsh(__a);
11634 static __inline__ vector bool int __ATTRS_o_ai
11635 vec_unpackh(vector bool short __a) {
11636 #ifdef __LITTLE_ENDIAN__
11637 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11639 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11643 static __inline__ vector unsigned int __ATTRS_o_ai
11644 vec_unpackh(vector pixel __a) {
11645 #ifdef __LITTLE_ENDIAN__
11646 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11648 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11652 #ifdef __POWER8_VECTOR__
11653 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11654 #ifdef __LITTLE_ENDIAN__
11655 return __builtin_altivec_vupklsw(__a);
11657 return __builtin_altivec_vupkhsw(__a);
11661 static __inline__ vector bool long long __ATTRS_o_ai
11662 vec_unpackh(vector bool int __a) {
11663 #ifdef __LITTLE_ENDIAN__
11664 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11666 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11670 static __inline__ vector double __ATTRS_o_ai
11671 vec_unpackh(vector float __a) {
11672 return (vector double)(__a[0], __a[1]);
11678 static __inline__ vector short __ATTRS_o_ai
11679 vec_vupkhsb(vector signed char __a) {
11680 #ifdef __LITTLE_ENDIAN__
11681 return __builtin_altivec_vupklsb((vector char)__a);
11683 return __builtin_altivec_vupkhsb((vector char)__a);
11687 static __inline__ vector bool short __ATTRS_o_ai
11688 vec_vupkhsb(vector bool char __a) {
11689 #ifdef __LITTLE_ENDIAN__
11690 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11692 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11698 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11699 #ifdef __LITTLE_ENDIAN__
11700 return __builtin_altivec_vupklsh(__a);
11702 return __builtin_altivec_vupkhsh(__a);
11706 static __inline__ vector bool int __ATTRS_o_ai
11707 vec_vupkhsh(vector bool short __a) {
11708 #ifdef __LITTLE_ENDIAN__
11709 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11711 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11715 static __inline__ vector unsigned int __ATTRS_o_ai
11716 vec_vupkhsh(vector pixel __a) {
11717 #ifdef __LITTLE_ENDIAN__
11718 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11720 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11726 #ifdef __POWER8_VECTOR__
11727 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11728 #ifdef __LITTLE_ENDIAN__
11729 return __builtin_altivec_vupklsw(__a);
11731 return __builtin_altivec_vupkhsw(__a);
11735 static __inline__ vector bool long long __ATTRS_o_ai
11736 vec_vupkhsw(vector bool int __a) {
11737 #ifdef __LITTLE_ENDIAN__
11738 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11740 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11747 static __inline__ vector short __ATTRS_o_ai
11748 vec_unpackl(vector signed char __a) {
11749 #ifdef __LITTLE_ENDIAN__
11750 return __builtin_altivec_vupkhsb((vector char)__a);
11752 return __builtin_altivec_vupklsb((vector char)__a);
11756 static __inline__ vector bool short __ATTRS_o_ai
11757 vec_unpackl(vector bool char __a) {
11758 #ifdef __LITTLE_ENDIAN__
11759 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11761 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11765 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11766 #ifdef __LITTLE_ENDIAN__
11767 return __builtin_altivec_vupkhsh(__a);
11769 return __builtin_altivec_vupklsh(__a);
11773 static __inline__ vector bool int __ATTRS_o_ai
11774 vec_unpackl(vector bool short __a) {
11775 #ifdef __LITTLE_ENDIAN__
11776 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11778 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11782 static __inline__ vector unsigned int __ATTRS_o_ai
11783 vec_unpackl(vector pixel __a) {
11784 #ifdef __LITTLE_ENDIAN__
11785 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11787 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11791 #ifdef __POWER8_VECTOR__
11792 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11793 #ifdef __LITTLE_ENDIAN__
11794 return __builtin_altivec_vupkhsw(__a);
11796 return __builtin_altivec_vupklsw(__a);
11800 static __inline__ vector bool long long __ATTRS_o_ai
11801 vec_unpackl(vector bool int __a) {
11802 #ifdef __LITTLE_ENDIAN__
11803 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11805 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11809 static __inline__ vector double __ATTRS_o_ai
11810 vec_unpackl(vector float __a) {
11811 return (vector double)(__a[2], __a[3]);
11817 static __inline__ vector short __ATTRS_o_ai
11818 vec_vupklsb(vector signed char __a) {
11819 #ifdef __LITTLE_ENDIAN__
11820 return __builtin_altivec_vupkhsb((vector char)__a);
11822 return __builtin_altivec_vupklsb((vector char)__a);
11826 static __inline__ vector bool short __ATTRS_o_ai
11827 vec_vupklsb(vector bool char __a) {
11828 #ifdef __LITTLE_ENDIAN__
11829 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11831 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11837 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11838 #ifdef __LITTLE_ENDIAN__
11839 return __builtin_altivec_vupkhsh(__a);
11841 return __builtin_altivec_vupklsh(__a);
11845 static __inline__ vector bool int __ATTRS_o_ai
11846 vec_vupklsh(vector bool short __a) {
11847 #ifdef __LITTLE_ENDIAN__
11848 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11850 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11854 static __inline__ vector unsigned int __ATTRS_o_ai
11855 vec_vupklsh(vector pixel __a) {
11856 #ifdef __LITTLE_ENDIAN__
11857 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11859 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11865 #ifdef __POWER8_VECTOR__
11866 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11867 #ifdef __LITTLE_ENDIAN__
11868 return __builtin_altivec_vupkhsw(__a);
11870 return __builtin_altivec_vupklsw(__a);
11874 static __inline__ vector bool long long __ATTRS_o_ai
11875 vec_vupklsw(vector bool int __a) {
11876 #ifdef __LITTLE_ENDIAN__
11877 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11879 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11888 static __inline__ vector bool int __ATTRS_o_ai
11889 vec_vsx_ld(int __a, const vector bool int *__b) {
11890 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11893 static __inline__ vector signed int __ATTRS_o_ai
11894 vec_vsx_ld(int __a, const vector signed int *__b) {
11895 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11898 static __inline__ vector signed int __ATTRS_o_ai
11899 vec_vsx_ld(int __a, const signed int *__b) {
11900 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11903 static __inline__ vector unsigned int __ATTRS_o_ai
11904 vec_vsx_ld(int __a, const vector unsigned int *__b) {
11905 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11908 static __inline__ vector unsigned int __ATTRS_o_ai
11909 vec_vsx_ld(int __a, const unsigned int *__b) {
11910 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11913 static __inline__ vector float __ATTRS_o_ai
11914 vec_vsx_ld(int __a, const vector float *__b) {
11915 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11918 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11919 const float *__b) {
11920 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11923 static __inline__ vector signed long long __ATTRS_o_ai
11924 vec_vsx_ld(int __a, const vector signed long long *__b) {
11925 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11928 static __inline__ vector unsigned long long __ATTRS_o_ai
11929 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11930 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11933 static __inline__ vector double __ATTRS_o_ai
11934 vec_vsx_ld(int __a, const vector double *__b) {
11935 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11938 static __inline__ vector double __ATTRS_o_ai
11939 vec_vsx_ld(int __a, const double *__b) {
11940 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11943 static __inline__ vector bool short __ATTRS_o_ai
11944 vec_vsx_ld(int __a, const vector bool short *__b) {
11945 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
11948 static __inline__ vector signed short __ATTRS_o_ai
11949 vec_vsx_ld(int __a, const vector signed short *__b) {
11950 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11953 static __inline__ vector signed short __ATTRS_o_ai
11954 vec_vsx_ld(int __a, const signed short *__b) {
11955 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11958 static __inline__ vector unsigned short __ATTRS_o_ai
11959 vec_vsx_ld(int __a, const vector unsigned short *__b) {
11960 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11963 static __inline__ vector unsigned short __ATTRS_o_ai
11964 vec_vsx_ld(int __a, const unsigned short *__b) {
11965 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11968 static __inline__ vector bool char __ATTRS_o_ai
11969 vec_vsx_ld(int __a, const vector bool char *__b) {
11970 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
11973 static __inline__ vector signed char __ATTRS_o_ai
11974 vec_vsx_ld(int __a, const vector signed char *__b) {
11975 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11978 static __inline__ vector signed char __ATTRS_o_ai
11979 vec_vsx_ld(int __a, const signed char *__b) {
11980 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11983 static __inline__ vector unsigned char __ATTRS_o_ai
11984 vec_vsx_ld(int __a, const vector unsigned char *__b) {
11985 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
11988 static __inline__ vector unsigned char __ATTRS_o_ai
11989 vec_vsx_ld(int __a, const unsigned char *__b) {
11990 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
11999 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12000 vector bool int *__c) {
12001 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12004 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12006 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12009 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12010 unsigned int *__c) {
12011 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12014 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12015 vector signed int *__c) {
12016 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12019 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12021 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12024 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12025 vector unsigned int *__c) {
12026 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12029 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12030 unsigned int *__c) {
12031 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12034 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12035 vector float *__c) {
12036 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12039 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12041 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12044 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12046 vector signed long long *__c) {
12047 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12050 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12052 vector unsigned long long *__c) {
12053 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12056 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12057 vector double *__c) {
12058 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12061 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12063 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12066 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12067 vector bool short *__c) {
12068 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12071 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12072 signed short *__c) {
12073 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12076 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12077 unsigned short *__c) {
12078 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12080 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12081 vector signed short *__c) {
12082 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12085 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed 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 unsigned short __a,
12092 vector unsigned short *__c) {
12093 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12096 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12097 int __b, unsigned short *__c) {
12098 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12101 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12102 vector bool char *__c) {
12103 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12106 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12107 signed char *__c) {
12108 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12111 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12112 unsigned char *__c) {
12113 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12116 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12117 vector signed char *__c) {
12118 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12121 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12122 signed char *__c) {
12123 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12126 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12128 vector unsigned char *__c) {
12129 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12132 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12133 int __b, unsigned char *__c) {
12134 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12140 #define vec_xxpermdi __builtin_vsx_xxpermdi
12141 #define vec_xxsldwi __builtin_vsx_xxsldwi
12146 #define __builtin_altivec_vxor vec_xor
12148 static __inline__ vector signed char __ATTRS_o_ai
12149 vec_xor(vector signed char __a, vector signed char __b) {
12153 static __inline__ vector signed char __ATTRS_o_ai
12154 vec_xor(vector bool char __a, vector signed char __b) {
12155 return (vector signed char)__a ^ __b;
12158 static __inline__ vector signed char __ATTRS_o_ai
12159 vec_xor(vector signed char __a, vector bool char __b) {
12160 return __a ^ (vector signed char)__b;
12163 static __inline__ vector unsigned char __ATTRS_o_ai
12164 vec_xor(vector unsigned char __a, vector unsigned char __b) {
12168 static __inline__ vector unsigned char __ATTRS_o_ai
12169 vec_xor(vector bool char __a, vector unsigned char __b) {
12170 return (vector unsigned char)__a ^ __b;
12173 static __inline__ vector unsigned char __ATTRS_o_ai
12174 vec_xor(vector unsigned char __a, vector bool char __b) {
12175 return __a ^ (vector unsigned char)__b;
12178 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12179 vector bool char __b) {
12183 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12184 vector short __b) {
12188 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12189 vector short __b) {
12190 return (vector short)__a ^ __b;
12193 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12194 vector bool short __b) {
12195 return __a ^ (vector short)__b;
12198 static __inline__ vector unsigned short __ATTRS_o_ai
12199 vec_xor(vector unsigned short __a, vector unsigned short __b) {
12203 static __inline__ vector unsigned short __ATTRS_o_ai
12204 vec_xor(vector bool short __a, vector unsigned short __b) {
12205 return (vector unsigned short)__a ^ __b;
12208 static __inline__ vector unsigned short __ATTRS_o_ai
12209 vec_xor(vector unsigned short __a, vector bool short __b) {
12210 return __a ^ (vector unsigned short)__b;
12213 static __inline__ vector bool short __ATTRS_o_ai
12214 vec_xor(vector bool short __a, vector bool short __b) {
12218 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12223 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12225 return (vector int)__a ^ __b;
12228 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12229 vector bool int __b) {
12230 return __a ^ (vector int)__b;
12233 static __inline__ vector unsigned int __ATTRS_o_ai
12234 vec_xor(vector unsigned int __a, vector unsigned int __b) {
12238 static __inline__ vector unsigned int __ATTRS_o_ai
12239 vec_xor(vector bool int __a, vector unsigned int __b) {
12240 return (vector unsigned int)__a ^ __b;
12243 static __inline__ vector unsigned int __ATTRS_o_ai
12244 vec_xor(vector unsigned int __a, vector bool int __b) {
12245 return __a ^ (vector unsigned int)__b;
12248 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12249 vector bool int __b) {
12253 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12254 vector float __b) {
12255 vector unsigned int __res =
12256 (vector unsigned int)__a ^ (vector unsigned int)__b;
12257 return (vector float)__res;
12260 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12261 vector float __b) {
12262 vector unsigned int __res =
12263 (vector unsigned int)__a ^ (vector unsigned int)__b;
12264 return (vector float)__res;
12267 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12268 vector bool int __b) {
12269 vector unsigned int __res =
12270 (vector unsigned int)__a ^ (vector unsigned int)__b;
12271 return (vector float)__res;
12275 static __inline__ vector signed long long __ATTRS_o_ai
12276 vec_xor(vector signed long long __a, vector signed long long __b) {
12280 static __inline__ vector signed long long __ATTRS_o_ai
12281 vec_xor(vector bool long long __a, vector signed long long __b) {
12282 return (vector signed long long)__a ^ __b;
12285 static __inline__ vector signed long long __ATTRS_o_ai
12286 vec_xor(vector signed long long __a, vector bool long long __b) {
12287 return __a ^ (vector signed long long)__b;
12290 static __inline__ vector unsigned long long __ATTRS_o_ai
12291 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12295 static __inline__ vector unsigned long long __ATTRS_o_ai
12296 vec_xor(vector bool long long __a, vector unsigned long long __b) {
12297 return (vector unsigned long long)__a ^ __b;
12300 static __inline__ vector unsigned long long __ATTRS_o_ai
12301 vec_xor(vector unsigned long long __a, vector bool long long __b) {
12302 return __a ^ (vector unsigned long long)__b;
12305 static __inline__ vector bool long long __ATTRS_o_ai
12306 vec_xor(vector bool long long __a, vector bool long long __b) {
12310 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12311 vector double __b) {
12312 return (vector double)((vector unsigned long long)__a ^
12313 (vector unsigned long long)__b);
12316 static __inline__ vector double __ATTRS_o_ai
12317 vec_xor(vector double __a, vector bool long long __b) {
12318 return (vector double)((vector unsigned long long)__a ^
12319 (vector unsigned long long)__b);
12322 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12323 vector double __b) {
12324 return (vector double)((vector unsigned long long)__a ^
12325 (vector unsigned long long)__b);
12331 static __inline__ vector signed char __ATTRS_o_ai
12332 vec_vxor(vector signed char __a, vector signed char __b) {
12336 static __inline__ vector signed char __ATTRS_o_ai
12337 vec_vxor(vector bool char __a, vector signed char __b) {
12338 return (vector signed char)__a ^ __b;
12341 static __inline__ vector signed char __ATTRS_o_ai
12342 vec_vxor(vector signed char __a, vector bool char __b) {
12343 return __a ^ (vector signed char)__b;
12346 static __inline__ vector unsigned char __ATTRS_o_ai
12347 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12351 static __inline__ vector unsigned char __ATTRS_o_ai
12352 vec_vxor(vector bool char __a, vector unsigned char __b) {
12353 return (vector unsigned char)__a ^ __b;
12356 static __inline__ vector unsigned char __ATTRS_o_ai
12357 vec_vxor(vector unsigned char __a, vector bool char __b) {
12358 return __a ^ (vector unsigned char)__b;
12361 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12362 vector bool char __b) {
12366 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12367 vector short __b) {
12371 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12372 vector short __b) {
12373 return (vector short)__a ^ __b;
12376 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12377 vector bool short __b) {
12378 return __a ^ (vector short)__b;
12381 static __inline__ vector unsigned short __ATTRS_o_ai
12382 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12386 static __inline__ vector unsigned short __ATTRS_o_ai
12387 vec_vxor(vector bool short __a, vector unsigned short __b) {
12388 return (vector unsigned short)__a ^ __b;
12391 static __inline__ vector unsigned short __ATTRS_o_ai
12392 vec_vxor(vector unsigned short __a, vector bool short __b) {
12393 return __a ^ (vector unsigned short)__b;
12396 static __inline__ vector bool short __ATTRS_o_ai
12397 vec_vxor(vector bool short __a, vector bool short __b) {
12401 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12406 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12408 return (vector int)__a ^ __b;
12411 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12412 vector bool int __b) {
12413 return __a ^ (vector int)__b;
12416 static __inline__ vector unsigned int __ATTRS_o_ai
12417 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12421 static __inline__ vector unsigned int __ATTRS_o_ai
12422 vec_vxor(vector bool int __a, vector unsigned int __b) {
12423 return (vector unsigned int)__a ^ __b;
12426 static __inline__ vector unsigned int __ATTRS_o_ai
12427 vec_vxor(vector unsigned int __a, vector bool int __b) {
12428 return __a ^ (vector unsigned int)__b;
12431 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12432 vector bool int __b) {
12436 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12437 vector float __b) {
12438 vector unsigned int __res =
12439 (vector unsigned int)__a ^ (vector unsigned int)__b;
12440 return (vector float)__res;
12443 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12444 vector float __b) {
12445 vector unsigned int __res =
12446 (vector unsigned int)__a ^ (vector unsigned int)__b;
12447 return (vector float)__res;
12450 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12451 vector bool int __b) {
12452 vector unsigned int __res =
12453 (vector unsigned int)__a ^ (vector unsigned int)__b;
12454 return (vector float)__res;
12458 static __inline__ vector signed long long __ATTRS_o_ai
12459 vec_vxor(vector signed long long __a, vector signed long long __b) {
12463 static __inline__ vector signed long long __ATTRS_o_ai
12464 vec_vxor(vector bool long long __a, vector signed long long __b) {
12465 return (vector signed long long)__a ^ __b;
12468 static __inline__ vector signed long long __ATTRS_o_ai
12469 vec_vxor(vector signed long long __a, vector bool long long __b) {
12470 return __a ^ (vector signed long long)__b;
12473 static __inline__ vector unsigned long long __ATTRS_o_ai
12474 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12478 static __inline__ vector unsigned long long __ATTRS_o_ai
12479 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12480 return (vector unsigned long long)__a ^ __b;
12483 static __inline__ vector unsigned long long __ATTRS_o_ai
12484 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12485 return __a ^ (vector unsigned long long)__b;
12488 static __inline__ vector bool long long __ATTRS_o_ai
12489 vec_vxor(vector bool long long __a, vector bool long long __b) {
12494 /* ------------------------ extensions for CBEA ----------------------------- */
12498 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12503 static __inline__ unsigned char __ATTRS_o_ai
12504 vec_extract(vector unsigned char __a, int __b) {
12508 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12513 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12518 static __inline__ unsigned short __ATTRS_o_ai
12519 vec_extract(vector unsigned short __a, int __b) {
12523 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12528 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12533 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12538 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12544 static __inline__ signed long long __ATTRS_o_ai
12545 vec_extract(vector signed long long __a, int __b) {
12549 static __inline__ unsigned long long __ATTRS_o_ai
12550 vec_extract(vector unsigned long long __a, int __b) {
12554 static __inline__ unsigned long long __ATTRS_o_ai
12555 vec_extract(vector bool long long __a, int __b) {
12559 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12564 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12568 #ifdef __POWER9_VECTOR__
12570 #define vec_insert4b __builtin_vsx_insertword
12571 #define vec_extract4b __builtin_vsx_extractuword
12573 /* vec_extract_exp */
12575 static __inline__ vector unsigned int __ATTRS_o_ai
12576 vec_extract_exp(vector float __a) {
12577 return __builtin_vsx_xvxexpsp(__a);
12580 static __inline__ vector unsigned long long __ATTRS_o_ai
12581 vec_extract_exp(vector double __a) {
12582 return __builtin_vsx_xvxexpdp(__a);
12585 /* vec_extract_sig */
12587 static __inline__ vector unsigned int __ATTRS_o_ai
12588 vec_extract_sig(vector float __a) {
12589 return __builtin_vsx_xvxsigsp(__a);
12592 static __inline__ vector unsigned long long __ATTRS_o_ai
12593 vec_extract_sig (vector double __a) {
12594 return __builtin_vsx_xvxsigdp(__a);
12597 static __inline__ vector float __ATTRS_o_ai
12598 vec_extract_fp32_from_shorth(vector unsigned short __a) {
12599 vector unsigned short __b =
12600 #ifdef __LITTLE_ENDIAN__
12601 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12603 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12605 return __builtin_vsx_xvcvhpsp(__b);
12608 static __inline__ vector float __ATTRS_o_ai
12609 vec_extract_fp32_from_shortl(vector unsigned short __a) {
12610 vector unsigned short __b =
12611 #ifdef __LITTLE_ENDIAN__
12612 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12614 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12616 return __builtin_vsx_xvcvhpsp(__b);
12618 #endif /* __POWER9_VECTOR__ */
12622 static __inline__ vector signed char __ATTRS_o_ai
12623 vec_insert(signed char __a, vector signed char __b, int __c) {
12628 static __inline__ vector unsigned char __ATTRS_o_ai
12629 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12634 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12635 vector bool char __b,
12641 static __inline__ vector signed short __ATTRS_o_ai
12642 vec_insert(signed short __a, vector signed short __b, int __c) {
12647 static __inline__ vector unsigned short __ATTRS_o_ai
12648 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12653 static __inline__ vector bool short __ATTRS_o_ai
12654 vec_insert(unsigned short __a, vector bool short __b, int __c) {
12659 static __inline__ vector signed int __ATTRS_o_ai
12660 vec_insert(signed int __a, vector signed int __b, int __c) {
12665 static __inline__ vector unsigned int __ATTRS_o_ai
12666 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12671 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12672 vector bool int __b,
12679 static __inline__ vector signed long long __ATTRS_o_ai
12680 vec_insert(signed long long __a, vector signed long long __b, int __c) {
12685 static __inline__ vector unsigned long long __ATTRS_o_ai
12686 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12691 static __inline__ vector bool long long __ATTRS_o_ai
12692 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12696 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12704 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12713 static __inline__ vector signed char __ATTRS_o_ai
12714 vec_lvlx(int __a, const signed char *__b) {
12715 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12716 vec_lvsl(__a, __b));
12719 static __inline__ vector signed char __ATTRS_o_ai
12720 vec_lvlx(int __a, const vector signed char *__b) {
12721 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12722 vec_lvsl(__a, (unsigned char *)__b));
12725 static __inline__ vector unsigned char __ATTRS_o_ai
12726 vec_lvlx(int __a, const unsigned char *__b) {
12727 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12728 vec_lvsl(__a, __b));
12731 static __inline__ vector unsigned char __ATTRS_o_ai
12732 vec_lvlx(int __a, const vector unsigned char *__b) {
12733 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12734 vec_lvsl(__a, (unsigned char *)__b));
12737 static __inline__ vector bool char __ATTRS_o_ai
12738 vec_lvlx(int __a, const vector bool char *__b) {
12739 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12740 vec_lvsl(__a, (unsigned char *)__b));
12743 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12744 const short *__b) {
12745 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12748 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12749 const vector short *__b) {
12750 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12751 vec_lvsl(__a, (unsigned char *)__b));
12754 static __inline__ vector unsigned short __ATTRS_o_ai
12755 vec_lvlx(int __a, const unsigned short *__b) {
12756 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12757 vec_lvsl(__a, __b));
12760 static __inline__ vector unsigned short __ATTRS_o_ai
12761 vec_lvlx(int __a, const vector unsigned short *__b) {
12762 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12763 vec_lvsl(__a, (unsigned char *)__b));
12766 static __inline__ vector bool short __ATTRS_o_ai
12767 vec_lvlx(int __a, const vector bool short *__b) {
12768 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12769 vec_lvsl(__a, (unsigned char *)__b));
12772 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12773 const vector pixel *__b) {
12774 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12775 vec_lvsl(__a, (unsigned char *)__b));
12778 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12779 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12782 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12783 const vector int *__b) {
12784 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12785 vec_lvsl(__a, (unsigned char *)__b));
12788 static __inline__ vector unsigned int __ATTRS_o_ai
12789 vec_lvlx(int __a, const unsigned int *__b) {
12790 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12791 vec_lvsl(__a, __b));
12794 static __inline__ vector unsigned int __ATTRS_o_ai
12795 vec_lvlx(int __a, const vector unsigned int *__b) {
12796 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12797 vec_lvsl(__a, (unsigned char *)__b));
12800 static __inline__ vector bool int __ATTRS_o_ai
12801 vec_lvlx(int __a, const vector bool int *__b) {
12802 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12803 vec_lvsl(__a, (unsigned char *)__b));
12806 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12807 const float *__b) {
12808 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12811 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12812 const vector float *__b) {
12813 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12814 vec_lvsl(__a, (unsigned char *)__b));
12819 static __inline__ vector signed char __ATTRS_o_ai
12820 vec_lvlxl(int __a, const signed char *__b) {
12821 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12822 vec_lvsl(__a, __b));
12825 static __inline__ vector signed char __ATTRS_o_ai
12826 vec_lvlxl(int __a, const vector signed char *__b) {
12827 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12828 vec_lvsl(__a, (unsigned char *)__b));
12831 static __inline__ vector unsigned char __ATTRS_o_ai
12832 vec_lvlxl(int __a, const unsigned char *__b) {
12833 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12834 vec_lvsl(__a, __b));
12837 static __inline__ vector unsigned char __ATTRS_o_ai
12838 vec_lvlxl(int __a, const vector unsigned char *__b) {
12839 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12840 vec_lvsl(__a, (unsigned char *)__b));
12843 static __inline__ vector bool char __ATTRS_o_ai
12844 vec_lvlxl(int __a, const vector bool char *__b) {
12845 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12846 vec_lvsl(__a, (unsigned char *)__b));
12849 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12850 const short *__b) {
12851 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12854 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12855 const vector short *__b) {
12856 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12857 vec_lvsl(__a, (unsigned char *)__b));
12860 static __inline__ vector unsigned short __ATTRS_o_ai
12861 vec_lvlxl(int __a, const unsigned short *__b) {
12862 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12863 vec_lvsl(__a, __b));
12866 static __inline__ vector unsigned short __ATTRS_o_ai
12867 vec_lvlxl(int __a, const vector unsigned short *__b) {
12868 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12869 vec_lvsl(__a, (unsigned char *)__b));
12872 static __inline__ vector bool short __ATTRS_o_ai
12873 vec_lvlxl(int __a, const vector bool short *__b) {
12874 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12875 vec_lvsl(__a, (unsigned char *)__b));
12878 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12879 const vector pixel *__b) {
12880 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12881 vec_lvsl(__a, (unsigned char *)__b));
12884 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12885 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12888 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12889 const vector int *__b) {
12890 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12891 vec_lvsl(__a, (unsigned char *)__b));
12894 static __inline__ vector unsigned int __ATTRS_o_ai
12895 vec_lvlxl(int __a, const unsigned int *__b) {
12896 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12897 vec_lvsl(__a, __b));
12900 static __inline__ vector unsigned int __ATTRS_o_ai
12901 vec_lvlxl(int __a, const vector unsigned int *__b) {
12902 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12903 vec_lvsl(__a, (unsigned char *)__b));
12906 static __inline__ vector bool int __ATTRS_o_ai
12907 vec_lvlxl(int __a, const vector bool int *__b) {
12908 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12909 vec_lvsl(__a, (unsigned char *)__b));
12912 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12913 const float *__b) {
12914 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12917 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12918 vector float *__b) {
12919 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12920 vec_lvsl(__a, (unsigned char *)__b));
12925 static __inline__ vector signed char __ATTRS_o_ai
12926 vec_lvrx(int __a, const signed char *__b) {
12927 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12928 vec_lvsl(__a, __b));
12931 static __inline__ vector signed char __ATTRS_o_ai
12932 vec_lvrx(int __a, const vector signed char *__b) {
12933 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12934 vec_lvsl(__a, (unsigned char *)__b));
12937 static __inline__ vector unsigned char __ATTRS_o_ai
12938 vec_lvrx(int __a, const unsigned char *__b) {
12939 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12940 vec_lvsl(__a, __b));
12943 static __inline__ vector unsigned char __ATTRS_o_ai
12944 vec_lvrx(int __a, const vector unsigned char *__b) {
12945 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12946 vec_lvsl(__a, (unsigned char *)__b));
12949 static __inline__ vector bool char __ATTRS_o_ai
12950 vec_lvrx(int __a, const vector bool char *__b) {
12951 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
12952 vec_lvsl(__a, (unsigned char *)__b));
12955 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12956 const short *__b) {
12957 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12960 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12961 const vector short *__b) {
12962 return vec_perm((vector short)(0), vec_ld(__a, __b),
12963 vec_lvsl(__a, (unsigned char *)__b));
12966 static __inline__ vector unsigned short __ATTRS_o_ai
12967 vec_lvrx(int __a, const unsigned short *__b) {
12968 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12969 vec_lvsl(__a, __b));
12972 static __inline__ vector unsigned short __ATTRS_o_ai
12973 vec_lvrx(int __a, const vector unsigned short *__b) {
12974 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12975 vec_lvsl(__a, (unsigned char *)__b));
12978 static __inline__ vector bool short __ATTRS_o_ai
12979 vec_lvrx(int __a, const vector bool short *__b) {
12980 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
12981 vec_lvsl(__a, (unsigned char *)__b));
12984 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
12985 const vector pixel *__b) {
12986 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
12987 vec_lvsl(__a, (unsigned char *)__b));
12990 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
12991 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12994 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
12995 const vector int *__b) {
12996 return vec_perm((vector int)(0), vec_ld(__a, __b),
12997 vec_lvsl(__a, (unsigned char *)__b));
13000 static __inline__ vector unsigned int __ATTRS_o_ai
13001 vec_lvrx(int __a, const unsigned int *__b) {
13002 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13003 vec_lvsl(__a, __b));
13006 static __inline__ vector unsigned int __ATTRS_o_ai
13007 vec_lvrx(int __a, const vector unsigned int *__b) {
13008 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13009 vec_lvsl(__a, (unsigned char *)__b));
13012 static __inline__ vector bool int __ATTRS_o_ai
13013 vec_lvrx(int __a, const vector bool int *__b) {
13014 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13015 vec_lvsl(__a, (unsigned char *)__b));
13018 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13019 const float *__b) {
13020 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13023 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13024 const vector float *__b) {
13025 return vec_perm((vector float)(0), vec_ld(__a, __b),
13026 vec_lvsl(__a, (unsigned char *)__b));
13031 static __inline__ vector signed char __ATTRS_o_ai
13032 vec_lvrxl(int __a, const signed char *__b) {
13033 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13034 vec_lvsl(__a, __b));
13037 static __inline__ vector signed char __ATTRS_o_ai
13038 vec_lvrxl(int __a, const vector signed char *__b) {
13039 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13040 vec_lvsl(__a, (unsigned char *)__b));
13043 static __inline__ vector unsigned char __ATTRS_o_ai
13044 vec_lvrxl(int __a, const unsigned char *__b) {
13045 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13046 vec_lvsl(__a, __b));
13049 static __inline__ vector unsigned char __ATTRS_o_ai
13050 vec_lvrxl(int __a, const vector unsigned char *__b) {
13051 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13052 vec_lvsl(__a, (unsigned char *)__b));
13055 static __inline__ vector bool char __ATTRS_o_ai
13056 vec_lvrxl(int __a, const vector bool char *__b) {
13057 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13058 vec_lvsl(__a, (unsigned char *)__b));
13061 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13062 const short *__b) {
13063 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13066 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13067 const vector short *__b) {
13068 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13069 vec_lvsl(__a, (unsigned char *)__b));
13072 static __inline__ vector unsigned short __ATTRS_o_ai
13073 vec_lvrxl(int __a, const unsigned short *__b) {
13074 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13075 vec_lvsl(__a, __b));
13078 static __inline__ vector unsigned short __ATTRS_o_ai
13079 vec_lvrxl(int __a, const vector unsigned short *__b) {
13080 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13081 vec_lvsl(__a, (unsigned char *)__b));
13084 static __inline__ vector bool short __ATTRS_o_ai
13085 vec_lvrxl(int __a, const vector bool short *__b) {
13086 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13087 vec_lvsl(__a, (unsigned char *)__b));
13090 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13091 const vector pixel *__b) {
13092 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13093 vec_lvsl(__a, (unsigned char *)__b));
13096 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13097 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13100 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13101 const vector int *__b) {
13102 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13103 vec_lvsl(__a, (unsigned char *)__b));
13106 static __inline__ vector unsigned int __ATTRS_o_ai
13107 vec_lvrxl(int __a, const unsigned int *__b) {
13108 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13109 vec_lvsl(__a, __b));
13112 static __inline__ vector unsigned int __ATTRS_o_ai
13113 vec_lvrxl(int __a, const vector unsigned int *__b) {
13114 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13115 vec_lvsl(__a, (unsigned char *)__b));
13118 static __inline__ vector bool int __ATTRS_o_ai
13119 vec_lvrxl(int __a, const vector bool int *__b) {
13120 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13121 vec_lvsl(__a, (unsigned char *)__b));
13124 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13125 const float *__b) {
13126 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13129 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13130 const vector float *__b) {
13131 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13132 vec_lvsl(__a, (unsigned char *)__b));
13137 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13138 signed char *__c) {
13139 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13143 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13144 vector signed char *__c) {
13146 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13150 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13151 unsigned char *__c) {
13152 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13156 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13157 vector unsigned char *__c) {
13159 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13163 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13164 vector bool char *__c) {
13166 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13170 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13172 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13176 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13177 vector short *__c) {
13179 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13183 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13184 int __b, unsigned short *__c) {
13185 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13189 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13191 vector unsigned 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 bool short __a, int __b,
13198 vector bool short *__c) {
13200 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13204 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13205 vector pixel *__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 int __a, int __b,
13213 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13217 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13220 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13224 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13225 unsigned int *__c) {
13226 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13230 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13231 vector unsigned int *__c) {
13233 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13237 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13238 vector bool int *__c) {
13240 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13244 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13245 vector float *__c) {
13247 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13253 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13254 signed char *__c) {
13255 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13259 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13260 vector signed char *__c) {
13262 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13266 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13267 int __b, unsigned char *__c) {
13268 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13272 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13274 vector unsigned 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 bool char __a, int __b,
13281 vector bool char *__c) {
13283 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13287 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13289 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13293 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13294 vector short *__c) {
13296 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13300 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13301 int __b, unsigned short *__c) {
13302 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13306 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13308 vector unsigned 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 bool short __a, int __b,
13315 vector bool short *__c) {
13317 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13321 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13322 vector pixel *__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 int __a, int __b,
13330 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13334 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13337 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13341 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13342 unsigned int *__c) {
13343 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13347 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13348 vector unsigned int *__c) {
13350 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13354 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13355 vector bool int *__c) {
13357 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13361 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13362 vector float *__c) {
13364 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13370 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13371 signed char *__c) {
13372 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13376 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13377 vector signed char *__c) {
13379 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13383 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13384 unsigned char *__c) {
13385 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13389 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13390 vector unsigned char *__c) {
13392 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13396 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13397 vector bool char *__c) {
13399 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13403 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13405 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13409 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13410 vector short *__c) {
13412 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13416 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13417 int __b, unsigned short *__c) {
13418 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13422 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13424 vector unsigned 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 bool short __a, int __b,
13431 vector bool short *__c) {
13433 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13437 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13438 vector pixel *__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 int __a, int __b,
13446 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13450 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13453 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13457 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13458 unsigned int *__c) {
13459 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13463 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13464 vector unsigned int *__c) {
13466 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13470 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13471 vector bool int *__c) {
13473 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13477 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13478 vector float *__c) {
13480 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13486 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13487 signed char *__c) {
13488 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13492 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13493 vector signed char *__c) {
13495 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13499 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13500 int __b, unsigned char *__c) {
13501 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13505 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13507 vector unsigned 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 bool char __a, int __b,
13514 vector bool char *__c) {
13516 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13520 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13522 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13526 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13527 vector short *__c) {
13529 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13533 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13534 int __b, unsigned short *__c) {
13535 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13539 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13541 vector unsigned 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 bool short __a, int __b,
13548 vector bool short *__c) {
13550 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13554 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13555 vector pixel *__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 int __a, int __b,
13563 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13567 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13570 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13574 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13575 unsigned int *__c) {
13576 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13580 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13581 vector unsigned int *__c) {
13583 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13587 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13588 vector bool int *__c) {
13590 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13594 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13595 vector float *__c) {
13597 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13603 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13605 vector signed char __res = (vector signed char)(0);
13610 static __inline__ vector unsigned char __ATTRS_o_ai
13611 vec_promote(unsigned char __a, int __b) {
13612 vector unsigned char __res = (vector unsigned char)(0);
13617 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13618 vector short __res = (vector short)(0);
13623 static __inline__ vector unsigned short __ATTRS_o_ai
13624 vec_promote(unsigned short __a, int __b) {
13625 vector unsigned short __res = (vector unsigned short)(0);
13630 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13631 vector int __res = (vector int)(0);
13636 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13638 vector unsigned int __res = (vector unsigned int)(0);
13643 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13644 vector float __res = (vector float)(0);
13651 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13652 return (vector signed char)(__a);
13655 static __inline__ vector unsigned char __ATTRS_o_ai
13656 vec_splats(unsigned char __a) {
13657 return (vector unsigned char)(__a);
13660 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13661 return (vector short)(__a);
13664 static __inline__ vector unsigned short __ATTRS_o_ai
13665 vec_splats(unsigned short __a) {
13666 return (vector unsigned short)(__a);
13669 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13670 return (vector int)(__a);
13673 static __inline__ vector unsigned int __ATTRS_o_ai
13674 vec_splats(unsigned int __a) {
13675 return (vector unsigned int)(__a);
13679 static __inline__ vector signed long long __ATTRS_o_ai
13680 vec_splats(signed long long __a) {
13681 return (vector signed long long)(__a);
13684 static __inline__ vector unsigned long long __ATTRS_o_ai
13685 vec_splats(unsigned long long __a) {
13686 return (vector unsigned long long)(__a);
13689 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13690 static __inline__ vector signed __int128 __ATTRS_o_ai
13691 vec_splats(signed __int128 __a) {
13692 return (vector signed __int128)(__a);
13695 static __inline__ vector unsigned __int128 __ATTRS_o_ai
13696 vec_splats(unsigned __int128 __a) {
13697 return (vector unsigned __int128)(__a);
13702 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13703 return (vector double)(__a);
13707 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13708 return (vector float)(__a);
13711 /* ----------------------------- predicates --------------------------------- */
13715 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13716 vector signed char __b) {
13717 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13721 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13722 vector bool char __b) {
13723 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13727 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13728 vector unsigned char __b) {
13729 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13733 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13734 vector bool char __b) {
13735 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13739 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13740 vector signed char __b) {
13741 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13745 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13746 vector unsigned char __b) {
13747 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13751 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13752 vector bool char __b) {
13753 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13757 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13758 vector short __b) {
13759 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13762 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13763 vector bool short __b) {
13764 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13767 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13768 vector unsigned short __b) {
13769 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13770 (vector short)__b);
13773 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13774 vector bool short __b) {
13775 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13776 (vector short)__b);
13779 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13780 vector short __b) {
13781 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13782 (vector short)__b);
13785 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13786 vector unsigned short __b) {
13787 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13788 (vector short)__b);
13791 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13792 vector bool short __b) {
13793 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13794 (vector short)__b);
13797 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13798 vector pixel __b) {
13799 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13800 (vector short)__b);
13803 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13804 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13807 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13808 vector bool int __b) {
13809 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13812 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13813 vector unsigned int __b) {
13814 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13818 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13819 vector bool int __b) {
13820 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13824 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13826 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13830 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13831 vector unsigned int __b) {
13832 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13836 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13837 vector bool int __b) {
13838 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13842 #ifdef __POWER8_VECTOR__
13843 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13844 vector signed long long __b) {
13845 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13848 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13849 vector bool long long __b) {
13850 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13853 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13854 vector unsigned long long __b) {
13855 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13856 (vector long long)__b);
13859 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13860 vector bool long long __b) {
13861 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13862 (vector long long)__b);
13865 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13866 vector long long __b) {
13867 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13868 (vector long long)__b);
13871 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13872 vector unsigned long long __b) {
13873 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13874 (vector long long)__b);
13877 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13878 vector bool long long __b) {
13879 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13880 (vector long long)__b);
13884 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13885 vector float __b) {
13887 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13889 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13894 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13895 vector double __b) {
13896 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13902 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13903 vector signed char __b) {
13904 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13907 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13908 vector bool char __b) {
13909 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13912 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13913 vector unsigned char __b) {
13914 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13917 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13918 vector bool char __b) {
13919 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13922 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13923 vector signed char __b) {
13924 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13925 (vector unsigned char)__a);
13928 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13929 vector unsigned char __b) {
13930 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13933 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13934 vector bool char __b) {
13935 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13936 (vector unsigned char)__a);
13939 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13940 vector short __b) {
13941 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
13944 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13945 vector bool short __b) {
13946 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
13949 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13950 vector unsigned short __b) {
13951 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
13954 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13955 vector bool short __b) {
13956 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13960 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13961 vector short __b) {
13962 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13963 (vector unsigned short)__a);
13966 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13967 vector unsigned short __b) {
13968 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
13969 (vector unsigned short)__a);
13972 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13973 vector bool short __b) {
13974 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13975 (vector unsigned short)__a);
13978 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
13979 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
13982 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
13983 vector bool int __b) {
13984 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
13987 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
13988 vector unsigned int __b) {
13989 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
13992 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
13993 vector bool int __b) {
13994 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
13997 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
13999 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14000 (vector unsigned int)__a);
14003 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14004 vector unsigned int __b) {
14005 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14008 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14009 vector bool int __b) {
14010 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14011 (vector unsigned int)__a);
14014 #ifdef __POWER8_VECTOR__
14015 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14016 vector signed long long __b) {
14017 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14019 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14020 vector bool long long __b) {
14021 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14025 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14026 vector unsigned long long __b) {
14027 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14030 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14031 vector bool long long __b) {
14032 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14036 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14037 vector signed long long __b) {
14038 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14039 (vector unsigned long long)__a);
14042 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14043 vector unsigned long long __b) {
14044 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14045 (vector unsigned long long)__a);
14048 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14049 vector bool long long __b) {
14050 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14051 (vector unsigned long long)__a);
14055 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14056 vector float __b) {
14058 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14060 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14065 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14066 vector double __b) {
14067 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14073 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14074 vector signed char __b) {
14075 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14078 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14079 vector bool char __b) {
14080 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14083 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14084 vector unsigned char __b) {
14085 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14088 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14089 vector bool char __b) {
14090 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14093 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14094 vector signed char __b) {
14095 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14096 (vector unsigned char)__b);
14099 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14100 vector unsigned char __b) {
14101 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14104 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14105 vector bool char __b) {
14106 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14107 (vector unsigned char)__b);
14110 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14111 vector short __b) {
14112 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14115 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14116 vector bool short __b) {
14117 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14120 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14121 vector unsigned short __b) {
14122 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14125 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14126 vector bool short __b) {
14127 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14128 (vector unsigned short)__b);
14131 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14132 vector short __b) {
14133 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14134 (vector unsigned short)__b);
14137 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14138 vector unsigned short __b) {
14139 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14143 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14144 vector bool short __b) {
14145 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14146 (vector unsigned short)__b);
14149 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14150 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14153 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14154 vector bool int __b) {
14155 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14158 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14159 vector unsigned int __b) {
14160 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14163 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14164 vector bool int __b) {
14165 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14168 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14170 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14171 (vector unsigned int)__b);
14174 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14175 vector unsigned int __b) {
14176 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14179 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14180 vector bool int __b) {
14181 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14182 (vector unsigned int)__b);
14185 #ifdef __POWER8_VECTOR__
14186 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14187 vector signed long long __b) {
14188 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14190 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14191 vector bool long long __b) {
14192 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14193 (vector signed long long)__b);
14196 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14197 vector unsigned long long __b) {
14198 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14201 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14202 vector bool long long __b) {
14203 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14204 (vector unsigned long long)__b);
14207 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14208 vector signed long long __b) {
14209 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14210 (vector unsigned long long)__b);
14213 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14214 vector unsigned long long __b) {
14215 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14219 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14220 vector bool long long __b) {
14221 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14222 (vector unsigned long long)__b);
14226 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14227 vector float __b) {
14229 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14231 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14236 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14237 vector double __b) {
14238 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14244 static __inline__ int __attribute__((__always_inline__))
14245 vec_all_in(vector float __a, vector float __b) {
14246 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14251 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14252 vector signed char __b) {
14253 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14256 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14257 vector bool char __b) {
14258 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14261 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14262 vector unsigned char __b) {
14263 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14266 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14267 vector bool char __b) {
14268 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14271 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14272 vector signed char __b) {
14273 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14274 (vector unsigned char)__b);
14277 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14278 vector unsigned char __b) {
14279 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14282 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14283 vector bool char __b) {
14284 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14285 (vector unsigned char)__b);
14288 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14289 vector short __b) {
14290 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14293 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14294 vector bool short __b) {
14295 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14298 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14299 vector unsigned short __b) {
14300 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14303 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14304 vector bool short __b) {
14305 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14306 (vector unsigned short)__b);
14309 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14310 vector short __b) {
14311 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14312 (vector unsigned short)__b);
14315 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14316 vector unsigned short __b) {
14317 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14321 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14322 vector bool short __b) {
14323 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14324 (vector unsigned short)__b);
14327 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14328 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14331 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14332 vector bool int __b) {
14333 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14336 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14337 vector unsigned int __b) {
14338 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14341 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14342 vector bool int __b) {
14343 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14346 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14348 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14349 (vector unsigned int)__b);
14352 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14353 vector unsigned int __b) {
14354 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14357 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14358 vector bool int __b) {
14359 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14360 (vector unsigned int)__b);
14363 #ifdef __POWER8_VECTOR__
14364 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14365 vector signed long long __b) {
14366 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14369 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14370 vector unsigned long long __b) {
14371 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14374 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14375 vector bool long long __b) {
14376 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14377 (vector signed long long)__b);
14380 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14381 vector bool long long __b) {
14382 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14383 (vector unsigned long long)__b);
14386 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14387 vector signed long long __b) {
14388 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14389 (vector unsigned long long)__b);
14392 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14393 vector unsigned long long __b) {
14394 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14398 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14399 vector bool long long __b) {
14400 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14401 (vector unsigned long long)__b);
14405 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14406 vector float __b) {
14408 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14410 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14415 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14416 vector double __b) {
14417 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14423 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14424 vector signed char __b) {
14425 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14428 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14429 vector bool char __b) {
14430 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14433 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14434 vector unsigned char __b) {
14435 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14438 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14439 vector bool char __b) {
14440 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14443 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14444 vector signed char __b) {
14445 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14446 (vector unsigned char)__a);
14449 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14450 vector unsigned char __b) {
14451 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14454 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14455 vector bool char __b) {
14456 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14457 (vector unsigned char)__a);
14460 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14461 vector short __b) {
14462 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14465 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14466 vector bool short __b) {
14467 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14470 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14471 vector unsigned short __b) {
14472 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14475 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14476 vector bool short __b) {
14477 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14481 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14482 vector short __b) {
14483 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14484 (vector unsigned short)__a);
14487 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14488 vector unsigned short __b) {
14489 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14490 (vector unsigned short)__a);
14493 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14494 vector bool short __b) {
14495 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14496 (vector unsigned short)__a);
14499 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14500 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14503 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14504 vector bool int __b) {
14505 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14508 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14509 vector unsigned int __b) {
14510 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14513 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14514 vector bool int __b) {
14515 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14518 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14520 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14521 (vector unsigned int)__a);
14524 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14525 vector unsigned int __b) {
14526 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14529 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14530 vector bool int __b) {
14531 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14532 (vector unsigned int)__a);
14535 #ifdef __POWER8_VECTOR__
14536 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14537 vector signed long long __b) {
14538 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14541 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14542 vector unsigned long long __b) {
14543 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14546 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14547 vector bool long long __b) {
14548 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14552 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14553 vector bool long long __b) {
14554 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14558 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14559 vector signed long long __b) {
14560 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14561 (vector unsigned long long)__a);
14564 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14565 vector unsigned long long __b) {
14566 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14567 (vector unsigned long long)__a);
14570 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14571 vector bool long long __b) {
14572 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14573 (vector unsigned long long)__a);
14577 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14578 vector float __b) {
14580 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14582 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14587 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14588 vector double __b) {
14589 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14595 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14597 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14599 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14604 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14605 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14611 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14612 vector signed char __b) {
14613 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14617 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14618 vector bool char __b) {
14619 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14623 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14624 vector unsigned char __b) {
14625 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14629 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14630 vector bool char __b) {
14631 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14635 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14636 vector signed char __b) {
14637 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14641 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14642 vector unsigned char __b) {
14643 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14647 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14648 vector bool char __b) {
14649 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14653 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14654 vector short __b) {
14655 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14658 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14659 vector bool short __b) {
14660 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14663 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14664 vector unsigned short __b) {
14665 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14666 (vector short)__b);
14669 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14670 vector bool short __b) {
14671 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14672 (vector short)__b);
14675 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14676 vector short __b) {
14677 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14678 (vector short)__b);
14681 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14682 vector unsigned short __b) {
14683 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14684 (vector short)__b);
14687 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14688 vector bool short __b) {
14689 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14690 (vector short)__b);
14693 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14694 vector pixel __b) {
14695 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14696 (vector short)__b);
14699 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14700 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14703 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14704 vector bool int __b) {
14705 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14708 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14709 vector unsigned int __b) {
14710 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14714 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14715 vector bool int __b) {
14716 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14720 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14722 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14726 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14727 vector unsigned int __b) {
14728 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14732 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14733 vector bool int __b) {
14734 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14738 #ifdef __POWER8_VECTOR__
14739 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14740 vector signed long long __b) {
14741 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14744 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14745 vector unsigned long long __b) {
14746 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14747 (vector long long)__b);
14750 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14751 vector bool long long __b) {
14752 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14753 (vector signed long long)__b);
14756 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14757 vector bool long long __b) {
14758 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14759 (vector signed long long)__b);
14762 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14763 vector signed long long __b) {
14764 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14765 (vector signed long long)__b);
14768 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14769 vector unsigned long long __b) {
14770 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14771 (vector signed long long)__b);
14774 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14775 vector bool long long __b) {
14776 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14777 (vector signed long long)__b);
14781 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14782 vector float __b) {
14784 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14786 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14791 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14792 vector double __b) {
14793 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14799 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14800 vector float __b) {
14802 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14804 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14809 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14810 vector double __b) {
14811 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14817 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14818 vector float __b) {
14820 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14822 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14827 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14828 vector double __b) {
14829 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14835 static __inline__ int __attribute__((__always_inline__))
14836 vec_all_nle(vector float __a, vector float __b) {
14837 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14842 static __inline__ int __attribute__((__always_inline__))
14843 vec_all_nlt(vector float __a, vector float __b) {
14844 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14847 /* vec_all_numeric */
14849 static __inline__ int __attribute__((__always_inline__))
14850 vec_all_numeric(vector float __a) {
14851 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14856 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14857 vector signed char __b) {
14858 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14862 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14863 vector bool char __b) {
14864 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14868 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14869 vector unsigned char __b) {
14870 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14874 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14875 vector bool char __b) {
14876 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14880 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14881 vector signed char __b) {
14882 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14886 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14887 vector unsigned char __b) {
14888 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14892 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14893 vector bool char __b) {
14894 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14898 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14899 vector short __b) {
14900 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14903 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14904 vector bool short __b) {
14905 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14908 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14909 vector unsigned short __b) {
14910 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14911 (vector short)__b);
14914 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14915 vector bool short __b) {
14916 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14917 (vector short)__b);
14920 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14921 vector short __b) {
14922 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14923 (vector short)__b);
14926 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14927 vector unsigned short __b) {
14928 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14929 (vector short)__b);
14932 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14933 vector bool short __b) {
14934 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14935 (vector short)__b);
14938 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14939 vector pixel __b) {
14940 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14941 (vector short)__b);
14944 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
14945 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
14948 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
14949 vector bool int __b) {
14950 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
14953 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14954 vector unsigned int __b) {
14955 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14959 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14960 vector bool int __b) {
14961 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14965 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14967 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14971 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14972 vector unsigned int __b) {
14973 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14977 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14978 vector bool int __b) {
14979 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14983 #ifdef __POWER8_VECTOR__
14984 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14985 vector signed long long __b) {
14986 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
14989 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
14990 vector unsigned long long __b) {
14991 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
14992 (vector long long)__b);
14995 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14996 vector bool long long __b) {
14997 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
14998 (vector signed long long)__b);
15001 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15002 vector bool long long __b) {
15003 return __builtin_altivec_vcmpequd_p(
15004 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15007 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15008 vector signed long long __b) {
15009 return __builtin_altivec_vcmpequd_p(
15010 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15013 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15014 vector unsigned long long __b) {
15015 return __builtin_altivec_vcmpequd_p(
15016 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15019 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15020 vector bool long long __b) {
15021 return __builtin_altivec_vcmpequd_p(
15022 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15026 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15027 vector float __b) {
15029 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15031 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15036 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15037 vector double __b) {
15038 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15044 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15045 vector signed char __b) {
15046 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15049 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15050 vector bool char __b) {
15051 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15055 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15056 vector unsigned char __b) {
15057 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15060 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15061 vector bool char __b) {
15062 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15066 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15067 vector signed char __b) {
15068 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15069 (vector unsigned char)__a);
15072 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15073 vector unsigned char __b) {
15074 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15075 (vector unsigned char)__a);
15078 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15079 vector bool char __b) {
15080 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15081 (vector unsigned char)__a);
15084 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15085 vector short __b) {
15086 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15089 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15090 vector bool short __b) {
15091 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15094 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15095 vector unsigned short __b) {
15096 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15099 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15100 vector bool short __b) {
15101 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15105 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15106 vector short __b) {
15107 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15108 (vector unsigned short)__a);
15111 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15112 vector unsigned short __b) {
15113 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15114 (vector unsigned short)__a);
15117 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15118 vector bool short __b) {
15119 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15120 (vector unsigned short)__a);
15123 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15124 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15127 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15128 vector bool int __b) {
15129 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15132 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15133 vector unsigned int __b) {
15134 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15137 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15138 vector bool int __b) {
15139 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15143 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15145 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15146 (vector unsigned int)__a);
15149 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15150 vector unsigned int __b) {
15151 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15152 (vector unsigned int)__a);
15155 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15156 vector bool int __b) {
15157 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15158 (vector unsigned int)__a);
15161 #ifdef __POWER8_VECTOR__
15162 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15163 vector signed long long __b) {
15164 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15167 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15168 vector unsigned long long __b) {
15169 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15172 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15173 vector bool long long __b) {
15174 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15175 (vector signed long long)__b, __a);
15178 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15179 vector bool long long __b) {
15180 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15181 (vector unsigned long long)__b, __a);
15184 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15185 vector signed long long __b) {
15186 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15187 (vector unsigned long long)__b,
15188 (vector unsigned long long)__a);
15191 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15192 vector unsigned long long __b) {
15193 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15194 (vector unsigned long long)__a);
15197 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15198 vector bool long long __b) {
15199 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15200 (vector unsigned long long)__b,
15201 (vector unsigned long long)__a);
15205 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15206 vector float __b) {
15208 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15210 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15215 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15216 vector double __b) {
15217 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15223 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15224 vector signed char __b) {
15225 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15228 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15229 vector bool char __b) {
15230 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15231 (vector signed char)__b);
15234 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15235 vector unsigned char __b) {
15236 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15239 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15240 vector bool char __b) {
15241 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15242 (vector unsigned char)__b);
15245 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15246 vector signed char __b) {
15247 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15248 (vector unsigned char)__b);
15251 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15252 vector unsigned char __b) {
15253 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15257 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15258 vector bool char __b) {
15259 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15260 (vector unsigned char)__b);
15263 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15264 vector short __b) {
15265 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15268 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15269 vector bool short __b) {
15270 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15273 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15274 vector unsigned short __b) {
15275 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15278 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15279 vector bool short __b) {
15280 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15281 (vector unsigned short)__b);
15284 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15285 vector short __b) {
15286 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15287 (vector unsigned short)__b);
15290 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15291 vector unsigned short __b) {
15292 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15296 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15297 vector bool short __b) {
15298 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15299 (vector unsigned short)__b);
15302 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15303 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15306 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15307 vector bool int __b) {
15308 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15311 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15312 vector unsigned int __b) {
15313 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15316 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15317 vector bool int __b) {
15318 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15319 (vector unsigned int)__b);
15322 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15324 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15325 (vector unsigned int)__b);
15328 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15329 vector unsigned int __b) {
15330 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15334 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15335 vector bool int __b) {
15336 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15337 (vector unsigned int)__b);
15340 #ifdef __POWER8_VECTOR__
15341 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15342 vector signed long long __b) {
15343 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15346 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15347 vector unsigned long long __b) {
15348 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15351 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15352 vector bool long long __b) {
15353 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15354 (vector signed long long)__b);
15357 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15358 vector bool long long __b) {
15359 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15360 (vector unsigned long long)__b);
15363 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15364 vector signed long long __b) {
15365 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15366 (vector unsigned long long)__a,
15367 (vector unsigned long long)__b);
15370 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15371 vector unsigned long long __b) {
15372 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15373 (vector unsigned long long)__a, __b);
15376 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15377 vector bool long long __b) {
15378 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15379 (vector unsigned long long)__a,
15380 (vector unsigned long long)__b);
15384 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15385 vector float __b) {
15387 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15389 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15394 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15395 vector double __b) {
15396 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15402 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15403 vector signed char __b) {
15404 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15407 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15408 vector bool char __b) {
15409 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15410 (vector signed char)__b);
15413 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15414 vector unsigned char __b) {
15415 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15418 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15419 vector bool char __b) {
15420 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15421 (vector unsigned char)__b);
15424 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15425 vector signed char __b) {
15426 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15427 (vector unsigned char)__b);
15430 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15431 vector unsigned char __b) {
15432 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15436 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15437 vector bool char __b) {
15438 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15439 (vector unsigned char)__b);
15442 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15443 vector short __b) {
15444 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15447 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15448 vector bool short __b) {
15449 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15452 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15453 vector unsigned short __b) {
15454 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15457 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15458 vector bool short __b) {
15459 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15460 (vector unsigned short)__b);
15463 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15464 vector short __b) {
15465 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15466 (vector unsigned short)__b);
15469 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15470 vector unsigned short __b) {
15471 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15475 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15476 vector bool short __b) {
15477 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15478 (vector unsigned short)__b);
15481 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15482 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15485 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15486 vector bool int __b) {
15487 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15490 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15491 vector unsigned int __b) {
15492 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15495 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15496 vector bool int __b) {
15497 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15498 (vector unsigned int)__b);
15501 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15503 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15504 (vector unsigned int)__b);
15507 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15508 vector unsigned int __b) {
15509 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15513 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15514 vector bool int __b) {
15515 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15516 (vector unsigned int)__b);
15519 #ifdef __POWER8_VECTOR__
15520 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15521 vector signed long long __b) {
15522 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15525 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15526 vector unsigned long long __b) {
15527 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15530 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15531 vector bool long long __b) {
15532 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15533 (vector signed long long)__b);
15536 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15537 vector bool long long __b) {
15538 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15539 (vector unsigned long long)__b);
15542 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15543 vector signed long long __b) {
15544 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15545 (vector unsigned long long)__a,
15546 (vector unsigned long long)__b);
15549 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15550 vector unsigned long long __b) {
15551 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15552 (vector unsigned long long)__a, __b);
15555 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15556 vector bool long long __b) {
15557 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15558 (vector unsigned long long)__a,
15559 (vector unsigned long long)__b);
15563 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15564 vector float __b) {
15566 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15568 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15573 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15574 vector double __b) {
15575 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15581 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15582 vector signed char __b) {
15583 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15586 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15587 vector bool char __b) {
15588 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15592 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15593 vector unsigned char __b) {
15594 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15597 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15598 vector bool char __b) {
15599 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15603 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15604 vector signed char __b) {
15605 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15606 (vector unsigned char)__a);
15609 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15610 vector unsigned char __b) {
15611 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15612 (vector unsigned char)__a);
15615 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15616 vector bool char __b) {
15617 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15618 (vector unsigned char)__a);
15621 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15622 vector short __b) {
15623 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15626 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15627 vector bool short __b) {
15628 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15631 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15632 vector unsigned short __b) {
15633 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15636 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15637 vector bool short __b) {
15638 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15642 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15643 vector short __b) {
15644 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15645 (vector unsigned short)__a);
15648 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15649 vector unsigned short __b) {
15650 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15651 (vector unsigned short)__a);
15654 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15655 vector bool short __b) {
15656 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15657 (vector unsigned short)__a);
15660 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15661 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15664 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15665 vector bool int __b) {
15666 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15669 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15670 vector unsigned int __b) {
15671 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15674 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15675 vector bool int __b) {
15676 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15680 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15682 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15683 (vector unsigned int)__a);
15686 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15687 vector unsigned int __b) {
15688 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15689 (vector unsigned int)__a);
15692 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15693 vector bool int __b) {
15694 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15695 (vector unsigned int)__a);
15698 #ifdef __POWER8_VECTOR__
15699 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15700 vector signed long long __b) {
15701 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15704 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15705 vector unsigned long long __b) {
15706 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15709 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15710 vector bool long long __b) {
15711 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15712 (vector signed long long)__b, __a);
15715 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15716 vector bool long long __b) {
15717 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15718 (vector unsigned long long)__b, __a);
15721 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15722 vector signed long long __b) {
15723 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15724 (vector unsigned long long)__b,
15725 (vector unsigned long long)__a);
15728 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15729 vector unsigned long long __b) {
15730 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15731 (vector unsigned long long)__a);
15734 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15735 vector bool long long __b) {
15736 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15737 (vector unsigned long long)__b,
15738 (vector unsigned long long)__a);
15742 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15743 vector float __b) {
15745 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15747 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15752 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15753 vector double __b) {
15754 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15760 static __inline__ int __attribute__((__always_inline__))
15761 vec_any_nan(vector float __a) {
15762 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15767 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15768 vector signed char __b) {
15769 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15773 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15774 vector bool char __b) {
15775 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15779 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15780 vector unsigned char __b) {
15781 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15785 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15786 vector bool char __b) {
15787 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15791 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15792 vector signed char __b) {
15793 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15797 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15798 vector unsigned char __b) {
15799 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15803 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15804 vector bool char __b) {
15805 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15809 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15810 vector short __b) {
15811 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15814 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15815 vector bool short __b) {
15816 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15819 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15820 vector unsigned short __b) {
15821 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15822 (vector short)__b);
15825 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15826 vector bool short __b) {
15827 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15828 (vector short)__b);
15831 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15832 vector short __b) {
15833 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15834 (vector short)__b);
15837 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15838 vector unsigned short __b) {
15839 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15840 (vector short)__b);
15843 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15844 vector bool short __b) {
15845 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15846 (vector short)__b);
15849 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15850 vector pixel __b) {
15851 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15852 (vector short)__b);
15855 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15856 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15859 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15860 vector bool int __b) {
15861 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15864 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15865 vector unsigned int __b) {
15866 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15870 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15871 vector bool int __b) {
15872 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15876 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15878 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15882 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15883 vector unsigned int __b) {
15884 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15888 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15889 vector bool int __b) {
15890 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15894 #ifdef __POWER8_VECTOR__
15895 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15896 vector signed long long __b) {
15897 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15900 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15901 vector unsigned long long __b) {
15902 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15903 (vector long long)__b);
15906 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15907 vector bool long long __b) {
15908 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15909 (vector signed long long)__b);
15912 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15913 vector bool long long __b) {
15914 return __builtin_altivec_vcmpequd_p(
15915 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15918 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15919 vector signed long long __b) {
15920 return __builtin_altivec_vcmpequd_p(
15921 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15924 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15925 vector unsigned long long __b) {
15926 return __builtin_altivec_vcmpequd_p(
15927 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15930 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15931 vector bool long long __b) {
15932 return __builtin_altivec_vcmpequd_p(
15933 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15937 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15938 vector float __b) {
15940 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
15942 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
15947 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
15948 vector double __b) {
15949 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
15955 static __inline__ int __attribute__((__always_inline__))
15956 vec_any_nge(vector float __a, vector float __b) {
15957 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
15962 static __inline__ int __attribute__((__always_inline__))
15963 vec_any_ngt(vector float __a, vector float __b) {
15964 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
15969 static __inline__ int __attribute__((__always_inline__))
15970 vec_any_nle(vector float __a, vector float __b) {
15971 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
15976 static __inline__ int __attribute__((__always_inline__))
15977 vec_any_nlt(vector float __a, vector float __b) {
15978 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
15981 /* vec_any_numeric */
15983 static __inline__ int __attribute__((__always_inline__))
15984 vec_any_numeric(vector float __a) {
15985 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
15990 static __inline__ int __attribute__((__always_inline__))
15991 vec_any_out(vector float __a, vector float __b) {
15992 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
15995 /* Power 8 Crypto functions
15996 Note: We diverge from the current GCC implementation with regard
15997 to cryptography and related functions as follows:
15998 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
15999 - The remaining ones are only available on Power8 and up so
16000 require -mpower8-vector
16001 The justification for this is that export requirements require that
16002 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16003 support). As a result, we need to be able to turn off support for those.
16004 The remaining ones (currently controlled by -mcrypto for GCC) still
16005 need to be provided on compliant hardware even if Vector.Crypto is not
16009 #define vec_sbox_be __builtin_altivec_crypto_vsbox
16010 #define vec_cipher_be __builtin_altivec_crypto_vcipher
16011 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16012 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16013 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16015 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16016 __builtin_crypto_vsbox(vector unsigned long long __a) {
16017 return __builtin_altivec_crypto_vsbox(__a);
16020 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16021 __builtin_crypto_vcipher(vector unsigned long long __a,
16022 vector unsigned long long __b) {
16023 return __builtin_altivec_crypto_vcipher(__a, __b);
16026 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16027 __builtin_crypto_vcipherlast(vector unsigned long long __a,
16028 vector unsigned long long __b) {
16029 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16032 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16033 __builtin_crypto_vncipher(vector unsigned long long __a,
16034 vector unsigned long long __b) {
16035 return __builtin_altivec_crypto_vncipher(__a, __b);
16038 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16039 __builtin_crypto_vncipherlast(vector unsigned long long __a,
16040 vector unsigned long long __b) {
16041 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16044 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16045 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16047 #define vec_shasigma_be(X, Y, Z) \
16048 _Generic((X), vector unsigned int \
16049 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16050 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16053 #ifdef __POWER8_VECTOR__
16054 static __inline__ vector bool char __ATTRS_o_ai
16055 vec_permxor(vector bool char __a, vector bool char __b,
16056 vector bool char __c) {
16057 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16060 static __inline__ vector signed char __ATTRS_o_ai
16061 vec_permxor(vector signed char __a, vector signed char __b,
16062 vector signed char __c) {
16063 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16066 static __inline__ vector unsigned char __ATTRS_o_ai
16067 vec_permxor(vector unsigned char __a, vector unsigned char __b,
16068 vector unsigned char __c) {
16069 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16072 static __inline__ vector unsigned char __ATTRS_o_ai
16073 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16074 vector unsigned char __c) {
16075 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16078 static __inline__ vector unsigned short __ATTRS_o_ai
16079 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16080 vector unsigned short __c) {
16081 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16082 (vector unsigned char)__a, (vector unsigned char)__b,
16083 (vector unsigned char)__c);
16086 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16087 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16088 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16089 (vector unsigned char)__a, (vector unsigned char)__b,
16090 (vector unsigned char)__c);
16093 static __inline__ vector unsigned long long __ATTRS_o_ai
16094 __builtin_crypto_vpermxor(vector unsigned long long __a,
16095 vector unsigned long long __b,
16096 vector unsigned long long __c) {
16097 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16098 (vector unsigned char)__a, (vector unsigned char)__b,
16099 (vector unsigned char)__c);
16102 static __inline__ vector unsigned char __ATTRS_o_ai
16103 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16104 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16107 static __inline__ vector unsigned short __ATTRS_o_ai
16108 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16109 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16112 static __inline__ vector unsigned int __ATTRS_o_ai
16113 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16114 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16117 static __inline__ vector unsigned long long __ATTRS_o_ai
16118 __builtin_crypto_vpmsumb(vector unsigned long long __a,
16119 vector unsigned long long __b) {
16120 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16123 static __inline__ vector signed char __ATTRS_o_ai
16124 vec_vgbbd(vector signed char __a) {
16125 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16128 #define vec_pmsum_be __builtin_crypto_vpmsumb
16129 #define vec_gb __builtin_altivec_vgbbd
16131 static __inline__ vector unsigned char __ATTRS_o_ai
16132 vec_vgbbd(vector unsigned char __a) {
16133 return __builtin_altivec_vgbbd(__a);
16136 static __inline__ vector long long __ATTRS_o_ai
16137 vec_vbpermq(vector signed char __a, vector signed char __b) {
16138 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16139 (vector unsigned char)__b);
16142 static __inline__ vector long long __ATTRS_o_ai
16143 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16144 return __builtin_altivec_vbpermq(__a, __b);
16147 #ifdef __powerpc64__
16148 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16149 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16150 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16151 (vector unsigned char)__b);
16159 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16160 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16164 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16165 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16169 static inline __ATTRS_o_ai vector unsigned char
16170 vec_reve(vector unsigned char __a) {
16171 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16175 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16176 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16179 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16180 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16183 static inline __ATTRS_o_ai vector unsigned int
16184 vec_reve(vector unsigned int __a) {
16185 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16188 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16189 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16192 static inline __ATTRS_o_ai vector signed short
16193 vec_reve(vector signed short __a) {
16194 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16197 static inline __ATTRS_o_ai vector unsigned short
16198 vec_reve(vector unsigned short __a) {
16199 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16202 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16203 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16207 static inline __ATTRS_o_ai vector bool long long
16208 vec_reve(vector bool long long __a) {
16209 return __builtin_shufflevector(__a, __a, 1, 0);
16212 static inline __ATTRS_o_ai vector signed long long
16213 vec_reve(vector signed long long __a) {
16214 return __builtin_shufflevector(__a, __a, 1, 0);
16217 static inline __ATTRS_o_ai vector unsigned long long
16218 vec_reve(vector unsigned long long __a) {
16219 return __builtin_shufflevector(__a, __a, 1, 0);
16222 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16223 return __builtin_shufflevector(__a, __a, 1, 0);
16228 static __inline__ vector bool char __ATTRS_o_ai
16229 vec_revb(vector bool char __a) {
16233 static __inline__ vector signed char __ATTRS_o_ai
16234 vec_revb(vector signed char __a) {
16238 static __inline__ vector unsigned char __ATTRS_o_ai
16239 vec_revb(vector unsigned char __a) {
16243 static __inline__ vector bool short __ATTRS_o_ai
16244 vec_revb(vector bool short __a) {
16245 vector unsigned char __indices =
16246 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16247 return vec_perm(__a, __a, __indices);
16250 static __inline__ vector signed short __ATTRS_o_ai
16251 vec_revb(vector signed short __a) {
16252 vector unsigned char __indices =
16253 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16254 return vec_perm(__a, __a, __indices);
16257 static __inline__ vector unsigned short __ATTRS_o_ai
16258 vec_revb(vector unsigned 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 bool int __ATTRS_o_ai
16265 vec_revb(vector bool int __a) {
16266 vector unsigned char __indices =
16267 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16268 return vec_perm(__a, __a, __indices);
16271 static __inline__ vector signed int __ATTRS_o_ai
16272 vec_revb(vector signed int __a) {
16273 vector unsigned char __indices =
16274 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16275 return vec_perm(__a, __a, __indices);
16278 static __inline__ vector unsigned int __ATTRS_o_ai
16279 vec_revb(vector unsigned 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 float __ATTRS_o_ai
16286 vec_revb(vector float __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);
16293 static __inline__ vector bool long long __ATTRS_o_ai
16294 vec_revb(vector bool long long __a) {
16295 vector unsigned char __indices =
16296 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16297 return vec_perm(__a, __a, __indices);
16300 static __inline__ vector signed long long __ATTRS_o_ai
16301 vec_revb(vector signed long long __a) {
16302 vector unsigned char __indices =
16303 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16304 return vec_perm(__a, __a, __indices);
16307 static __inline__ vector unsigned long long __ATTRS_o_ai
16308 vec_revb(vector unsigned 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 double __ATTRS_o_ai
16315 vec_revb(vector double __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);
16320 #endif /* End __VSX__ */
16322 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16323 static __inline__ vector signed __int128 __ATTRS_o_ai
16324 vec_revb(vector signed __int128 __a) {
16325 vector unsigned char __indices =
16326 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16327 return (vector signed __int128)vec_perm((vector signed int)__a,
16328 (vector signed int)__a,
16332 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16333 vec_revb(vector unsigned __int128 __a) {
16334 vector unsigned char __indices =
16335 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16336 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16337 (vector signed int)__a,
16340 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16344 typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16345 typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16346 typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
16347 typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
16348 typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16349 typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16350 typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16352 static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16353 signed char *__ptr) {
16354 return *(unaligned_vec_schar *)(__ptr + __offset);
16357 static inline __ATTRS_o_ai vector unsigned char
16358 vec_xl(signed long long __offset, unsigned char *__ptr) {
16359 return *(unaligned_vec_uchar*)(__ptr + __offset);
16362 static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16363 signed short *__ptr) {
16364 return *(unaligned_vec_sshort *)(__ptr + __offset);
16367 static inline __ATTRS_o_ai vector unsigned short
16368 vec_xl(signed long long __offset, unsigned short *__ptr) {
16369 return *(unaligned_vec_ushort *)(__ptr + __offset);
16372 static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16373 signed int *__ptr) {
16374 return *(unaligned_vec_sint *)(__ptr + __offset);
16377 static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16378 unsigned int *__ptr) {
16379 return *(unaligned_vec_uint *)(__ptr + __offset);
16382 static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16384 return *(unaligned_vec_float *)(__ptr + __offset);
16388 typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
16389 typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16390 typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16392 static inline __ATTRS_o_ai vector signed long long
16393 vec_xl(signed long long __offset, signed long long *__ptr) {
16394 return *(unaligned_vec_sll *)(__ptr + __offset);
16397 static inline __ATTRS_o_ai vector unsigned long long
16398 vec_xl(signed long long __offset, unsigned long long *__ptr) {
16399 return *(unaligned_vec_ull *)(__ptr + __offset);
16402 static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16404 return *(unaligned_vec_double *)(__ptr + __offset);
16408 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16409 typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16410 typedef vector unsigned __int128 unaligned_vec_ui128
16411 __attribute__((aligned(1)));
16412 static inline __ATTRS_o_ai vector signed __int128
16413 vec_xl(signed long long __offset, signed __int128 *__ptr) {
16414 return *(unaligned_vec_si128 *)(__ptr + __offset);
16417 static inline __ATTRS_o_ai vector unsigned __int128
16418 vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
16419 return *(unaligned_vec_ui128 *)(__ptr + __offset);
16425 #ifdef __LITTLE_ENDIAN__
16426 static __inline__ vector signed char __ATTRS_o_ai
16427 vec_xl_be(signed long long __offset, signed char *__ptr) {
16428 vector signed char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16429 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16430 13, 12, 11, 10, 9, 8);
16433 static __inline__ vector unsigned char __ATTRS_o_ai
16434 vec_xl_be(signed long long __offset, unsigned char *__ptr) {
16435 vector unsigned char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16436 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16437 13, 12, 11, 10, 9, 8);
16440 static __inline__ vector signed short __ATTRS_o_ai
16441 vec_xl_be(signed long long __offset, signed short *__ptr) {
16442 vector signed short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16443 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16446 static __inline__ vector unsigned short __ATTRS_o_ai
16447 vec_xl_be(signed long long __offset, unsigned short *__ptr) {
16448 vector unsigned short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16449 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16452 static __inline__ vector signed int __ATTRS_o_ai
16453 vec_xl_be(signed long long __offset, signed int *__ptr) {
16454 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16457 static __inline__ vector unsigned int __ATTRS_o_ai
16458 vec_xl_be(signed long long __offset, unsigned int *__ptr) {
16459 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16462 static __inline__ vector float __ATTRS_o_ai
16463 vec_xl_be(signed long long __offset, float *__ptr) {
16464 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16468 static __inline__ vector signed long long __ATTRS_o_ai
16469 vec_xl_be(signed long long __offset, signed long long *__ptr) {
16470 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16473 static __inline__ vector unsigned long long __ATTRS_o_ai
16474 vec_xl_be(signed long long __offset, unsigned long long *__ptr) {
16475 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16478 static __inline__ vector double __ATTRS_o_ai
16479 vec_xl_be(signed long long __offset, double *__ptr) {
16480 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16484 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16485 static __inline__ vector signed __int128 __ATTRS_o_ai
16486 vec_xl_be(signed long long __offset, signed __int128 *__ptr) {
16487 return vec_xl(__offset, __ptr);
16490 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16491 vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
16492 return vec_xl(__offset, __ptr);
16496 #define vec_xl_be vec_xl
16501 static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16502 signed long long __offset,
16503 signed char *__ptr) {
16504 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
16507 static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16508 signed long long __offset,
16509 unsigned char *__ptr) {
16510 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
16513 static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16514 signed long long __offset,
16515 signed short *__ptr) {
16516 *(unaligned_vec_sshort *)(__ptr + __offset) = __vec;
16519 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16520 signed long long __offset,
16521 unsigned short *__ptr) {
16522 *(unaligned_vec_ushort *)(__ptr + __offset) = __vec;
16525 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16526 signed long long __offset,
16527 signed int *__ptr) {
16528 *(unaligned_vec_sint *)(__ptr + __offset) = __vec;
16531 static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16532 signed long long __offset,
16533 unsigned int *__ptr) {
16534 *(unaligned_vec_uint *)(__ptr + __offset) = __vec;
16537 static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16538 signed long long __offset,
16540 *(unaligned_vec_float *)(__ptr + __offset) = __vec;
16544 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16545 signed long long __offset,
16546 signed long long *__ptr) {
16547 *(unaligned_vec_sll *)(__ptr + __offset) = __vec;
16550 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16551 signed long long __offset,
16552 unsigned long long *__ptr) {
16553 *(unaligned_vec_ull *)(__ptr + __offset) = __vec;
16556 static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16557 signed long long __offset,
16559 *(unaligned_vec_double *)(__ptr + __offset) = __vec;
16563 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16564 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16565 signed long long __offset,
16566 signed __int128 *__ptr) {
16567 *(unaligned_vec_si128 *)(__ptr + __offset) = __vec;
16570 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16571 signed long long __offset,
16572 unsigned __int128 *__ptr) {
16573 *(unaligned_vec_ui128 *)(__ptr + __offset) = __vec;
16579 #ifdef __LITTLE_ENDIAN__
16580 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16581 signed long long __offset,
16582 signed char *__ptr) {
16583 vector signed char __tmp =
16584 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16585 13, 12, 11, 10, 9, 8);
16586 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16589 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16590 signed long long __offset,
16591 unsigned char *__ptr) {
16592 vector unsigned char __tmp =
16593 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16594 13, 12, 11, 10, 9, 8);
16595 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16598 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16599 signed long long __offset,
16600 signed short *__ptr) {
16601 vector signed short __tmp =
16602 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16603 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16606 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16607 signed long long __offset,
16608 unsigned short *__ptr) {
16609 vector unsigned short __tmp =
16610 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16611 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16614 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16615 signed long long __offset,
16616 signed int *__ptr) {
16617 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16620 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16621 signed long long __offset,
16622 unsigned int *__ptr) {
16623 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16626 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16627 signed long long __offset,
16629 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16633 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16634 signed long long __offset,
16635 signed long long *__ptr) {
16636 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16639 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16640 signed long long __offset,
16641 unsigned long long *__ptr) {
16642 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16645 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16646 signed long long __offset,
16648 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16652 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16653 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16654 signed long long __offset,
16655 signed __int128 *__ptr) {
16656 vec_xst(__vec, __offset, __ptr);
16659 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16660 signed long long __offset,
16661 unsigned __int128 *__ptr) {
16662 vec_xst(__vec, __offset, __ptr);
16666 #define vec_xst_be vec_xst
16669 #ifdef __POWER9_VECTOR__
16670 #define vec_test_data_class(__a, __b) \
16673 (vector bool int)__builtin_vsx_xvtstdcsp((__a), (__b)), \
16675 (vector bool long long)__builtin_vsx_xvtstdcdp((__a), (__b)) \
16678 #endif /* #ifdef __POWER9_VECTOR__ */
16680 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16685 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16691 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16692 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16697 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16701 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16705 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16709 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16710 return - vec_abs(__a);
16714 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16715 return - vec_abs(__a);
16720 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16721 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16722 return __builtin_altivec_vminsd(__a, -__a);
16726 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16727 return __builtin_altivec_vminsw(__a, -__a);
16730 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16731 return __builtin_altivec_vminsh(__a, -__a);
16734 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16735 return __builtin_altivec_vminsb(__a, -__a);
16737 #undef __ATTRS_o_ai
16739 #endif /* __ALTIVEC_H */