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 unsigned char __ATTRS_o_ai
2765 vec_xl_len_r(unsigned char *__a, size_t __b) {
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((vector int)(__a), (__b)), \
2880 vector unsigned int \
2881 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2883 vector unsigned long long \
2884 : (__builtin_convertvector((vector unsigned long long)(__a), \
2886 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2888 vector signed long long \
2889 : (__builtin_convertvector((vector signed long long)(__a), \
2891 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2894 #define vec_ctf(__a, __b) \
2895 _Generic((__a), vector int \
2896 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2897 vector unsigned int \
2898 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2904 #define vec_vcfux __builtin_altivec_vcfux
2908 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2913 #define vec_cts(__a, __b) \
2914 _Generic((__a), vector float \
2915 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
2918 vector double __ret = \
2919 (vector double)(__a) * \
2920 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2922 __builtin_convertvector(__ret, vector signed long long); \
2925 #define vec_cts __builtin_altivec_vctsxs
2930 #define vec_vctsxs __builtin_altivec_vctsxs
2935 #define vec_ctu(__a, __b) \
2936 _Generic((__a), vector float \
2937 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
2940 vector double __ret = \
2941 (vector double)(__a) * \
2942 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2944 __builtin_convertvector(__ret, vector unsigned long long); \
2947 #define vec_ctu __builtin_altivec_vctuxs
2952 #define vec_vctuxs __builtin_altivec_vctuxs
2956 static __inline__ vector signed int __ATTRS_o_ai
2957 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2959 static __inline__ vector signed int __ATTRS_o_ai
2960 vec_signed(vector float __a) {
2961 return __builtin_convertvector(__a, vector signed int);
2965 static __inline__ vector signed long long __ATTRS_o_ai
2966 vec_signed(vector double __a) {
2967 return __builtin_convertvector(__a, vector signed long long);
2970 static __inline__ vector signed int __attribute__((__always_inline__))
2971 vec_signed2(vector double __a, vector double __b) {
2972 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2975 static __inline__ vector signed int __ATTRS_o_ai
2976 vec_signede(vector double __a) {
2977 #ifdef __LITTLE_ENDIAN__
2978 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2979 return vec_sld(__ret, __ret, 12);
2981 return __builtin_vsx_xvcvdpsxws(__a);
2985 static __inline__ vector signed int __ATTRS_o_ai
2986 vec_signedo(vector double __a) {
2987 #ifdef __LITTLE_ENDIAN__
2988 return __builtin_vsx_xvcvdpsxws(__a);
2990 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2991 return vec_sld(__ret, __ret, 12);
2998 static __inline__ vector unsigned int __ATTRS_o_ai
2999 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3001 static __inline__ vector unsigned int __ATTRS_o_ai
3002 vec_unsigned(vector float __a) {
3003 return __builtin_convertvector(__a, vector unsigned int);
3007 static __inline__ vector unsigned long long __ATTRS_o_ai
3008 vec_unsigned(vector double __a) {
3009 return __builtin_convertvector(__a, vector unsigned long long);
3012 static __inline__ vector unsigned int __attribute__((__always_inline__))
3013 vec_unsigned2(vector double __a, vector double __b) {
3014 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3017 static __inline__ vector unsigned int __ATTRS_o_ai
3018 vec_unsignede(vector double __a) {
3019 #ifdef __LITTLE_ENDIAN__
3020 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3021 return vec_sld(__ret, __ret, 12);
3023 return __builtin_vsx_xvcvdpuxws(__a);
3027 static __inline__ vector unsigned int __ATTRS_o_ai
3028 vec_unsignedo(vector double __a) {
3029 #ifdef __LITTLE_ENDIAN__
3030 return __builtin_vsx_xvcvdpuxws(__a);
3032 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3033 return vec_sld(__ret, __ret, 12);
3040 static __inline__ vector float __ATTRS_o_ai
3041 vec_sld(vector float, vector float, unsigned const int __c);
3043 static __inline__ vector float __ATTRS_o_ai
3044 vec_float(vector signed int __a) {
3045 return __builtin_convertvector(__a, vector float);
3048 static __inline__ vector float __ATTRS_o_ai
3049 vec_float(vector unsigned int __a) {
3050 return __builtin_convertvector(__a, vector float);
3054 static __inline__ vector float __ATTRS_o_ai
3055 vec_float2(vector signed long long __a, vector signed long long __b) {
3056 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3059 static __inline__ vector float __ATTRS_o_ai
3060 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3061 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3064 static __inline__ vector float __ATTRS_o_ai
3065 vec_float2(vector double __a, vector double __b) {
3066 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3069 static __inline__ vector float __ATTRS_o_ai
3070 vec_floate(vector signed long long __a) {
3071 #ifdef __LITTLE_ENDIAN__
3072 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3073 return vec_sld(__ret, __ret, 12);
3075 return __builtin_vsx_xvcvsxdsp(__a);
3079 static __inline__ vector float __ATTRS_o_ai
3080 vec_floate(vector unsigned long long __a) {
3081 #ifdef __LITTLE_ENDIAN__
3082 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3083 return vec_sld(__ret, __ret, 12);
3085 return __builtin_vsx_xvcvuxdsp(__a);
3089 static __inline__ vector float __ATTRS_o_ai
3090 vec_floate(vector double __a) {
3091 #ifdef __LITTLE_ENDIAN__
3092 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3093 return vec_sld(__ret, __ret, 12);
3095 return __builtin_vsx_xvcvdpsp(__a);
3099 static __inline__ vector float __ATTRS_o_ai
3100 vec_floato(vector signed long long __a) {
3101 #ifdef __LITTLE_ENDIAN__
3102 return __builtin_vsx_xvcvsxdsp(__a);
3104 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3105 return vec_sld(__ret, __ret, 12);
3109 static __inline__ vector float __ATTRS_o_ai
3110 vec_floato(vector unsigned long long __a) {
3111 #ifdef __LITTLE_ENDIAN__
3112 return __builtin_vsx_xvcvuxdsp(__a);
3114 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3115 return vec_sld(__ret, __ret, 12);
3119 static __inline__ vector float __ATTRS_o_ai
3120 vec_floato(vector double __a) {
3121 #ifdef __LITTLE_ENDIAN__
3122 return __builtin_vsx_xvcvdpsp(__a);
3124 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3125 return vec_sld(__ret, __ret, 12);
3133 static __inline__ vector double __ATTRS_o_ai
3134 vec_double(vector signed long long __a) {
3135 return __builtin_convertvector(__a, vector double);
3138 static __inline__ vector double __ATTRS_o_ai
3139 vec_double(vector unsigned long long __a) {
3140 return __builtin_convertvector(__a, vector double);
3143 static __inline__ vector double __ATTRS_o_ai
3144 vec_doublee(vector signed int __a) {
3145 #ifdef __LITTLE_ENDIAN__
3146 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3148 return __builtin_vsx_xvcvsxwdp(__a);
3152 static __inline__ vector double __ATTRS_o_ai
3153 vec_doublee(vector unsigned int __a) {
3154 #ifdef __LITTLE_ENDIAN__
3155 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3157 return __builtin_vsx_xvcvuxwdp(__a);
3161 static __inline__ vector double __ATTRS_o_ai
3162 vec_doublee(vector float __a) {
3163 #ifdef __LITTLE_ENDIAN__
3164 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3166 return __builtin_vsx_xvcvspdp(__a);
3170 static __inline__ vector double __ATTRS_o_ai
3171 vec_doubleh(vector signed int __a) {
3172 vector double __ret = {__a[0], __a[1]};
3176 static __inline__ vector double __ATTRS_o_ai
3177 vec_doubleh(vector unsigned int __a) {
3178 vector double __ret = {__a[0], __a[1]};
3182 static __inline__ vector double __ATTRS_o_ai
3183 vec_doubleh(vector float __a) {
3184 vector double __ret = {__a[0], __a[1]};
3188 static __inline__ vector double __ATTRS_o_ai
3189 vec_doublel(vector signed int __a) {
3190 vector double __ret = {__a[2], __a[3]};
3194 static __inline__ vector double __ATTRS_o_ai
3195 vec_doublel(vector unsigned int __a) {
3196 vector double __ret = {__a[2], __a[3]};
3200 static __inline__ vector double __ATTRS_o_ai
3201 vec_doublel(vector float __a) {
3202 vector double __ret = {__a[2], __a[3]};
3206 static __inline__ vector double __ATTRS_o_ai
3207 vec_doubleo(vector signed int __a) {
3208 #ifdef __LITTLE_ENDIAN__
3209 return __builtin_vsx_xvcvsxwdp(__a);
3211 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3215 static __inline__ vector double __ATTRS_o_ai
3216 vec_doubleo(vector unsigned int __a) {
3217 #ifdef __LITTLE_ENDIAN__
3218 return __builtin_vsx_xvcvuxwdp(__a);
3220 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3224 static __inline__ vector double __ATTRS_o_ai
3225 vec_doubleo(vector float __a) {
3226 #ifdef __LITTLE_ENDIAN__
3227 return __builtin_vsx_xvcvspdp(__a);
3229 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3236 /* Integer vector divides (vectors are scalarized, elements divided
3237 and the vectors reassembled).
3239 static __inline__ vector signed char __ATTRS_o_ai
3240 vec_div(vector signed char __a, vector signed char __b) {
3244 static __inline__ vector unsigned char __ATTRS_o_ai
3245 vec_div(vector unsigned char __a, vector unsigned char __b) {
3249 static __inline__ vector signed short __ATTRS_o_ai
3250 vec_div(vector signed short __a, vector signed short __b) {
3254 static __inline__ vector unsigned short __ATTRS_o_ai
3255 vec_div(vector unsigned short __a, vector unsigned short __b) {
3259 static __inline__ vector signed int __ATTRS_o_ai
3260 vec_div(vector signed int __a, vector signed int __b) {
3264 static __inline__ vector unsigned int __ATTRS_o_ai
3265 vec_div(vector unsigned int __a, vector unsigned int __b) {
3270 static __inline__ vector signed long long __ATTRS_o_ai
3271 vec_div(vector signed long long __a, vector signed long long __b) {
3275 static __inline__ vector unsigned long long __ATTRS_o_ai
3276 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3280 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3285 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3286 vector double __b) {
3293 #define vec_dss __builtin_altivec_dss
3297 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3298 __builtin_altivec_dssall();
3302 #define vec_dst(__PTR, __CW, __STR) \
3304 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3307 #define vec_dstst(__PTR, __CW, __STR) \
3309 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3312 #define vec_dststt(__PTR, __CW, __STR) \
3314 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3317 #define vec_dstt(__PTR, __CW, __STR) \
3319 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3323 #ifdef __POWER8_VECTOR__
3324 static __inline__ vector signed char __ATTRS_o_ai
3325 vec_eqv(vector signed char __a, vector signed char __b) {
3326 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3327 (vector unsigned int)__b);
3330 static __inline__ vector unsigned char __ATTRS_o_ai
3331 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3332 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3333 (vector unsigned int)__b);
3336 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3337 vector bool char __b) {
3338 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3339 (vector unsigned int)__b);
3342 static __inline__ vector signed short __ATTRS_o_ai
3343 vec_eqv(vector signed short __a, vector signed short __b) {
3344 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3345 (vector unsigned int)__b);
3348 static __inline__ vector unsigned short __ATTRS_o_ai
3349 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3350 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3351 (vector unsigned int)__b);
3354 static __inline__ vector bool short __ATTRS_o_ai
3355 vec_eqv(vector bool short __a, vector bool short __b) {
3356 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3357 (vector unsigned int)__b);
3360 static __inline__ vector signed int __ATTRS_o_ai
3361 vec_eqv(vector signed int __a, vector signed int __b) {
3362 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3363 (vector unsigned int)__b);
3366 static __inline__ vector unsigned int __ATTRS_o_ai
3367 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3368 return __builtin_vsx_xxleqv(__a, __b);
3371 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3372 vector bool int __b) {
3373 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3374 (vector unsigned int)__b);
3377 static __inline__ vector signed long long __ATTRS_o_ai
3378 vec_eqv(vector signed long long __a, vector signed long long __b) {
3379 return (vector signed long long)__builtin_vsx_xxleqv(
3380 (vector unsigned int)__a, (vector unsigned int)__b);
3383 static __inline__ vector unsigned long long __ATTRS_o_ai
3384 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3385 return (vector unsigned long long)__builtin_vsx_xxleqv(
3386 (vector unsigned int)__a, (vector unsigned int)__b);
3389 static __inline__ vector bool long long __ATTRS_o_ai
3390 vec_eqv(vector bool long long __a, vector bool long long __b) {
3391 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3392 (vector unsigned int)__b);
3395 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3397 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3398 (vector unsigned int)__b);
3401 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3402 vector double __b) {
3403 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3404 (vector unsigned int)__b);
3410 static __inline__ vector float __attribute__((__always_inline__))
3411 vec_expte(vector float __a) {
3412 return __builtin_altivec_vexptefp(__a);
3417 static __inline__ vector float __attribute__((__always_inline__))
3418 vec_vexptefp(vector float __a) {
3419 return __builtin_altivec_vexptefp(__a);
3424 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3426 return __builtin_vsx_xvrspim(__a);
3428 return __builtin_altivec_vrfim(__a);
3433 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3434 return __builtin_vsx_xvrdpim(__a);
3440 static __inline__ vector float __attribute__((__always_inline__))
3441 vec_vrfim(vector float __a) {
3442 return __builtin_altivec_vrfim(__a);
3447 static __inline__ vector signed char __ATTRS_o_ai
3448 vec_ld(int __a, const vector signed char *__b) {
3449 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3452 static __inline__ vector signed char __ATTRS_o_ai
3453 vec_ld(int __a, const signed char *__b) {
3454 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3457 static __inline__ vector unsigned char __ATTRS_o_ai
3458 vec_ld(int __a, const vector unsigned char *__b) {
3459 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3462 static __inline__ vector unsigned char __ATTRS_o_ai
3463 vec_ld(int __a, const unsigned char *__b) {
3464 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3467 static __inline__ vector bool char __ATTRS_o_ai
3468 vec_ld(int __a, const vector bool char *__b) {
3469 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3472 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3473 const vector short *__b) {
3474 return (vector short)__builtin_altivec_lvx(__a, __b);
3477 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3478 return (vector short)__builtin_altivec_lvx(__a, __b);
3481 static __inline__ vector unsigned short __ATTRS_o_ai
3482 vec_ld(int __a, const vector unsigned short *__b) {
3483 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3486 static __inline__ vector unsigned short __ATTRS_o_ai
3487 vec_ld(int __a, const unsigned short *__b) {
3488 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3491 static __inline__ vector bool short __ATTRS_o_ai
3492 vec_ld(int __a, const vector bool short *__b) {
3493 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3496 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3497 const vector pixel *__b) {
3498 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3501 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3502 const vector int *__b) {
3503 return (vector int)__builtin_altivec_lvx(__a, __b);
3506 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3507 return (vector int)__builtin_altivec_lvx(__a, __b);
3510 static __inline__ vector unsigned int __ATTRS_o_ai
3511 vec_ld(int __a, const vector unsigned int *__b) {
3512 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3515 static __inline__ vector unsigned int __ATTRS_o_ai
3516 vec_ld(int __a, const unsigned int *__b) {
3517 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3520 static __inline__ vector bool int __ATTRS_o_ai
3521 vec_ld(int __a, const vector bool int *__b) {
3522 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3525 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3526 const vector float *__b) {
3527 return (vector float)__builtin_altivec_lvx(__a, __b);
3530 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3531 return (vector float)__builtin_altivec_lvx(__a, __b);
3536 static __inline__ vector signed char __ATTRS_o_ai
3537 vec_lvx(int __a, const vector signed char *__b) {
3538 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3541 static __inline__ vector signed char __ATTRS_o_ai
3542 vec_lvx(int __a, const signed char *__b) {
3543 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3546 static __inline__ vector unsigned char __ATTRS_o_ai
3547 vec_lvx(int __a, const vector unsigned char *__b) {
3548 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3551 static __inline__ vector unsigned char __ATTRS_o_ai
3552 vec_lvx(int __a, const unsigned char *__b) {
3553 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3556 static __inline__ vector bool char __ATTRS_o_ai
3557 vec_lvx(int __a, const vector bool char *__b) {
3558 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3561 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3562 const vector short *__b) {
3563 return (vector short)__builtin_altivec_lvx(__a, __b);
3566 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3567 return (vector short)__builtin_altivec_lvx(__a, __b);
3570 static __inline__ vector unsigned short __ATTRS_o_ai
3571 vec_lvx(int __a, const vector unsigned short *__b) {
3572 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3575 static __inline__ vector unsigned short __ATTRS_o_ai
3576 vec_lvx(int __a, const unsigned short *__b) {
3577 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3580 static __inline__ vector bool short __ATTRS_o_ai
3581 vec_lvx(int __a, const vector bool short *__b) {
3582 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3585 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3586 const vector pixel *__b) {
3587 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3590 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3591 const vector int *__b) {
3592 return (vector int)__builtin_altivec_lvx(__a, __b);
3595 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3596 return (vector int)__builtin_altivec_lvx(__a, __b);
3599 static __inline__ vector unsigned int __ATTRS_o_ai
3600 vec_lvx(int __a, const vector unsigned int *__b) {
3601 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3604 static __inline__ vector unsigned int __ATTRS_o_ai
3605 vec_lvx(int __a, const unsigned int *__b) {
3606 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3609 static __inline__ vector bool int __ATTRS_o_ai
3610 vec_lvx(int __a, const vector bool int *__b) {
3611 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3614 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3615 const vector float *__b) {
3616 return (vector float)__builtin_altivec_lvx(__a, __b);
3619 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3620 return (vector float)__builtin_altivec_lvx(__a, __b);
3625 static __inline__ vector signed char __ATTRS_o_ai
3626 vec_lde(int __a, const signed char *__b) {
3627 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3630 static __inline__ vector unsigned char __ATTRS_o_ai
3631 vec_lde(int __a, const unsigned char *__b) {
3632 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3635 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3636 return (vector short)__builtin_altivec_lvehx(__a, __b);
3639 static __inline__ vector unsigned short __ATTRS_o_ai
3640 vec_lde(int __a, const unsigned short *__b) {
3641 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3644 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3645 return (vector int)__builtin_altivec_lvewx(__a, __b);
3648 static __inline__ vector unsigned int __ATTRS_o_ai
3649 vec_lde(int __a, const unsigned int *__b) {
3650 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3653 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3654 return (vector float)__builtin_altivec_lvewx(__a, __b);
3659 static __inline__ vector signed char __ATTRS_o_ai
3660 vec_lvebx(int __a, const signed char *__b) {
3661 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3664 static __inline__ vector unsigned char __ATTRS_o_ai
3665 vec_lvebx(int __a, const unsigned char *__b) {
3666 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3671 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3673 return (vector short)__builtin_altivec_lvehx(__a, __b);
3676 static __inline__ vector unsigned short __ATTRS_o_ai
3677 vec_lvehx(int __a, const unsigned short *__b) {
3678 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3683 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3684 return (vector int)__builtin_altivec_lvewx(__a, __b);
3687 static __inline__ vector unsigned int __ATTRS_o_ai
3688 vec_lvewx(int __a, const unsigned int *__b) {
3689 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3692 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3694 return (vector float)__builtin_altivec_lvewx(__a, __b);
3699 static __inline__ vector signed char __ATTRS_o_ai
3700 vec_ldl(int __a, const vector signed char *__b) {
3701 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3704 static __inline__ vector signed char __ATTRS_o_ai
3705 vec_ldl(int __a, const signed char *__b) {
3706 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3709 static __inline__ vector unsigned char __ATTRS_o_ai
3710 vec_ldl(int __a, const vector unsigned char *__b) {
3711 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3714 static __inline__ vector unsigned char __ATTRS_o_ai
3715 vec_ldl(int __a, const unsigned char *__b) {
3716 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3719 static __inline__ vector bool char __ATTRS_o_ai
3720 vec_ldl(int __a, const vector bool char *__b) {
3721 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3724 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3725 const vector short *__b) {
3726 return (vector short)__builtin_altivec_lvxl(__a, __b);
3729 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3730 return (vector short)__builtin_altivec_lvxl(__a, __b);
3733 static __inline__ vector unsigned short __ATTRS_o_ai
3734 vec_ldl(int __a, const vector unsigned short *__b) {
3735 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3738 static __inline__ vector unsigned short __ATTRS_o_ai
3739 vec_ldl(int __a, const unsigned short *__b) {
3740 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3743 static __inline__ vector bool short __ATTRS_o_ai
3744 vec_ldl(int __a, const vector bool short *__b) {
3745 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3748 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3749 const vector pixel *__b) {
3750 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3753 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3754 const vector int *__b) {
3755 return (vector int)__builtin_altivec_lvxl(__a, __b);
3758 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3759 return (vector int)__builtin_altivec_lvxl(__a, __b);
3762 static __inline__ vector unsigned int __ATTRS_o_ai
3763 vec_ldl(int __a, const vector unsigned int *__b) {
3764 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3767 static __inline__ vector unsigned int __ATTRS_o_ai
3768 vec_ldl(int __a, const unsigned int *__b) {
3769 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3772 static __inline__ vector bool int __ATTRS_o_ai
3773 vec_ldl(int __a, const vector bool int *__b) {
3774 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3777 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3778 const vector float *__b) {
3779 return (vector float)__builtin_altivec_lvxl(__a, __b);
3782 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3783 return (vector float)__builtin_altivec_lvxl(__a, __b);
3788 static __inline__ vector signed char __ATTRS_o_ai
3789 vec_lvxl(int __a, const vector signed char *__b) {
3790 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3793 static __inline__ vector signed char __ATTRS_o_ai
3794 vec_lvxl(int __a, const signed char *__b) {
3795 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3798 static __inline__ vector unsigned char __ATTRS_o_ai
3799 vec_lvxl(int __a, const vector unsigned char *__b) {
3800 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3803 static __inline__ vector unsigned char __ATTRS_o_ai
3804 vec_lvxl(int __a, const unsigned char *__b) {
3805 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3808 static __inline__ vector bool char __ATTRS_o_ai
3809 vec_lvxl(int __a, const vector bool char *__b) {
3810 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3813 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3814 const vector short *__b) {
3815 return (vector short)__builtin_altivec_lvxl(__a, __b);
3818 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3820 return (vector short)__builtin_altivec_lvxl(__a, __b);
3823 static __inline__ vector unsigned short __ATTRS_o_ai
3824 vec_lvxl(int __a, const vector unsigned short *__b) {
3825 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3828 static __inline__ vector unsigned short __ATTRS_o_ai
3829 vec_lvxl(int __a, const unsigned short *__b) {
3830 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3833 static __inline__ vector bool short __ATTRS_o_ai
3834 vec_lvxl(int __a, const vector bool short *__b) {
3835 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3838 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3839 const vector pixel *__b) {
3840 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3843 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3844 const vector int *__b) {
3845 return (vector int)__builtin_altivec_lvxl(__a, __b);
3848 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3849 return (vector int)__builtin_altivec_lvxl(__a, __b);
3852 static __inline__ vector unsigned int __ATTRS_o_ai
3853 vec_lvxl(int __a, const vector unsigned int *__b) {
3854 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3857 static __inline__ vector unsigned int __ATTRS_o_ai
3858 vec_lvxl(int __a, const unsigned int *__b) {
3859 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3862 static __inline__ vector bool int __ATTRS_o_ai
3863 vec_lvxl(int __a, const vector bool int *__b) {
3864 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3867 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3868 const vector float *__b) {
3869 return (vector float)__builtin_altivec_lvxl(__a, __b);
3872 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3874 return (vector float)__builtin_altivec_lvxl(__a, __b);
3879 static __inline__ vector float __attribute__((__always_inline__))
3880 vec_loge(vector float __a) {
3881 return __builtin_altivec_vlogefp(__a);
3886 static __inline__ vector float __attribute__((__always_inline__))
3887 vec_vlogefp(vector float __a) {
3888 return __builtin_altivec_vlogefp(__a);
3893 #ifdef __LITTLE_ENDIAN__
3894 static __inline__ vector unsigned char __ATTRS_o_ai
3895 __attribute__((__deprecated__("use assignment for unaligned little endian \
3896 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3897 vector unsigned char mask =
3898 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3899 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3900 7, 6, 5, 4, 3, 2, 1, 0};
3901 return vec_perm(mask, mask, reverse);
3904 static __inline__ vector unsigned char __ATTRS_o_ai
3905 vec_lvsl(int __a, const signed char *__b) {
3906 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3910 #ifdef __LITTLE_ENDIAN__
3911 static __inline__ vector unsigned char __ATTRS_o_ai
3912 __attribute__((__deprecated__("use assignment for unaligned little endian \
3913 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3914 vector unsigned char mask =
3915 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3916 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3917 7, 6, 5, 4, 3, 2, 1, 0};
3918 return vec_perm(mask, mask, reverse);
3921 static __inline__ vector unsigned char __ATTRS_o_ai
3922 vec_lvsl(int __a, const unsigned char *__b) {
3923 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3927 #ifdef __LITTLE_ENDIAN__
3928 static __inline__ vector unsigned char __ATTRS_o_ai
3929 __attribute__((__deprecated__("use assignment for unaligned little endian \
3930 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3931 vector unsigned char mask =
3932 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3933 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3934 7, 6, 5, 4, 3, 2, 1, 0};
3935 return vec_perm(mask, mask, reverse);
3938 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3940 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3944 #ifdef __LITTLE_ENDIAN__
3945 static __inline__ vector unsigned char __ATTRS_o_ai
3946 __attribute__((__deprecated__("use assignment for unaligned little endian \
3947 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3948 vector unsigned char mask =
3949 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3950 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3951 7, 6, 5, 4, 3, 2, 1, 0};
3952 return vec_perm(mask, mask, reverse);
3955 static __inline__ vector unsigned char __ATTRS_o_ai
3956 vec_lvsl(int __a, const unsigned short *__b) {
3957 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3961 #ifdef __LITTLE_ENDIAN__
3962 static __inline__ vector unsigned char __ATTRS_o_ai
3963 __attribute__((__deprecated__("use assignment for unaligned little endian \
3964 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3965 vector unsigned char mask =
3966 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3967 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3968 7, 6, 5, 4, 3, 2, 1, 0};
3969 return vec_perm(mask, mask, reverse);
3972 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3974 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3978 #ifdef __LITTLE_ENDIAN__
3979 static __inline__ vector unsigned char __ATTRS_o_ai
3980 __attribute__((__deprecated__("use assignment for unaligned little endian \
3981 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
3982 vector unsigned char mask =
3983 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3984 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3985 7, 6, 5, 4, 3, 2, 1, 0};
3986 return vec_perm(mask, mask, reverse);
3989 static __inline__ vector unsigned char __ATTRS_o_ai
3990 vec_lvsl(int __a, const unsigned int *__b) {
3991 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3995 #ifdef __LITTLE_ENDIAN__
3996 static __inline__ vector unsigned char __ATTRS_o_ai
3997 __attribute__((__deprecated__("use assignment for unaligned little endian \
3998 loads/stores"))) vec_lvsl(int __a, const float *__b) {
3999 vector unsigned char mask =
4000 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4001 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4002 7, 6, 5, 4, 3, 2, 1, 0};
4003 return vec_perm(mask, mask, reverse);
4006 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4008 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4014 #ifdef __LITTLE_ENDIAN__
4015 static __inline__ vector unsigned char __ATTRS_o_ai
4016 __attribute__((__deprecated__("use assignment for unaligned little endian \
4017 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4018 vector unsigned char mask =
4019 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4020 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4021 7, 6, 5, 4, 3, 2, 1, 0};
4022 return vec_perm(mask, mask, reverse);
4025 static __inline__ vector unsigned char __ATTRS_o_ai
4026 vec_lvsr(int __a, const signed char *__b) {
4027 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4031 #ifdef __LITTLE_ENDIAN__
4032 static __inline__ vector unsigned char __ATTRS_o_ai
4033 __attribute__((__deprecated__("use assignment for unaligned little endian \
4034 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4035 vector unsigned char mask =
4036 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4037 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4038 7, 6, 5, 4, 3, 2, 1, 0};
4039 return vec_perm(mask, mask, reverse);
4042 static __inline__ vector unsigned char __ATTRS_o_ai
4043 vec_lvsr(int __a, const unsigned char *__b) {
4044 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4048 #ifdef __LITTLE_ENDIAN__
4049 static __inline__ vector unsigned char __ATTRS_o_ai
4050 __attribute__((__deprecated__("use assignment for unaligned little endian \
4051 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4052 vector unsigned char mask =
4053 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4054 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4055 7, 6, 5, 4, 3, 2, 1, 0};
4056 return vec_perm(mask, mask, reverse);
4059 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4061 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4065 #ifdef __LITTLE_ENDIAN__
4066 static __inline__ vector unsigned char __ATTRS_o_ai
4067 __attribute__((__deprecated__("use assignment for unaligned little endian \
4068 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4069 vector unsigned char mask =
4070 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4071 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4072 7, 6, 5, 4, 3, 2, 1, 0};
4073 return vec_perm(mask, mask, reverse);
4076 static __inline__ vector unsigned char __ATTRS_o_ai
4077 vec_lvsr(int __a, const unsigned short *__b) {
4078 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4082 #ifdef __LITTLE_ENDIAN__
4083 static __inline__ vector unsigned char __ATTRS_o_ai
4084 __attribute__((__deprecated__("use assignment for unaligned little endian \
4085 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4086 vector unsigned char mask =
4087 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4088 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4089 7, 6, 5, 4, 3, 2, 1, 0};
4090 return vec_perm(mask, mask, reverse);
4093 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4095 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4099 #ifdef __LITTLE_ENDIAN__
4100 static __inline__ vector unsigned char __ATTRS_o_ai
4101 __attribute__((__deprecated__("use assignment for unaligned little endian \
4102 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4103 vector unsigned char mask =
4104 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4105 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4106 7, 6, 5, 4, 3, 2, 1, 0};
4107 return vec_perm(mask, mask, reverse);
4110 static __inline__ vector unsigned char __ATTRS_o_ai
4111 vec_lvsr(int __a, const unsigned int *__b) {
4112 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4116 #ifdef __LITTLE_ENDIAN__
4117 static __inline__ vector unsigned char __ATTRS_o_ai
4118 __attribute__((__deprecated__("use assignment for unaligned little endian \
4119 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4120 vector unsigned char mask =
4121 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4122 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4123 7, 6, 5, 4, 3, 2, 1, 0};
4124 return vec_perm(mask, mask, reverse);
4127 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4129 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4134 static __inline__ vector signed short __ATTRS_o_ai
4135 vec_mladd(vector signed short, vector signed short, vector signed short);
4136 static __inline__ vector signed short __ATTRS_o_ai
4137 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4138 static __inline__ vector signed short __ATTRS_o_ai
4139 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4140 static __inline__ vector unsigned short __ATTRS_o_ai
4141 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4143 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4144 vector signed short __a, vector signed short __b, vector signed short __c) {
4145 return vec_mladd(__a, __b, __c);
4148 static __inline__ vector signed short __ATTRS_o_ai
4149 vec_madd(vector signed short __a, vector unsigned short __b,
4150 vector unsigned short __c) {
4151 return vec_mladd(__a, __b, __c);
4154 static __inline__ vector signed short __ATTRS_o_ai
4155 vec_madd(vector unsigned short __a, vector signed short __b,
4156 vector signed short __c) {
4157 return vec_mladd(__a, __b, __c);
4160 static __inline__ vector unsigned short __ATTRS_o_ai
4161 vec_madd(vector unsigned short __a, vector unsigned short __b,
4162 vector unsigned short __c) {
4163 return vec_mladd(__a, __b, __c);
4166 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4170 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4172 return __builtin_altivec_vmaddfp(__a, __b, __c);
4177 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4179 vector double __c) {
4180 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4186 static __inline__ vector float __attribute__((__always_inline__))
4187 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4188 return __builtin_altivec_vmaddfp(__a, __b, __c);
4193 static __inline__ vector signed short __attribute__((__always_inline__))
4194 vec_madds(vector signed short __a, vector signed short __b,
4195 vector signed short __c) {
4196 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4200 static __inline__ vector signed short __attribute__((__always_inline__))
4201 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4202 vector signed short __c) {
4203 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4209 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4212 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4215 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4217 vector double __c) {
4218 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4224 static __inline__ vector signed char __ATTRS_o_ai
4225 vec_max(vector signed char __a, vector signed char __b) {
4226 return __builtin_altivec_vmaxsb(__a, __b);
4229 static __inline__ vector signed char __ATTRS_o_ai
4230 vec_max(vector bool char __a, vector signed char __b) {
4231 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4234 static __inline__ vector signed char __ATTRS_o_ai
4235 vec_max(vector signed char __a, vector bool char __b) {
4236 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4239 static __inline__ vector unsigned char __ATTRS_o_ai
4240 vec_max(vector unsigned char __a, vector unsigned char __b) {
4241 return __builtin_altivec_vmaxub(__a, __b);
4244 static __inline__ vector unsigned char __ATTRS_o_ai
4245 vec_max(vector bool char __a, vector unsigned char __b) {
4246 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4249 static __inline__ vector unsigned char __ATTRS_o_ai
4250 vec_max(vector unsigned char __a, vector bool char __b) {
4251 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4254 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4256 return __builtin_altivec_vmaxsh(__a, __b);
4259 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4261 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4264 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4265 vector bool short __b) {
4266 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4269 static __inline__ vector unsigned short __ATTRS_o_ai
4270 vec_max(vector unsigned short __a, vector unsigned short __b) {
4271 return __builtin_altivec_vmaxuh(__a, __b);
4274 static __inline__ vector unsigned short __ATTRS_o_ai
4275 vec_max(vector bool short __a, vector unsigned short __b) {
4276 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4279 static __inline__ vector unsigned short __ATTRS_o_ai
4280 vec_max(vector unsigned short __a, vector bool short __b) {
4281 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4284 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4286 return __builtin_altivec_vmaxsw(__a, __b);
4289 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4291 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4294 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4295 vector bool int __b) {
4296 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4299 static __inline__ vector unsigned int __ATTRS_o_ai
4300 vec_max(vector unsigned int __a, vector unsigned int __b) {
4301 return __builtin_altivec_vmaxuw(__a, __b);
4304 static __inline__ vector unsigned int __ATTRS_o_ai
4305 vec_max(vector bool int __a, vector unsigned int __b) {
4306 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4309 static __inline__ vector unsigned int __ATTRS_o_ai
4310 vec_max(vector unsigned int __a, vector bool int __b) {
4311 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4314 #ifdef __POWER8_VECTOR__
4315 static __inline__ vector signed long long __ATTRS_o_ai
4316 vec_max(vector signed long long __a, vector signed long long __b) {
4317 return __builtin_altivec_vmaxsd(__a, __b);
4320 static __inline__ vector signed long long __ATTRS_o_ai
4321 vec_max(vector bool long long __a, vector signed long long __b) {
4322 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4325 static __inline__ vector signed long long __ATTRS_o_ai
4326 vec_max(vector signed long long __a, vector bool long long __b) {
4327 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4330 static __inline__ vector unsigned long long __ATTRS_o_ai
4331 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4332 return __builtin_altivec_vmaxud(__a, __b);
4335 static __inline__ vector unsigned long long __ATTRS_o_ai
4336 vec_max(vector bool long long __a, vector unsigned long long __b) {
4337 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4340 static __inline__ vector unsigned long long __ATTRS_o_ai
4341 vec_max(vector unsigned long long __a, vector bool long long __b) {
4342 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4346 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4349 return __builtin_vsx_xvmaxsp(__a, __b);
4351 return __builtin_altivec_vmaxfp(__a, __b);
4356 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4357 vector double __b) {
4358 return __builtin_vsx_xvmaxdp(__a, __b);
4364 static __inline__ vector signed char __ATTRS_o_ai
4365 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4366 return __builtin_altivec_vmaxsb(__a, __b);
4369 static __inline__ vector signed char __ATTRS_o_ai
4370 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4371 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4374 static __inline__ vector signed char __ATTRS_o_ai
4375 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4376 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4381 static __inline__ vector unsigned char __ATTRS_o_ai
4382 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4383 return __builtin_altivec_vmaxub(__a, __b);
4386 static __inline__ vector unsigned char __ATTRS_o_ai
4387 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4388 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4391 static __inline__ vector unsigned char __ATTRS_o_ai
4392 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4393 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4398 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4400 return __builtin_altivec_vmaxsh(__a, __b);
4403 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4405 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4408 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4409 vector bool short __b) {
4410 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4415 static __inline__ vector unsigned short __ATTRS_o_ai
4416 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4417 return __builtin_altivec_vmaxuh(__a, __b);
4420 static __inline__ vector unsigned short __ATTRS_o_ai
4421 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4422 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4425 static __inline__ vector unsigned short __ATTRS_o_ai
4426 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4427 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4432 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4434 return __builtin_altivec_vmaxsw(__a, __b);
4437 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4439 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4442 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4443 vector bool int __b) {
4444 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4449 static __inline__ vector unsigned int __ATTRS_o_ai
4450 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4451 return __builtin_altivec_vmaxuw(__a, __b);
4454 static __inline__ vector unsigned int __ATTRS_o_ai
4455 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4456 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4459 static __inline__ vector unsigned int __ATTRS_o_ai
4460 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4461 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4466 static __inline__ vector float __attribute__((__always_inline__))
4467 vec_vmaxfp(vector float __a, vector float __b) {
4469 return __builtin_vsx_xvmaxsp(__a, __b);
4471 return __builtin_altivec_vmaxfp(__a, __b);
4477 static __inline__ vector signed char __ATTRS_o_ai
4478 vec_mergeh(vector signed char __a, vector signed char __b) {
4479 return vec_perm(__a, __b,
4480 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4481 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4482 0x06, 0x16, 0x07, 0x17));
4485 static __inline__ vector unsigned char __ATTRS_o_ai
4486 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4487 return vec_perm(__a, __b,
4488 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4489 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4490 0x06, 0x16, 0x07, 0x17));
4493 static __inline__ vector bool char __ATTRS_o_ai
4494 vec_mergeh(vector bool char __a, vector bool char __b) {
4495 return vec_perm(__a, __b,
4496 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4497 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4498 0x06, 0x16, 0x07, 0x17));
4501 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4503 return vec_perm(__a, __b,
4504 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4505 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4506 0x06, 0x07, 0x16, 0x17));
4509 static __inline__ vector unsigned short __ATTRS_o_ai
4510 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4511 return vec_perm(__a, __b,
4512 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4513 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4514 0x06, 0x07, 0x16, 0x17));
4517 static __inline__ vector bool short __ATTRS_o_ai
4518 vec_mergeh(vector bool short __a, vector bool short __b) {
4519 return vec_perm(__a, __b,
4520 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4521 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4522 0x06, 0x07, 0x16, 0x17));
4525 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4527 return vec_perm(__a, __b,
4528 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4529 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4530 0x06, 0x07, 0x16, 0x17));
4533 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4535 return vec_perm(__a, __b,
4536 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4537 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4538 0x14, 0x15, 0x16, 0x17));
4541 static __inline__ vector unsigned int __ATTRS_o_ai
4542 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4543 return vec_perm(__a, __b,
4544 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4545 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4546 0x14, 0x15, 0x16, 0x17));
4549 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4550 vector bool int __b) {
4551 return vec_perm(__a, __b,
4552 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4553 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4554 0x14, 0x15, 0x16, 0x17));
4557 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4559 return vec_perm(__a, __b,
4560 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4561 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4562 0x14, 0x15, 0x16, 0x17));
4566 static __inline__ vector signed long long __ATTRS_o_ai
4567 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4568 return vec_perm(__a, __b,
4569 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4570 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4571 0x14, 0x15, 0x16, 0x17));
4574 static __inline__ vector signed long long __ATTRS_o_ai
4575 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4576 return vec_perm(__a, (vector signed long long)__b,
4577 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4578 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4579 0x14, 0x15, 0x16, 0x17));
4582 static __inline__ vector signed long long __ATTRS_o_ai
4583 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4584 return vec_perm((vector signed long long)__a, __b,
4585 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4586 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4587 0x14, 0x15, 0x16, 0x17));
4590 static __inline__ vector unsigned long long __ATTRS_o_ai
4591 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4592 return vec_perm(__a, __b,
4593 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4594 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4595 0x14, 0x15, 0x16, 0x17));
4598 static __inline__ vector unsigned long long __ATTRS_o_ai
4599 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4600 return vec_perm(__a, (vector unsigned long long)__b,
4601 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4602 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4603 0x14, 0x15, 0x16, 0x17));
4606 static __inline__ vector unsigned long long __ATTRS_o_ai
4607 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4608 return vec_perm((vector unsigned long long)__a, __b,
4609 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4610 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4611 0x14, 0x15, 0x16, 0x17));
4614 static __inline__ vector bool long long __ATTRS_o_ai
4615 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4616 return vec_perm(__a, __b,
4617 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4618 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4619 0x14, 0x15, 0x16, 0x17));
4622 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4623 vector double __b) {
4624 return vec_perm(__a, __b,
4625 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4626 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4627 0x14, 0x15, 0x16, 0x17));
4629 static __inline__ vector double __ATTRS_o_ai
4630 vec_mergeh(vector double __a, vector bool long long __b) {
4631 return vec_perm(__a, (vector double)__b,
4632 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4633 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4634 0x14, 0x15, 0x16, 0x17));
4636 static __inline__ vector double __ATTRS_o_ai
4637 vec_mergeh(vector bool long long __a, vector double __b) {
4638 return vec_perm((vector double)__a, __b,
4639 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4640 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4641 0x14, 0x15, 0x16, 0x17));
4647 #define __builtin_altivec_vmrghb vec_vmrghb
4649 static __inline__ vector signed char __ATTRS_o_ai
4650 vec_vmrghb(vector signed char __a, vector signed char __b) {
4651 return vec_perm(__a, __b,
4652 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4653 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4654 0x06, 0x16, 0x07, 0x17));
4657 static __inline__ vector unsigned char __ATTRS_o_ai
4658 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4659 return vec_perm(__a, __b,
4660 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4661 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4662 0x06, 0x16, 0x07, 0x17));
4665 static __inline__ vector bool char __ATTRS_o_ai
4666 vec_vmrghb(vector bool char __a, vector bool char __b) {
4667 return vec_perm(__a, __b,
4668 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4669 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4670 0x06, 0x16, 0x07, 0x17));
4675 #define __builtin_altivec_vmrghh vec_vmrghh
4677 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4679 return vec_perm(__a, __b,
4680 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4681 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4682 0x06, 0x07, 0x16, 0x17));
4685 static __inline__ vector unsigned short __ATTRS_o_ai
4686 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4687 return vec_perm(__a, __b,
4688 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4689 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4690 0x06, 0x07, 0x16, 0x17));
4693 static __inline__ vector bool short __ATTRS_o_ai
4694 vec_vmrghh(vector bool short __a, vector bool short __b) {
4695 return vec_perm(__a, __b,
4696 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4697 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4698 0x06, 0x07, 0x16, 0x17));
4701 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4703 return vec_perm(__a, __b,
4704 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4705 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4706 0x06, 0x07, 0x16, 0x17));
4711 #define __builtin_altivec_vmrghw vec_vmrghw
4713 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4715 return vec_perm(__a, __b,
4716 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4717 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4718 0x14, 0x15, 0x16, 0x17));
4721 static __inline__ vector unsigned int __ATTRS_o_ai
4722 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4723 return vec_perm(__a, __b,
4724 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4725 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4726 0x14, 0x15, 0x16, 0x17));
4729 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4730 vector bool int __b) {
4731 return vec_perm(__a, __b,
4732 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4733 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4734 0x14, 0x15, 0x16, 0x17));
4737 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4739 return vec_perm(__a, __b,
4740 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4741 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4742 0x14, 0x15, 0x16, 0x17));
4747 static __inline__ vector signed char __ATTRS_o_ai
4748 vec_mergel(vector signed char __a, vector signed char __b) {
4749 return vec_perm(__a, __b,
4750 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4751 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4752 0x0E, 0x1E, 0x0F, 0x1F));
4755 static __inline__ vector unsigned char __ATTRS_o_ai
4756 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4757 return vec_perm(__a, __b,
4758 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4759 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4760 0x0E, 0x1E, 0x0F, 0x1F));
4763 static __inline__ vector bool char __ATTRS_o_ai
4764 vec_mergel(vector bool char __a, vector bool char __b) {
4765 return vec_perm(__a, __b,
4766 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4767 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4768 0x0E, 0x1E, 0x0F, 0x1F));
4771 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4773 return vec_perm(__a, __b,
4774 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4775 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4776 0x0E, 0x0F, 0x1E, 0x1F));
4779 static __inline__ vector unsigned short __ATTRS_o_ai
4780 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4781 return vec_perm(__a, __b,
4782 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4783 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4784 0x0E, 0x0F, 0x1E, 0x1F));
4787 static __inline__ vector bool short __ATTRS_o_ai
4788 vec_mergel(vector bool short __a, vector bool short __b) {
4789 return vec_perm(__a, __b,
4790 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4791 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4792 0x0E, 0x0F, 0x1E, 0x1F));
4795 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4797 return vec_perm(__a, __b,
4798 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4799 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4800 0x0E, 0x0F, 0x1E, 0x1F));
4803 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4805 return vec_perm(__a, __b,
4806 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4807 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4808 0x1C, 0x1D, 0x1E, 0x1F));
4811 static __inline__ vector unsigned int __ATTRS_o_ai
4812 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4813 return vec_perm(__a, __b,
4814 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4815 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4816 0x1C, 0x1D, 0x1E, 0x1F));
4819 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4820 vector bool int __b) {
4821 return vec_perm(__a, __b,
4822 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4823 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4824 0x1C, 0x1D, 0x1E, 0x1F));
4827 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4829 return vec_perm(__a, __b,
4830 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4831 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4832 0x1C, 0x1D, 0x1E, 0x1F));
4836 static __inline__ vector signed long long __ATTRS_o_ai
4837 vec_mergel(vector signed long long __a, vector signed long long __b) {
4838 return vec_perm(__a, __b,
4839 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4840 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4841 0x1C, 0x1D, 0x1E, 0x1F));
4843 static __inline__ vector signed long long __ATTRS_o_ai
4844 vec_mergel(vector signed long long __a, vector bool long long __b) {
4845 return vec_perm(__a, (vector signed long long)__b,
4846 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4847 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4848 0x1C, 0x1D, 0x1E, 0x1F));
4850 static __inline__ vector signed long long __ATTRS_o_ai
4851 vec_mergel(vector bool long long __a, vector signed long long __b) {
4852 return vec_perm((vector signed long long)__a, __b,
4853 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4854 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4855 0x1C, 0x1D, 0x1E, 0x1F));
4857 static __inline__ vector unsigned long long __ATTRS_o_ai
4858 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4859 return vec_perm(__a, __b,
4860 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4861 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4862 0x1C, 0x1D, 0x1E, 0x1F));
4864 static __inline__ vector unsigned long long __ATTRS_o_ai
4865 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4866 return vec_perm(__a, (vector unsigned long long)__b,
4867 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4868 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4869 0x1C, 0x1D, 0x1E, 0x1F));
4871 static __inline__ vector unsigned long long __ATTRS_o_ai
4872 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4873 return vec_perm((vector unsigned long long)__a, __b,
4874 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4875 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4876 0x1C, 0x1D, 0x1E, 0x1F));
4878 static __inline__ vector bool long long __ATTRS_o_ai
4879 vec_mergel(vector bool long long __a, vector bool long long __b) {
4880 return vec_perm(__a, __b,
4881 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4882 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4883 0x1C, 0x1D, 0x1E, 0x1F));
4885 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4886 vector double __b) {
4887 return vec_perm(__a, __b,
4888 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4889 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4890 0x1C, 0x1D, 0x1E, 0x1F));
4892 static __inline__ vector double __ATTRS_o_ai
4893 vec_mergel(vector double __a, vector bool long long __b) {
4894 return vec_perm(__a, (vector double)__b,
4895 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4896 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4897 0x1C, 0x1D, 0x1E, 0x1F));
4899 static __inline__ vector double __ATTRS_o_ai
4900 vec_mergel(vector bool long long __a, vector double __b) {
4901 return vec_perm((vector double)__a, __b,
4902 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4903 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4904 0x1C, 0x1D, 0x1E, 0x1F));
4910 #define __builtin_altivec_vmrglb vec_vmrglb
4912 static __inline__ vector signed char __ATTRS_o_ai
4913 vec_vmrglb(vector signed char __a, vector signed char __b) {
4914 return vec_perm(__a, __b,
4915 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4916 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4917 0x0E, 0x1E, 0x0F, 0x1F));
4920 static __inline__ vector unsigned char __ATTRS_o_ai
4921 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4922 return vec_perm(__a, __b,
4923 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4924 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4925 0x0E, 0x1E, 0x0F, 0x1F));
4928 static __inline__ vector bool char __ATTRS_o_ai
4929 vec_vmrglb(vector bool char __a, vector bool char __b) {
4930 return vec_perm(__a, __b,
4931 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4932 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4933 0x0E, 0x1E, 0x0F, 0x1F));
4938 #define __builtin_altivec_vmrglh vec_vmrglh
4940 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4942 return vec_perm(__a, __b,
4943 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4944 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4945 0x0E, 0x0F, 0x1E, 0x1F));
4948 static __inline__ vector unsigned short __ATTRS_o_ai
4949 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4950 return vec_perm(__a, __b,
4951 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4952 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4953 0x0E, 0x0F, 0x1E, 0x1F));
4956 static __inline__ vector bool short __ATTRS_o_ai
4957 vec_vmrglh(vector bool short __a, vector bool short __b) {
4958 return vec_perm(__a, __b,
4959 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4960 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4961 0x0E, 0x0F, 0x1E, 0x1F));
4964 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4966 return vec_perm(__a, __b,
4967 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4968 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4969 0x0E, 0x0F, 0x1E, 0x1F));
4974 #define __builtin_altivec_vmrglw vec_vmrglw
4976 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4978 return vec_perm(__a, __b,
4979 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4980 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4981 0x1C, 0x1D, 0x1E, 0x1F));
4984 static __inline__ vector unsigned int __ATTRS_o_ai
4985 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
4986 return vec_perm(__a, __b,
4987 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4988 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4989 0x1C, 0x1D, 0x1E, 0x1F));
4992 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
4993 vector bool int __b) {
4994 return vec_perm(__a, __b,
4995 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4996 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4997 0x1C, 0x1D, 0x1E, 0x1F));
5000 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5002 return vec_perm(__a, __b,
5003 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5004 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5005 0x1C, 0x1D, 0x1E, 0x1F));
5008 #ifdef __POWER8_VECTOR__
5011 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5012 vector bool int __b) {
5013 return vec_perm(__a, __b,
5014 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5015 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5016 0x18, 0x19, 0x1A, 0x1B));
5019 static __inline__ vector signed int __ATTRS_o_ai
5020 vec_mergee(vector signed int __a, vector signed int __b) {
5021 return vec_perm(__a, __b,
5022 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5023 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5024 0x18, 0x19, 0x1A, 0x1B));
5027 static __inline__ vector unsigned int __ATTRS_o_ai
5028 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5029 return vec_perm(__a, __b,
5030 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5031 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5032 0x18, 0x19, 0x1A, 0x1B));
5035 static __inline__ vector bool long long __ATTRS_o_ai
5036 vec_mergee(vector bool long long __a, vector bool long long __b) {
5037 return vec_mergeh(__a, __b);
5040 static __inline__ vector signed long long __ATTRS_o_ai
5041 vec_mergee(vector signed long long __a, vector signed long long __b) {
5042 return vec_mergeh(__a, __b);
5045 static __inline__ vector unsigned long long __ATTRS_o_ai
5046 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5047 return vec_mergeh(__a, __b);
5050 static __inline__ vector float __ATTRS_o_ai
5051 vec_mergee(vector float __a, vector float __b) {
5052 return vec_perm(__a, __b,
5053 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5054 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5055 0x18, 0x19, 0x1A, 0x1B));
5058 static __inline__ vector double __ATTRS_o_ai
5059 vec_mergee(vector double __a, vector double __b) {
5060 return vec_mergeh(__a, __b);
5065 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5066 vector bool int __b) {
5067 return vec_perm(__a, __b,
5068 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5069 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5070 0x1C, 0x1D, 0x1E, 0x1F));
5073 static __inline__ vector signed int __ATTRS_o_ai
5074 vec_mergeo(vector signed int __a, vector signed int __b) {
5075 return vec_perm(__a, __b,
5076 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5077 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5078 0x1C, 0x1D, 0x1E, 0x1F));
5081 static __inline__ vector unsigned int __ATTRS_o_ai
5082 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5083 return vec_perm(__a, __b,
5084 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5085 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5086 0x1C, 0x1D, 0x1E, 0x1F));
5089 static __inline__ vector bool long long __ATTRS_o_ai
5090 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5091 return vec_mergel(__a, __b);
5094 static __inline__ vector signed long long __ATTRS_o_ai
5095 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5096 return vec_mergel(__a, __b);
5099 static __inline__ vector unsigned long long __ATTRS_o_ai
5100 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5101 return vec_mergel(__a, __b);
5104 static __inline__ vector float __ATTRS_o_ai
5105 vec_mergeo(vector float __a, vector float __b) {
5106 return vec_perm(__a, __b,
5107 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5108 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5109 0x1C, 0x1D, 0x1E, 0x1F));
5112 static __inline__ vector double __ATTRS_o_ai
5113 vec_mergeo(vector double __a, vector double __b) {
5114 return vec_mergel(__a, __b);
5121 static __inline__ vector unsigned short __attribute__((__always_inline__))
5123 return __builtin_altivec_mfvscr();
5128 static __inline__ vector signed char __ATTRS_o_ai
5129 vec_min(vector signed char __a, vector signed char __b) {
5130 return __builtin_altivec_vminsb(__a, __b);
5133 static __inline__ vector signed char __ATTRS_o_ai
5134 vec_min(vector bool char __a, vector signed char __b) {
5135 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5138 static __inline__ vector signed char __ATTRS_o_ai
5139 vec_min(vector signed char __a, vector bool char __b) {
5140 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5143 static __inline__ vector unsigned char __ATTRS_o_ai
5144 vec_min(vector unsigned char __a, vector unsigned char __b) {
5145 return __builtin_altivec_vminub(__a, __b);
5148 static __inline__ vector unsigned char __ATTRS_o_ai
5149 vec_min(vector bool char __a, vector unsigned char __b) {
5150 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5153 static __inline__ vector unsigned char __ATTRS_o_ai
5154 vec_min(vector unsigned char __a, vector bool char __b) {
5155 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5158 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5160 return __builtin_altivec_vminsh(__a, __b);
5163 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5165 return __builtin_altivec_vminsh((vector short)__a, __b);
5168 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5169 vector bool short __b) {
5170 return __builtin_altivec_vminsh(__a, (vector short)__b);
5173 static __inline__ vector unsigned short __ATTRS_o_ai
5174 vec_min(vector unsigned short __a, vector unsigned short __b) {
5175 return __builtin_altivec_vminuh(__a, __b);
5178 static __inline__ vector unsigned short __ATTRS_o_ai
5179 vec_min(vector bool short __a, vector unsigned short __b) {
5180 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5183 static __inline__ vector unsigned short __ATTRS_o_ai
5184 vec_min(vector unsigned short __a, vector bool short __b) {
5185 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5188 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5190 return __builtin_altivec_vminsw(__a, __b);
5193 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5195 return __builtin_altivec_vminsw((vector int)__a, __b);
5198 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5199 vector bool int __b) {
5200 return __builtin_altivec_vminsw(__a, (vector int)__b);
5203 static __inline__ vector unsigned int __ATTRS_o_ai
5204 vec_min(vector unsigned int __a, vector unsigned int __b) {
5205 return __builtin_altivec_vminuw(__a, __b);
5208 static __inline__ vector unsigned int __ATTRS_o_ai
5209 vec_min(vector bool int __a, vector unsigned int __b) {
5210 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5213 static __inline__ vector unsigned int __ATTRS_o_ai
5214 vec_min(vector unsigned int __a, vector bool int __b) {
5215 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5218 #ifdef __POWER8_VECTOR__
5219 static __inline__ vector signed long long __ATTRS_o_ai
5220 vec_min(vector signed long long __a, vector signed long long __b) {
5221 return __builtin_altivec_vminsd(__a, __b);
5224 static __inline__ vector signed long long __ATTRS_o_ai
5225 vec_min(vector bool long long __a, vector signed long long __b) {
5226 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5229 static __inline__ vector signed long long __ATTRS_o_ai
5230 vec_min(vector signed long long __a, vector bool long long __b) {
5231 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5234 static __inline__ vector unsigned long long __ATTRS_o_ai
5235 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5236 return __builtin_altivec_vminud(__a, __b);
5239 static __inline__ vector unsigned long long __ATTRS_o_ai
5240 vec_min(vector bool long long __a, vector unsigned long long __b) {
5241 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5244 static __inline__ vector unsigned long long __ATTRS_o_ai
5245 vec_min(vector unsigned long long __a, vector bool long long __b) {
5246 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5250 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5253 return __builtin_vsx_xvminsp(__a, __b);
5255 return __builtin_altivec_vminfp(__a, __b);
5260 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5261 vector double __b) {
5262 return __builtin_vsx_xvmindp(__a, __b);
5268 static __inline__ vector signed char __ATTRS_o_ai
5269 vec_vminsb(vector signed char __a, vector signed char __b) {
5270 return __builtin_altivec_vminsb(__a, __b);
5273 static __inline__ vector signed char __ATTRS_o_ai
5274 vec_vminsb(vector bool char __a, vector signed char __b) {
5275 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5278 static __inline__ vector signed char __ATTRS_o_ai
5279 vec_vminsb(vector signed char __a, vector bool char __b) {
5280 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5285 static __inline__ vector unsigned char __ATTRS_o_ai
5286 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5287 return __builtin_altivec_vminub(__a, __b);
5290 static __inline__ vector unsigned char __ATTRS_o_ai
5291 vec_vminub(vector bool char __a, vector unsigned char __b) {
5292 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5295 static __inline__ vector unsigned char __ATTRS_o_ai
5296 vec_vminub(vector unsigned char __a, vector bool char __b) {
5297 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5302 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5304 return __builtin_altivec_vminsh(__a, __b);
5307 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5309 return __builtin_altivec_vminsh((vector short)__a, __b);
5312 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5313 vector bool short __b) {
5314 return __builtin_altivec_vminsh(__a, (vector short)__b);
5319 static __inline__ vector unsigned short __ATTRS_o_ai
5320 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5321 return __builtin_altivec_vminuh(__a, __b);
5324 static __inline__ vector unsigned short __ATTRS_o_ai
5325 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5326 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5329 static __inline__ vector unsigned short __ATTRS_o_ai
5330 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5331 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5336 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5338 return __builtin_altivec_vminsw(__a, __b);
5341 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5343 return __builtin_altivec_vminsw((vector int)__a, __b);
5346 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5347 vector bool int __b) {
5348 return __builtin_altivec_vminsw(__a, (vector int)__b);
5353 static __inline__ vector unsigned int __ATTRS_o_ai
5354 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5355 return __builtin_altivec_vminuw(__a, __b);
5358 static __inline__ vector unsigned int __ATTRS_o_ai
5359 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5360 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5363 static __inline__ vector unsigned int __ATTRS_o_ai
5364 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5365 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5370 static __inline__ vector float __attribute__((__always_inline__))
5371 vec_vminfp(vector float __a, vector float __b) {
5373 return __builtin_vsx_xvminsp(__a, __b);
5375 return __builtin_altivec_vminfp(__a, __b);
5381 #define __builtin_altivec_vmladduhm vec_mladd
5383 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5386 return __a * __b + __c;
5389 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5390 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5391 return __a * (vector short)__b + (vector short)__c;
5394 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5397 return (vector short)__a * __b + __c;
5400 static __inline__ vector unsigned short __ATTRS_o_ai
5401 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5402 vector unsigned short __c) {
5403 return __a * __b + __c;
5408 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5411 return __a * __b + __c;
5414 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5415 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5416 return __a * (vector short)__b + (vector short)__c;
5419 static __inline__ vector short __ATTRS_o_ai
5420 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5421 return (vector short)__a * __b + __c;
5424 static __inline__ vector unsigned short __ATTRS_o_ai
5425 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5426 vector unsigned short __c) {
5427 return __a * __b + __c;
5432 static __inline__ vector short __attribute__((__always_inline__))
5433 vec_mradds(vector short __a, vector short __b, vector short __c) {
5434 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5437 /* vec_vmhraddshs */
5439 static __inline__ vector short __attribute__((__always_inline__))
5440 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5441 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5446 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5447 vector unsigned char __b,
5449 return __builtin_altivec_vmsummbm(__a, __b, __c);
5452 static __inline__ vector unsigned int __ATTRS_o_ai
5453 vec_msum(vector unsigned char __a, vector unsigned char __b,
5454 vector unsigned int __c) {
5455 return __builtin_altivec_vmsumubm(__a, __b, __c);
5458 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5461 return __builtin_altivec_vmsumshm(__a, __b, __c);
5464 static __inline__ vector unsigned int __ATTRS_o_ai
5465 vec_msum(vector unsigned short __a, vector unsigned short __b,
5466 vector unsigned int __c) {
5467 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5472 static __inline__ vector int __attribute__((__always_inline__))
5473 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5474 return __builtin_altivec_vmsummbm(__a, __b, __c);
5479 static __inline__ vector unsigned int __attribute__((__always_inline__))
5480 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5481 vector unsigned int __c) {
5482 return __builtin_altivec_vmsumubm(__a, __b, __c);
5487 static __inline__ vector int __attribute__((__always_inline__))
5488 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5489 return __builtin_altivec_vmsumshm(__a, __b, __c);
5494 static __inline__ vector unsigned int __attribute__((__always_inline__))
5495 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5496 vector unsigned int __c) {
5497 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5502 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5505 return __builtin_altivec_vmsumshs(__a, __b, __c);
5508 static __inline__ vector unsigned int __ATTRS_o_ai
5509 vec_msums(vector unsigned short __a, vector unsigned short __b,
5510 vector unsigned int __c) {
5511 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5516 static __inline__ vector int __attribute__((__always_inline__))
5517 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5518 return __builtin_altivec_vmsumshs(__a, __b, __c);
5523 static __inline__ vector unsigned int __attribute__((__always_inline__))
5524 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5525 vector unsigned int __c) {
5526 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5531 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5532 __builtin_altivec_mtvscr((vector int)__a);
5535 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5536 __builtin_altivec_mtvscr((vector int)__a);
5539 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5540 __builtin_altivec_mtvscr((vector int)__a);
5543 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5544 __builtin_altivec_mtvscr((vector int)__a);
5547 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5548 __builtin_altivec_mtvscr((vector int)__a);
5551 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5552 __builtin_altivec_mtvscr((vector int)__a);
5555 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5556 __builtin_altivec_mtvscr((vector int)__a);
5559 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5560 __builtin_altivec_mtvscr((vector int)__a);
5563 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5564 __builtin_altivec_mtvscr((vector int)__a);
5567 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5568 __builtin_altivec_mtvscr((vector int)__a);
5571 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5572 __builtin_altivec_mtvscr((vector int)__a);
5577 /* Integer vector multiplication will involve multiplication of the odd/even
5578 elements separately, then truncating the results and moving to the
5581 static __inline__ vector signed char __ATTRS_o_ai
5582 vec_mul(vector signed char __a, vector signed char __b) {
5586 static __inline__ vector unsigned char __ATTRS_o_ai
5587 vec_mul(vector unsigned char __a, vector unsigned char __b) {
5591 static __inline__ vector signed short __ATTRS_o_ai
5592 vec_mul(vector signed short __a, vector signed short __b) {
5596 static __inline__ vector unsigned short __ATTRS_o_ai
5597 vec_mul(vector unsigned short __a, vector unsigned short __b) {
5601 static __inline__ vector signed int __ATTRS_o_ai
5602 vec_mul(vector signed int __a, vector signed int __b) {
5606 static __inline__ vector unsigned int __ATTRS_o_ai
5607 vec_mul(vector unsigned int __a, vector unsigned int __b) {
5612 static __inline__ vector signed long long __ATTRS_o_ai
5613 vec_mul(vector signed long long __a, vector signed long long __b) {
5617 static __inline__ vector unsigned long long __ATTRS_o_ai
5618 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5623 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5629 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5630 vector double __b) {
5635 /* The vmulos* and vmules* instructions have a big endian bias, so
5636 we must reverse the meaning of "even" and "odd" for little endian. */
5640 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5641 vector signed char __b) {
5642 #ifdef __LITTLE_ENDIAN__
5643 return __builtin_altivec_vmulosb(__a, __b);
5645 return __builtin_altivec_vmulesb(__a, __b);
5649 static __inline__ vector unsigned short __ATTRS_o_ai
5650 vec_mule(vector unsigned char __a, vector unsigned char __b) {
5651 #ifdef __LITTLE_ENDIAN__
5652 return __builtin_altivec_vmuloub(__a, __b);
5654 return __builtin_altivec_vmuleub(__a, __b);
5658 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5660 #ifdef __LITTLE_ENDIAN__
5661 return __builtin_altivec_vmulosh(__a, __b);
5663 return __builtin_altivec_vmulesh(__a, __b);
5667 static __inline__ vector unsigned int __ATTRS_o_ai
5668 vec_mule(vector unsigned short __a, vector unsigned short __b) {
5669 #ifdef __LITTLE_ENDIAN__
5670 return __builtin_altivec_vmulouh(__a, __b);
5672 return __builtin_altivec_vmuleuh(__a, __b);
5676 #ifdef __POWER8_VECTOR__
5677 static __inline__ vector signed long long __ATTRS_o_ai
5678 vec_mule(vector signed int __a, vector signed int __b) {
5679 #ifdef __LITTLE_ENDIAN__
5680 return __builtin_altivec_vmulosw(__a, __b);
5682 return __builtin_altivec_vmulesw(__a, __b);
5686 static __inline__ vector unsigned long long __ATTRS_o_ai
5687 vec_mule(vector unsigned int __a, vector unsigned int __b) {
5688 #ifdef __LITTLE_ENDIAN__
5689 return __builtin_altivec_vmulouw(__a, __b);
5691 return __builtin_altivec_vmuleuw(__a, __b);
5698 static __inline__ vector short __attribute__((__always_inline__))
5699 vec_vmulesb(vector signed char __a, vector signed char __b) {
5700 #ifdef __LITTLE_ENDIAN__
5701 return __builtin_altivec_vmulosb(__a, __b);
5703 return __builtin_altivec_vmulesb(__a, __b);
5709 static __inline__ vector unsigned short __attribute__((__always_inline__))
5710 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5711 #ifdef __LITTLE_ENDIAN__
5712 return __builtin_altivec_vmuloub(__a, __b);
5714 return __builtin_altivec_vmuleub(__a, __b);
5720 static __inline__ vector int __attribute__((__always_inline__))
5721 vec_vmulesh(vector short __a, vector short __b) {
5722 #ifdef __LITTLE_ENDIAN__
5723 return __builtin_altivec_vmulosh(__a, __b);
5725 return __builtin_altivec_vmulesh(__a, __b);
5731 static __inline__ vector unsigned int __attribute__((__always_inline__))
5732 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5733 #ifdef __LITTLE_ENDIAN__
5734 return __builtin_altivec_vmulouh(__a, __b);
5736 return __builtin_altivec_vmuleuh(__a, __b);
5742 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5743 vector signed char __b) {
5744 #ifdef __LITTLE_ENDIAN__
5745 return __builtin_altivec_vmulesb(__a, __b);
5747 return __builtin_altivec_vmulosb(__a, __b);
5751 static __inline__ vector unsigned short __ATTRS_o_ai
5752 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5753 #ifdef __LITTLE_ENDIAN__
5754 return __builtin_altivec_vmuleub(__a, __b);
5756 return __builtin_altivec_vmuloub(__a, __b);
5760 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5762 #ifdef __LITTLE_ENDIAN__
5763 return __builtin_altivec_vmulesh(__a, __b);
5765 return __builtin_altivec_vmulosh(__a, __b);
5769 static __inline__ vector unsigned int __ATTRS_o_ai
5770 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5771 #ifdef __LITTLE_ENDIAN__
5772 return __builtin_altivec_vmuleuh(__a, __b);
5774 return __builtin_altivec_vmulouh(__a, __b);
5778 #ifdef __POWER8_VECTOR__
5779 static __inline__ vector signed long long __ATTRS_o_ai
5780 vec_mulo(vector signed int __a, vector signed int __b) {
5781 #ifdef __LITTLE_ENDIAN__
5782 return __builtin_altivec_vmulesw(__a, __b);
5784 return __builtin_altivec_vmulosw(__a, __b);
5788 static __inline__ vector unsigned long long __ATTRS_o_ai
5789 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5790 #ifdef __LITTLE_ENDIAN__
5791 return __builtin_altivec_vmuleuw(__a, __b);
5793 return __builtin_altivec_vmulouw(__a, __b);
5800 static __inline__ vector short __attribute__((__always_inline__))
5801 vec_vmulosb(vector signed char __a, vector signed char __b) {
5802 #ifdef __LITTLE_ENDIAN__
5803 return __builtin_altivec_vmulesb(__a, __b);
5805 return __builtin_altivec_vmulosb(__a, __b);
5811 static __inline__ vector unsigned short __attribute__((__always_inline__))
5812 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5813 #ifdef __LITTLE_ENDIAN__
5814 return __builtin_altivec_vmuleub(__a, __b);
5816 return __builtin_altivec_vmuloub(__a, __b);
5822 static __inline__ vector int __attribute__((__always_inline__))
5823 vec_vmulosh(vector short __a, vector short __b) {
5824 #ifdef __LITTLE_ENDIAN__
5825 return __builtin_altivec_vmulesh(__a, __b);
5827 return __builtin_altivec_vmulosh(__a, __b);
5833 static __inline__ vector unsigned int __attribute__((__always_inline__))
5834 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5835 #ifdef __LITTLE_ENDIAN__
5836 return __builtin_altivec_vmuleuh(__a, __b);
5838 return __builtin_altivec_vmulouh(__a, __b);
5844 #ifdef __POWER8_VECTOR__
5845 static __inline__ vector signed char __ATTRS_o_ai
5846 vec_nand(vector signed char __a, vector signed char __b) {
5847 return ~(__a & __b);
5850 static __inline__ vector signed char __ATTRS_o_ai
5851 vec_nand(vector signed char __a, vector bool char __b) {
5852 return ~(__a & __b);
5855 static __inline__ vector signed char __ATTRS_o_ai
5856 vec_nand(vector bool char __a, vector signed char __b) {
5857 return ~(__a & __b);
5860 static __inline__ vector unsigned char __ATTRS_o_ai
5861 vec_nand(vector unsigned char __a, vector unsigned char __b) {
5862 return ~(__a & __b);
5865 static __inline__ vector unsigned char __ATTRS_o_ai
5866 vec_nand(vector unsigned char __a, vector bool char __b) {
5867 return ~(__a & __b);
5870 static __inline__ vector unsigned char __ATTRS_o_ai
5871 vec_nand(vector bool char __a, vector unsigned char __b) {
5872 return ~(__a & __b);
5875 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5876 vector bool char __b) {
5877 return ~(__a & __b);
5880 static __inline__ vector signed short __ATTRS_o_ai
5881 vec_nand(vector signed short __a, vector signed short __b) {
5882 return ~(__a & __b);
5885 static __inline__ vector signed short __ATTRS_o_ai
5886 vec_nand(vector signed short __a, vector bool short __b) {
5887 return ~(__a & __b);
5890 static __inline__ vector signed short __ATTRS_o_ai
5891 vec_nand(vector bool short __a, vector signed short __b) {
5892 return ~(__a & __b);
5895 static __inline__ vector unsigned short __ATTRS_o_ai
5896 vec_nand(vector unsigned short __a, vector unsigned short __b) {
5897 return ~(__a & __b);
5900 static __inline__ vector unsigned short __ATTRS_o_ai
5901 vec_nand(vector unsigned short __a, vector bool short __b) {
5902 return ~(__a & __b);
5905 static __inline__ vector bool short __ATTRS_o_ai
5906 vec_nand(vector bool short __a, vector bool short __b) {
5907 return ~(__a & __b);
5910 static __inline__ vector signed int __ATTRS_o_ai
5911 vec_nand(vector signed int __a, vector signed int __b) {
5912 return ~(__a & __b);
5915 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5916 vector bool int __b) {
5917 return ~(__a & __b);
5920 static __inline__ vector signed int __ATTRS_o_ai
5921 vec_nand(vector bool int __a, vector signed int __b) {
5922 return ~(__a & __b);
5925 static __inline__ vector unsigned int __ATTRS_o_ai
5926 vec_nand(vector unsigned int __a, vector unsigned int __b) {
5927 return ~(__a & __b);
5930 static __inline__ vector unsigned int __ATTRS_o_ai
5931 vec_nand(vector unsigned int __a, vector bool int __b) {
5932 return ~(__a & __b);
5935 static __inline__ vector unsigned int __ATTRS_o_ai
5936 vec_nand(vector bool int __a, vector unsigned int __b) {
5937 return ~(__a & __b);
5940 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5941 vector bool int __b) {
5942 return ~(__a & __b);
5945 static __inline__ vector float __ATTRS_o_ai
5946 vec_nand(vector float __a, vector float __b) {
5947 return (vector float)(~((vector unsigned int)__a &
5948 (vector unsigned int)__b));
5951 static __inline__ vector signed long long __ATTRS_o_ai
5952 vec_nand(vector signed long long __a, vector signed long long __b) {
5953 return ~(__a & __b);
5956 static __inline__ vector signed long long __ATTRS_o_ai
5957 vec_nand(vector signed long long __a, vector bool long long __b) {
5958 return ~(__a & __b);
5961 static __inline__ vector signed long long __ATTRS_o_ai
5962 vec_nand(vector bool long long __a, vector signed long long __b) {
5963 return ~(__a & __b);
5966 static __inline__ vector unsigned long long __ATTRS_o_ai
5967 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
5968 return ~(__a & __b);
5971 static __inline__ vector unsigned long long __ATTRS_o_ai
5972 vec_nand(vector unsigned long long __a, vector bool long long __b) {
5973 return ~(__a & __b);
5976 static __inline__ vector unsigned long long __ATTRS_o_ai
5977 vec_nand(vector bool long long __a, vector unsigned long long __b) {
5978 return ~(__a & __b);
5981 static __inline__ vector bool long long __ATTRS_o_ai
5982 vec_nand(vector bool long long __a, vector bool long long __b) {
5983 return ~(__a & __b);
5986 static __inline__ vector double __ATTRS_o_ai
5987 vec_nand(vector double __a, vector double __b) {
5988 return (vector double)(~((vector unsigned long long)__a &
5989 (vector unsigned long long)__b));
5997 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6000 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6003 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6005 vector double __c) {
6006 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6012 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6016 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6018 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6023 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6025 vector double __c) {
6026 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6032 static __inline__ vector float __attribute__((__always_inline__))
6033 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6034 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6039 #define __builtin_altivec_vnor vec_nor
6041 static __inline__ vector signed char __ATTRS_o_ai
6042 vec_nor(vector signed char __a, vector signed char __b) {
6043 return ~(__a | __b);
6046 static __inline__ vector unsigned char __ATTRS_o_ai
6047 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6048 return ~(__a | __b);
6051 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6052 vector bool char __b) {
6053 return ~(__a | __b);
6056 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6058 return ~(__a | __b);
6061 static __inline__ vector unsigned short __ATTRS_o_ai
6062 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6063 return ~(__a | __b);
6066 static __inline__ vector bool short __ATTRS_o_ai
6067 vec_nor(vector bool short __a, vector bool short __b) {
6068 return ~(__a | __b);
6071 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6073 return ~(__a | __b);
6076 static __inline__ vector unsigned int __ATTRS_o_ai
6077 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6078 return ~(__a | __b);
6081 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6082 vector bool int __b) {
6083 return ~(__a | __b);
6086 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6088 vector unsigned int __res =
6089 ~((vector unsigned int)__a | (vector unsigned int)__b);
6090 return (vector float)__res;
6094 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6095 vector double __b) {
6096 vector unsigned long long __res =
6097 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6098 return (vector double)__res;
6104 static __inline__ vector signed char __ATTRS_o_ai
6105 vec_vnor(vector signed char __a, vector signed char __b) {
6106 return ~(__a | __b);
6109 static __inline__ vector unsigned char __ATTRS_o_ai
6110 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6111 return ~(__a | __b);
6114 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6115 vector bool char __b) {
6116 return ~(__a | __b);
6119 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6121 return ~(__a | __b);
6124 static __inline__ vector unsigned short __ATTRS_o_ai
6125 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6126 return ~(__a | __b);
6129 static __inline__ vector bool short __ATTRS_o_ai
6130 vec_vnor(vector bool short __a, vector bool short __b) {
6131 return ~(__a | __b);
6134 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6136 return ~(__a | __b);
6139 static __inline__ vector unsigned int __ATTRS_o_ai
6140 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6141 return ~(__a | __b);
6144 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6145 vector bool int __b) {
6146 return ~(__a | __b);
6149 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6151 vector unsigned int __res =
6152 ~((vector unsigned int)__a | (vector unsigned int)__b);
6153 return (vector float)__res;
6157 static __inline__ vector signed long long __ATTRS_o_ai
6158 vec_nor(vector signed long long __a, vector signed long long __b) {
6159 return ~(__a | __b);
6162 static __inline__ vector unsigned long long __ATTRS_o_ai
6163 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6164 return ~(__a | __b);
6167 static __inline__ vector bool long long __ATTRS_o_ai
6168 vec_nor(vector bool long long __a, vector bool long long __b) {
6169 return ~(__a | __b);
6175 #define __builtin_altivec_vor vec_or
6177 static __inline__ vector signed char __ATTRS_o_ai
6178 vec_or(vector signed char __a, vector signed char __b) {
6182 static __inline__ vector signed char __ATTRS_o_ai
6183 vec_or(vector bool char __a, vector signed char __b) {
6184 return (vector signed char)__a | __b;
6187 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6188 vector bool char __b) {
6189 return __a | (vector signed char)__b;
6192 static __inline__ vector unsigned char __ATTRS_o_ai
6193 vec_or(vector unsigned char __a, vector unsigned char __b) {
6197 static __inline__ vector unsigned char __ATTRS_o_ai
6198 vec_or(vector bool char __a, vector unsigned char __b) {
6199 return (vector unsigned char)__a | __b;
6202 static __inline__ vector unsigned char __ATTRS_o_ai
6203 vec_or(vector unsigned char __a, vector bool char __b) {
6204 return __a | (vector unsigned char)__b;
6207 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6208 vector bool char __b) {
6212 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6217 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6219 return (vector short)__a | __b;
6222 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6223 vector bool short __b) {
6224 return __a | (vector short)__b;
6227 static __inline__ vector unsigned short __ATTRS_o_ai
6228 vec_or(vector unsigned short __a, vector unsigned short __b) {
6232 static __inline__ vector unsigned short __ATTRS_o_ai
6233 vec_or(vector bool short __a, vector unsigned short __b) {
6234 return (vector unsigned short)__a | __b;
6237 static __inline__ vector unsigned short __ATTRS_o_ai
6238 vec_or(vector unsigned short __a, vector bool short __b) {
6239 return __a | (vector unsigned short)__b;
6242 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6243 vector bool short __b) {
6247 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6252 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6254 return (vector int)__a | __b;
6257 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6258 vector bool int __b) {
6259 return __a | (vector int)__b;
6262 static __inline__ vector unsigned int __ATTRS_o_ai
6263 vec_or(vector unsigned int __a, vector unsigned int __b) {
6267 static __inline__ vector unsigned int __ATTRS_o_ai
6268 vec_or(vector bool int __a, vector unsigned int __b) {
6269 return (vector unsigned int)__a | __b;
6272 static __inline__ vector unsigned int __ATTRS_o_ai
6273 vec_or(vector unsigned int __a, vector bool int __b) {
6274 return __a | (vector unsigned int)__b;
6277 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6278 vector bool int __b) {
6282 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6284 vector unsigned int __res =
6285 (vector unsigned int)__a | (vector unsigned int)__b;
6286 return (vector float)__res;
6289 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6291 vector unsigned int __res =
6292 (vector unsigned int)__a | (vector unsigned int)__b;
6293 return (vector float)__res;
6296 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6297 vector bool int __b) {
6298 vector unsigned int __res =
6299 (vector unsigned int)__a | (vector unsigned int)__b;
6300 return (vector float)__res;
6304 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6305 vector double __b) {
6306 return (vector double)((vector unsigned long long)__a |
6307 (vector unsigned long long)__b);
6310 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6311 vector bool long long __b) {
6312 return (vector double)((vector unsigned long long)__a |
6313 (vector unsigned long long)__b);
6316 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6317 vector double __b) {
6318 return (vector double)((vector unsigned long long)__a |
6319 (vector unsigned long long)__b);
6322 static __inline__ vector signed long long __ATTRS_o_ai
6323 vec_or(vector signed long long __a, vector signed long long __b) {
6327 static __inline__ vector signed long long __ATTRS_o_ai
6328 vec_or(vector bool long long __a, vector signed long long __b) {
6329 return (vector signed long long)__a | __b;
6332 static __inline__ vector signed long long __ATTRS_o_ai
6333 vec_or(vector signed long long __a, vector bool long long __b) {
6334 return __a | (vector signed long long)__b;
6337 static __inline__ vector unsigned long long __ATTRS_o_ai
6338 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6342 static __inline__ vector unsigned long long __ATTRS_o_ai
6343 vec_or(vector bool long long __a, vector unsigned long long __b) {
6344 return (vector unsigned long long)__a | __b;
6347 static __inline__ vector unsigned long long __ATTRS_o_ai
6348 vec_or(vector unsigned long long __a, vector bool long long __b) {
6349 return __a | (vector unsigned long long)__b;
6352 static __inline__ vector bool long long __ATTRS_o_ai
6353 vec_or(vector bool long long __a, vector bool long long __b) {
6358 #ifdef __POWER8_VECTOR__
6359 static __inline__ vector signed char __ATTRS_o_ai
6360 vec_orc(vector signed char __a, vector signed char __b) {
6364 static __inline__ vector signed char __ATTRS_o_ai
6365 vec_orc(vector signed char __a, vector bool char __b) {
6369 static __inline__ vector signed char __ATTRS_o_ai
6370 vec_orc(vector bool char __a, vector signed char __b) {
6374 static __inline__ vector unsigned char __ATTRS_o_ai
6375 vec_orc(vector unsigned char __a, vector unsigned char __b) {
6379 static __inline__ vector unsigned char __ATTRS_o_ai
6380 vec_orc(vector unsigned char __a, vector bool char __b) {
6384 static __inline__ vector unsigned char __ATTRS_o_ai
6385 vec_orc(vector bool char __a, vector unsigned char __b) {
6389 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6390 vector bool char __b) {
6394 static __inline__ vector signed short __ATTRS_o_ai
6395 vec_orc(vector signed short __a, vector signed short __b) {
6399 static __inline__ vector signed short __ATTRS_o_ai
6400 vec_orc(vector signed short __a, vector bool short __b) {
6404 static __inline__ vector signed short __ATTRS_o_ai
6405 vec_orc(vector bool short __a, vector signed short __b) {
6409 static __inline__ vector unsigned short __ATTRS_o_ai
6410 vec_orc(vector unsigned short __a, vector unsigned short __b) {
6414 static __inline__ vector unsigned short __ATTRS_o_ai
6415 vec_orc(vector unsigned short __a, vector bool short __b) {
6419 static __inline__ vector unsigned short __ATTRS_o_ai
6420 vec_orc(vector bool short __a, vector unsigned short __b) {
6424 static __inline__ vector bool short __ATTRS_o_ai
6425 vec_orc(vector bool short __a, vector bool short __b) {
6429 static __inline__ vector signed int __ATTRS_o_ai
6430 vec_orc(vector signed int __a, vector signed int __b) {
6434 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6435 vector bool int __b) {
6439 static __inline__ vector signed int __ATTRS_o_ai
6440 vec_orc(vector bool int __a, vector signed int __b) {
6444 static __inline__ vector unsigned int __ATTRS_o_ai
6445 vec_orc(vector unsigned int __a, vector unsigned int __b) {
6449 static __inline__ vector unsigned int __ATTRS_o_ai
6450 vec_orc(vector unsigned int __a, vector bool int __b) {
6454 static __inline__ vector unsigned int __ATTRS_o_ai
6455 vec_orc(vector bool int __a, vector unsigned int __b) {
6459 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6460 vector bool int __b) {
6464 static __inline__ vector float __ATTRS_o_ai
6465 vec_orc(vector bool int __a, vector float __b) {
6466 return (vector float)(__a | ~(vector unsigned int)__b);
6469 static __inline__ vector float __ATTRS_o_ai
6470 vec_orc(vector float __a, vector bool int __b) {
6471 return (vector float)((vector unsigned int)__a | ~__b);
6474 static __inline__ vector signed long long __ATTRS_o_ai
6475 vec_orc(vector signed long long __a, vector signed long long __b) {
6479 static __inline__ vector signed long long __ATTRS_o_ai
6480 vec_orc(vector signed long long __a, vector bool long long __b) {
6484 static __inline__ vector signed long long __ATTRS_o_ai
6485 vec_orc(vector bool long long __a, vector signed long long __b) {
6489 static __inline__ vector unsigned long long __ATTRS_o_ai
6490 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6494 static __inline__ vector unsigned long long __ATTRS_o_ai
6495 vec_orc(vector unsigned long long __a, vector bool long long __b) {
6499 static __inline__ vector unsigned long long __ATTRS_o_ai
6500 vec_orc(vector bool long long __a, vector unsigned long long __b) {
6504 static __inline__ vector bool long long __ATTRS_o_ai
6505 vec_orc(vector bool long long __a, vector bool long long __b) {
6509 static __inline__ vector double __ATTRS_o_ai
6510 vec_orc(vector double __a, vector bool long long __b) {
6511 return (vector double)((vector unsigned long long)__a | ~__b);
6514 static __inline__ vector double __ATTRS_o_ai
6515 vec_orc(vector bool long long __a, vector double __b) {
6516 return (vector double)(__a | ~(vector unsigned long long)__b);
6522 static __inline__ vector signed char __ATTRS_o_ai
6523 vec_vor(vector signed char __a, vector signed char __b) {
6527 static __inline__ vector signed char __ATTRS_o_ai
6528 vec_vor(vector bool char __a, vector signed char __b) {
6529 return (vector signed char)__a | __b;
6532 static __inline__ vector signed char __ATTRS_o_ai
6533 vec_vor(vector signed char __a, vector bool char __b) {
6534 return __a | (vector signed char)__b;
6537 static __inline__ vector unsigned char __ATTRS_o_ai
6538 vec_vor(vector unsigned char __a, vector unsigned char __b) {
6542 static __inline__ vector unsigned char __ATTRS_o_ai
6543 vec_vor(vector bool char __a, vector unsigned char __b) {
6544 return (vector unsigned char)__a | __b;
6547 static __inline__ vector unsigned char __ATTRS_o_ai
6548 vec_vor(vector unsigned char __a, vector bool char __b) {
6549 return __a | (vector unsigned char)__b;
6552 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6553 vector bool char __b) {
6557 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6562 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6564 return (vector short)__a | __b;
6567 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6568 vector bool short __b) {
6569 return __a | (vector short)__b;
6572 static __inline__ vector unsigned short __ATTRS_o_ai
6573 vec_vor(vector unsigned short __a, vector unsigned short __b) {
6577 static __inline__ vector unsigned short __ATTRS_o_ai
6578 vec_vor(vector bool short __a, vector unsigned short __b) {
6579 return (vector unsigned short)__a | __b;
6582 static __inline__ vector unsigned short __ATTRS_o_ai
6583 vec_vor(vector unsigned short __a, vector bool short __b) {
6584 return __a | (vector unsigned short)__b;
6587 static __inline__ vector bool short __ATTRS_o_ai
6588 vec_vor(vector bool short __a, vector bool short __b) {
6592 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6597 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6599 return (vector int)__a | __b;
6602 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6603 vector bool int __b) {
6604 return __a | (vector int)__b;
6607 static __inline__ vector unsigned int __ATTRS_o_ai
6608 vec_vor(vector unsigned int __a, vector unsigned int __b) {
6612 static __inline__ vector unsigned int __ATTRS_o_ai
6613 vec_vor(vector bool int __a, vector unsigned int __b) {
6614 return (vector unsigned int)__a | __b;
6617 static __inline__ vector unsigned int __ATTRS_o_ai
6618 vec_vor(vector unsigned int __a, vector bool int __b) {
6619 return __a | (vector unsigned int)__b;
6622 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6623 vector bool int __b) {
6627 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6629 vector unsigned int __res =
6630 (vector unsigned int)__a | (vector unsigned int)__b;
6631 return (vector float)__res;
6634 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6636 vector unsigned int __res =
6637 (vector unsigned int)__a | (vector unsigned int)__b;
6638 return (vector float)__res;
6641 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6642 vector bool int __b) {
6643 vector unsigned int __res =
6644 (vector unsigned int)__a | (vector unsigned int)__b;
6645 return (vector float)__res;
6649 static __inline__ vector signed long long __ATTRS_o_ai
6650 vec_vor(vector signed long long __a, vector signed long long __b) {
6654 static __inline__ vector signed long long __ATTRS_o_ai
6655 vec_vor(vector bool long long __a, vector signed long long __b) {
6656 return (vector signed long long)__a | __b;
6659 static __inline__ vector signed long long __ATTRS_o_ai
6660 vec_vor(vector signed long long __a, vector bool long long __b) {
6661 return __a | (vector signed long long)__b;
6664 static __inline__ vector unsigned long long __ATTRS_o_ai
6665 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6669 static __inline__ vector unsigned long long __ATTRS_o_ai
6670 vec_vor(vector bool long long __a, vector unsigned long long __b) {
6671 return (vector unsigned long long)__a | __b;
6674 static __inline__ vector unsigned long long __ATTRS_o_ai
6675 vec_vor(vector unsigned long long __a, vector bool long long __b) {
6676 return __a | (vector unsigned long long)__b;
6679 static __inline__ vector bool long long __ATTRS_o_ai
6680 vec_vor(vector bool long long __a, vector bool long long __b) {
6687 /* The various vector pack instructions have a big-endian bias, so for
6688 little endian we must handle reversed element numbering. */
6690 static __inline__ vector signed char __ATTRS_o_ai
6691 vec_pack(vector signed short __a, vector signed short __b) {
6692 #ifdef __LITTLE_ENDIAN__
6693 return (vector signed char)vec_perm(
6695 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6696 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6698 return (vector signed char)vec_perm(
6700 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6701 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6705 static __inline__ vector unsigned char __ATTRS_o_ai
6706 vec_pack(vector unsigned short __a, vector unsigned short __b) {
6707 #ifdef __LITTLE_ENDIAN__
6708 return (vector unsigned char)vec_perm(
6710 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6711 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6713 return (vector unsigned char)vec_perm(
6715 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6716 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6720 static __inline__ vector bool char __ATTRS_o_ai
6721 vec_pack(vector bool short __a, vector bool short __b) {
6722 #ifdef __LITTLE_ENDIAN__
6723 return (vector bool char)vec_perm(
6725 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6726 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6728 return (vector bool char)vec_perm(
6730 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6731 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6735 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6737 #ifdef __LITTLE_ENDIAN__
6738 return (vector short)vec_perm(
6740 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6741 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6743 return (vector short)vec_perm(
6745 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6746 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6750 static __inline__ vector unsigned short __ATTRS_o_ai
6751 vec_pack(vector unsigned int __a, vector unsigned int __b) {
6752 #ifdef __LITTLE_ENDIAN__
6753 return (vector unsigned short)vec_perm(
6755 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6756 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6758 return (vector unsigned short)vec_perm(
6760 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6761 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6765 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6766 vector bool int __b) {
6767 #ifdef __LITTLE_ENDIAN__
6768 return (vector bool short)vec_perm(
6770 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6771 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6773 return (vector bool short)vec_perm(
6775 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6776 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6781 static __inline__ vector signed int __ATTRS_o_ai
6782 vec_pack(vector signed long long __a, vector signed long long __b) {
6783 #ifdef __LITTLE_ENDIAN__
6784 return (vector signed int)vec_perm(
6786 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6787 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6789 return (vector signed int)vec_perm(
6791 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6792 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6795 static __inline__ vector unsigned int __ATTRS_o_ai
6796 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6797 #ifdef __LITTLE_ENDIAN__
6798 return (vector unsigned int)vec_perm(
6800 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6801 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6803 return (vector unsigned int)vec_perm(
6805 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6806 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6810 static __inline__ vector bool int __ATTRS_o_ai
6811 vec_pack(vector bool long long __a, vector bool long long __b) {
6812 #ifdef __LITTLE_ENDIAN__
6813 return (vector bool int)vec_perm(
6815 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6816 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6818 return (vector bool int)vec_perm(
6820 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6821 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6825 static __inline__ vector float __ATTRS_o_ai
6826 vec_pack(vector double __a, vector double __b) {
6827 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6831 #ifdef __POWER9_VECTOR__
6832 static __inline__ vector unsigned short __ATTRS_o_ai
6833 vec_pack_to_short_fp32(vector float __a, vector float __b) {
6834 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6835 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6836 #ifdef __LITTLE_ENDIAN__
6837 return (vector unsigned short)vec_mergee(__resa, __resb);
6839 return (vector unsigned short)vec_mergeo(__resa, __resb);
6846 #define __builtin_altivec_vpkuhum vec_vpkuhum
6848 static __inline__ vector signed char __ATTRS_o_ai
6849 vec_vpkuhum(vector signed short __a, vector signed short __b) {
6850 #ifdef __LITTLE_ENDIAN__
6851 return (vector signed char)vec_perm(
6853 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6854 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6856 return (vector signed char)vec_perm(
6858 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6859 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6863 static __inline__ vector unsigned char __ATTRS_o_ai
6864 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6865 #ifdef __LITTLE_ENDIAN__
6866 return (vector unsigned char)vec_perm(
6868 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6869 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6871 return (vector unsigned char)vec_perm(
6873 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6874 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6878 static __inline__ vector bool char __ATTRS_o_ai
6879 vec_vpkuhum(vector bool short __a, vector bool short __b) {
6880 #ifdef __LITTLE_ENDIAN__
6881 return (vector bool char)vec_perm(
6883 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6884 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6886 return (vector bool char)vec_perm(
6888 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6889 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6895 #define __builtin_altivec_vpkuwum vec_vpkuwum
6897 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6899 #ifdef __LITTLE_ENDIAN__
6900 return (vector short)vec_perm(
6902 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6903 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6905 return (vector short)vec_perm(
6907 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6908 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6912 static __inline__ vector unsigned short __ATTRS_o_ai
6913 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6914 #ifdef __LITTLE_ENDIAN__
6915 return (vector unsigned short)vec_perm(
6917 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6918 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6920 return (vector unsigned short)vec_perm(
6922 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6923 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6927 static __inline__ vector bool short __ATTRS_o_ai
6928 vec_vpkuwum(vector bool int __a, vector bool int __b) {
6929 #ifdef __LITTLE_ENDIAN__
6930 return (vector bool short)vec_perm(
6932 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6933 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6935 return (vector bool short)vec_perm(
6937 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6938 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6944 #ifdef __POWER8_VECTOR__
6945 #define __builtin_altivec_vpkudum vec_vpkudum
6947 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
6948 vector long long __b) {
6949 #ifdef __LITTLE_ENDIAN__
6950 return (vector int)vec_perm(
6952 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6953 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6955 return (vector int)vec_perm(
6957 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6958 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6962 static __inline__ vector unsigned int __ATTRS_o_ai
6963 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
6964 #ifdef __LITTLE_ENDIAN__
6965 return (vector unsigned int)vec_perm(
6967 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6968 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6970 return (vector unsigned int)vec_perm(
6972 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6973 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6977 static __inline__ vector bool int __ATTRS_o_ai
6978 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
6979 #ifdef __LITTLE_ENDIAN__
6980 return (vector bool int)vec_perm(
6981 (vector long long)__a, (vector long long)__b,
6982 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6983 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6985 return (vector bool int)vec_perm(
6986 (vector long long)__a, (vector long long)__b,
6987 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6988 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6995 static __inline__ vector pixel __attribute__((__always_inline__))
6996 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
6997 #ifdef __LITTLE_ENDIAN__
6998 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7000 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7006 static __inline__ vector pixel __attribute__((__always_inline__))
7007 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7008 #ifdef __LITTLE_ENDIAN__
7009 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7011 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7017 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7019 #ifdef __LITTLE_ENDIAN__
7020 return __builtin_altivec_vpkshss(__b, __a);
7022 return __builtin_altivec_vpkshss(__a, __b);
7026 static __inline__ vector unsigned char __ATTRS_o_ai
7027 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7028 #ifdef __LITTLE_ENDIAN__
7029 return __builtin_altivec_vpkuhus(__b, __a);
7031 return __builtin_altivec_vpkuhus(__a, __b);
7035 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7037 #ifdef __LITTLE_ENDIAN__
7038 return __builtin_altivec_vpkswss(__b, __a);
7040 return __builtin_altivec_vpkswss(__a, __b);
7044 static __inline__ vector unsigned short __ATTRS_o_ai
7045 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7046 #ifdef __LITTLE_ENDIAN__
7047 return __builtin_altivec_vpkuwus(__b, __a);
7049 return __builtin_altivec_vpkuwus(__a, __b);
7053 #ifdef __POWER8_VECTOR__
7054 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7055 vector long long __b) {
7056 #ifdef __LITTLE_ENDIAN__
7057 return __builtin_altivec_vpksdss(__b, __a);
7059 return __builtin_altivec_vpksdss(__a, __b);
7063 static __inline__ vector unsigned int __ATTRS_o_ai
7064 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7065 #ifdef __LITTLE_ENDIAN__
7066 return __builtin_altivec_vpkudus(__b, __a);
7068 return __builtin_altivec_vpkudus(__a, __b);
7075 static __inline__ vector signed char __attribute__((__always_inline__))
7076 vec_vpkshss(vector short __a, vector short __b) {
7077 #ifdef __LITTLE_ENDIAN__
7078 return __builtin_altivec_vpkshss(__b, __a);
7080 return __builtin_altivec_vpkshss(__a, __b);
7086 #ifdef __POWER8_VECTOR__
7087 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7088 vector long long __b) {
7089 #ifdef __LITTLE_ENDIAN__
7090 return __builtin_altivec_vpksdss(__b, __a);
7092 return __builtin_altivec_vpksdss(__a, __b);
7099 static __inline__ vector unsigned char __attribute__((__always_inline__))
7100 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7101 #ifdef __LITTLE_ENDIAN__
7102 return __builtin_altivec_vpkuhus(__b, __a);
7104 return __builtin_altivec_vpkuhus(__a, __b);
7110 #ifdef __POWER8_VECTOR__
7111 static __inline__ vector unsigned int __attribute__((__always_inline__))
7112 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7113 #ifdef __LITTLE_ENDIAN__
7114 return __builtin_altivec_vpkudus(__b, __a);
7116 return __builtin_altivec_vpkudus(__a, __b);
7123 static __inline__ vector signed short __attribute__((__always_inline__))
7124 vec_vpkswss(vector int __a, vector int __b) {
7125 #ifdef __LITTLE_ENDIAN__
7126 return __builtin_altivec_vpkswss(__b, __a);
7128 return __builtin_altivec_vpkswss(__a, __b);
7134 static __inline__ vector unsigned short __attribute__((__always_inline__))
7135 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7136 #ifdef __LITTLE_ENDIAN__
7137 return __builtin_altivec_vpkuwus(__b, __a);
7139 return __builtin_altivec_vpkuwus(__a, __b);
7145 static __inline__ vector unsigned char __ATTRS_o_ai
7146 vec_packsu(vector short __a, vector short __b) {
7147 #ifdef __LITTLE_ENDIAN__
7148 return __builtin_altivec_vpkshus(__b, __a);
7150 return __builtin_altivec_vpkshus(__a, __b);
7154 static __inline__ vector unsigned char __ATTRS_o_ai
7155 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7156 #ifdef __LITTLE_ENDIAN__
7157 return __builtin_altivec_vpkuhus(__b, __a);
7159 return __builtin_altivec_vpkuhus(__a, __b);
7163 static __inline__ vector unsigned short __ATTRS_o_ai
7164 vec_packsu(vector int __a, vector int __b) {
7165 #ifdef __LITTLE_ENDIAN__
7166 return __builtin_altivec_vpkswus(__b, __a);
7168 return __builtin_altivec_vpkswus(__a, __b);
7172 static __inline__ vector unsigned short __ATTRS_o_ai
7173 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7174 #ifdef __LITTLE_ENDIAN__
7175 return __builtin_altivec_vpkuwus(__b, __a);
7177 return __builtin_altivec_vpkuwus(__a, __b);
7181 #ifdef __POWER8_VECTOR__
7182 static __inline__ vector unsigned int __ATTRS_o_ai
7183 vec_packsu(vector long long __a, vector long long __b) {
7184 #ifdef __LITTLE_ENDIAN__
7185 return __builtin_altivec_vpksdus(__b, __a);
7187 return __builtin_altivec_vpksdus(__a, __b);
7191 static __inline__ vector unsigned int __ATTRS_o_ai
7192 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7193 #ifdef __LITTLE_ENDIAN__
7194 return __builtin_altivec_vpkudus(__b, __a);
7196 return __builtin_altivec_vpkudus(__a, __b);
7203 static __inline__ vector unsigned char __ATTRS_o_ai
7204 vec_vpkshus(vector short __a, vector short __b) {
7205 #ifdef __LITTLE_ENDIAN__
7206 return __builtin_altivec_vpkshus(__b, __a);
7208 return __builtin_altivec_vpkshus(__a, __b);
7212 static __inline__ vector unsigned char __ATTRS_o_ai
7213 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7214 #ifdef __LITTLE_ENDIAN__
7215 return __builtin_altivec_vpkuhus(__b, __a);
7217 return __builtin_altivec_vpkuhus(__a, __b);
7223 static __inline__ vector unsigned short __ATTRS_o_ai
7224 vec_vpkswus(vector int __a, vector int __b) {
7225 #ifdef __LITTLE_ENDIAN__
7226 return __builtin_altivec_vpkswus(__b, __a);
7228 return __builtin_altivec_vpkswus(__a, __b);
7232 static __inline__ vector unsigned short __ATTRS_o_ai
7233 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7234 #ifdef __LITTLE_ENDIAN__
7235 return __builtin_altivec_vpkuwus(__b, __a);
7237 return __builtin_altivec_vpkuwus(__a, __b);
7243 #ifdef __POWER8_VECTOR__
7244 static __inline__ vector unsigned int __ATTRS_o_ai
7245 vec_vpksdus(vector long long __a, vector long long __b) {
7246 #ifdef __LITTLE_ENDIAN__
7247 return __builtin_altivec_vpksdus(__b, __a);
7249 return __builtin_altivec_vpksdus(__a, __b);
7256 // The vperm instruction is defined architecturally with a big-endian bias.
7257 // For little endian, we swap the input operands and invert the permute
7258 // control vector. Only the rightmost 5 bits matter, so we could use
7259 // a vector of all 31s instead of all 255s to perform the inversion.
7260 // However, when the PCV is not a constant, using 255 has an advantage
7261 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7262 // later, possibly a vec_nand).
7264 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7265 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7266 #ifdef __LITTLE_ENDIAN__
7267 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7268 255, 255, 255, 255, 255, 255, 255, 255};
7269 __d = vec_xor(__c, __d);
7270 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7271 (vector int)__a, __d);
7273 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7274 (vector int)__b, __c);
7278 static __inline__ vector unsigned char __ATTRS_o_ai
7279 vec_perm(vector unsigned char __a, vector unsigned char __b,
7280 vector unsigned char __c) {
7281 #ifdef __LITTLE_ENDIAN__
7282 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7283 255, 255, 255, 255, 255, 255, 255, 255};
7284 __d = vec_xor(__c, __d);
7285 return (vector unsigned char)__builtin_altivec_vperm_4si(
7286 (vector int)__b, (vector int)__a, __d);
7288 return (vector unsigned char)__builtin_altivec_vperm_4si(
7289 (vector int)__a, (vector int)__b, __c);
7293 static __inline__ vector bool char __ATTRS_o_ai
7294 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7295 #ifdef __LITTLE_ENDIAN__
7296 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7297 255, 255, 255, 255, 255, 255, 255, 255};
7298 __d = vec_xor(__c, __d);
7299 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7300 (vector int)__a, __d);
7302 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7303 (vector int)__b, __c);
7307 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7308 vector signed short __b,
7309 vector unsigned char __c) {
7310 #ifdef __LITTLE_ENDIAN__
7311 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7312 255, 255, 255, 255, 255, 255, 255, 255};
7313 __d = vec_xor(__c, __d);
7314 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7315 (vector int)__a, __d);
7317 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7318 (vector int)__b, __c);
7322 static __inline__ vector unsigned short __ATTRS_o_ai
7323 vec_perm(vector unsigned short __a, vector unsigned short __b,
7324 vector unsigned char __c) {
7325 #ifdef __LITTLE_ENDIAN__
7326 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7327 255, 255, 255, 255, 255, 255, 255, 255};
7328 __d = vec_xor(__c, __d);
7329 return (vector unsigned short)__builtin_altivec_vperm_4si(
7330 (vector int)__b, (vector int)__a, __d);
7332 return (vector unsigned short)__builtin_altivec_vperm_4si(
7333 (vector int)__a, (vector int)__b, __c);
7337 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7338 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7339 #ifdef __LITTLE_ENDIAN__
7340 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7341 255, 255, 255, 255, 255, 255, 255, 255};
7342 __d = vec_xor(__c, __d);
7343 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7344 (vector int)__a, __d);
7346 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7347 (vector int)__b, __c);
7351 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7353 vector unsigned char __c) {
7354 #ifdef __LITTLE_ENDIAN__
7355 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7356 255, 255, 255, 255, 255, 255, 255, 255};
7357 __d = vec_xor(__c, __d);
7358 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7359 (vector int)__a, __d);
7361 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7362 (vector int)__b, __c);
7366 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7367 vector signed int __b,
7368 vector unsigned char __c) {
7369 #ifdef __LITTLE_ENDIAN__
7370 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7371 255, 255, 255, 255, 255, 255, 255, 255};
7372 __d = vec_xor(__c, __d);
7373 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7375 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7379 static __inline__ vector unsigned int __ATTRS_o_ai
7380 vec_perm(vector unsigned int __a, vector unsigned int __b,
7381 vector unsigned char __c) {
7382 #ifdef __LITTLE_ENDIAN__
7383 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7384 255, 255, 255, 255, 255, 255, 255, 255};
7385 __d = vec_xor(__c, __d);
7386 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7387 (vector int)__a, __d);
7389 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7390 (vector int)__b, __c);
7394 static __inline__ vector bool int __ATTRS_o_ai
7395 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7396 #ifdef __LITTLE_ENDIAN__
7397 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7398 255, 255, 255, 255, 255, 255, 255, 255};
7399 __d = vec_xor(__c, __d);
7400 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
7401 (vector int)__a, __d);
7403 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7404 (vector int)__b, __c);
7408 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7410 vector unsigned char __c) {
7411 #ifdef __LITTLE_ENDIAN__
7412 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7413 255, 255, 255, 255, 255, 255, 255, 255};
7414 __d = vec_xor(__c, __d);
7415 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7416 (vector int)__a, __d);
7418 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7419 (vector int)__b, __c);
7424 static __inline__ vector long long __ATTRS_o_ai
7425 vec_perm(vector signed long long __a, vector signed long long __b,
7426 vector unsigned char __c) {
7427 #ifdef __LITTLE_ENDIAN__
7428 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7429 255, 255, 255, 255, 255, 255, 255, 255};
7430 __d = vec_xor(__c, __d);
7431 return (vector signed long long)__builtin_altivec_vperm_4si(
7432 (vector int)__b, (vector int)__a, __d);
7434 return (vector signed long long)__builtin_altivec_vperm_4si(
7435 (vector int)__a, (vector int)__b, __c);
7439 static __inline__ vector unsigned long long __ATTRS_o_ai
7440 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7441 vector unsigned char __c) {
7442 #ifdef __LITTLE_ENDIAN__
7443 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7444 255, 255, 255, 255, 255, 255, 255, 255};
7445 __d = vec_xor(__c, __d);
7446 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7447 (vector int)__b, (vector int)__a, __d);
7449 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7450 (vector int)__a, (vector int)__b, __c);
7454 static __inline__ vector bool long long __ATTRS_o_ai
7455 vec_perm(vector bool long long __a, vector bool long long __b,
7456 vector unsigned char __c) {
7457 #ifdef __LITTLE_ENDIAN__
7458 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7459 255, 255, 255, 255, 255, 255, 255, 255};
7460 __d = vec_xor(__c, __d);
7461 return (vector bool long long)__builtin_altivec_vperm_4si(
7462 (vector int)__b, (vector int)__a, __d);
7464 return (vector bool long long)__builtin_altivec_vperm_4si(
7465 (vector int)__a, (vector int)__b, __c);
7469 static __inline__ vector double __ATTRS_o_ai
7470 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
7471 #ifdef __LITTLE_ENDIAN__
7472 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7473 255, 255, 255, 255, 255, 255, 255, 255};
7474 __d = vec_xor(__c, __d);
7475 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
7476 (vector int)__a, __d);
7478 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7479 (vector int)__b, __c);
7486 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7487 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7488 return vec_perm(__a, __b, __c);
7491 static __inline__ vector unsigned char __ATTRS_o_ai
7492 vec_vperm(vector unsigned char __a, vector unsigned char __b,
7493 vector unsigned char __c) {
7494 return vec_perm(__a, __b, __c);
7497 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7498 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7499 return vec_perm(__a, __b, __c);
7502 static __inline__ vector short __ATTRS_o_ai
7503 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7504 return vec_perm(__a, __b, __c);
7507 static __inline__ vector unsigned short __ATTRS_o_ai
7508 vec_vperm(vector unsigned short __a, vector unsigned short __b,
7509 vector unsigned char __c) {
7510 return vec_perm(__a, __b, __c);
7513 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7514 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7515 return vec_perm(__a, __b, __c);
7518 static __inline__ vector pixel __ATTRS_o_ai
7519 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7520 return vec_perm(__a, __b, __c);
7523 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7525 vector unsigned char __c) {
7526 return vec_perm(__a, __b, __c);
7529 static __inline__ vector unsigned int __ATTRS_o_ai
7530 vec_vperm(vector unsigned int __a, vector unsigned int __b,
7531 vector unsigned char __c) {
7532 return vec_perm(__a, __b, __c);
7535 static __inline__ vector bool int __ATTRS_o_ai
7536 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7537 return vec_perm(__a, __b, __c);
7540 static __inline__ vector float __ATTRS_o_ai
7541 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7542 return vec_perm(__a, __b, __c);
7546 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7547 vector long long __a, vector long long __b, vector unsigned char __c) {
7548 return vec_perm(__a, __b, __c);
7551 static __inline__ vector unsigned long long __ATTRS_o_ai
7552 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7553 vector unsigned char __c) {
7554 return vec_perm(__a, __b, __c);
7557 static __inline__ vector double __ATTRS_o_ai
7558 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7559 return vec_perm(__a, __b, __c);
7565 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7567 return __builtin_vsx_xvresp(__a);
7569 return __builtin_altivec_vrefp(__a);
7574 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7575 return __builtin_vsx_xvredp(__a);
7581 static __inline__ vector float __attribute__((__always_inline__))
7582 vec_vrefp(vector float __a) {
7583 return __builtin_altivec_vrefp(__a);
7588 static __inline__ vector signed char __ATTRS_o_ai
7589 vec_rl(vector signed char __a, vector unsigned char __b) {
7590 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7593 static __inline__ vector unsigned char __ATTRS_o_ai
7594 vec_rl(vector unsigned char __a, vector unsigned char __b) {
7595 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7598 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7599 vector unsigned short __b) {
7600 return __builtin_altivec_vrlh(__a, __b);
7603 static __inline__ vector unsigned short __ATTRS_o_ai
7604 vec_rl(vector unsigned short __a, vector unsigned short __b) {
7605 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7608 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7609 vector unsigned int __b) {
7610 return __builtin_altivec_vrlw(__a, __b);
7613 static __inline__ vector unsigned int __ATTRS_o_ai
7614 vec_rl(vector unsigned int __a, vector unsigned int __b) {
7615 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7618 #ifdef __POWER8_VECTOR__
7619 static __inline__ vector signed long long __ATTRS_o_ai
7620 vec_rl(vector signed long long __a, vector unsigned long long __b) {
7621 return __builtin_altivec_vrld(__a, __b);
7624 static __inline__ vector unsigned long long __ATTRS_o_ai
7625 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7626 return __builtin_altivec_vrld(__a, __b);
7631 #ifdef __POWER9_VECTOR__
7632 static __inline__ vector unsigned int __ATTRS_o_ai
7633 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7634 vector unsigned int __c) {
7635 return __builtin_altivec_vrlwmi(__a, __c, __b);
7638 static __inline__ vector unsigned long long __ATTRS_o_ai
7639 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7640 vector unsigned long long __c) {
7641 return __builtin_altivec_vrldmi(__a, __c, __b);
7645 static __inline__ vector unsigned int __ATTRS_o_ai
7646 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7647 vector unsigned int __c) {
7648 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7649 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7652 static __inline__ vector unsigned long long __ATTRS_o_ai
7653 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7654 vector unsigned long long __c) {
7655 vector unsigned long long OneByte = { 0x8, 0x8 };
7656 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7662 static __inline__ vector signed char __ATTRS_o_ai
7663 vec_vrlb(vector signed char __a, vector unsigned char __b) {
7664 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7667 static __inline__ vector unsigned char __ATTRS_o_ai
7668 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7669 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7674 static __inline__ vector short __ATTRS_o_ai
7675 vec_vrlh(vector short __a, vector unsigned short __b) {
7676 return __builtin_altivec_vrlh(__a, __b);
7679 static __inline__ vector unsigned short __ATTRS_o_ai
7680 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7681 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7686 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7687 vector unsigned int __b) {
7688 return __builtin_altivec_vrlw(__a, __b);
7691 static __inline__ vector unsigned int __ATTRS_o_ai
7692 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7693 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7698 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7700 return __builtin_vsx_xvrspi(__a);
7702 return __builtin_altivec_vrfin(__a);
7707 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7708 return __builtin_vsx_xvrdpi(__a);
7713 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7714 return __builtin_vsx_xvrspic(__a);
7717 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7718 return __builtin_vsx_xvrdpic(__a);
7723 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7724 return __builtin_vsx_xvrspi(__a);
7727 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7728 return __builtin_vsx_xvrdpi(__a);
7734 static __inline__ vector float __attribute__((__always_inline__))
7735 vec_vrfin(vector float __a) {
7736 return __builtin_altivec_vrfin(__a);
7742 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7743 return __builtin_vsx_xvsqrtsp(__a);
7746 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7747 return __builtin_vsx_xvsqrtdp(__a);
7753 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7755 return __builtin_vsx_xvrsqrtesp(__a);
7757 return __builtin_altivec_vrsqrtefp(__a);
7762 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7763 return __builtin_vsx_xvrsqrtedp(__a);
7769 static __inline__ __vector float __attribute__((__always_inline__))
7770 vec_vrsqrtefp(vector float __a) {
7771 return __builtin_altivec_vrsqrtefp(__a);
7776 #define __builtin_altivec_vsel_4si vec_sel
7778 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7779 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7780 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7783 static __inline__ vector signed char __ATTRS_o_ai
7784 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7785 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7788 static __inline__ vector unsigned char __ATTRS_o_ai
7789 vec_sel(vector unsigned char __a, vector unsigned char __b,
7790 vector unsigned char __c) {
7791 return (__a & ~__c) | (__b & __c);
7794 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7795 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7796 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7799 static __inline__ vector bool char __ATTRS_o_ai
7800 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7801 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7804 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7805 vector bool char __b,
7806 vector bool char __c) {
7807 return (__a & ~__c) | (__b & __c);
7810 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7812 vector unsigned short __c) {
7813 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7816 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7818 vector bool short __c) {
7819 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7822 static __inline__ vector unsigned short __ATTRS_o_ai
7823 vec_sel(vector unsigned short __a, vector unsigned short __b,
7824 vector unsigned short __c) {
7825 return (__a & ~__c) | (__b & __c);
7828 static __inline__ vector unsigned short __ATTRS_o_ai
7829 vec_sel(vector unsigned short __a, vector unsigned short __b,
7830 vector bool short __c) {
7831 return (__a & ~(vector unsigned short)__c) |
7832 (__b & (vector unsigned short)__c);
7835 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7836 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7837 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7840 static __inline__ vector bool short __ATTRS_o_ai
7841 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7842 return (__a & ~__c) | (__b & __c);
7845 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7847 vector unsigned int __c) {
7848 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7851 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7853 vector bool int __c) {
7854 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7857 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7858 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7859 return (__a & ~__c) | (__b & __c);
7862 static __inline__ vector unsigned int __ATTRS_o_ai
7863 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7864 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7867 static __inline__ vector bool int __ATTRS_o_ai
7868 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7869 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7872 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7873 vector bool int __b,
7874 vector bool int __c) {
7875 return (__a & ~__c) | (__b & __c);
7878 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7880 vector unsigned int __c) {
7881 vector int __res = ((vector int)__a & ~(vector int)__c) |
7882 ((vector int)__b & (vector int)__c);
7883 return (vector float)__res;
7886 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7888 vector bool int __c) {
7889 vector int __res = ((vector int)__a & ~(vector int)__c) |
7890 ((vector int)__b & (vector int)__c);
7891 return (vector float)__res;
7895 static __inline__ vector double __ATTRS_o_ai
7896 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7897 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7898 ((vector long long)__b & (vector long long)__c);
7899 return (vector double)__res;
7902 static __inline__ vector double __ATTRS_o_ai
7903 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7904 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7905 ((vector long long)__b & (vector long long)__c);
7906 return (vector double)__res;
7912 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7913 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7914 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7917 static __inline__ vector signed char __ATTRS_o_ai
7918 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7919 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7922 static __inline__ vector unsigned char __ATTRS_o_ai
7923 vec_vsel(vector unsigned char __a, vector unsigned char __b,
7924 vector unsigned char __c) {
7925 return (__a & ~__c) | (__b & __c);
7928 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7929 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7930 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7933 static __inline__ vector bool char __ATTRS_o_ai
7934 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7935 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7938 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7939 vector bool char __b,
7940 vector bool char __c) {
7941 return (__a & ~__c) | (__b & __c);
7944 static __inline__ vector short __ATTRS_o_ai
7945 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
7946 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7949 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
7951 vector bool short __c) {
7952 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7955 static __inline__ vector unsigned short __ATTRS_o_ai
7956 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7957 vector unsigned short __c) {
7958 return (__a & ~__c) | (__b & __c);
7961 static __inline__ vector unsigned short __ATTRS_o_ai
7962 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7963 vector bool short __c) {
7964 return (__a & ~(vector unsigned short)__c) |
7965 (__b & (vector unsigned short)__c);
7968 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
7969 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7970 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7973 static __inline__ vector bool short __ATTRS_o_ai
7974 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
7975 return (__a & ~__c) | (__b & __c);
7978 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7980 vector unsigned int __c) {
7981 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7984 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7986 vector bool int __c) {
7987 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7990 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
7991 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7992 return (__a & ~__c) | (__b & __c);
7995 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
7996 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7997 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8000 static __inline__ vector bool int __ATTRS_o_ai
8001 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8002 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8005 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8006 vector bool int __b,
8007 vector bool int __c) {
8008 return (__a & ~__c) | (__b & __c);
8011 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8013 vector unsigned int __c) {
8014 vector int __res = ((vector int)__a & ~(vector int)__c) |
8015 ((vector int)__b & (vector int)__c);
8016 return (vector float)__res;
8019 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8021 vector bool int __c) {
8022 vector int __res = ((vector int)__a & ~(vector int)__c) |
8023 ((vector int)__b & (vector int)__c);
8024 return (vector float)__res;
8029 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8030 // than the length of __a.
8031 static __inline__ vector unsigned char __ATTRS_o_ai
8032 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8033 return __a << (__b %
8034 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8037 static __inline__ vector signed char __ATTRS_o_ai
8038 vec_sl(vector signed char __a, vector unsigned char __b) {
8039 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8042 static __inline__ vector unsigned short __ATTRS_o_ai
8043 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8044 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8048 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8049 vector unsigned short __b) {
8050 return (vector short)vec_sl((vector unsigned short)__a, __b);
8053 static __inline__ vector unsigned int __ATTRS_o_ai
8054 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8055 return __a << (__b %
8056 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8059 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8060 vector unsigned int __b) {
8061 return (vector int)vec_sl((vector unsigned int)__a, __b);
8064 #ifdef __POWER8_VECTOR__
8065 static __inline__ vector unsigned long long __ATTRS_o_ai
8066 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8067 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8071 static __inline__ vector long long __ATTRS_o_ai
8072 vec_sl(vector long long __a, vector unsigned long long __b) {
8073 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8079 #define __builtin_altivec_vslb vec_vslb
8081 static __inline__ vector signed char __ATTRS_o_ai
8082 vec_vslb(vector signed char __a, vector unsigned char __b) {
8083 return vec_sl(__a, __b);
8086 static __inline__ vector unsigned char __ATTRS_o_ai
8087 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8088 return vec_sl(__a, __b);
8093 #define __builtin_altivec_vslh vec_vslh
8095 static __inline__ vector short __ATTRS_o_ai
8096 vec_vslh(vector short __a, vector unsigned short __b) {
8097 return vec_sl(__a, __b);
8100 static __inline__ vector unsigned short __ATTRS_o_ai
8101 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8102 return vec_sl(__a, __b);
8107 #define __builtin_altivec_vslw vec_vslw
8109 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8110 vector unsigned int __b) {
8111 return vec_sl(__a, __b);
8114 static __inline__ vector unsigned int __ATTRS_o_ai
8115 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8116 return vec_sl(__a, __b);
8121 #define __builtin_altivec_vsldoi_4si vec_sld
8123 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8124 vector signed char __a, vector signed char __b, unsigned const int __c) {
8125 unsigned char __d = __c & 0x0F;
8126 #ifdef __LITTLE_ENDIAN__
8128 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8129 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8130 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8131 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8135 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8136 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8137 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8141 static __inline__ vector unsigned char __ATTRS_o_ai
8142 vec_sld(vector unsigned char __a, vector unsigned char __b,
8143 unsigned const int __c) {
8144 unsigned char __d = __c & 0x0F;
8145 #ifdef __LITTLE_ENDIAN__
8147 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8148 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8149 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8150 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8154 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8155 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8156 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8160 static __inline__ vector bool char __ATTRS_o_ai
8161 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8162 unsigned char __d = __c & 0x0F;
8163 #ifdef __LITTLE_ENDIAN__
8165 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8166 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8167 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8168 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8172 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8173 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8174 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8178 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8179 vector signed short __a, vector signed short __b, unsigned const int __c) {
8180 unsigned char __d = __c & 0x0F;
8181 #ifdef __LITTLE_ENDIAN__
8183 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8184 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8185 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8186 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8190 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8191 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8192 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8196 static __inline__ vector unsigned short __ATTRS_o_ai
8197 vec_sld(vector unsigned short __a, vector unsigned short __b,
8198 unsigned const int __c) {
8199 unsigned char __d = __c & 0x0F;
8200 #ifdef __LITTLE_ENDIAN__
8202 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8203 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8204 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8205 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8209 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8210 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8211 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8215 static __inline__ vector bool short __ATTRS_o_ai
8216 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8217 unsigned char __d = __c & 0x0F;
8218 #ifdef __LITTLE_ENDIAN__
8220 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8221 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8222 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8223 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8227 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8228 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8229 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8233 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8235 unsigned const int __c) {
8236 unsigned char __d = __c & 0x0F;
8237 #ifdef __LITTLE_ENDIAN__
8239 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8240 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8241 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8242 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8246 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8247 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8248 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8252 static __inline__ vector signed int __ATTRS_o_ai
8253 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
8254 unsigned char __d = __c & 0x0F;
8255 #ifdef __LITTLE_ENDIAN__
8257 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8258 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8259 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8260 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8264 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8265 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8266 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8270 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8271 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8272 unsigned char __d = __c & 0x0F;
8273 #ifdef __LITTLE_ENDIAN__
8275 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8276 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8277 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8278 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8282 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8283 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8284 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8288 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8289 vector bool int __b,
8290 unsigned const int __c) {
8291 unsigned char __d = __c & 0x0F;
8292 #ifdef __LITTLE_ENDIAN__
8294 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8295 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8296 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8297 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8301 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8302 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8303 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8307 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8309 unsigned const int __c) {
8310 unsigned char __d = __c & 0x0F;
8311 #ifdef __LITTLE_ENDIAN__
8313 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8314 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8315 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8316 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8320 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8321 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8322 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8327 static __inline__ vector bool long long __ATTRS_o_ai
8328 vec_sld(vector bool long long __a, vector bool long long __b,
8329 unsigned const int __c) {
8330 unsigned char __d = __c & 0x0F;
8331 #ifdef __LITTLE_ENDIAN__
8333 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8334 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8335 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8336 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8340 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8341 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8342 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8346 static __inline__ vector signed long long __ATTRS_o_ai
8347 vec_sld(vector signed long long __a, vector signed long long __b,
8348 unsigned const int __c) {
8349 unsigned char __d = __c & 0x0F;
8350 #ifdef __LITTLE_ENDIAN__
8352 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8353 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8354 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8355 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8359 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8360 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8361 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8365 static __inline__ vector unsigned long long __ATTRS_o_ai
8366 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8367 unsigned const int __c) {
8368 unsigned char __d = __c & 0x0F;
8369 #ifdef __LITTLE_ENDIAN__
8371 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8372 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8373 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8374 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8378 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8379 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8380 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8384 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8386 unsigned const int __c) {
8387 unsigned char __d = __c & 0x0F;
8388 #ifdef __LITTLE_ENDIAN__
8390 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8391 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8392 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8393 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8397 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8398 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8399 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8405 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8406 vector signed char __a, vector signed char __b, unsigned const int __c) {
8407 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8410 static __inline__ vector unsigned char __ATTRS_o_ai
8411 vec_sldw(vector unsigned char __a, vector unsigned char __b,
8412 unsigned const int __c) {
8413 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8416 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8417 vector signed short __a, vector signed short __b, unsigned const int __c) {
8418 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8421 static __inline__ vector unsigned short __ATTRS_o_ai
8422 vec_sldw(vector unsigned short __a, vector unsigned short __b,
8423 unsigned const int __c) {
8424 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8427 static __inline__ vector signed int __ATTRS_o_ai
8428 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8429 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8432 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8433 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8434 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8438 static __inline__ vector signed long long __ATTRS_o_ai
8439 vec_sldw(vector signed long long __a, vector signed long long __b,
8440 unsigned const int __c) {
8441 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8444 static __inline__ vector unsigned long long __ATTRS_o_ai
8445 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8446 unsigned const int __c) {
8447 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8451 #ifdef __POWER9_VECTOR__
8453 static __inline__ vector unsigned char __ATTRS_o_ai
8454 vec_slv(vector unsigned char __a, vector unsigned char __b) {
8455 return __builtin_altivec_vslv(__a, __b);
8459 static __inline__ vector unsigned char __ATTRS_o_ai
8460 vec_srv(vector unsigned char __a, vector unsigned char __b) {
8461 return __builtin_altivec_vsrv(__a, __b);
8467 static __inline__ vector signed char __ATTRS_o_ai
8468 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8469 unsigned char __d = __c & 0x0F;
8470 #ifdef __LITTLE_ENDIAN__
8472 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8473 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8474 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8475 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8479 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8480 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8481 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8485 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8486 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
8487 unsigned char __d = __c & 0x0F;
8488 #ifdef __LITTLE_ENDIAN__
8490 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8491 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8492 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8493 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8497 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8498 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8499 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8503 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
8505 unsigned char __c) {
8506 unsigned char __d = __c & 0x0F;
8507 #ifdef __LITTLE_ENDIAN__
8509 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8510 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8511 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8512 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8516 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8517 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8518 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8522 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
8523 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
8524 unsigned char __d = __c & 0x0F;
8525 #ifdef __LITTLE_ENDIAN__
8527 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8528 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8529 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8530 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8534 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8535 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8536 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8540 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
8542 unsigned char __c) {
8543 unsigned char __d = __c & 0x0F;
8544 #ifdef __LITTLE_ENDIAN__
8546 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8547 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8548 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8549 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8553 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8554 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8555 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8559 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8561 unsigned char __c) {
8562 unsigned char __d = __c & 0x0F;
8563 #ifdef __LITTLE_ENDIAN__
8565 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8566 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8567 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8568 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8572 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8573 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8574 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8578 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8579 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8580 unsigned char __d = __c & 0x0F;
8581 #ifdef __LITTLE_ENDIAN__
8583 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8584 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8585 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8586 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8590 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8591 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8592 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8596 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8598 unsigned char __c) {
8599 unsigned char __d = __c & 0x0F;
8600 #ifdef __LITTLE_ENDIAN__
8602 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8603 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8604 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8605 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8609 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8610 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8611 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8617 static __inline__ vector signed char __ATTRS_o_ai
8618 vec_sll(vector signed char __a, vector unsigned char __b) {
8619 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8623 static __inline__ vector signed char __ATTRS_o_ai
8624 vec_sll(vector signed char __a, vector unsigned short __b) {
8625 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8629 static __inline__ vector signed char __ATTRS_o_ai
8630 vec_sll(vector signed char __a, vector unsigned int __b) {
8631 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8635 static __inline__ vector unsigned char __ATTRS_o_ai
8636 vec_sll(vector unsigned char __a, vector unsigned char __b) {
8637 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8641 static __inline__ vector unsigned char __ATTRS_o_ai
8642 vec_sll(vector unsigned char __a, vector unsigned short __b) {
8643 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8647 static __inline__ vector unsigned char __ATTRS_o_ai
8648 vec_sll(vector unsigned char __a, vector unsigned int __b) {
8649 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8653 static __inline__ vector bool char __ATTRS_o_ai
8654 vec_sll(vector bool char __a, vector unsigned char __b) {
8655 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8659 static __inline__ vector bool char __ATTRS_o_ai
8660 vec_sll(vector bool char __a, vector unsigned short __b) {
8661 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8665 static __inline__ vector bool char __ATTRS_o_ai
8666 vec_sll(vector bool char __a, vector unsigned int __b) {
8667 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8671 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8672 vector unsigned char __b) {
8673 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8676 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8677 vector unsigned short __b) {
8678 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8681 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8682 vector unsigned int __b) {
8683 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8686 static __inline__ vector unsigned short __ATTRS_o_ai
8687 vec_sll(vector unsigned short __a, vector unsigned char __b) {
8688 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8692 static __inline__ vector unsigned short __ATTRS_o_ai
8693 vec_sll(vector unsigned short __a, vector unsigned short __b) {
8694 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8698 static __inline__ vector unsigned short __ATTRS_o_ai
8699 vec_sll(vector unsigned short __a, vector unsigned int __b) {
8700 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8704 static __inline__ vector bool short __ATTRS_o_ai
8705 vec_sll(vector bool short __a, vector unsigned char __b) {
8706 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8710 static __inline__ vector bool short __ATTRS_o_ai
8711 vec_sll(vector bool short __a, vector unsigned short __b) {
8712 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8716 static __inline__ vector bool short __ATTRS_o_ai
8717 vec_sll(vector bool short __a, vector unsigned int __b) {
8718 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8722 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8723 vector unsigned char __b) {
8724 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8727 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8728 vector unsigned short __b) {
8729 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8732 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8733 vector unsigned int __b) {
8734 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8737 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8738 vector unsigned char __b) {
8739 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8742 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8743 vector unsigned short __b) {
8744 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8747 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8748 vector unsigned int __b) {
8749 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8752 static __inline__ vector unsigned int __ATTRS_o_ai
8753 vec_sll(vector unsigned int __a, vector unsigned char __b) {
8754 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8758 static __inline__ vector unsigned int __ATTRS_o_ai
8759 vec_sll(vector unsigned int __a, vector unsigned short __b) {
8760 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8764 static __inline__ vector unsigned int __ATTRS_o_ai
8765 vec_sll(vector unsigned int __a, vector unsigned int __b) {
8766 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8770 static __inline__ vector bool int __ATTRS_o_ai
8771 vec_sll(vector bool int __a, vector unsigned char __b) {
8772 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8776 static __inline__ vector bool int __ATTRS_o_ai
8777 vec_sll(vector bool int __a, vector unsigned short __b) {
8778 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8782 static __inline__ vector bool int __ATTRS_o_ai
8783 vec_sll(vector bool int __a, vector unsigned int __b) {
8784 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8789 static __inline__ vector signed long long __ATTRS_o_ai
8790 vec_sll(vector signed long long __a, vector unsigned char __b) {
8791 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8795 static __inline__ vector unsigned long long __ATTRS_o_ai
8796 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8797 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8804 static __inline__ vector signed char __ATTRS_o_ai
8805 vec_vsl(vector signed char __a, vector unsigned char __b) {
8806 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8810 static __inline__ vector signed char __ATTRS_o_ai
8811 vec_vsl(vector signed char __a, vector unsigned short __b) {
8812 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8816 static __inline__ vector signed char __ATTRS_o_ai
8817 vec_vsl(vector signed char __a, vector unsigned int __b) {
8818 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8822 static __inline__ vector unsigned char __ATTRS_o_ai
8823 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8824 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8828 static __inline__ vector unsigned char __ATTRS_o_ai
8829 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8830 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8834 static __inline__ vector unsigned char __ATTRS_o_ai
8835 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8836 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8840 static __inline__ vector bool char __ATTRS_o_ai
8841 vec_vsl(vector bool char __a, vector unsigned char __b) {
8842 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8846 static __inline__ vector bool char __ATTRS_o_ai
8847 vec_vsl(vector bool char __a, vector unsigned short __b) {
8848 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8852 static __inline__ vector bool char __ATTRS_o_ai
8853 vec_vsl(vector bool char __a, vector unsigned int __b) {
8854 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8858 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8859 vector unsigned char __b) {
8860 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8863 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8864 vector unsigned short __b) {
8865 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8868 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8869 vector unsigned int __b) {
8870 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8873 static __inline__ vector unsigned short __ATTRS_o_ai
8874 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8875 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8879 static __inline__ vector unsigned short __ATTRS_o_ai
8880 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8881 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8885 static __inline__ vector unsigned short __ATTRS_o_ai
8886 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8887 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8891 static __inline__ vector bool short __ATTRS_o_ai
8892 vec_vsl(vector bool short __a, vector unsigned char __b) {
8893 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8897 static __inline__ vector bool short __ATTRS_o_ai
8898 vec_vsl(vector bool short __a, vector unsigned short __b) {
8899 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8903 static __inline__ vector bool short __ATTRS_o_ai
8904 vec_vsl(vector bool short __a, vector unsigned int __b) {
8905 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8909 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8910 vector unsigned char __b) {
8911 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8914 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8915 vector unsigned short __b) {
8916 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8919 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8920 vector unsigned int __b) {
8921 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8924 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8925 vector unsigned char __b) {
8926 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8929 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8930 vector unsigned short __b) {
8931 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8934 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8935 vector unsigned int __b) {
8936 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8939 static __inline__ vector unsigned int __ATTRS_o_ai
8940 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8941 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8945 static __inline__ vector unsigned int __ATTRS_o_ai
8946 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
8947 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8951 static __inline__ vector unsigned int __ATTRS_o_ai
8952 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
8953 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8957 static __inline__ vector bool int __ATTRS_o_ai
8958 vec_vsl(vector bool int __a, vector unsigned char __b) {
8959 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8963 static __inline__ vector bool int __ATTRS_o_ai
8964 vec_vsl(vector bool int __a, vector unsigned short __b) {
8965 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8969 static __inline__ vector bool int __ATTRS_o_ai
8970 vec_vsl(vector bool int __a, vector unsigned int __b) {
8971 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8977 static __inline__ vector signed char __ATTRS_o_ai
8978 vec_slo(vector signed char __a, vector signed char __b) {
8979 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8983 static __inline__ vector signed char __ATTRS_o_ai
8984 vec_slo(vector signed char __a, vector unsigned char __b) {
8985 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8989 static __inline__ vector unsigned char __ATTRS_o_ai
8990 vec_slo(vector unsigned char __a, vector signed char __b) {
8991 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
8995 static __inline__ vector unsigned char __ATTRS_o_ai
8996 vec_slo(vector unsigned char __a, vector unsigned char __b) {
8997 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9001 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9002 vector signed char __b) {
9003 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9006 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9007 vector unsigned char __b) {
9008 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9011 static __inline__ vector unsigned short __ATTRS_o_ai
9012 vec_slo(vector unsigned short __a, vector signed char __b) {
9013 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9017 static __inline__ vector unsigned short __ATTRS_o_ai
9018 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9019 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9023 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9024 vector signed char __b) {
9025 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9028 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9029 vector unsigned char __b) {
9030 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9033 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9034 vector signed char __b) {
9035 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9038 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9039 vector unsigned char __b) {
9040 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9043 static __inline__ vector unsigned int __ATTRS_o_ai
9044 vec_slo(vector unsigned int __a, vector signed char __b) {
9045 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9049 static __inline__ vector unsigned int __ATTRS_o_ai
9050 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9051 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9055 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9056 vector signed char __b) {
9057 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9060 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9061 vector unsigned char __b) {
9062 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9066 static __inline__ vector signed long long __ATTRS_o_ai
9067 vec_slo(vector signed long long __a, vector signed char __b) {
9068 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9072 static __inline__ vector signed long long __ATTRS_o_ai
9073 vec_slo(vector signed long long __a, vector unsigned char __b) {
9074 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9078 static __inline__ vector unsigned long long __ATTRS_o_ai
9079 vec_slo(vector unsigned long long __a, vector signed char __b) {
9080 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9084 static __inline__ vector unsigned long long __ATTRS_o_ai
9085 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9086 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9093 static __inline__ vector signed char __ATTRS_o_ai
9094 vec_vslo(vector signed char __a, vector signed char __b) {
9095 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9099 static __inline__ vector signed char __ATTRS_o_ai
9100 vec_vslo(vector signed char __a, vector unsigned char __b) {
9101 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9105 static __inline__ vector unsigned char __ATTRS_o_ai
9106 vec_vslo(vector unsigned char __a, vector signed char __b) {
9107 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9111 static __inline__ vector unsigned char __ATTRS_o_ai
9112 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9113 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9117 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9118 vector signed char __b) {
9119 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9122 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9123 vector unsigned char __b) {
9124 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9127 static __inline__ vector unsigned short __ATTRS_o_ai
9128 vec_vslo(vector unsigned short __a, vector signed char __b) {
9129 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9133 static __inline__ vector unsigned short __ATTRS_o_ai
9134 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9135 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9139 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9140 vector signed char __b) {
9141 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9144 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9145 vector unsigned char __b) {
9146 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9149 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9150 vector signed char __b) {
9151 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9154 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9155 vector unsigned char __b) {
9156 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9159 static __inline__ vector unsigned int __ATTRS_o_ai
9160 vec_vslo(vector unsigned int __a, vector signed char __b) {
9161 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9165 static __inline__ vector unsigned int __ATTRS_o_ai
9166 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9167 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9171 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9172 vector signed char __b) {
9173 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9176 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9177 vector unsigned char __b) {
9178 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9183 static __inline__ vector signed char __ATTRS_o_ai
9184 vec_splat(vector signed char __a, unsigned const int __b) {
9185 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9188 static __inline__ vector unsigned char __ATTRS_o_ai
9189 vec_splat(vector unsigned char __a, unsigned const int __b) {
9190 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9193 static __inline__ vector bool char __ATTRS_o_ai
9194 vec_splat(vector bool char __a, unsigned const int __b) {
9195 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9198 static __inline__ vector signed short __ATTRS_o_ai
9199 vec_splat(vector signed short __a, unsigned const int __b) {
9200 unsigned char b0 = (__b & 0x07) * 2;
9201 unsigned char b1 = b0 + 1;
9202 return vec_perm(__a, __a,
9203 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9204 b0, b1, b0, b1, b0, b1));
9207 static __inline__ vector unsigned short __ATTRS_o_ai
9208 vec_splat(vector unsigned short __a, unsigned const int __b) {
9209 unsigned char b0 = (__b & 0x07) * 2;
9210 unsigned char b1 = b0 + 1;
9211 return vec_perm(__a, __a,
9212 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9213 b0, b1, b0, b1, b0, b1));
9216 static __inline__ vector bool short __ATTRS_o_ai
9217 vec_splat(vector bool short __a, unsigned const int __b) {
9218 unsigned char b0 = (__b & 0x07) * 2;
9219 unsigned char b1 = b0 + 1;
9220 return vec_perm(__a, __a,
9221 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9222 b0, b1, b0, b1, b0, b1));
9225 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9226 unsigned const int __b) {
9227 unsigned char b0 = (__b & 0x07) * 2;
9228 unsigned char b1 = b0 + 1;
9229 return vec_perm(__a, __a,
9230 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9231 b0, b1, b0, b1, b0, b1));
9234 static __inline__ vector signed int __ATTRS_o_ai
9235 vec_splat(vector signed int __a, unsigned const int __b) {
9236 unsigned char b0 = (__b & 0x03) * 4;
9237 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9238 return vec_perm(__a, __a,
9239 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9240 b2, b3, b0, b1, b2, b3));
9243 static __inline__ vector unsigned int __ATTRS_o_ai
9244 vec_splat(vector unsigned int __a, unsigned const int __b) {
9245 unsigned char b0 = (__b & 0x03) * 4;
9246 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9247 return vec_perm(__a, __a,
9248 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9249 b2, b3, b0, b1, b2, b3));
9252 static __inline__ vector bool int __ATTRS_o_ai
9253 vec_splat(vector bool int __a, unsigned const int __b) {
9254 unsigned char b0 = (__b & 0x03) * 4;
9255 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9256 return vec_perm(__a, __a,
9257 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9258 b2, b3, b0, b1, b2, b3));
9261 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9262 unsigned const int __b) {
9263 unsigned char b0 = (__b & 0x03) * 4;
9264 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9265 return vec_perm(__a, __a,
9266 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9267 b2, b3, b0, b1, b2, b3));
9271 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9272 unsigned const int __b) {
9273 unsigned char b0 = (__b & 0x01) * 8;
9274 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9275 b6 = b0 + 6, b7 = b0 + 7;
9276 return vec_perm(__a, __a,
9277 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9278 b2, b3, b4, b5, b6, b7));
9280 static __inline__ vector bool long long __ATTRS_o_ai
9281 vec_splat(vector bool long long __a, unsigned const int __b) {
9282 unsigned char b0 = (__b & 0x01) * 8;
9283 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9284 b6 = b0 + 6, b7 = b0 + 7;
9285 return vec_perm(__a, __a,
9286 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9287 b2, b3, b4, b5, b6, b7));
9289 static __inline__ vector signed long long __ATTRS_o_ai
9290 vec_splat(vector signed long long __a, unsigned const int __b) {
9291 unsigned char b0 = (__b & 0x01) * 8;
9292 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9293 b6 = b0 + 6, b7 = b0 + 7;
9294 return vec_perm(__a, __a,
9295 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9296 b2, b3, b4, b5, b6, b7));
9298 static __inline__ vector unsigned long long __ATTRS_o_ai
9299 vec_splat(vector unsigned long long __a, unsigned const int __b) {
9300 unsigned char b0 = (__b & 0x01) * 8;
9301 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9302 b6 = b0 + 6, b7 = b0 + 7;
9303 return vec_perm(__a, __a,
9304 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9305 b2, b3, b4, b5, b6, b7));
9311 #define __builtin_altivec_vspltb vec_vspltb
9313 static __inline__ vector signed char __ATTRS_o_ai
9314 vec_vspltb(vector signed char __a, unsigned char __b) {
9315 return vec_perm(__a, __a, (vector unsigned char)(__b));
9318 static __inline__ vector unsigned char __ATTRS_o_ai
9319 vec_vspltb(vector unsigned char __a, unsigned char __b) {
9320 return vec_perm(__a, __a, (vector unsigned char)(__b));
9323 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9324 unsigned char __b) {
9325 return vec_perm(__a, __a, (vector unsigned char)(__b));
9330 #define __builtin_altivec_vsplth vec_vsplth
9332 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9333 unsigned char __b) {
9335 unsigned char b1 = __b + 1;
9336 return vec_perm(__a, __a,
9337 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9338 __b, b1, __b, b1, __b, b1, __b, b1));
9341 static __inline__ vector unsigned short __ATTRS_o_ai
9342 vec_vsplth(vector unsigned short __a, unsigned char __b) {
9344 unsigned char b1 = __b + 1;
9345 return vec_perm(__a, __a,
9346 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9347 __b, b1, __b, b1, __b, b1, __b, b1));
9350 static __inline__ vector bool short __ATTRS_o_ai
9351 vec_vsplth(vector bool short __a, unsigned char __b) {
9353 unsigned char b1 = __b + 1;
9354 return vec_perm(__a, __a,
9355 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9356 __b, b1, __b, b1, __b, b1, __b, b1));
9359 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9360 unsigned char __b) {
9362 unsigned char b1 = __b + 1;
9363 return vec_perm(__a, __a,
9364 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9365 __b, b1, __b, b1, __b, b1, __b, b1));
9370 #define __builtin_altivec_vspltw vec_vspltw
9372 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9373 unsigned char __b) {
9375 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9376 return vec_perm(__a, __a,
9377 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9378 b1, b2, b3, __b, b1, b2, b3));
9381 static __inline__ vector unsigned int __ATTRS_o_ai
9382 vec_vspltw(vector unsigned int __a, unsigned char __b) {
9384 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9385 return vec_perm(__a, __a,
9386 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9387 b1, b2, b3, __b, b1, b2, b3));
9390 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9391 unsigned char __b) {
9393 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9394 return vec_perm(__a, __a,
9395 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9396 b1, b2, b3, __b, b1, b2, b3));
9399 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9400 unsigned char __b) {
9402 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9403 return vec_perm(__a, __a,
9404 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9405 b1, b2, b3, __b, b1, b2, b3));
9410 #define __builtin_altivec_vspltisb vec_splat_s8
9412 // FIXME: parameter should be treated as 5-bit signed literal
9413 static __inline__ vector signed char __ATTRS_o_ai
9414 vec_splat_s8(signed char __a) {
9415 return (vector signed char)(__a);
9420 // FIXME: parameter should be treated as 5-bit signed literal
9421 static __inline__ vector signed char __ATTRS_o_ai
9422 vec_vspltisb(signed char __a) {
9423 return (vector signed char)(__a);
9428 #define __builtin_altivec_vspltish vec_splat_s16
9430 // FIXME: parameter should be treated as 5-bit signed literal
9431 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9432 return (vector short)(__a);
9437 // FIXME: parameter should be treated as 5-bit signed literal
9438 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9439 return (vector short)(__a);
9444 #define __builtin_altivec_vspltisw vec_splat_s32
9446 // FIXME: parameter should be treated as 5-bit signed literal
9447 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9448 return (vector int)(__a);
9453 // FIXME: parameter should be treated as 5-bit signed literal
9454 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9455 return (vector int)(__a);
9460 // FIXME: parameter should be treated as 5-bit signed literal
9461 static __inline__ vector unsigned char __ATTRS_o_ai
9462 vec_splat_u8(unsigned char __a) {
9463 return (vector unsigned char)(__a);
9468 // FIXME: parameter should be treated as 5-bit signed literal
9469 static __inline__ vector unsigned short __ATTRS_o_ai
9470 vec_splat_u16(signed char __a) {
9471 return (vector unsigned short)(__a);
9476 // FIXME: parameter should be treated as 5-bit signed literal
9477 static __inline__ vector unsigned int __ATTRS_o_ai
9478 vec_splat_u32(signed char __a) {
9479 return (vector unsigned int)(__a);
9484 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
9485 // than the length of __a.
9486 static __inline__ vector unsigned char __ATTRS_o_ai
9487 vec_sr(vector unsigned char __a, vector unsigned char __b) {
9489 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
9492 static __inline__ vector signed char __ATTRS_o_ai
9493 vec_sr(vector signed char __a, vector unsigned char __b) {
9494 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
9497 static __inline__ vector unsigned short __ATTRS_o_ai
9498 vec_sr(vector unsigned short __a, vector unsigned short __b) {
9500 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
9503 static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
9504 vector unsigned short __b) {
9505 return (vector short)vec_sr((vector unsigned short)__a, __b);
9508 static __inline__ vector unsigned int __ATTRS_o_ai
9509 vec_sr(vector unsigned int __a, vector unsigned int __b) {
9511 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
9514 static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
9515 vector unsigned int __b) {
9516 return (vector int)vec_sr((vector unsigned int)__a, __b);
9519 #ifdef __POWER8_VECTOR__
9520 static __inline__ vector unsigned long long __ATTRS_o_ai
9521 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9522 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
9526 static __inline__ vector long long __ATTRS_o_ai
9527 vec_sr(vector long long __a, vector unsigned long long __b) {
9528 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9534 #define __builtin_altivec_vsrb vec_vsrb
9536 static __inline__ vector signed char __ATTRS_o_ai
9537 vec_vsrb(vector signed char __a, vector unsigned char __b) {
9538 return vec_sr(__a, __b);
9541 static __inline__ vector unsigned char __ATTRS_o_ai
9542 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9543 return vec_sr(__a, __b);
9548 #define __builtin_altivec_vsrh vec_vsrh
9550 static __inline__ vector short __ATTRS_o_ai
9551 vec_vsrh(vector short __a, vector unsigned short __b) {
9552 return vec_sr(__a, __b);
9555 static __inline__ vector unsigned short __ATTRS_o_ai
9556 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9557 return vec_sr(__a, __b);
9562 #define __builtin_altivec_vsrw vec_vsrw
9564 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9565 vector unsigned int __b) {
9566 return vec_sr(__a, __b);
9569 static __inline__ vector unsigned int __ATTRS_o_ai
9570 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9571 return vec_sr(__a, __b);
9576 static __inline__ vector signed char __ATTRS_o_ai
9577 vec_sra(vector signed char __a, vector unsigned char __b) {
9578 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9581 static __inline__ vector unsigned char __ATTRS_o_ai
9582 vec_sra(vector unsigned char __a, vector unsigned char __b) {
9583 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9586 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9587 vector unsigned short __b) {
9588 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9591 static __inline__ vector unsigned short __ATTRS_o_ai
9592 vec_sra(vector unsigned short __a, vector unsigned short __b) {
9593 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9596 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9597 vector unsigned int __b) {
9598 return __builtin_altivec_vsraw(__a, __b);
9601 static __inline__ vector unsigned int __ATTRS_o_ai
9602 vec_sra(vector unsigned int __a, vector unsigned int __b) {
9603 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9606 #ifdef __POWER8_VECTOR__
9607 static __inline__ vector signed long long __ATTRS_o_ai
9608 vec_sra(vector signed long long __a, vector unsigned long long __b) {
9612 static __inline__ vector unsigned long long __ATTRS_o_ai
9613 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9614 return (vector unsigned long long)((vector signed long long)__a >> __b);
9620 static __inline__ vector signed char __ATTRS_o_ai
9621 vec_vsrab(vector signed char __a, vector unsigned char __b) {
9622 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9625 static __inline__ vector unsigned char __ATTRS_o_ai
9626 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9627 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9632 static __inline__ vector short __ATTRS_o_ai
9633 vec_vsrah(vector short __a, vector unsigned short __b) {
9634 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9637 static __inline__ vector unsigned short __ATTRS_o_ai
9638 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9639 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9644 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9645 vector unsigned int __b) {
9646 return __builtin_altivec_vsraw(__a, __b);
9649 static __inline__ vector unsigned int __ATTRS_o_ai
9650 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9651 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9656 static __inline__ vector signed char __ATTRS_o_ai
9657 vec_srl(vector signed char __a, vector unsigned char __b) {
9658 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9662 static __inline__ vector signed char __ATTRS_o_ai
9663 vec_srl(vector signed char __a, vector unsigned short __b) {
9664 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9668 static __inline__ vector signed char __ATTRS_o_ai
9669 vec_srl(vector signed char __a, vector unsigned int __b) {
9670 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9674 static __inline__ vector unsigned char __ATTRS_o_ai
9675 vec_srl(vector unsigned char __a, vector unsigned char __b) {
9676 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9680 static __inline__ vector unsigned char __ATTRS_o_ai
9681 vec_srl(vector unsigned char __a, vector unsigned short __b) {
9682 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9686 static __inline__ vector unsigned char __ATTRS_o_ai
9687 vec_srl(vector unsigned char __a, vector unsigned int __b) {
9688 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9692 static __inline__ vector bool char __ATTRS_o_ai
9693 vec_srl(vector bool char __a, vector unsigned char __b) {
9694 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9698 static __inline__ vector bool char __ATTRS_o_ai
9699 vec_srl(vector bool char __a, vector unsigned short __b) {
9700 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9704 static __inline__ vector bool char __ATTRS_o_ai
9705 vec_srl(vector bool char __a, vector unsigned int __b) {
9706 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9710 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9711 vector unsigned char __b) {
9712 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9715 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9716 vector unsigned short __b) {
9717 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9720 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9721 vector unsigned int __b) {
9722 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9725 static __inline__ vector unsigned short __ATTRS_o_ai
9726 vec_srl(vector unsigned short __a, vector unsigned char __b) {
9727 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9731 static __inline__ vector unsigned short __ATTRS_o_ai
9732 vec_srl(vector unsigned short __a, vector unsigned short __b) {
9733 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9737 static __inline__ vector unsigned short __ATTRS_o_ai
9738 vec_srl(vector unsigned short __a, vector unsigned int __b) {
9739 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9743 static __inline__ vector bool short __ATTRS_o_ai
9744 vec_srl(vector bool short __a, vector unsigned char __b) {
9745 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9749 static __inline__ vector bool short __ATTRS_o_ai
9750 vec_srl(vector bool short __a, vector unsigned short __b) {
9751 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9755 static __inline__ vector bool short __ATTRS_o_ai
9756 vec_srl(vector bool short __a, vector unsigned int __b) {
9757 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9761 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9762 vector unsigned char __b) {
9763 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9766 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9767 vector unsigned short __b) {
9768 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9771 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9772 vector unsigned int __b) {
9773 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9776 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9777 vector unsigned char __b) {
9778 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9781 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9782 vector unsigned short __b) {
9783 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9786 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9787 vector unsigned int __b) {
9788 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9791 static __inline__ vector unsigned int __ATTRS_o_ai
9792 vec_srl(vector unsigned int __a, vector unsigned char __b) {
9793 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9797 static __inline__ vector unsigned int __ATTRS_o_ai
9798 vec_srl(vector unsigned int __a, vector unsigned short __b) {
9799 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9803 static __inline__ vector unsigned int __ATTRS_o_ai
9804 vec_srl(vector unsigned int __a, vector unsigned int __b) {
9805 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9809 static __inline__ vector bool int __ATTRS_o_ai
9810 vec_srl(vector bool int __a, vector unsigned char __b) {
9811 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9815 static __inline__ vector bool int __ATTRS_o_ai
9816 vec_srl(vector bool int __a, vector unsigned short __b) {
9817 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9821 static __inline__ vector bool int __ATTRS_o_ai
9822 vec_srl(vector bool int __a, vector unsigned int __b) {
9823 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9828 static __inline__ vector signed long long __ATTRS_o_ai
9829 vec_srl(vector signed long long __a, vector unsigned char __b) {
9830 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9834 static __inline__ vector unsigned long long __ATTRS_o_ai
9835 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9836 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9843 static __inline__ vector signed char __ATTRS_o_ai
9844 vec_vsr(vector signed char __a, vector unsigned char __b) {
9845 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9849 static __inline__ vector signed char __ATTRS_o_ai
9850 vec_vsr(vector signed char __a, vector unsigned short __b) {
9851 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9855 static __inline__ vector signed char __ATTRS_o_ai
9856 vec_vsr(vector signed char __a, vector unsigned int __b) {
9857 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9861 static __inline__ vector unsigned char __ATTRS_o_ai
9862 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9863 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9867 static __inline__ vector unsigned char __ATTRS_o_ai
9868 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9869 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9873 static __inline__ vector unsigned char __ATTRS_o_ai
9874 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9875 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9879 static __inline__ vector bool char __ATTRS_o_ai
9880 vec_vsr(vector bool char __a, vector unsigned char __b) {
9881 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9885 static __inline__ vector bool char __ATTRS_o_ai
9886 vec_vsr(vector bool char __a, vector unsigned short __b) {
9887 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9891 static __inline__ vector bool char __ATTRS_o_ai
9892 vec_vsr(vector bool char __a, vector unsigned int __b) {
9893 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9897 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9898 vector unsigned char __b) {
9899 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9902 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9903 vector unsigned short __b) {
9904 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9907 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9908 vector unsigned int __b) {
9909 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9912 static __inline__ vector unsigned short __ATTRS_o_ai
9913 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9914 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9918 static __inline__ vector unsigned short __ATTRS_o_ai
9919 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9920 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9924 static __inline__ vector unsigned short __ATTRS_o_ai
9925 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9926 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9930 static __inline__ vector bool short __ATTRS_o_ai
9931 vec_vsr(vector bool short __a, vector unsigned char __b) {
9932 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9936 static __inline__ vector bool short __ATTRS_o_ai
9937 vec_vsr(vector bool short __a, vector unsigned short __b) {
9938 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9942 static __inline__ vector bool short __ATTRS_o_ai
9943 vec_vsr(vector bool short __a, vector unsigned int __b) {
9944 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9948 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9949 vector unsigned char __b) {
9950 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9953 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9954 vector unsigned short __b) {
9955 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9958 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9959 vector unsigned int __b) {
9960 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9963 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9964 vector unsigned char __b) {
9965 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9968 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9969 vector unsigned short __b) {
9970 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9973 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9974 vector unsigned int __b) {
9975 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9978 static __inline__ vector unsigned int __ATTRS_o_ai
9979 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
9980 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9984 static __inline__ vector unsigned int __ATTRS_o_ai
9985 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
9986 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9990 static __inline__ vector unsigned int __ATTRS_o_ai
9991 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
9992 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9996 static __inline__ vector bool int __ATTRS_o_ai
9997 vec_vsr(vector bool int __a, vector unsigned char __b) {
9998 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10002 static __inline__ vector bool int __ATTRS_o_ai
10003 vec_vsr(vector bool int __a, vector unsigned short __b) {
10004 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10008 static __inline__ vector bool int __ATTRS_o_ai
10009 vec_vsr(vector bool int __a, vector unsigned int __b) {
10010 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10016 static __inline__ vector signed char __ATTRS_o_ai
10017 vec_sro(vector signed char __a, vector signed char __b) {
10018 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10022 static __inline__ vector signed char __ATTRS_o_ai
10023 vec_sro(vector signed char __a, vector unsigned char __b) {
10024 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10028 static __inline__ vector unsigned char __ATTRS_o_ai
10029 vec_sro(vector unsigned char __a, vector signed char __b) {
10030 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10034 static __inline__ vector unsigned char __ATTRS_o_ai
10035 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10036 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10040 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10041 vector signed char __b) {
10042 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10045 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10046 vector unsigned char __b) {
10047 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10050 static __inline__ vector unsigned short __ATTRS_o_ai
10051 vec_sro(vector unsigned short __a, vector signed char __b) {
10052 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10056 static __inline__ vector unsigned short __ATTRS_o_ai
10057 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10058 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10062 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10063 vector signed char __b) {
10064 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10067 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10068 vector unsigned char __b) {
10069 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10072 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10073 vector signed char __b) {
10074 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10077 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10078 vector unsigned char __b) {
10079 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10082 static __inline__ vector unsigned int __ATTRS_o_ai
10083 vec_sro(vector unsigned int __a, vector signed char __b) {
10084 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10088 static __inline__ vector unsigned int __ATTRS_o_ai
10089 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10090 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10094 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10095 vector signed char __b) {
10096 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10099 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10100 vector unsigned char __b) {
10101 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10105 static __inline__ vector signed long long __ATTRS_o_ai
10106 vec_sro(vector signed long long __a, vector signed char __b) {
10107 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10111 static __inline__ vector signed long long __ATTRS_o_ai
10112 vec_sro(vector signed long long __a, vector unsigned char __b) {
10113 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10117 static __inline__ vector unsigned long long __ATTRS_o_ai
10118 vec_sro(vector unsigned long long __a, vector signed char __b) {
10119 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10123 static __inline__ vector unsigned long long __ATTRS_o_ai
10124 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10125 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10132 static __inline__ vector signed char __ATTRS_o_ai
10133 vec_vsro(vector signed char __a, vector signed char __b) {
10134 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10138 static __inline__ vector signed char __ATTRS_o_ai
10139 vec_vsro(vector signed char __a, vector unsigned char __b) {
10140 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10144 static __inline__ vector unsigned char __ATTRS_o_ai
10145 vec_vsro(vector unsigned char __a, vector signed char __b) {
10146 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10150 static __inline__ vector unsigned char __ATTRS_o_ai
10151 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10152 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10156 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10157 vector signed char __b) {
10158 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10161 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10162 vector unsigned char __b) {
10163 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10166 static __inline__ vector unsigned short __ATTRS_o_ai
10167 vec_vsro(vector unsigned short __a, vector signed char __b) {
10168 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10172 static __inline__ vector unsigned short __ATTRS_o_ai
10173 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10174 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10178 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10179 vector signed char __b) {
10180 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10183 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10184 vector unsigned char __b) {
10185 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10188 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10189 vector signed char __b) {
10190 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10193 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10194 vector unsigned char __b) {
10195 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10198 static __inline__ vector unsigned int __ATTRS_o_ai
10199 vec_vsro(vector unsigned int __a, vector signed char __b) {
10200 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10204 static __inline__ vector unsigned int __ATTRS_o_ai
10205 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10206 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10210 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10211 vector signed char __b) {
10212 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10215 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10216 vector unsigned char __b) {
10217 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10222 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10223 vector signed char *__c) {
10224 __builtin_altivec_stvx((vector int)__a, __b, __c);
10227 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10228 signed char *__c) {
10229 __builtin_altivec_stvx((vector int)__a, __b, __c);
10232 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10233 vector unsigned char *__c) {
10234 __builtin_altivec_stvx((vector int)__a, __b, __c);
10237 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10238 unsigned char *__c) {
10239 __builtin_altivec_stvx((vector int)__a, __b, __c);
10242 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10243 signed char *__c) {
10244 __builtin_altivec_stvx((vector int)__a, __b, __c);
10247 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10248 unsigned char *__c) {
10249 __builtin_altivec_stvx((vector int)__a, __b, __c);
10252 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10253 vector bool char *__c) {
10254 __builtin_altivec_stvx((vector int)__a, __b, __c);
10257 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10258 vector short *__c) {
10259 __builtin_altivec_stvx((vector int)__a, __b, __c);
10262 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10264 __builtin_altivec_stvx((vector int)__a, __b, __c);
10267 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10268 vector unsigned short *__c) {
10269 __builtin_altivec_stvx((vector int)__a, __b, __c);
10272 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10273 unsigned short *__c) {
10274 __builtin_altivec_stvx((vector int)__a, __b, __c);
10277 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10279 __builtin_altivec_stvx((vector int)__a, __b, __c);
10282 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10283 unsigned short *__c) {
10284 __builtin_altivec_stvx((vector int)__a, __b, __c);
10287 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10288 vector bool short *__c) {
10289 __builtin_altivec_stvx((vector int)__a, __b, __c);
10292 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10294 __builtin_altivec_stvx((vector int)__a, __b, __c);
10297 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10298 unsigned short *__c) {
10299 __builtin_altivec_stvx((vector int)__a, __b, __c);
10302 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10303 vector pixel *__c) {
10304 __builtin_altivec_stvx((vector int)__a, __b, __c);
10307 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10309 __builtin_altivec_stvx(__a, __b, __c);
10312 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10313 __builtin_altivec_stvx(__a, __b, __c);
10316 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10317 vector unsigned int *__c) {
10318 __builtin_altivec_stvx((vector int)__a, __b, __c);
10321 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10322 unsigned int *__c) {
10323 __builtin_altivec_stvx((vector int)__a, __b, __c);
10326 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10328 __builtin_altivec_stvx((vector int)__a, __b, __c);
10331 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10332 unsigned int *__c) {
10333 __builtin_altivec_stvx((vector int)__a, __b, __c);
10336 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10337 vector bool int *__c) {
10338 __builtin_altivec_stvx((vector int)__a, __b, __c);
10341 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10342 vector float *__c) {
10343 __builtin_altivec_stvx((vector int)__a, __b, __c);
10346 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10348 __builtin_altivec_stvx((vector int)__a, __b, __c);
10353 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10354 vector signed char *__c) {
10355 __builtin_altivec_stvx((vector int)__a, __b, __c);
10358 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10359 signed char *__c) {
10360 __builtin_altivec_stvx((vector int)__a, __b, __c);
10363 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10364 vector unsigned char *__c) {
10365 __builtin_altivec_stvx((vector int)__a, __b, __c);
10368 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10369 unsigned char *__c) {
10370 __builtin_altivec_stvx((vector int)__a, __b, __c);
10373 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10374 signed char *__c) {
10375 __builtin_altivec_stvx((vector int)__a, __b, __c);
10378 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10379 unsigned char *__c) {
10380 __builtin_altivec_stvx((vector int)__a, __b, __c);
10383 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10384 vector bool char *__c) {
10385 __builtin_altivec_stvx((vector int)__a, __b, __c);
10388 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10389 vector short *__c) {
10390 __builtin_altivec_stvx((vector int)__a, __b, __c);
10393 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10395 __builtin_altivec_stvx((vector int)__a, __b, __c);
10398 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10399 vector unsigned short *__c) {
10400 __builtin_altivec_stvx((vector int)__a, __b, __c);
10403 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10404 unsigned short *__c) {
10405 __builtin_altivec_stvx((vector int)__a, __b, __c);
10408 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10410 __builtin_altivec_stvx((vector int)__a, __b, __c);
10413 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10414 unsigned short *__c) {
10415 __builtin_altivec_stvx((vector int)__a, __b, __c);
10418 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10419 vector bool short *__c) {
10420 __builtin_altivec_stvx((vector int)__a, __b, __c);
10423 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10425 __builtin_altivec_stvx((vector int)__a, __b, __c);
10428 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10429 unsigned short *__c) {
10430 __builtin_altivec_stvx((vector int)__a, __b, __c);
10433 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10434 vector pixel *__c) {
10435 __builtin_altivec_stvx((vector int)__a, __b, __c);
10438 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10440 __builtin_altivec_stvx(__a, __b, __c);
10443 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10445 __builtin_altivec_stvx(__a, __b, __c);
10448 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10449 vector unsigned int *__c) {
10450 __builtin_altivec_stvx((vector int)__a, __b, __c);
10453 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10454 unsigned int *__c) {
10455 __builtin_altivec_stvx((vector int)__a, __b, __c);
10458 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10460 __builtin_altivec_stvx((vector int)__a, __b, __c);
10463 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10464 unsigned int *__c) {
10465 __builtin_altivec_stvx((vector int)__a, __b, __c);
10468 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10469 vector bool int *__c) {
10470 __builtin_altivec_stvx((vector int)__a, __b, __c);
10473 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10474 vector float *__c) {
10475 __builtin_altivec_stvx((vector int)__a, __b, __c);
10478 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10480 __builtin_altivec_stvx((vector int)__a, __b, __c);
10485 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10486 signed char *__c) {
10487 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10490 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10491 unsigned char *__c) {
10492 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10495 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10496 signed char *__c) {
10497 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10500 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10501 unsigned char *__c) {
10502 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10505 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10507 __builtin_altivec_stvehx(__a, __b, __c);
10510 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10511 unsigned short *__c) {
10512 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10515 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10517 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10520 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10521 unsigned short *__c) {
10522 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10525 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10527 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10530 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10531 unsigned short *__c) {
10532 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10535 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10536 __builtin_altivec_stvewx(__a, __b, __c);
10539 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10540 unsigned int *__c) {
10541 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10544 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10546 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10549 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10550 unsigned int *__c) {
10551 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10554 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10556 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10561 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10562 signed char *__c) {
10563 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10566 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10567 int __b, unsigned char *__c) {
10568 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10571 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10572 signed char *__c) {
10573 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10576 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10577 unsigned char *__c) {
10578 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10583 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10585 __builtin_altivec_stvehx(__a, __b, __c);
10588 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10589 int __b, unsigned short *__c) {
10590 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10593 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10595 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10598 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10599 unsigned short *__c) {
10600 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10603 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10605 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10608 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10609 unsigned short *__c) {
10610 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10615 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10617 __builtin_altivec_stvewx(__a, __b, __c);
10620 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10621 unsigned int *__c) {
10622 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10625 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10627 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10630 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10631 unsigned int *__c) {
10632 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10635 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10637 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10642 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10643 vector signed char *__c) {
10644 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10647 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10648 signed char *__c) {
10649 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10652 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10653 vector unsigned char *__c) {
10654 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10657 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10658 unsigned char *__c) {
10659 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10662 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10663 signed char *__c) {
10664 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10667 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10668 unsigned char *__c) {
10669 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10672 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10673 vector bool char *__c) {
10674 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10677 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10678 vector short *__c) {
10679 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10682 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10684 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10687 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10688 vector unsigned short *__c) {
10689 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10692 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10693 unsigned short *__c) {
10694 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10697 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10699 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10702 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10703 unsigned short *__c) {
10704 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10707 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10708 vector bool short *__c) {
10709 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10712 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10714 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10717 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10718 unsigned short *__c) {
10719 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10722 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10723 vector pixel *__c) {
10724 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10727 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10729 __builtin_altivec_stvxl(__a, __b, __c);
10732 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10733 __builtin_altivec_stvxl(__a, __b, __c);
10736 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10737 vector unsigned int *__c) {
10738 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10741 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10742 unsigned int *__c) {
10743 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10746 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10748 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10751 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10752 unsigned int *__c) {
10753 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10756 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10757 vector bool int *__c) {
10758 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10761 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10762 vector float *__c) {
10763 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10766 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10768 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10773 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10774 vector signed char *__c) {
10775 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10778 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10779 signed char *__c) {
10780 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10783 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10784 vector unsigned char *__c) {
10785 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10788 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10789 unsigned char *__c) {
10790 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10793 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10794 signed char *__c) {
10795 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10798 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10799 unsigned char *__c) {
10800 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10803 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10804 vector bool char *__c) {
10805 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10808 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10809 vector short *__c) {
10810 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10813 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10815 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10818 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10820 vector unsigned short *__c) {
10821 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10824 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10825 int __b, unsigned short *__c) {
10826 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10829 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10831 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10834 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10835 unsigned short *__c) {
10836 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10839 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10840 vector bool short *__c) {
10841 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10844 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10846 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10849 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10850 unsigned short *__c) {
10851 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10854 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10855 vector pixel *__c) {
10856 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10859 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10861 __builtin_altivec_stvxl(__a, __b, __c);
10864 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10866 __builtin_altivec_stvxl(__a, __b, __c);
10869 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10870 vector unsigned int *__c) {
10871 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10874 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10875 unsigned int *__c) {
10876 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10879 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10881 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10884 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10885 unsigned int *__c) {
10886 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10889 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10890 vector bool int *__c) {
10891 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10894 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10895 vector float *__c) {
10896 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10899 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10901 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10906 static __inline__ vector signed char __ATTRS_o_ai
10907 vec_sub(vector signed char __a, vector signed char __b) {
10911 static __inline__ vector signed char __ATTRS_o_ai
10912 vec_sub(vector bool char __a, vector signed char __b) {
10913 return (vector signed char)__a - __b;
10916 static __inline__ vector signed char __ATTRS_o_ai
10917 vec_sub(vector signed char __a, vector bool char __b) {
10918 return __a - (vector signed char)__b;
10921 static __inline__ vector unsigned char __ATTRS_o_ai
10922 vec_sub(vector unsigned char __a, vector unsigned char __b) {
10926 static __inline__ vector unsigned char __ATTRS_o_ai
10927 vec_sub(vector bool char __a, vector unsigned char __b) {
10928 return (vector unsigned char)__a - __b;
10931 static __inline__ vector unsigned char __ATTRS_o_ai
10932 vec_sub(vector unsigned char __a, vector bool char __b) {
10933 return __a - (vector unsigned char)__b;
10936 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10937 vector short __b) {
10941 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10942 vector short __b) {
10943 return (vector short)__a - __b;
10946 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10947 vector bool short __b) {
10948 return __a - (vector short)__b;
10951 static __inline__ vector unsigned short __ATTRS_o_ai
10952 vec_sub(vector unsigned short __a, vector unsigned short __b) {
10956 static __inline__ vector unsigned short __ATTRS_o_ai
10957 vec_sub(vector bool short __a, vector unsigned short __b) {
10958 return (vector unsigned short)__a - __b;
10961 static __inline__ vector unsigned short __ATTRS_o_ai
10962 vec_sub(vector unsigned short __a, vector bool short __b) {
10963 return __a - (vector unsigned short)__b;
10966 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10971 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
10973 return (vector int)__a - __b;
10976 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10977 vector bool int __b) {
10978 return __a - (vector int)__b;
10981 static __inline__ vector unsigned int __ATTRS_o_ai
10982 vec_sub(vector unsigned int __a, vector unsigned int __b) {
10986 static __inline__ vector unsigned int __ATTRS_o_ai
10987 vec_sub(vector bool int __a, vector unsigned int __b) {
10988 return (vector unsigned int)__a - __b;
10991 static __inline__ vector unsigned int __ATTRS_o_ai
10992 vec_sub(vector unsigned int __a, vector bool int __b) {
10993 return __a - (vector unsigned int)__b;
10996 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
10997 static __inline__ vector signed __int128 __ATTRS_o_ai
10998 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11002 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11003 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11006 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11009 static __inline__ vector signed long long __ATTRS_o_ai
11010 vec_sub(vector signed long long __a, vector signed long long __b) {
11014 static __inline__ vector unsigned long long __ATTRS_o_ai
11015 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11019 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11020 vector double __b) {
11025 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11026 vector float __b) {
11032 #define __builtin_altivec_vsububm vec_vsububm
11034 static __inline__ vector signed char __ATTRS_o_ai
11035 vec_vsububm(vector signed char __a, vector signed char __b) {
11039 static __inline__ vector signed char __ATTRS_o_ai
11040 vec_vsububm(vector bool char __a, vector signed char __b) {
11041 return (vector signed char)__a - __b;
11044 static __inline__ vector signed char __ATTRS_o_ai
11045 vec_vsububm(vector signed char __a, vector bool char __b) {
11046 return __a - (vector signed char)__b;
11049 static __inline__ vector unsigned char __ATTRS_o_ai
11050 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11054 static __inline__ vector unsigned char __ATTRS_o_ai
11055 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11056 return (vector unsigned char)__a - __b;
11059 static __inline__ vector unsigned char __ATTRS_o_ai
11060 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11061 return __a - (vector unsigned char)__b;
11066 #define __builtin_altivec_vsubuhm vec_vsubuhm
11068 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11069 vector short __b) {
11073 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11074 vector short __b) {
11075 return (vector short)__a - __b;
11078 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11079 vector bool short __b) {
11080 return __a - (vector short)__b;
11083 static __inline__ vector unsigned short __ATTRS_o_ai
11084 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11088 static __inline__ vector unsigned short __ATTRS_o_ai
11089 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11090 return (vector unsigned short)__a - __b;
11093 static __inline__ vector unsigned short __ATTRS_o_ai
11094 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11095 return __a - (vector unsigned short)__b;
11100 #define __builtin_altivec_vsubuwm vec_vsubuwm
11102 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11107 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11109 return (vector int)__a - __b;
11112 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11113 vector bool int __b) {
11114 return __a - (vector int)__b;
11117 static __inline__ vector unsigned int __ATTRS_o_ai
11118 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11122 static __inline__ vector unsigned int __ATTRS_o_ai
11123 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11124 return (vector unsigned int)__a - __b;
11127 static __inline__ vector unsigned int __ATTRS_o_ai
11128 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11129 return __a - (vector unsigned int)__b;
11134 #define __builtin_altivec_vsubfp vec_vsubfp
11136 static __inline__ vector float __attribute__((__always_inline__))
11137 vec_vsubfp(vector float __a, vector float __b) {
11143 static __inline__ vector signed int __ATTRS_o_ai
11144 vec_subc(vector signed int __a, vector signed int __b) {
11145 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11146 (vector unsigned int) __b);
11149 static __inline__ vector unsigned int __ATTRS_o_ai
11150 vec_subc(vector unsigned int __a, vector unsigned int __b) {
11151 return __builtin_altivec_vsubcuw(__a, __b);
11154 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11155 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11156 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11157 return __builtin_altivec_vsubcuq(__a, __b);
11160 static __inline__ vector signed __int128 __ATTRS_o_ai
11161 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11162 return __builtin_altivec_vsubcuq(__a, __b);
11164 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11168 static __inline__ vector unsigned int __attribute__((__always_inline__))
11169 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11170 return __builtin_altivec_vsubcuw(__a, __b);
11175 static __inline__ vector signed char __ATTRS_o_ai
11176 vec_subs(vector signed char __a, vector signed char __b) {
11177 return __builtin_altivec_vsubsbs(__a, __b);
11180 static __inline__ vector signed char __ATTRS_o_ai
11181 vec_subs(vector bool char __a, vector signed char __b) {
11182 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11185 static __inline__ vector signed char __ATTRS_o_ai
11186 vec_subs(vector signed char __a, vector bool char __b) {
11187 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11190 static __inline__ vector unsigned char __ATTRS_o_ai
11191 vec_subs(vector unsigned char __a, vector unsigned char __b) {
11192 return __builtin_altivec_vsububs(__a, __b);
11195 static __inline__ vector unsigned char __ATTRS_o_ai
11196 vec_subs(vector bool char __a, vector unsigned char __b) {
11197 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11200 static __inline__ vector unsigned char __ATTRS_o_ai
11201 vec_subs(vector unsigned char __a, vector bool char __b) {
11202 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11205 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11206 vector short __b) {
11207 return __builtin_altivec_vsubshs(__a, __b);
11210 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11211 vector short __b) {
11212 return __builtin_altivec_vsubshs((vector short)__a, __b);
11215 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11216 vector bool short __b) {
11217 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11220 static __inline__ vector unsigned short __ATTRS_o_ai
11221 vec_subs(vector unsigned short __a, vector unsigned short __b) {
11222 return __builtin_altivec_vsubuhs(__a, __b);
11225 static __inline__ vector unsigned short __ATTRS_o_ai
11226 vec_subs(vector bool short __a, vector unsigned short __b) {
11227 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11230 static __inline__ vector unsigned short __ATTRS_o_ai
11231 vec_subs(vector unsigned short __a, vector bool short __b) {
11232 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11235 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11237 return __builtin_altivec_vsubsws(__a, __b);
11240 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11242 return __builtin_altivec_vsubsws((vector int)__a, __b);
11245 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11246 vector bool int __b) {
11247 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11250 static __inline__ vector unsigned int __ATTRS_o_ai
11251 vec_subs(vector unsigned int __a, vector unsigned int __b) {
11252 return __builtin_altivec_vsubuws(__a, __b);
11255 static __inline__ vector unsigned int __ATTRS_o_ai
11256 vec_subs(vector bool int __a, vector unsigned int __b) {
11257 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11260 static __inline__ vector unsigned int __ATTRS_o_ai
11261 vec_subs(vector unsigned int __a, vector bool int __b) {
11262 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11267 static __inline__ vector signed char __ATTRS_o_ai
11268 vec_vsubsbs(vector signed char __a, vector signed char __b) {
11269 return __builtin_altivec_vsubsbs(__a, __b);
11272 static __inline__ vector signed char __ATTRS_o_ai
11273 vec_vsubsbs(vector bool char __a, vector signed char __b) {
11274 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11277 static __inline__ vector signed char __ATTRS_o_ai
11278 vec_vsubsbs(vector signed char __a, vector bool char __b) {
11279 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11284 static __inline__ vector unsigned char __ATTRS_o_ai
11285 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11286 return __builtin_altivec_vsububs(__a, __b);
11289 static __inline__ vector unsigned char __ATTRS_o_ai
11290 vec_vsububs(vector bool char __a, vector unsigned char __b) {
11291 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11294 static __inline__ vector unsigned char __ATTRS_o_ai
11295 vec_vsububs(vector unsigned char __a, vector bool char __b) {
11296 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11301 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11302 vector short __b) {
11303 return __builtin_altivec_vsubshs(__a, __b);
11306 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11307 vector short __b) {
11308 return __builtin_altivec_vsubshs((vector short)__a, __b);
11311 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11312 vector bool short __b) {
11313 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11318 static __inline__ vector unsigned short __ATTRS_o_ai
11319 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11320 return __builtin_altivec_vsubuhs(__a, __b);
11323 static __inline__ vector unsigned short __ATTRS_o_ai
11324 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11325 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11328 static __inline__ vector unsigned short __ATTRS_o_ai
11329 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11330 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11335 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11337 return __builtin_altivec_vsubsws(__a, __b);
11340 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11342 return __builtin_altivec_vsubsws((vector int)__a, __b);
11345 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11346 vector bool int __b) {
11347 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11352 static __inline__ vector unsigned int __ATTRS_o_ai
11353 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11354 return __builtin_altivec_vsubuws(__a, __b);
11357 static __inline__ vector unsigned int __ATTRS_o_ai
11358 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11359 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11362 static __inline__ vector unsigned int __ATTRS_o_ai
11363 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11364 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11367 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11370 static __inline__ vector signed __int128 __ATTRS_o_ai
11371 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11375 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11376 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11383 static __inline__ vector signed __int128 __ATTRS_o_ai
11384 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11385 vector signed __int128 __c) {
11386 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11389 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11390 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11391 vector unsigned __int128 __c) {
11392 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11395 static __inline__ vector signed __int128 __ATTRS_o_ai
11396 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11397 vector signed __int128 __c) {
11398 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11401 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11402 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11403 vector unsigned __int128 __c) {
11404 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11409 static __inline__ vector signed __int128 __ATTRS_o_ai
11410 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11411 return __builtin_altivec_vsubcuq(__a, __b);
11414 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11415 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11416 return __builtin_altivec_vsubcuq(__a, __b);
11421 static __inline__ vector signed __int128 __ATTRS_o_ai
11422 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11423 vector signed __int128 __c) {
11424 return __builtin_altivec_vsubecuq(__a, __b, __c);
11427 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11428 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11429 vector unsigned __int128 __c) {
11430 return __builtin_altivec_vsubecuq(__a, __b, __c);
11433 static __inline__ vector signed int __ATTRS_o_ai
11434 vec_subec(vector signed int __a, vector signed int __b,
11435 vector signed int __c) {
11436 return vec_addec(__a, ~__b, __c);
11439 static __inline__ vector unsigned int __ATTRS_o_ai
11440 vec_subec(vector unsigned int __a, vector unsigned int __b,
11441 vector unsigned int __c) {
11442 return vec_addec(__a, ~__b, __c);
11445 static __inline__ vector signed __int128 __ATTRS_o_ai
11446 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11447 vector signed __int128 __c) {
11448 return __builtin_altivec_vsubecuq(__a, __b, __c);
11451 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11452 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11453 vector unsigned __int128 __c) {
11454 return __builtin_altivec_vsubecuq(__a, __b, __c);
11456 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11458 static __inline__ vector signed int __ATTRS_o_ai
11459 vec_sube(vector signed int __a, vector signed int __b,
11460 vector signed int __c) {
11461 vector signed int __mask = {1, 1, 1, 1};
11462 vector signed int __carry = __c & __mask;
11463 return vec_adde(__a, ~__b, __carry);
11466 static __inline__ vector unsigned int __ATTRS_o_ai
11467 vec_sube(vector unsigned int __a, vector unsigned int __b,
11468 vector unsigned int __c) {
11469 vector unsigned int __mask = {1, 1, 1, 1};
11470 vector unsigned int __carry = __c & __mask;
11471 return vec_adde(__a, ~__b, __carry);
11475 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11477 return __builtin_altivec_vsum4sbs(__a, __b);
11480 static __inline__ vector unsigned int __ATTRS_o_ai
11481 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11482 return __builtin_altivec_vsum4ubs(__a, __b);
11485 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11487 return __builtin_altivec_vsum4shs(__a, __b);
11492 static __inline__ vector int __attribute__((__always_inline__))
11493 vec_vsum4sbs(vector signed char __a, vector int __b) {
11494 return __builtin_altivec_vsum4sbs(__a, __b);
11499 static __inline__ vector unsigned int __attribute__((__always_inline__))
11500 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11501 return __builtin_altivec_vsum4ubs(__a, __b);
11506 static __inline__ vector int __attribute__((__always_inline__))
11507 vec_vsum4shs(vector signed short __a, vector int __b) {
11508 return __builtin_altivec_vsum4shs(__a, __b);
11513 /* The vsum2sws instruction has a big-endian bias, so that the second
11514 input vector and the result always reference big-endian elements
11515 1 and 3 (little-endian element 0 and 2). For ease of porting the
11516 programmer wants elements 1 and 3 in both cases, so for little
11517 endian we must perform some permutes. */
11519 static __inline__ vector signed int __attribute__((__always_inline__))
11520 vec_sum2s(vector int __a, vector int __b) {
11521 #ifdef __LITTLE_ENDIAN__
11522 vector int __c = (vector signed int)vec_perm(
11523 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11525 __c = __builtin_altivec_vsum2sws(__a, __c);
11526 return (vector signed int)vec_perm(
11527 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11530 return __builtin_altivec_vsum2sws(__a, __b);
11536 static __inline__ vector signed int __attribute__((__always_inline__))
11537 vec_vsum2sws(vector int __a, vector int __b) {
11538 #ifdef __LITTLE_ENDIAN__
11539 vector int __c = (vector signed int)vec_perm(
11540 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11542 __c = __builtin_altivec_vsum2sws(__a, __c);
11543 return (vector signed int)vec_perm(
11544 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11547 return __builtin_altivec_vsum2sws(__a, __b);
11553 /* The vsumsws instruction has a big-endian bias, so that the second
11554 input vector and the result always reference big-endian element 3
11555 (little-endian element 0). For ease of porting the programmer
11556 wants element 3 in both cases, so for little endian we must perform
11559 static __inline__ vector signed int __attribute__((__always_inline__))
11560 vec_sums(vector signed int __a, vector signed int __b) {
11561 #ifdef __LITTLE_ENDIAN__
11562 __b = (vector signed int)vec_splat(__b, 3);
11563 __b = __builtin_altivec_vsumsws(__a, __b);
11564 return (vector signed int)(0, 0, 0, __b[0]);
11566 return __builtin_altivec_vsumsws(__a, __b);
11572 static __inline__ vector signed int __attribute__((__always_inline__))
11573 vec_vsumsws(vector signed int __a, vector signed int __b) {
11574 #ifdef __LITTLE_ENDIAN__
11575 __b = (vector signed int)vec_splat(__b, 3);
11576 __b = __builtin_altivec_vsumsws(__a, __b);
11577 return (vector signed int)(0, 0, 0, __b[0]);
11579 return __builtin_altivec_vsumsws(__a, __b);
11585 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11587 return __builtin_vsx_xvrspiz(__a);
11589 return __builtin_altivec_vrfiz(__a);
11594 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11595 return __builtin_vsx_xvrdpiz(__a);
11601 static __inline__ vector float __attribute__((__always_inline__))
11602 vec_vrfiz(vector float __a) {
11603 return __builtin_altivec_vrfiz(__a);
11608 /* The vector unpack instructions all have a big-endian bias, so for
11609 little endian we must reverse the meanings of "high" and "low." */
11611 static __inline__ vector short __ATTRS_o_ai
11612 vec_unpackh(vector signed char __a) {
11613 #ifdef __LITTLE_ENDIAN__
11614 return __builtin_altivec_vupklsb((vector char)__a);
11616 return __builtin_altivec_vupkhsb((vector char)__a);
11620 static __inline__ vector bool short __ATTRS_o_ai
11621 vec_unpackh(vector bool char __a) {
11622 #ifdef __LITTLE_ENDIAN__
11623 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11625 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11629 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11630 #ifdef __LITTLE_ENDIAN__
11631 return __builtin_altivec_vupklsh(__a);
11633 return __builtin_altivec_vupkhsh(__a);
11637 static __inline__ vector bool int __ATTRS_o_ai
11638 vec_unpackh(vector bool short __a) {
11639 #ifdef __LITTLE_ENDIAN__
11640 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11642 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11646 static __inline__ vector unsigned int __ATTRS_o_ai
11647 vec_unpackh(vector pixel __a) {
11648 #ifdef __LITTLE_ENDIAN__
11649 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11651 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11655 #ifdef __POWER8_VECTOR__
11656 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11657 #ifdef __LITTLE_ENDIAN__
11658 return __builtin_altivec_vupklsw(__a);
11660 return __builtin_altivec_vupkhsw(__a);
11664 static __inline__ vector bool long long __ATTRS_o_ai
11665 vec_unpackh(vector bool int __a) {
11666 #ifdef __LITTLE_ENDIAN__
11667 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11669 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11673 static __inline__ vector double __ATTRS_o_ai
11674 vec_unpackh(vector float __a) {
11675 return (vector double)(__a[0], __a[1]);
11681 static __inline__ vector short __ATTRS_o_ai
11682 vec_vupkhsb(vector signed char __a) {
11683 #ifdef __LITTLE_ENDIAN__
11684 return __builtin_altivec_vupklsb((vector char)__a);
11686 return __builtin_altivec_vupkhsb((vector char)__a);
11690 static __inline__ vector bool short __ATTRS_o_ai
11691 vec_vupkhsb(vector bool char __a) {
11692 #ifdef __LITTLE_ENDIAN__
11693 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11695 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11701 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11702 #ifdef __LITTLE_ENDIAN__
11703 return __builtin_altivec_vupklsh(__a);
11705 return __builtin_altivec_vupkhsh(__a);
11709 static __inline__ vector bool int __ATTRS_o_ai
11710 vec_vupkhsh(vector bool short __a) {
11711 #ifdef __LITTLE_ENDIAN__
11712 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11714 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11718 static __inline__ vector unsigned int __ATTRS_o_ai
11719 vec_vupkhsh(vector pixel __a) {
11720 #ifdef __LITTLE_ENDIAN__
11721 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11723 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11729 #ifdef __POWER8_VECTOR__
11730 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11731 #ifdef __LITTLE_ENDIAN__
11732 return __builtin_altivec_vupklsw(__a);
11734 return __builtin_altivec_vupkhsw(__a);
11738 static __inline__ vector bool long long __ATTRS_o_ai
11739 vec_vupkhsw(vector bool int __a) {
11740 #ifdef __LITTLE_ENDIAN__
11741 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11743 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11750 static __inline__ vector short __ATTRS_o_ai
11751 vec_unpackl(vector signed char __a) {
11752 #ifdef __LITTLE_ENDIAN__
11753 return __builtin_altivec_vupkhsb((vector char)__a);
11755 return __builtin_altivec_vupklsb((vector char)__a);
11759 static __inline__ vector bool short __ATTRS_o_ai
11760 vec_unpackl(vector bool char __a) {
11761 #ifdef __LITTLE_ENDIAN__
11762 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11764 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11768 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11769 #ifdef __LITTLE_ENDIAN__
11770 return __builtin_altivec_vupkhsh(__a);
11772 return __builtin_altivec_vupklsh(__a);
11776 static __inline__ vector bool int __ATTRS_o_ai
11777 vec_unpackl(vector bool short __a) {
11778 #ifdef __LITTLE_ENDIAN__
11779 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11781 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11785 static __inline__ vector unsigned int __ATTRS_o_ai
11786 vec_unpackl(vector pixel __a) {
11787 #ifdef __LITTLE_ENDIAN__
11788 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11790 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11794 #ifdef __POWER8_VECTOR__
11795 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11796 #ifdef __LITTLE_ENDIAN__
11797 return __builtin_altivec_vupkhsw(__a);
11799 return __builtin_altivec_vupklsw(__a);
11803 static __inline__ vector bool long long __ATTRS_o_ai
11804 vec_unpackl(vector bool int __a) {
11805 #ifdef __LITTLE_ENDIAN__
11806 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11808 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11812 static __inline__ vector double __ATTRS_o_ai
11813 vec_unpackl(vector float __a) {
11814 return (vector double)(__a[2], __a[3]);
11820 static __inline__ vector short __ATTRS_o_ai
11821 vec_vupklsb(vector signed char __a) {
11822 #ifdef __LITTLE_ENDIAN__
11823 return __builtin_altivec_vupkhsb((vector char)__a);
11825 return __builtin_altivec_vupklsb((vector char)__a);
11829 static __inline__ vector bool short __ATTRS_o_ai
11830 vec_vupklsb(vector bool char __a) {
11831 #ifdef __LITTLE_ENDIAN__
11832 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11834 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11840 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11841 #ifdef __LITTLE_ENDIAN__
11842 return __builtin_altivec_vupkhsh(__a);
11844 return __builtin_altivec_vupklsh(__a);
11848 static __inline__ vector bool int __ATTRS_o_ai
11849 vec_vupklsh(vector bool short __a) {
11850 #ifdef __LITTLE_ENDIAN__
11851 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11853 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11857 static __inline__ vector unsigned int __ATTRS_o_ai
11858 vec_vupklsh(vector pixel __a) {
11859 #ifdef __LITTLE_ENDIAN__
11860 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11862 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11868 #ifdef __POWER8_VECTOR__
11869 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11870 #ifdef __LITTLE_ENDIAN__
11871 return __builtin_altivec_vupkhsw(__a);
11873 return __builtin_altivec_vupklsw(__a);
11877 static __inline__ vector bool long long __ATTRS_o_ai
11878 vec_vupklsw(vector bool int __a) {
11879 #ifdef __LITTLE_ENDIAN__
11880 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11882 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11891 static __inline__ vector bool int __ATTRS_o_ai
11892 vec_vsx_ld(int __a, const vector bool int *__b) {
11893 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11896 static __inline__ vector signed int __ATTRS_o_ai
11897 vec_vsx_ld(int __a, const vector signed int *__b) {
11898 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11901 static __inline__ vector signed int __ATTRS_o_ai
11902 vec_vsx_ld(int __a, const signed int *__b) {
11903 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11906 static __inline__ vector unsigned int __ATTRS_o_ai
11907 vec_vsx_ld(int __a, const vector unsigned int *__b) {
11908 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11911 static __inline__ vector unsigned int __ATTRS_o_ai
11912 vec_vsx_ld(int __a, const unsigned int *__b) {
11913 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11916 static __inline__ vector float __ATTRS_o_ai
11917 vec_vsx_ld(int __a, const vector float *__b) {
11918 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11921 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11922 const float *__b) {
11923 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11926 static __inline__ vector signed long long __ATTRS_o_ai
11927 vec_vsx_ld(int __a, const vector signed long long *__b) {
11928 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11931 static __inline__ vector unsigned long long __ATTRS_o_ai
11932 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11933 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11936 static __inline__ vector double __ATTRS_o_ai
11937 vec_vsx_ld(int __a, const vector double *__b) {
11938 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11941 static __inline__ vector double __ATTRS_o_ai
11942 vec_vsx_ld(int __a, const double *__b) {
11943 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11946 static __inline__ vector bool short __ATTRS_o_ai
11947 vec_vsx_ld(int __a, const vector bool short *__b) {
11948 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
11951 static __inline__ vector signed short __ATTRS_o_ai
11952 vec_vsx_ld(int __a, const vector signed short *__b) {
11953 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11956 static __inline__ vector signed short __ATTRS_o_ai
11957 vec_vsx_ld(int __a, const signed short *__b) {
11958 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11961 static __inline__ vector unsigned short __ATTRS_o_ai
11962 vec_vsx_ld(int __a, const vector unsigned short *__b) {
11963 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11966 static __inline__ vector unsigned short __ATTRS_o_ai
11967 vec_vsx_ld(int __a, const unsigned short *__b) {
11968 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11971 static __inline__ vector bool char __ATTRS_o_ai
11972 vec_vsx_ld(int __a, const vector bool char *__b) {
11973 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
11976 static __inline__ vector signed char __ATTRS_o_ai
11977 vec_vsx_ld(int __a, const vector signed char *__b) {
11978 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11981 static __inline__ vector signed char __ATTRS_o_ai
11982 vec_vsx_ld(int __a, const signed char *__b) {
11983 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11986 static __inline__ vector unsigned char __ATTRS_o_ai
11987 vec_vsx_ld(int __a, const vector unsigned char *__b) {
11988 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
11991 static __inline__ vector unsigned char __ATTRS_o_ai
11992 vec_vsx_ld(int __a, const unsigned char *__b) {
11993 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12002 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12003 vector bool int *__c) {
12004 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12007 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12009 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12012 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12013 unsigned int *__c) {
12014 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12017 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12018 vector signed int *__c) {
12019 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12022 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12024 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12027 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12028 vector unsigned int *__c) {
12029 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12032 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12033 unsigned int *__c) {
12034 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12037 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12038 vector float *__c) {
12039 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12042 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12044 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12047 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12049 vector signed long long *__c) {
12050 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12053 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12055 vector unsigned long long *__c) {
12056 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12059 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12060 vector double *__c) {
12061 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12064 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12066 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12069 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12070 vector bool short *__c) {
12071 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12074 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12075 signed short *__c) {
12076 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12079 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12080 unsigned short *__c) {
12081 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12083 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12084 vector signed short *__c) {
12085 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12088 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12089 signed short *__c) {
12090 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12093 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12095 vector unsigned short *__c) {
12096 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12099 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12100 int __b, unsigned short *__c) {
12101 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12104 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12105 vector bool char *__c) {
12106 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12109 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12110 signed char *__c) {
12111 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12114 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12115 unsigned char *__c) {
12116 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12119 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12120 vector signed char *__c) {
12121 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12124 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12125 signed char *__c) {
12126 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12129 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12131 vector unsigned char *__c) {
12132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12135 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12136 int __b, unsigned char *__c) {
12137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12143 #define vec_xxpermdi __builtin_vsx_xxpermdi
12144 #define vec_xxsldwi __builtin_vsx_xxsldwi
12149 #define __builtin_altivec_vxor vec_xor
12151 static __inline__ vector signed char __ATTRS_o_ai
12152 vec_xor(vector signed char __a, vector signed char __b) {
12156 static __inline__ vector signed char __ATTRS_o_ai
12157 vec_xor(vector bool char __a, vector signed char __b) {
12158 return (vector signed char)__a ^ __b;
12161 static __inline__ vector signed char __ATTRS_o_ai
12162 vec_xor(vector signed char __a, vector bool char __b) {
12163 return __a ^ (vector signed char)__b;
12166 static __inline__ vector unsigned char __ATTRS_o_ai
12167 vec_xor(vector unsigned char __a, vector unsigned char __b) {
12171 static __inline__ vector unsigned char __ATTRS_o_ai
12172 vec_xor(vector bool char __a, vector unsigned char __b) {
12173 return (vector unsigned char)__a ^ __b;
12176 static __inline__ vector unsigned char __ATTRS_o_ai
12177 vec_xor(vector unsigned char __a, vector bool char __b) {
12178 return __a ^ (vector unsigned char)__b;
12181 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12182 vector bool char __b) {
12186 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12187 vector short __b) {
12191 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12192 vector short __b) {
12193 return (vector short)__a ^ __b;
12196 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12197 vector bool short __b) {
12198 return __a ^ (vector short)__b;
12201 static __inline__ vector unsigned short __ATTRS_o_ai
12202 vec_xor(vector unsigned short __a, vector unsigned short __b) {
12206 static __inline__ vector unsigned short __ATTRS_o_ai
12207 vec_xor(vector bool short __a, vector unsigned short __b) {
12208 return (vector unsigned short)__a ^ __b;
12211 static __inline__ vector unsigned short __ATTRS_o_ai
12212 vec_xor(vector unsigned short __a, vector bool short __b) {
12213 return __a ^ (vector unsigned short)__b;
12216 static __inline__ vector bool short __ATTRS_o_ai
12217 vec_xor(vector bool short __a, vector bool short __b) {
12221 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12226 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12228 return (vector int)__a ^ __b;
12231 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12232 vector bool int __b) {
12233 return __a ^ (vector int)__b;
12236 static __inline__ vector unsigned int __ATTRS_o_ai
12237 vec_xor(vector unsigned int __a, vector unsigned int __b) {
12241 static __inline__ vector unsigned int __ATTRS_o_ai
12242 vec_xor(vector bool int __a, vector unsigned int __b) {
12243 return (vector unsigned int)__a ^ __b;
12246 static __inline__ vector unsigned int __ATTRS_o_ai
12247 vec_xor(vector unsigned int __a, vector bool int __b) {
12248 return __a ^ (vector unsigned int)__b;
12251 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12252 vector bool int __b) {
12256 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12257 vector float __b) {
12258 vector unsigned int __res =
12259 (vector unsigned int)__a ^ (vector unsigned int)__b;
12260 return (vector float)__res;
12263 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12264 vector float __b) {
12265 vector unsigned int __res =
12266 (vector unsigned int)__a ^ (vector unsigned int)__b;
12267 return (vector float)__res;
12270 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12271 vector bool int __b) {
12272 vector unsigned int __res =
12273 (vector unsigned int)__a ^ (vector unsigned int)__b;
12274 return (vector float)__res;
12278 static __inline__ vector signed long long __ATTRS_o_ai
12279 vec_xor(vector signed long long __a, vector signed long long __b) {
12283 static __inline__ vector signed long long __ATTRS_o_ai
12284 vec_xor(vector bool long long __a, vector signed long long __b) {
12285 return (vector signed long long)__a ^ __b;
12288 static __inline__ vector signed long long __ATTRS_o_ai
12289 vec_xor(vector signed long long __a, vector bool long long __b) {
12290 return __a ^ (vector signed long long)__b;
12293 static __inline__ vector unsigned long long __ATTRS_o_ai
12294 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12298 static __inline__ vector unsigned long long __ATTRS_o_ai
12299 vec_xor(vector bool long long __a, vector unsigned long long __b) {
12300 return (vector unsigned long long)__a ^ __b;
12303 static __inline__ vector unsigned long long __ATTRS_o_ai
12304 vec_xor(vector unsigned long long __a, vector bool long long __b) {
12305 return __a ^ (vector unsigned long long)__b;
12308 static __inline__ vector bool long long __ATTRS_o_ai
12309 vec_xor(vector bool long long __a, vector bool long long __b) {
12313 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12314 vector double __b) {
12315 return (vector double)((vector unsigned long long)__a ^
12316 (vector unsigned long long)__b);
12319 static __inline__ vector double __ATTRS_o_ai
12320 vec_xor(vector double __a, vector bool long long __b) {
12321 return (vector double)((vector unsigned long long)__a ^
12322 (vector unsigned long long)__b);
12325 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12326 vector double __b) {
12327 return (vector double)((vector unsigned long long)__a ^
12328 (vector unsigned long long)__b);
12334 static __inline__ vector signed char __ATTRS_o_ai
12335 vec_vxor(vector signed char __a, vector signed char __b) {
12339 static __inline__ vector signed char __ATTRS_o_ai
12340 vec_vxor(vector bool char __a, vector signed char __b) {
12341 return (vector signed char)__a ^ __b;
12344 static __inline__ vector signed char __ATTRS_o_ai
12345 vec_vxor(vector signed char __a, vector bool char __b) {
12346 return __a ^ (vector signed char)__b;
12349 static __inline__ vector unsigned char __ATTRS_o_ai
12350 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12354 static __inline__ vector unsigned char __ATTRS_o_ai
12355 vec_vxor(vector bool char __a, vector unsigned char __b) {
12356 return (vector unsigned char)__a ^ __b;
12359 static __inline__ vector unsigned char __ATTRS_o_ai
12360 vec_vxor(vector unsigned char __a, vector bool char __b) {
12361 return __a ^ (vector unsigned char)__b;
12364 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12365 vector bool char __b) {
12369 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12370 vector short __b) {
12374 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12375 vector short __b) {
12376 return (vector short)__a ^ __b;
12379 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12380 vector bool short __b) {
12381 return __a ^ (vector short)__b;
12384 static __inline__ vector unsigned short __ATTRS_o_ai
12385 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12389 static __inline__ vector unsigned short __ATTRS_o_ai
12390 vec_vxor(vector bool short __a, vector unsigned short __b) {
12391 return (vector unsigned short)__a ^ __b;
12394 static __inline__ vector unsigned short __ATTRS_o_ai
12395 vec_vxor(vector unsigned short __a, vector bool short __b) {
12396 return __a ^ (vector unsigned short)__b;
12399 static __inline__ vector bool short __ATTRS_o_ai
12400 vec_vxor(vector bool short __a, vector bool short __b) {
12404 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12409 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12411 return (vector int)__a ^ __b;
12414 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12415 vector bool int __b) {
12416 return __a ^ (vector int)__b;
12419 static __inline__ vector unsigned int __ATTRS_o_ai
12420 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12424 static __inline__ vector unsigned int __ATTRS_o_ai
12425 vec_vxor(vector bool int __a, vector unsigned int __b) {
12426 return (vector unsigned int)__a ^ __b;
12429 static __inline__ vector unsigned int __ATTRS_o_ai
12430 vec_vxor(vector unsigned int __a, vector bool int __b) {
12431 return __a ^ (vector unsigned int)__b;
12434 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12435 vector bool int __b) {
12439 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12440 vector float __b) {
12441 vector unsigned int __res =
12442 (vector unsigned int)__a ^ (vector unsigned int)__b;
12443 return (vector float)__res;
12446 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12447 vector float __b) {
12448 vector unsigned int __res =
12449 (vector unsigned int)__a ^ (vector unsigned int)__b;
12450 return (vector float)__res;
12453 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12454 vector bool int __b) {
12455 vector unsigned int __res =
12456 (vector unsigned int)__a ^ (vector unsigned int)__b;
12457 return (vector float)__res;
12461 static __inline__ vector signed long long __ATTRS_o_ai
12462 vec_vxor(vector signed long long __a, vector signed long long __b) {
12466 static __inline__ vector signed long long __ATTRS_o_ai
12467 vec_vxor(vector bool long long __a, vector signed long long __b) {
12468 return (vector signed long long)__a ^ __b;
12471 static __inline__ vector signed long long __ATTRS_o_ai
12472 vec_vxor(vector signed long long __a, vector bool long long __b) {
12473 return __a ^ (vector signed long long)__b;
12476 static __inline__ vector unsigned long long __ATTRS_o_ai
12477 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12481 static __inline__ vector unsigned long long __ATTRS_o_ai
12482 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12483 return (vector unsigned long long)__a ^ __b;
12486 static __inline__ vector unsigned long long __ATTRS_o_ai
12487 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12488 return __a ^ (vector unsigned long long)__b;
12491 static __inline__ vector bool long long __ATTRS_o_ai
12492 vec_vxor(vector bool long long __a, vector bool long long __b) {
12497 /* ------------------------ extensions for CBEA ----------------------------- */
12501 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12506 static __inline__ unsigned char __ATTRS_o_ai
12507 vec_extract(vector unsigned char __a, int __b) {
12511 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12516 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12521 static __inline__ unsigned short __ATTRS_o_ai
12522 vec_extract(vector unsigned short __a, int __b) {
12526 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12531 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12536 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12541 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12547 static __inline__ signed long long __ATTRS_o_ai
12548 vec_extract(vector signed long long __a, int __b) {
12552 static __inline__ unsigned long long __ATTRS_o_ai
12553 vec_extract(vector unsigned long long __a, int __b) {
12557 static __inline__ unsigned long long __ATTRS_o_ai
12558 vec_extract(vector bool long long __a, int __b) {
12562 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12567 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12571 #ifdef __POWER9_VECTOR__
12573 #define vec_insert4b __builtin_vsx_insertword
12574 #define vec_extract4b __builtin_vsx_extractuword
12576 /* vec_extract_exp */
12578 static __inline__ vector unsigned int __ATTRS_o_ai
12579 vec_extract_exp(vector float __a) {
12580 return __builtin_vsx_xvxexpsp(__a);
12583 static __inline__ vector unsigned long long __ATTRS_o_ai
12584 vec_extract_exp(vector double __a) {
12585 return __builtin_vsx_xvxexpdp(__a);
12588 /* vec_extract_sig */
12590 static __inline__ vector unsigned int __ATTRS_o_ai
12591 vec_extract_sig(vector float __a) {
12592 return __builtin_vsx_xvxsigsp(__a);
12595 static __inline__ vector unsigned long long __ATTRS_o_ai
12596 vec_extract_sig (vector double __a) {
12597 return __builtin_vsx_xvxsigdp(__a);
12600 static __inline__ vector float __ATTRS_o_ai
12601 vec_extract_fp32_from_shorth(vector unsigned short __a) {
12602 vector unsigned short __b =
12603 #ifdef __LITTLE_ENDIAN__
12604 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12606 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12608 return __builtin_vsx_xvcvhpsp(__b);
12611 static __inline__ vector float __ATTRS_o_ai
12612 vec_extract_fp32_from_shortl(vector unsigned short __a) {
12613 vector unsigned short __b =
12614 #ifdef __LITTLE_ENDIAN__
12615 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12617 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12619 return __builtin_vsx_xvcvhpsp(__b);
12621 #endif /* __POWER9_VECTOR__ */
12625 static __inline__ vector signed char __ATTRS_o_ai
12626 vec_insert(signed char __a, vector signed char __b, int __c) {
12631 static __inline__ vector unsigned char __ATTRS_o_ai
12632 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12637 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12638 vector bool char __b,
12644 static __inline__ vector signed short __ATTRS_o_ai
12645 vec_insert(signed short __a, vector signed short __b, int __c) {
12650 static __inline__ vector unsigned short __ATTRS_o_ai
12651 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12656 static __inline__ vector bool short __ATTRS_o_ai
12657 vec_insert(unsigned short __a, vector bool short __b, int __c) {
12662 static __inline__ vector signed int __ATTRS_o_ai
12663 vec_insert(signed int __a, vector signed int __b, int __c) {
12668 static __inline__ vector unsigned int __ATTRS_o_ai
12669 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12674 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12675 vector bool int __b,
12682 static __inline__ vector signed long long __ATTRS_o_ai
12683 vec_insert(signed long long __a, vector signed long long __b, int __c) {
12688 static __inline__ vector unsigned long long __ATTRS_o_ai
12689 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12694 static __inline__ vector bool long long __ATTRS_o_ai
12695 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12699 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12707 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12716 static __inline__ vector signed char __ATTRS_o_ai
12717 vec_lvlx(int __a, const signed char *__b) {
12718 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12719 vec_lvsl(__a, __b));
12722 static __inline__ vector signed char __ATTRS_o_ai
12723 vec_lvlx(int __a, const vector signed char *__b) {
12724 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12725 vec_lvsl(__a, (unsigned char *)__b));
12728 static __inline__ vector unsigned char __ATTRS_o_ai
12729 vec_lvlx(int __a, const unsigned char *__b) {
12730 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12731 vec_lvsl(__a, __b));
12734 static __inline__ vector unsigned char __ATTRS_o_ai
12735 vec_lvlx(int __a, const vector unsigned char *__b) {
12736 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12737 vec_lvsl(__a, (unsigned char *)__b));
12740 static __inline__ vector bool char __ATTRS_o_ai
12741 vec_lvlx(int __a, const vector bool char *__b) {
12742 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12743 vec_lvsl(__a, (unsigned char *)__b));
12746 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12747 const short *__b) {
12748 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12751 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12752 const vector short *__b) {
12753 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12754 vec_lvsl(__a, (unsigned char *)__b));
12757 static __inline__ vector unsigned short __ATTRS_o_ai
12758 vec_lvlx(int __a, const unsigned short *__b) {
12759 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12760 vec_lvsl(__a, __b));
12763 static __inline__ vector unsigned short __ATTRS_o_ai
12764 vec_lvlx(int __a, const vector unsigned short *__b) {
12765 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12766 vec_lvsl(__a, (unsigned char *)__b));
12769 static __inline__ vector bool short __ATTRS_o_ai
12770 vec_lvlx(int __a, const vector bool short *__b) {
12771 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12772 vec_lvsl(__a, (unsigned char *)__b));
12775 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12776 const vector pixel *__b) {
12777 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12778 vec_lvsl(__a, (unsigned char *)__b));
12781 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12782 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12785 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12786 const vector int *__b) {
12787 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12788 vec_lvsl(__a, (unsigned char *)__b));
12791 static __inline__ vector unsigned int __ATTRS_o_ai
12792 vec_lvlx(int __a, const unsigned int *__b) {
12793 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12794 vec_lvsl(__a, __b));
12797 static __inline__ vector unsigned int __ATTRS_o_ai
12798 vec_lvlx(int __a, const vector unsigned int *__b) {
12799 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12800 vec_lvsl(__a, (unsigned char *)__b));
12803 static __inline__ vector bool int __ATTRS_o_ai
12804 vec_lvlx(int __a, const vector bool int *__b) {
12805 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12806 vec_lvsl(__a, (unsigned char *)__b));
12809 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12810 const float *__b) {
12811 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12814 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12815 const vector float *__b) {
12816 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12817 vec_lvsl(__a, (unsigned char *)__b));
12822 static __inline__ vector signed char __ATTRS_o_ai
12823 vec_lvlxl(int __a, const signed char *__b) {
12824 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12825 vec_lvsl(__a, __b));
12828 static __inline__ vector signed char __ATTRS_o_ai
12829 vec_lvlxl(int __a, const vector signed char *__b) {
12830 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12831 vec_lvsl(__a, (unsigned char *)__b));
12834 static __inline__ vector unsigned char __ATTRS_o_ai
12835 vec_lvlxl(int __a, const unsigned char *__b) {
12836 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12837 vec_lvsl(__a, __b));
12840 static __inline__ vector unsigned char __ATTRS_o_ai
12841 vec_lvlxl(int __a, const vector unsigned char *__b) {
12842 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12843 vec_lvsl(__a, (unsigned char *)__b));
12846 static __inline__ vector bool char __ATTRS_o_ai
12847 vec_lvlxl(int __a, const vector bool char *__b) {
12848 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12849 vec_lvsl(__a, (unsigned char *)__b));
12852 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12853 const short *__b) {
12854 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12857 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12858 const vector short *__b) {
12859 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12860 vec_lvsl(__a, (unsigned char *)__b));
12863 static __inline__ vector unsigned short __ATTRS_o_ai
12864 vec_lvlxl(int __a, const unsigned short *__b) {
12865 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12866 vec_lvsl(__a, __b));
12869 static __inline__ vector unsigned short __ATTRS_o_ai
12870 vec_lvlxl(int __a, const vector unsigned short *__b) {
12871 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12872 vec_lvsl(__a, (unsigned char *)__b));
12875 static __inline__ vector bool short __ATTRS_o_ai
12876 vec_lvlxl(int __a, const vector bool short *__b) {
12877 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12878 vec_lvsl(__a, (unsigned char *)__b));
12881 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12882 const vector pixel *__b) {
12883 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12884 vec_lvsl(__a, (unsigned char *)__b));
12887 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12888 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12891 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12892 const vector int *__b) {
12893 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12894 vec_lvsl(__a, (unsigned char *)__b));
12897 static __inline__ vector unsigned int __ATTRS_o_ai
12898 vec_lvlxl(int __a, const unsigned int *__b) {
12899 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12900 vec_lvsl(__a, __b));
12903 static __inline__ vector unsigned int __ATTRS_o_ai
12904 vec_lvlxl(int __a, const vector unsigned int *__b) {
12905 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12906 vec_lvsl(__a, (unsigned char *)__b));
12909 static __inline__ vector bool int __ATTRS_o_ai
12910 vec_lvlxl(int __a, const vector bool int *__b) {
12911 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12912 vec_lvsl(__a, (unsigned char *)__b));
12915 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12916 const float *__b) {
12917 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12920 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12921 vector float *__b) {
12922 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12923 vec_lvsl(__a, (unsigned char *)__b));
12928 static __inline__ vector signed char __ATTRS_o_ai
12929 vec_lvrx(int __a, const signed char *__b) {
12930 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12931 vec_lvsl(__a, __b));
12934 static __inline__ vector signed char __ATTRS_o_ai
12935 vec_lvrx(int __a, const vector signed char *__b) {
12936 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12937 vec_lvsl(__a, (unsigned char *)__b));
12940 static __inline__ vector unsigned char __ATTRS_o_ai
12941 vec_lvrx(int __a, const unsigned char *__b) {
12942 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12943 vec_lvsl(__a, __b));
12946 static __inline__ vector unsigned char __ATTRS_o_ai
12947 vec_lvrx(int __a, const vector unsigned char *__b) {
12948 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12949 vec_lvsl(__a, (unsigned char *)__b));
12952 static __inline__ vector bool char __ATTRS_o_ai
12953 vec_lvrx(int __a, const vector bool char *__b) {
12954 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
12955 vec_lvsl(__a, (unsigned char *)__b));
12958 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12959 const short *__b) {
12960 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12963 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12964 const vector short *__b) {
12965 return vec_perm((vector short)(0), vec_ld(__a, __b),
12966 vec_lvsl(__a, (unsigned char *)__b));
12969 static __inline__ vector unsigned short __ATTRS_o_ai
12970 vec_lvrx(int __a, const unsigned short *__b) {
12971 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12972 vec_lvsl(__a, __b));
12975 static __inline__ vector unsigned short __ATTRS_o_ai
12976 vec_lvrx(int __a, const vector unsigned short *__b) {
12977 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12978 vec_lvsl(__a, (unsigned char *)__b));
12981 static __inline__ vector bool short __ATTRS_o_ai
12982 vec_lvrx(int __a, const vector bool short *__b) {
12983 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
12984 vec_lvsl(__a, (unsigned char *)__b));
12987 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
12988 const vector pixel *__b) {
12989 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
12990 vec_lvsl(__a, (unsigned char *)__b));
12993 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
12994 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12997 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
12998 const vector int *__b) {
12999 return vec_perm((vector int)(0), vec_ld(__a, __b),
13000 vec_lvsl(__a, (unsigned char *)__b));
13003 static __inline__ vector unsigned int __ATTRS_o_ai
13004 vec_lvrx(int __a, const unsigned int *__b) {
13005 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13006 vec_lvsl(__a, __b));
13009 static __inline__ vector unsigned int __ATTRS_o_ai
13010 vec_lvrx(int __a, const vector unsigned int *__b) {
13011 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13012 vec_lvsl(__a, (unsigned char *)__b));
13015 static __inline__ vector bool int __ATTRS_o_ai
13016 vec_lvrx(int __a, const vector bool int *__b) {
13017 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13018 vec_lvsl(__a, (unsigned char *)__b));
13021 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13022 const float *__b) {
13023 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13026 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13027 const vector float *__b) {
13028 return vec_perm((vector float)(0), vec_ld(__a, __b),
13029 vec_lvsl(__a, (unsigned char *)__b));
13034 static __inline__ vector signed char __ATTRS_o_ai
13035 vec_lvrxl(int __a, const signed char *__b) {
13036 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13037 vec_lvsl(__a, __b));
13040 static __inline__ vector signed char __ATTRS_o_ai
13041 vec_lvrxl(int __a, const vector signed char *__b) {
13042 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13043 vec_lvsl(__a, (unsigned char *)__b));
13046 static __inline__ vector unsigned char __ATTRS_o_ai
13047 vec_lvrxl(int __a, const unsigned char *__b) {
13048 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13049 vec_lvsl(__a, __b));
13052 static __inline__ vector unsigned char __ATTRS_o_ai
13053 vec_lvrxl(int __a, const vector unsigned char *__b) {
13054 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13055 vec_lvsl(__a, (unsigned char *)__b));
13058 static __inline__ vector bool char __ATTRS_o_ai
13059 vec_lvrxl(int __a, const vector bool char *__b) {
13060 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13061 vec_lvsl(__a, (unsigned char *)__b));
13064 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13065 const short *__b) {
13066 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13069 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13070 const vector short *__b) {
13071 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13072 vec_lvsl(__a, (unsigned char *)__b));
13075 static __inline__ vector unsigned short __ATTRS_o_ai
13076 vec_lvrxl(int __a, const unsigned short *__b) {
13077 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13078 vec_lvsl(__a, __b));
13081 static __inline__ vector unsigned short __ATTRS_o_ai
13082 vec_lvrxl(int __a, const vector unsigned short *__b) {
13083 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13084 vec_lvsl(__a, (unsigned char *)__b));
13087 static __inline__ vector bool short __ATTRS_o_ai
13088 vec_lvrxl(int __a, const vector bool short *__b) {
13089 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13090 vec_lvsl(__a, (unsigned char *)__b));
13093 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13094 const vector pixel *__b) {
13095 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13096 vec_lvsl(__a, (unsigned char *)__b));
13099 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13100 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13103 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13104 const vector int *__b) {
13105 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13106 vec_lvsl(__a, (unsigned char *)__b));
13109 static __inline__ vector unsigned int __ATTRS_o_ai
13110 vec_lvrxl(int __a, const unsigned int *__b) {
13111 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13112 vec_lvsl(__a, __b));
13115 static __inline__ vector unsigned int __ATTRS_o_ai
13116 vec_lvrxl(int __a, const vector unsigned int *__b) {
13117 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13118 vec_lvsl(__a, (unsigned char *)__b));
13121 static __inline__ vector bool int __ATTRS_o_ai
13122 vec_lvrxl(int __a, const vector bool int *__b) {
13123 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13124 vec_lvsl(__a, (unsigned char *)__b));
13127 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13128 const float *__b) {
13129 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13132 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13133 const vector float *__b) {
13134 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13135 vec_lvsl(__a, (unsigned char *)__b));
13140 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13141 signed char *__c) {
13142 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13146 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13147 vector signed char *__c) {
13149 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13153 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13154 unsigned char *__c) {
13155 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13159 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13160 vector unsigned char *__c) {
13162 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13166 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13167 vector bool char *__c) {
13169 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13173 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13175 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13179 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13180 vector short *__c) {
13182 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13186 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13187 int __b, unsigned short *__c) {
13188 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13192 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13194 vector unsigned short *__c) {
13196 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13200 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
13201 vector bool short *__c) {
13203 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13207 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13208 vector pixel *__c) {
13210 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13214 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13216 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13220 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13223 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13227 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13228 unsigned int *__c) {
13229 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13233 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13234 vector unsigned int *__c) {
13236 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13240 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13241 vector bool int *__c) {
13243 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13247 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13248 vector float *__c) {
13250 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13256 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13257 signed char *__c) {
13258 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13262 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13263 vector signed char *__c) {
13265 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13269 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13270 int __b, unsigned char *__c) {
13271 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13275 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13277 vector unsigned char *__c) {
13279 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13283 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
13284 vector bool char *__c) {
13286 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13290 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13292 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13296 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13297 vector short *__c) {
13299 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13303 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13304 int __b, unsigned short *__c) {
13305 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13309 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13311 vector unsigned short *__c) {
13313 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13317 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
13318 vector bool short *__c) {
13320 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13324 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13325 vector pixel *__c) {
13327 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13331 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13333 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13337 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13340 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13344 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13345 unsigned int *__c) {
13346 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13350 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13351 vector unsigned int *__c) {
13353 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13357 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13358 vector bool int *__c) {
13360 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13364 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13365 vector float *__c) {
13367 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13373 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13374 signed char *__c) {
13375 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13379 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13380 vector signed char *__c) {
13382 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13386 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13387 unsigned char *__c) {
13388 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13392 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13393 vector unsigned char *__c) {
13395 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13399 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13400 vector bool char *__c) {
13402 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13406 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13408 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13412 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13413 vector short *__c) {
13415 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13419 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13420 int __b, unsigned short *__c) {
13421 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13425 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13427 vector unsigned short *__c) {
13429 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13433 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
13434 vector bool short *__c) {
13436 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13440 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13441 vector pixel *__c) {
13443 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13447 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13449 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13453 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13456 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13460 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13461 unsigned int *__c) {
13462 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13466 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13467 vector unsigned int *__c) {
13469 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13473 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13474 vector bool int *__c) {
13476 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13480 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13481 vector float *__c) {
13483 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13489 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13490 signed char *__c) {
13491 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13495 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13496 vector signed char *__c) {
13498 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13502 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13503 int __b, unsigned char *__c) {
13504 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13508 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13510 vector unsigned char *__c) {
13512 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13516 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
13517 vector bool char *__c) {
13519 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13523 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13525 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13529 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13530 vector short *__c) {
13532 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13536 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13537 int __b, unsigned short *__c) {
13538 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13542 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13544 vector unsigned short *__c) {
13546 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13550 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
13551 vector bool short *__c) {
13553 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13557 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13558 vector pixel *__c) {
13560 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13564 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13566 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13570 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13573 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13577 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13578 unsigned int *__c) {
13579 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13583 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13584 vector unsigned int *__c) {
13586 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13590 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13591 vector bool int *__c) {
13593 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13597 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13598 vector float *__c) {
13600 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13606 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13608 vector signed char __res = (vector signed char)(0);
13613 static __inline__ vector unsigned char __ATTRS_o_ai
13614 vec_promote(unsigned char __a, int __b) {
13615 vector unsigned char __res = (vector unsigned char)(0);
13620 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13621 vector short __res = (vector short)(0);
13626 static __inline__ vector unsigned short __ATTRS_o_ai
13627 vec_promote(unsigned short __a, int __b) {
13628 vector unsigned short __res = (vector unsigned short)(0);
13633 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13634 vector int __res = (vector int)(0);
13639 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13641 vector unsigned int __res = (vector unsigned int)(0);
13646 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13647 vector float __res = (vector float)(0);
13654 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13655 return (vector signed char)(__a);
13658 static __inline__ vector unsigned char __ATTRS_o_ai
13659 vec_splats(unsigned char __a) {
13660 return (vector unsigned char)(__a);
13663 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13664 return (vector short)(__a);
13667 static __inline__ vector unsigned short __ATTRS_o_ai
13668 vec_splats(unsigned short __a) {
13669 return (vector unsigned short)(__a);
13672 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13673 return (vector int)(__a);
13676 static __inline__ vector unsigned int __ATTRS_o_ai
13677 vec_splats(unsigned int __a) {
13678 return (vector unsigned int)(__a);
13682 static __inline__ vector signed long long __ATTRS_o_ai
13683 vec_splats(signed long long __a) {
13684 return (vector signed long long)(__a);
13687 static __inline__ vector unsigned long long __ATTRS_o_ai
13688 vec_splats(unsigned long long __a) {
13689 return (vector unsigned long long)(__a);
13692 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13693 static __inline__ vector signed __int128 __ATTRS_o_ai
13694 vec_splats(signed __int128 __a) {
13695 return (vector signed __int128)(__a);
13698 static __inline__ vector unsigned __int128 __ATTRS_o_ai
13699 vec_splats(unsigned __int128 __a) {
13700 return (vector unsigned __int128)(__a);
13705 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13706 return (vector double)(__a);
13710 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13711 return (vector float)(__a);
13714 /* ----------------------------- predicates --------------------------------- */
13718 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13719 vector signed char __b) {
13720 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13724 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13725 vector bool char __b) {
13726 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13730 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13731 vector unsigned char __b) {
13732 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13736 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13737 vector bool char __b) {
13738 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13742 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13743 vector signed char __b) {
13744 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13748 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13749 vector unsigned char __b) {
13750 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13754 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13755 vector bool char __b) {
13756 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13760 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13761 vector short __b) {
13762 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13765 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13766 vector bool short __b) {
13767 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13770 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13771 vector unsigned short __b) {
13772 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13773 (vector short)__b);
13776 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13777 vector bool short __b) {
13778 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13779 (vector short)__b);
13782 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13783 vector short __b) {
13784 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13785 (vector short)__b);
13788 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13789 vector unsigned short __b) {
13790 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13791 (vector short)__b);
13794 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13795 vector bool short __b) {
13796 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13797 (vector short)__b);
13800 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13801 vector pixel __b) {
13802 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13803 (vector short)__b);
13806 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13807 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13810 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13811 vector bool int __b) {
13812 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13815 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13816 vector unsigned int __b) {
13817 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13821 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13822 vector bool int __b) {
13823 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13827 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13829 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13833 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13834 vector unsigned int __b) {
13835 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13839 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13840 vector bool int __b) {
13841 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13845 #ifdef __POWER8_VECTOR__
13846 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13847 vector signed long long __b) {
13848 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13851 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13852 vector bool long long __b) {
13853 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13856 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13857 vector unsigned long long __b) {
13858 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13859 (vector long long)__b);
13862 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13863 vector bool long long __b) {
13864 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13865 (vector long long)__b);
13868 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13869 vector long long __b) {
13870 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13871 (vector long long)__b);
13874 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13875 vector unsigned long long __b) {
13876 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13877 (vector long long)__b);
13880 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13881 vector bool long long __b) {
13882 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13883 (vector long long)__b);
13887 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13888 vector float __b) {
13890 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13892 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13897 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13898 vector double __b) {
13899 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13905 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13906 vector signed char __b) {
13907 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13910 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13911 vector bool char __b) {
13912 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13915 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13916 vector unsigned char __b) {
13917 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13920 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13921 vector bool char __b) {
13922 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13925 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13926 vector signed char __b) {
13927 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13928 (vector unsigned char)__a);
13931 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13932 vector unsigned char __b) {
13933 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13936 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13937 vector bool char __b) {
13938 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13939 (vector unsigned char)__a);
13942 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13943 vector short __b) {
13944 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
13947 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13948 vector bool short __b) {
13949 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
13952 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13953 vector unsigned short __b) {
13954 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
13957 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13958 vector bool short __b) {
13959 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13963 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13964 vector short __b) {
13965 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13966 (vector unsigned short)__a);
13969 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13970 vector unsigned short __b) {
13971 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
13972 (vector unsigned short)__a);
13975 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13976 vector bool short __b) {
13977 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13978 (vector unsigned short)__a);
13981 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
13982 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
13985 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
13986 vector bool int __b) {
13987 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
13990 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
13991 vector unsigned int __b) {
13992 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
13995 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
13996 vector bool int __b) {
13997 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14000 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14002 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14003 (vector unsigned int)__a);
14006 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14007 vector unsigned int __b) {
14008 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14011 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14012 vector bool int __b) {
14013 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14014 (vector unsigned int)__a);
14017 #ifdef __POWER8_VECTOR__
14018 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14019 vector signed long long __b) {
14020 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14022 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14023 vector bool long long __b) {
14024 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14028 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14029 vector unsigned long long __b) {
14030 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14033 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14034 vector bool long long __b) {
14035 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14039 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14040 vector signed long long __b) {
14041 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14042 (vector unsigned long long)__a);
14045 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14046 vector unsigned long long __b) {
14047 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14048 (vector unsigned long long)__a);
14051 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14052 vector bool long long __b) {
14053 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14054 (vector unsigned long long)__a);
14058 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14059 vector float __b) {
14061 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14063 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14068 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14069 vector double __b) {
14070 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14076 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14077 vector signed char __b) {
14078 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14081 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14082 vector bool char __b) {
14083 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14086 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14087 vector unsigned char __b) {
14088 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14091 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14092 vector bool char __b) {
14093 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14096 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14097 vector signed char __b) {
14098 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14099 (vector unsigned char)__b);
14102 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14103 vector unsigned char __b) {
14104 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14107 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14108 vector bool char __b) {
14109 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14110 (vector unsigned char)__b);
14113 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14114 vector short __b) {
14115 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14118 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14119 vector bool short __b) {
14120 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14123 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14124 vector unsigned short __b) {
14125 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14128 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14129 vector bool short __b) {
14130 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14131 (vector unsigned short)__b);
14134 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14135 vector short __b) {
14136 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14137 (vector unsigned short)__b);
14140 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14141 vector unsigned short __b) {
14142 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14146 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14147 vector bool short __b) {
14148 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14149 (vector unsigned short)__b);
14152 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14153 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14156 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14157 vector bool int __b) {
14158 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14161 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14162 vector unsigned int __b) {
14163 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14166 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14167 vector bool int __b) {
14168 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14171 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14173 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14174 (vector unsigned int)__b);
14177 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14178 vector unsigned int __b) {
14179 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14182 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14183 vector bool int __b) {
14184 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14185 (vector unsigned int)__b);
14188 #ifdef __POWER8_VECTOR__
14189 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14190 vector signed long long __b) {
14191 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14193 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14194 vector bool long long __b) {
14195 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14196 (vector signed long long)__b);
14199 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14200 vector unsigned long long __b) {
14201 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14204 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14205 vector bool long long __b) {
14206 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14207 (vector unsigned long long)__b);
14210 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14211 vector signed long long __b) {
14212 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14213 (vector unsigned long long)__b);
14216 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14217 vector unsigned long long __b) {
14218 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14222 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14223 vector bool long long __b) {
14224 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14225 (vector unsigned long long)__b);
14229 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14230 vector float __b) {
14232 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14234 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14239 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14240 vector double __b) {
14241 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14247 static __inline__ int __attribute__((__always_inline__))
14248 vec_all_in(vector float __a, vector float __b) {
14249 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14254 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14255 vector signed char __b) {
14256 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14259 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14260 vector bool char __b) {
14261 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14264 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14265 vector unsigned char __b) {
14266 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14269 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14270 vector bool char __b) {
14271 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14274 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14275 vector signed char __b) {
14276 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14277 (vector unsigned char)__b);
14280 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14281 vector unsigned char __b) {
14282 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14285 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14286 vector bool char __b) {
14287 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14288 (vector unsigned char)__b);
14291 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14292 vector short __b) {
14293 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14296 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14297 vector bool short __b) {
14298 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14301 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14302 vector unsigned short __b) {
14303 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14306 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14307 vector bool short __b) {
14308 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14309 (vector unsigned short)__b);
14312 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14313 vector short __b) {
14314 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14315 (vector unsigned short)__b);
14318 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14319 vector unsigned short __b) {
14320 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14324 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14325 vector bool short __b) {
14326 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14327 (vector unsigned short)__b);
14330 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14331 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14334 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14335 vector bool int __b) {
14336 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14339 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14340 vector unsigned int __b) {
14341 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14344 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14345 vector bool int __b) {
14346 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14349 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14351 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14352 (vector unsigned int)__b);
14355 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14356 vector unsigned int __b) {
14357 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14360 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14361 vector bool int __b) {
14362 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14363 (vector unsigned int)__b);
14366 #ifdef __POWER8_VECTOR__
14367 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14368 vector signed long long __b) {
14369 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14372 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14373 vector unsigned long long __b) {
14374 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14377 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14378 vector bool long long __b) {
14379 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14380 (vector signed long long)__b);
14383 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14384 vector bool long long __b) {
14385 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14386 (vector unsigned long long)__b);
14389 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14390 vector signed long long __b) {
14391 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14392 (vector unsigned long long)__b);
14395 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14396 vector unsigned long long __b) {
14397 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14401 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14402 vector bool long long __b) {
14403 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14404 (vector unsigned long long)__b);
14408 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14409 vector float __b) {
14411 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14413 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14418 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14419 vector double __b) {
14420 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14426 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14427 vector signed char __b) {
14428 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14431 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14432 vector bool char __b) {
14433 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14436 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14437 vector unsigned char __b) {
14438 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14441 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14442 vector bool char __b) {
14443 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14446 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14447 vector signed char __b) {
14448 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14449 (vector unsigned char)__a);
14452 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14453 vector unsigned char __b) {
14454 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14457 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14458 vector bool char __b) {
14459 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14460 (vector unsigned char)__a);
14463 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14464 vector short __b) {
14465 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14468 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14469 vector bool short __b) {
14470 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14473 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14474 vector unsigned short __b) {
14475 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14478 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14479 vector bool short __b) {
14480 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14484 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14485 vector short __b) {
14486 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14487 (vector unsigned short)__a);
14490 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14491 vector unsigned short __b) {
14492 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14493 (vector unsigned short)__a);
14496 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14497 vector bool short __b) {
14498 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14499 (vector unsigned short)__a);
14502 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14503 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14506 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14507 vector bool int __b) {
14508 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14511 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14512 vector unsigned int __b) {
14513 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14516 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14517 vector bool int __b) {
14518 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14521 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14523 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14524 (vector unsigned int)__a);
14527 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14528 vector unsigned int __b) {
14529 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14532 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14533 vector bool int __b) {
14534 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14535 (vector unsigned int)__a);
14538 #ifdef __POWER8_VECTOR__
14539 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14540 vector signed long long __b) {
14541 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14544 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14545 vector unsigned long long __b) {
14546 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14549 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14550 vector bool long long __b) {
14551 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14555 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14556 vector bool long long __b) {
14557 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14561 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14562 vector signed long long __b) {
14563 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14564 (vector unsigned long long)__a);
14567 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14568 vector unsigned long long __b) {
14569 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14570 (vector unsigned long long)__a);
14573 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14574 vector bool long long __b) {
14575 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14576 (vector unsigned long long)__a);
14580 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14581 vector float __b) {
14583 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14585 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14590 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14591 vector double __b) {
14592 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14598 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14600 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14602 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14607 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14608 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14614 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14615 vector signed char __b) {
14616 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14620 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14621 vector bool char __b) {
14622 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14626 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14627 vector unsigned char __b) {
14628 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14632 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14633 vector bool char __b) {
14634 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14638 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14639 vector signed char __b) {
14640 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14644 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14645 vector unsigned char __b) {
14646 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14650 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14651 vector bool char __b) {
14652 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14656 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14657 vector short __b) {
14658 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14661 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14662 vector bool short __b) {
14663 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14666 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14667 vector unsigned short __b) {
14668 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14669 (vector short)__b);
14672 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14673 vector bool short __b) {
14674 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14675 (vector short)__b);
14678 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14679 vector short __b) {
14680 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14681 (vector short)__b);
14684 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14685 vector unsigned short __b) {
14686 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14687 (vector short)__b);
14690 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14691 vector bool short __b) {
14692 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14693 (vector short)__b);
14696 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14697 vector pixel __b) {
14698 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14699 (vector short)__b);
14702 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14703 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14706 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14707 vector bool int __b) {
14708 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14711 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14712 vector unsigned int __b) {
14713 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14717 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14718 vector bool int __b) {
14719 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14723 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14725 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14729 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14730 vector unsigned int __b) {
14731 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14735 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14736 vector bool int __b) {
14737 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14741 #ifdef __POWER8_VECTOR__
14742 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14743 vector signed long long __b) {
14744 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14747 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14748 vector unsigned long long __b) {
14749 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14750 (vector long long)__b);
14753 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14754 vector bool long long __b) {
14755 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14756 (vector signed long long)__b);
14759 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14760 vector bool long long __b) {
14761 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14762 (vector signed long long)__b);
14765 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14766 vector signed long long __b) {
14767 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14768 (vector signed long long)__b);
14771 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14772 vector unsigned long long __b) {
14773 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14774 (vector signed long long)__b);
14777 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14778 vector bool long long __b) {
14779 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14780 (vector signed long long)__b);
14784 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14785 vector float __b) {
14787 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, (vector double)__a, (vector double)__b);
14789 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14794 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14795 vector double __b) {
14796 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14802 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14803 vector float __b) {
14805 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14807 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14812 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14813 vector double __b) {
14814 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14820 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14821 vector float __b) {
14823 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14825 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14830 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14831 vector double __b) {
14832 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14838 static __inline__ int __attribute__((__always_inline__))
14839 vec_all_nle(vector float __a, vector float __b) {
14840 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14845 static __inline__ int __attribute__((__always_inline__))
14846 vec_all_nlt(vector float __a, vector float __b) {
14847 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14850 /* vec_all_numeric */
14852 static __inline__ int __attribute__((__always_inline__))
14853 vec_all_numeric(vector float __a) {
14854 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14859 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14860 vector signed char __b) {
14861 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14865 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14866 vector bool char __b) {
14867 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14871 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14872 vector unsigned char __b) {
14873 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14877 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14878 vector bool char __b) {
14879 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14883 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14884 vector signed char __b) {
14885 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14889 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14890 vector unsigned char __b) {
14891 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14895 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14896 vector bool char __b) {
14897 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14901 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14902 vector short __b) {
14903 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14906 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14907 vector bool short __b) {
14908 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14911 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14912 vector unsigned short __b) {
14913 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14914 (vector short)__b);
14917 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14918 vector bool short __b) {
14919 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14920 (vector short)__b);
14923 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14924 vector short __b) {
14925 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14926 (vector short)__b);
14929 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14930 vector unsigned short __b) {
14931 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14932 (vector short)__b);
14935 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14936 vector bool short __b) {
14937 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14938 (vector short)__b);
14941 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14942 vector pixel __b) {
14943 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14944 (vector short)__b);
14947 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
14948 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
14951 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
14952 vector bool int __b) {
14953 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
14956 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14957 vector unsigned int __b) {
14958 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14962 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14963 vector bool int __b) {
14964 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14968 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14970 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14974 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14975 vector unsigned int __b) {
14976 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14980 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14981 vector bool int __b) {
14982 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14986 #ifdef __POWER8_VECTOR__
14987 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14988 vector signed long long __b) {
14989 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
14992 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
14993 vector unsigned long long __b) {
14994 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
14995 (vector long long)__b);
14998 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14999 vector bool long long __b) {
15000 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
15001 (vector signed long long)__b);
15004 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15005 vector bool long long __b) {
15006 return __builtin_altivec_vcmpequd_p(
15007 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15010 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15011 vector signed long long __b) {
15012 return __builtin_altivec_vcmpequd_p(
15013 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15016 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15017 vector unsigned long long __b) {
15018 return __builtin_altivec_vcmpequd_p(
15019 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15022 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15023 vector bool long long __b) {
15024 return __builtin_altivec_vcmpequd_p(
15025 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15029 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15030 vector float __b) {
15032 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15034 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15039 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15040 vector double __b) {
15041 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15047 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15048 vector signed char __b) {
15049 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15052 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15053 vector bool char __b) {
15054 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15058 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15059 vector unsigned char __b) {
15060 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15063 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15064 vector bool char __b) {
15065 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15069 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15070 vector signed char __b) {
15071 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15072 (vector unsigned char)__a);
15075 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15076 vector unsigned char __b) {
15077 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15078 (vector unsigned char)__a);
15081 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15082 vector bool char __b) {
15083 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15084 (vector unsigned char)__a);
15087 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15088 vector short __b) {
15089 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15092 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15093 vector bool short __b) {
15094 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15097 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15098 vector unsigned short __b) {
15099 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15102 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15103 vector bool short __b) {
15104 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15108 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15109 vector short __b) {
15110 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15111 (vector unsigned short)__a);
15114 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15115 vector unsigned short __b) {
15116 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15117 (vector unsigned short)__a);
15120 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15121 vector bool short __b) {
15122 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15123 (vector unsigned short)__a);
15126 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15127 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15130 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15131 vector bool int __b) {
15132 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15135 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15136 vector unsigned int __b) {
15137 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15140 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15141 vector bool int __b) {
15142 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15146 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15148 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15149 (vector unsigned int)__a);
15152 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15153 vector unsigned int __b) {
15154 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15155 (vector unsigned int)__a);
15158 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15159 vector bool int __b) {
15160 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15161 (vector unsigned int)__a);
15164 #ifdef __POWER8_VECTOR__
15165 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15166 vector signed long long __b) {
15167 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15170 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15171 vector unsigned long long __b) {
15172 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15175 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15176 vector bool long long __b) {
15177 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15178 (vector signed long long)__b, __a);
15181 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15182 vector bool long long __b) {
15183 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15184 (vector unsigned long long)__b, __a);
15187 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15188 vector signed long long __b) {
15189 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15190 (vector unsigned long long)__b,
15191 (vector unsigned long long)__a);
15194 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15195 vector unsigned long long __b) {
15196 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15197 (vector unsigned long long)__a);
15200 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15201 vector bool long long __b) {
15202 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15203 (vector unsigned long long)__b,
15204 (vector unsigned long long)__a);
15208 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15209 vector float __b) {
15211 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15213 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15218 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15219 vector double __b) {
15220 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15226 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15227 vector signed char __b) {
15228 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15231 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15232 vector bool char __b) {
15233 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15234 (vector signed char)__b);
15237 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15238 vector unsigned char __b) {
15239 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15242 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15243 vector bool char __b) {
15244 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15245 (vector unsigned char)__b);
15248 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15249 vector signed char __b) {
15250 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15251 (vector unsigned char)__b);
15254 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15255 vector unsigned char __b) {
15256 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15260 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15261 vector bool char __b) {
15262 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15263 (vector unsigned char)__b);
15266 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15267 vector short __b) {
15268 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15271 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15272 vector bool short __b) {
15273 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15276 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15277 vector unsigned short __b) {
15278 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15281 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15282 vector bool short __b) {
15283 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15284 (vector unsigned short)__b);
15287 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15288 vector short __b) {
15289 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15290 (vector unsigned short)__b);
15293 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15294 vector unsigned short __b) {
15295 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15299 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15300 vector bool short __b) {
15301 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15302 (vector unsigned short)__b);
15305 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15306 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15309 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15310 vector bool int __b) {
15311 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15314 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15315 vector unsigned int __b) {
15316 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15319 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15320 vector bool int __b) {
15321 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15322 (vector unsigned int)__b);
15325 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15327 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15328 (vector unsigned int)__b);
15331 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15332 vector unsigned int __b) {
15333 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15337 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15338 vector bool int __b) {
15339 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15340 (vector unsigned int)__b);
15343 #ifdef __POWER8_VECTOR__
15344 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15345 vector signed long long __b) {
15346 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15349 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15350 vector unsigned long long __b) {
15351 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15354 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15355 vector bool long long __b) {
15356 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15357 (vector signed long long)__b);
15360 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15361 vector bool long long __b) {
15362 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15363 (vector unsigned long long)__b);
15366 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15367 vector signed long long __b) {
15368 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15369 (vector unsigned long long)__a,
15370 (vector unsigned long long)__b);
15373 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15374 vector unsigned long long __b) {
15375 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15376 (vector unsigned long long)__a, __b);
15379 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15380 vector bool long long __b) {
15381 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15382 (vector unsigned long long)__a,
15383 (vector unsigned long long)__b);
15387 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15388 vector float __b) {
15390 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15392 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15397 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15398 vector double __b) {
15399 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15405 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15406 vector signed char __b) {
15407 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15410 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15411 vector bool char __b) {
15412 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15413 (vector signed char)__b);
15416 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15417 vector unsigned char __b) {
15418 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15421 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15422 vector bool char __b) {
15423 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15424 (vector unsigned char)__b);
15427 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15428 vector signed char __b) {
15429 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15430 (vector unsigned char)__b);
15433 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15434 vector unsigned char __b) {
15435 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15439 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15440 vector bool char __b) {
15441 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15442 (vector unsigned char)__b);
15445 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15446 vector short __b) {
15447 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15450 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15451 vector bool short __b) {
15452 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15455 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15456 vector unsigned short __b) {
15457 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15460 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15461 vector bool short __b) {
15462 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15463 (vector unsigned short)__b);
15466 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15467 vector short __b) {
15468 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15469 (vector unsigned short)__b);
15472 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15473 vector unsigned short __b) {
15474 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15478 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15479 vector bool short __b) {
15480 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15481 (vector unsigned short)__b);
15484 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15485 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15488 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15489 vector bool int __b) {
15490 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15493 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15494 vector unsigned int __b) {
15495 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15498 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15499 vector bool int __b) {
15500 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15501 (vector unsigned int)__b);
15504 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15506 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15507 (vector unsigned int)__b);
15510 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15511 vector unsigned int __b) {
15512 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15516 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15517 vector bool int __b) {
15518 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15519 (vector unsigned int)__b);
15522 #ifdef __POWER8_VECTOR__
15523 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15524 vector signed long long __b) {
15525 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15528 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15529 vector unsigned long long __b) {
15530 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15533 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15534 vector bool long long __b) {
15535 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15536 (vector signed long long)__b);
15539 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15540 vector bool long long __b) {
15541 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15542 (vector unsigned long long)__b);
15545 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15546 vector signed long long __b) {
15547 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15548 (vector unsigned long long)__a,
15549 (vector unsigned long long)__b);
15552 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15553 vector unsigned long long __b) {
15554 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15555 (vector unsigned long long)__a, __b);
15558 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15559 vector bool long long __b) {
15560 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15561 (vector unsigned long long)__a,
15562 (vector unsigned long long)__b);
15566 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15567 vector float __b) {
15569 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15571 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15576 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15577 vector double __b) {
15578 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15584 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15585 vector signed char __b) {
15586 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15589 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15590 vector bool char __b) {
15591 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15595 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15596 vector unsigned char __b) {
15597 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15600 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15601 vector bool char __b) {
15602 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15606 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15607 vector signed char __b) {
15608 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15609 (vector unsigned char)__a);
15612 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15613 vector unsigned char __b) {
15614 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15615 (vector unsigned char)__a);
15618 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15619 vector bool char __b) {
15620 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15621 (vector unsigned char)__a);
15624 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15625 vector short __b) {
15626 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15629 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15630 vector bool short __b) {
15631 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15634 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15635 vector unsigned short __b) {
15636 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15639 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15640 vector bool short __b) {
15641 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15645 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15646 vector short __b) {
15647 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15648 (vector unsigned short)__a);
15651 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15652 vector unsigned short __b) {
15653 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15654 (vector unsigned short)__a);
15657 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15658 vector bool short __b) {
15659 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15660 (vector unsigned short)__a);
15663 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15664 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15667 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15668 vector bool int __b) {
15669 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15672 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15673 vector unsigned int __b) {
15674 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15677 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15678 vector bool int __b) {
15679 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15683 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15685 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15686 (vector unsigned int)__a);
15689 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15690 vector unsigned int __b) {
15691 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15692 (vector unsigned int)__a);
15695 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15696 vector bool int __b) {
15697 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15698 (vector unsigned int)__a);
15701 #ifdef __POWER8_VECTOR__
15702 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15703 vector signed long long __b) {
15704 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15707 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15708 vector unsigned long long __b) {
15709 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15712 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15713 vector bool long long __b) {
15714 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15715 (vector signed long long)__b, __a);
15718 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15719 vector bool long long __b) {
15720 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15721 (vector unsigned long long)__b, __a);
15724 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15725 vector signed long long __b) {
15726 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15727 (vector unsigned long long)__b,
15728 (vector unsigned long long)__a);
15731 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15732 vector unsigned long long __b) {
15733 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15734 (vector unsigned long long)__a);
15737 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15738 vector bool long long __b) {
15739 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15740 (vector unsigned long long)__b,
15741 (vector unsigned long long)__a);
15745 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15746 vector float __b) {
15748 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15750 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15755 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15756 vector double __b) {
15757 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15763 static __inline__ int __attribute__((__always_inline__))
15764 vec_any_nan(vector float __a) {
15765 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15770 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15771 vector signed char __b) {
15772 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15776 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15777 vector bool char __b) {
15778 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15782 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15783 vector unsigned char __b) {
15784 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15788 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15789 vector bool char __b) {
15790 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15794 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15795 vector signed char __b) {
15796 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15800 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15801 vector unsigned char __b) {
15802 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15806 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15807 vector bool char __b) {
15808 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15812 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15813 vector short __b) {
15814 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15817 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15818 vector bool short __b) {
15819 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15822 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15823 vector unsigned short __b) {
15824 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15825 (vector short)__b);
15828 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15829 vector bool short __b) {
15830 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15831 (vector short)__b);
15834 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15835 vector short __b) {
15836 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15837 (vector short)__b);
15840 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15841 vector unsigned short __b) {
15842 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15843 (vector short)__b);
15846 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15847 vector bool short __b) {
15848 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15849 (vector short)__b);
15852 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15853 vector pixel __b) {
15854 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15855 (vector short)__b);
15858 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15859 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15862 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15863 vector bool int __b) {
15864 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15867 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15868 vector unsigned int __b) {
15869 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15873 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15874 vector bool int __b) {
15875 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15879 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15881 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15885 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15886 vector unsigned int __b) {
15887 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15891 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15892 vector bool int __b) {
15893 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15897 #ifdef __POWER8_VECTOR__
15898 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15899 vector signed long long __b) {
15900 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15903 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15904 vector unsigned long long __b) {
15905 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15906 (vector long long)__b);
15909 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15910 vector bool long long __b) {
15911 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15912 (vector signed long long)__b);
15915 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15916 vector bool long long __b) {
15917 return __builtin_altivec_vcmpequd_p(
15918 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15921 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15922 vector signed long long __b) {
15923 return __builtin_altivec_vcmpequd_p(
15924 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15927 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15928 vector unsigned long long __b) {
15929 return __builtin_altivec_vcmpequd_p(
15930 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15933 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15934 vector bool long long __b) {
15935 return __builtin_altivec_vcmpequd_p(
15936 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15940 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15941 vector float __b) {
15943 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
15945 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
15950 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
15951 vector double __b) {
15952 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
15958 static __inline__ int __attribute__((__always_inline__))
15959 vec_any_nge(vector float __a, vector float __b) {
15960 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
15965 static __inline__ int __attribute__((__always_inline__))
15966 vec_any_ngt(vector float __a, vector float __b) {
15967 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
15972 static __inline__ int __attribute__((__always_inline__))
15973 vec_any_nle(vector float __a, vector float __b) {
15974 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
15979 static __inline__ int __attribute__((__always_inline__))
15980 vec_any_nlt(vector float __a, vector float __b) {
15981 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
15984 /* vec_any_numeric */
15986 static __inline__ int __attribute__((__always_inline__))
15987 vec_any_numeric(vector float __a) {
15988 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
15993 static __inline__ int __attribute__((__always_inline__))
15994 vec_any_out(vector float __a, vector float __b) {
15995 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
15998 /* Power 8 Crypto functions
15999 Note: We diverge from the current GCC implementation with regard
16000 to cryptography and related functions as follows:
16001 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
16002 - The remaining ones are only available on Power8 and up so
16003 require -mpower8-vector
16004 The justification for this is that export requirements require that
16005 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16006 support). As a result, we need to be able to turn off support for those.
16007 The remaining ones (currently controlled by -mcrypto for GCC) still
16008 need to be provided on compliant hardware even if Vector.Crypto is not
16012 #define vec_sbox_be __builtin_altivec_crypto_vsbox
16013 #define vec_cipher_be __builtin_altivec_crypto_vcipher
16014 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16015 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16016 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16018 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16019 __builtin_crypto_vsbox(vector unsigned long long __a) {
16020 return __builtin_altivec_crypto_vsbox(__a);
16023 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16024 __builtin_crypto_vcipher(vector unsigned long long __a,
16025 vector unsigned long long __b) {
16026 return __builtin_altivec_crypto_vcipher(__a, __b);
16029 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16030 __builtin_crypto_vcipherlast(vector unsigned long long __a,
16031 vector unsigned long long __b) {
16032 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16035 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16036 __builtin_crypto_vncipher(vector unsigned long long __a,
16037 vector unsigned long long __b) {
16038 return __builtin_altivec_crypto_vncipher(__a, __b);
16041 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16042 __builtin_crypto_vncipherlast(vector unsigned long long __a,
16043 vector unsigned long long __b) {
16044 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16047 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16048 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16050 #define vec_shasigma_be(X, Y, Z) \
16051 _Generic((X), vector unsigned int \
16052 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16053 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16056 #ifdef __POWER8_VECTOR__
16057 static __inline__ vector bool char __ATTRS_o_ai
16058 vec_permxor(vector bool char __a, vector bool char __b,
16059 vector bool char __c) {
16060 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16063 static __inline__ vector signed char __ATTRS_o_ai
16064 vec_permxor(vector signed char __a, vector signed char __b,
16065 vector signed char __c) {
16066 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16069 static __inline__ vector unsigned char __ATTRS_o_ai
16070 vec_permxor(vector unsigned char __a, vector unsigned char __b,
16071 vector unsigned char __c) {
16072 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16075 static __inline__ vector unsigned char __ATTRS_o_ai
16076 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16077 vector unsigned char __c) {
16078 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16081 static __inline__ vector unsigned short __ATTRS_o_ai
16082 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16083 vector unsigned short __c) {
16084 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16085 (vector unsigned char)__a, (vector unsigned char)__b,
16086 (vector unsigned char)__c);
16089 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16090 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16091 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16092 (vector unsigned char)__a, (vector unsigned char)__b,
16093 (vector unsigned char)__c);
16096 static __inline__ vector unsigned long long __ATTRS_o_ai
16097 __builtin_crypto_vpermxor(vector unsigned long long __a,
16098 vector unsigned long long __b,
16099 vector unsigned long long __c) {
16100 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16101 (vector unsigned char)__a, (vector unsigned char)__b,
16102 (vector unsigned char)__c);
16105 static __inline__ vector unsigned char __ATTRS_o_ai
16106 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16107 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16110 static __inline__ vector unsigned short __ATTRS_o_ai
16111 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16112 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16115 static __inline__ vector unsigned int __ATTRS_o_ai
16116 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16117 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16120 static __inline__ vector unsigned long long __ATTRS_o_ai
16121 __builtin_crypto_vpmsumb(vector unsigned long long __a,
16122 vector unsigned long long __b) {
16123 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16126 static __inline__ vector signed char __ATTRS_o_ai
16127 vec_vgbbd(vector signed char __a) {
16128 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16131 #define vec_pmsum_be __builtin_crypto_vpmsumb
16132 #define vec_gb __builtin_altivec_vgbbd
16134 static __inline__ vector unsigned char __ATTRS_o_ai
16135 vec_vgbbd(vector unsigned char __a) {
16136 return __builtin_altivec_vgbbd(__a);
16139 static __inline__ vector long long __ATTRS_o_ai
16140 vec_vbpermq(vector signed char __a, vector signed char __b) {
16141 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16142 (vector unsigned char)__b);
16145 static __inline__ vector long long __ATTRS_o_ai
16146 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16147 return __builtin_altivec_vbpermq(__a, __b);
16150 #ifdef __powerpc64__
16151 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16152 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16153 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16154 (vector unsigned char)__b);
16162 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16163 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16167 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16168 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16172 static inline __ATTRS_o_ai vector unsigned char
16173 vec_reve(vector unsigned char __a) {
16174 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16178 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16179 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16182 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16183 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16186 static inline __ATTRS_o_ai vector unsigned int
16187 vec_reve(vector unsigned int __a) {
16188 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16191 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16192 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16195 static inline __ATTRS_o_ai vector signed short
16196 vec_reve(vector signed short __a) {
16197 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16200 static inline __ATTRS_o_ai vector unsigned short
16201 vec_reve(vector unsigned short __a) {
16202 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16205 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16206 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16210 static inline __ATTRS_o_ai vector bool long long
16211 vec_reve(vector bool long long __a) {
16212 return __builtin_shufflevector(__a, __a, 1, 0);
16215 static inline __ATTRS_o_ai vector signed long long
16216 vec_reve(vector signed long long __a) {
16217 return __builtin_shufflevector(__a, __a, 1, 0);
16220 static inline __ATTRS_o_ai vector unsigned long long
16221 vec_reve(vector unsigned long long __a) {
16222 return __builtin_shufflevector(__a, __a, 1, 0);
16225 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16226 return __builtin_shufflevector(__a, __a, 1, 0);
16231 static __inline__ vector bool char __ATTRS_o_ai
16232 vec_revb(vector bool char __a) {
16236 static __inline__ vector signed char __ATTRS_o_ai
16237 vec_revb(vector signed char __a) {
16241 static __inline__ vector unsigned char __ATTRS_o_ai
16242 vec_revb(vector unsigned char __a) {
16246 static __inline__ vector bool short __ATTRS_o_ai
16247 vec_revb(vector bool short __a) {
16248 vector unsigned char __indices =
16249 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16250 return vec_perm(__a, __a, __indices);
16253 static __inline__ vector signed short __ATTRS_o_ai
16254 vec_revb(vector signed short __a) {
16255 vector unsigned char __indices =
16256 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16257 return vec_perm(__a, __a, __indices);
16260 static __inline__ vector unsigned short __ATTRS_o_ai
16261 vec_revb(vector unsigned short __a) {
16262 vector unsigned char __indices =
16263 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16264 return vec_perm(__a, __a, __indices);
16267 static __inline__ vector bool int __ATTRS_o_ai
16268 vec_revb(vector bool int __a) {
16269 vector unsigned char __indices =
16270 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16271 return vec_perm(__a, __a, __indices);
16274 static __inline__ vector signed int __ATTRS_o_ai
16275 vec_revb(vector signed int __a) {
16276 vector unsigned char __indices =
16277 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16278 return vec_perm(__a, __a, __indices);
16281 static __inline__ vector unsigned int __ATTRS_o_ai
16282 vec_revb(vector unsigned int __a) {
16283 vector unsigned char __indices =
16284 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16285 return vec_perm(__a, __a, __indices);
16288 static __inline__ vector float __ATTRS_o_ai
16289 vec_revb(vector float __a) {
16290 vector unsigned char __indices =
16291 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16292 return vec_perm(__a, __a, __indices);
16296 static __inline__ vector bool long long __ATTRS_o_ai
16297 vec_revb(vector bool long long __a) {
16298 vector unsigned char __indices =
16299 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16300 return vec_perm(__a, __a, __indices);
16303 static __inline__ vector signed long long __ATTRS_o_ai
16304 vec_revb(vector signed long long __a) {
16305 vector unsigned char __indices =
16306 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16307 return vec_perm(__a, __a, __indices);
16310 static __inline__ vector unsigned long long __ATTRS_o_ai
16311 vec_revb(vector unsigned long long __a) {
16312 vector unsigned char __indices =
16313 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16314 return vec_perm(__a, __a, __indices);
16317 static __inline__ vector double __ATTRS_o_ai
16318 vec_revb(vector double __a) {
16319 vector unsigned char __indices =
16320 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16321 return vec_perm(__a, __a, __indices);
16323 #endif /* End __VSX__ */
16325 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16326 static __inline__ vector signed __int128 __ATTRS_o_ai
16327 vec_revb(vector signed __int128 __a) {
16328 vector unsigned char __indices =
16329 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16330 return (vector signed __int128)vec_perm((vector signed int)__a,
16331 (vector signed int)__a,
16335 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16336 vec_revb(vector unsigned __int128 __a) {
16337 vector unsigned char __indices =
16338 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16339 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16340 (vector signed int)__a,
16343 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16347 typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16348 typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16349 typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
16350 typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
16351 typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16352 typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16353 typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16355 static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16356 signed char *__ptr) {
16357 return *(unaligned_vec_schar *)(__ptr + __offset);
16360 static inline __ATTRS_o_ai vector unsigned char
16361 vec_xl(signed long long __offset, unsigned char *__ptr) {
16362 return *(unaligned_vec_uchar*)(__ptr + __offset);
16365 static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16366 signed short *__ptr) {
16367 return *(unaligned_vec_sshort *)(__ptr + __offset);
16370 static inline __ATTRS_o_ai vector unsigned short
16371 vec_xl(signed long long __offset, unsigned short *__ptr) {
16372 return *(unaligned_vec_ushort *)(__ptr + __offset);
16375 static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16376 signed int *__ptr) {
16377 return *(unaligned_vec_sint *)(__ptr + __offset);
16380 static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16381 unsigned int *__ptr) {
16382 return *(unaligned_vec_uint *)(__ptr + __offset);
16385 static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16387 return *(unaligned_vec_float *)(__ptr + __offset);
16391 typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
16392 typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16393 typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16395 static inline __ATTRS_o_ai vector signed long long
16396 vec_xl(signed long long __offset, signed long long *__ptr) {
16397 return *(unaligned_vec_sll *)(__ptr + __offset);
16400 static inline __ATTRS_o_ai vector unsigned long long
16401 vec_xl(signed long long __offset, unsigned long long *__ptr) {
16402 return *(unaligned_vec_ull *)(__ptr + __offset);
16405 static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16407 return *(unaligned_vec_double *)(__ptr + __offset);
16411 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16412 typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16413 typedef vector unsigned __int128 unaligned_vec_ui128
16414 __attribute__((aligned(1)));
16415 static inline __ATTRS_o_ai vector signed __int128
16416 vec_xl(signed long long __offset, signed __int128 *__ptr) {
16417 return *(unaligned_vec_si128 *)(__ptr + __offset);
16420 static inline __ATTRS_o_ai vector unsigned __int128
16421 vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
16422 return *(unaligned_vec_ui128 *)(__ptr + __offset);
16428 #ifdef __LITTLE_ENDIAN__
16429 static __inline__ vector signed char __ATTRS_o_ai
16430 vec_xl_be(signed long long __offset, signed char *__ptr) {
16431 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16432 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16433 13, 12, 11, 10, 9, 8);
16436 static __inline__ vector unsigned char __ATTRS_o_ai
16437 vec_xl_be(signed long long __offset, unsigned char *__ptr) {
16438 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16439 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16440 13, 12, 11, 10, 9, 8);
16443 static __inline__ vector signed short __ATTRS_o_ai
16444 vec_xl_be(signed long long __offset, signed short *__ptr) {
16445 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16446 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16449 static __inline__ vector unsigned short __ATTRS_o_ai
16450 vec_xl_be(signed long long __offset, unsigned short *__ptr) {
16451 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16452 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16455 static __inline__ vector signed int __ATTRS_o_ai
16456 vec_xl_be(signed long long __offset, signed int *__ptr) {
16457 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16460 static __inline__ vector unsigned int __ATTRS_o_ai
16461 vec_xl_be(signed long long __offset, unsigned int *__ptr) {
16462 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16465 static __inline__ vector float __ATTRS_o_ai
16466 vec_xl_be(signed long long __offset, float *__ptr) {
16467 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16471 static __inline__ vector signed long long __ATTRS_o_ai
16472 vec_xl_be(signed long long __offset, signed long long *__ptr) {
16473 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16476 static __inline__ vector unsigned long long __ATTRS_o_ai
16477 vec_xl_be(signed long long __offset, unsigned long long *__ptr) {
16478 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16481 static __inline__ vector double __ATTRS_o_ai
16482 vec_xl_be(signed long long __offset, double *__ptr) {
16483 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16487 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16488 static __inline__ vector signed __int128 __ATTRS_o_ai
16489 vec_xl_be(signed long long __offset, signed __int128 *__ptr) {
16490 return vec_xl(__offset, __ptr);
16493 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16494 vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
16495 return vec_xl(__offset, __ptr);
16499 #define vec_xl_be vec_xl
16504 static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16505 signed long long __offset,
16506 signed char *__ptr) {
16507 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
16510 static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16511 signed long long __offset,
16512 unsigned char *__ptr) {
16513 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
16516 static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16517 signed long long __offset,
16518 signed short *__ptr) {
16519 *(unaligned_vec_sshort *)(__ptr + __offset) = __vec;
16522 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16523 signed long long __offset,
16524 unsigned short *__ptr) {
16525 *(unaligned_vec_ushort *)(__ptr + __offset) = __vec;
16528 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16529 signed long long __offset,
16530 signed int *__ptr) {
16531 *(unaligned_vec_sint *)(__ptr + __offset) = __vec;
16534 static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16535 signed long long __offset,
16536 unsigned int *__ptr) {
16537 *(unaligned_vec_uint *)(__ptr + __offset) = __vec;
16540 static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16541 signed long long __offset,
16543 *(unaligned_vec_float *)(__ptr + __offset) = __vec;
16547 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16548 signed long long __offset,
16549 signed long long *__ptr) {
16550 *(unaligned_vec_sll *)(__ptr + __offset) = __vec;
16553 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16554 signed long long __offset,
16555 unsigned long long *__ptr) {
16556 *(unaligned_vec_ull *)(__ptr + __offset) = __vec;
16559 static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16560 signed long long __offset,
16562 *(unaligned_vec_double *)(__ptr + __offset) = __vec;
16566 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16567 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16568 signed long long __offset,
16569 signed __int128 *__ptr) {
16570 *(unaligned_vec_si128 *)(__ptr + __offset) = __vec;
16573 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16574 signed long long __offset,
16575 unsigned __int128 *__ptr) {
16576 *(unaligned_vec_ui128 *)(__ptr + __offset) = __vec;
16582 #ifdef __LITTLE_ENDIAN__
16583 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16584 signed long long __offset,
16585 signed char *__ptr) {
16586 vector signed char __tmp =
16587 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16588 13, 12, 11, 10, 9, 8);
16589 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16590 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16593 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16594 signed long long __offset,
16595 unsigned char *__ptr) {
16596 vector unsigned char __tmp =
16597 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16598 13, 12, 11, 10, 9, 8);
16599 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16600 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16603 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16604 signed long long __offset,
16605 signed short *__ptr) {
16606 vector signed short __tmp =
16607 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16608 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16609 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16612 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16613 signed long long __offset,
16614 unsigned short *__ptr) {
16615 vector unsigned short __tmp =
16616 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16617 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16618 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16621 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16622 signed long long __offset,
16623 signed int *__ptr) {
16624 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16627 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16628 signed long long __offset,
16629 unsigned int *__ptr) {
16630 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16633 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16634 signed long long __offset,
16636 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16640 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16641 signed long long __offset,
16642 signed long long *__ptr) {
16643 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16646 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16647 signed long long __offset,
16648 unsigned long long *__ptr) {
16649 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16652 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16653 signed long long __offset,
16655 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16659 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16660 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16661 signed long long __offset,
16662 signed __int128 *__ptr) {
16663 vec_xst(__vec, __offset, __ptr);
16666 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16667 signed long long __offset,
16668 unsigned __int128 *__ptr) {
16669 vec_xst(__vec, __offset, __ptr);
16673 #define vec_xst_be vec_xst
16676 #ifdef __POWER9_VECTOR__
16677 #define vec_test_data_class(__a, __b) \
16679 (__a), vector float \
16680 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
16682 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
16685 #endif /* #ifdef __POWER9_VECTOR__ */
16687 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16692 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16698 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16699 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16704 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16708 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16712 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16716 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16717 return - vec_abs(__a);
16721 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16722 return - vec_abs(__a);
16727 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16728 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16729 return __builtin_altivec_vminsd(__a, -__a);
16733 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16734 return __builtin_altivec_vminsw(__a, -__a);
16737 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16738 return __builtin_altivec_vminsh(__a, -__a);
16741 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16742 return __builtin_altivec_vminsb(__a, -__a);
16744 #undef __ATTRS_o_ai
16746 #endif /* __ALTIVEC_H */