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 int __ATTRS_o_ai
1770 vec_cmpne(vector float __a, vector float __b) {
1771 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1777 static __inline__ vector bool char __ATTRS_o_ai
1778 vec_cmpnez(vector signed char __a, vector signed char __b) {
1779 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1783 static __inline__ vector bool char __ATTRS_o_ai
1784 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1785 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1789 static __inline__ vector bool short __ATTRS_o_ai
1790 vec_cmpnez(vector signed short __a, vector signed short __b) {
1791 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1795 static __inline__ vector bool short __ATTRS_o_ai
1796 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1797 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1801 static __inline__ vector bool int __ATTRS_o_ai
1802 vec_cmpnez(vector signed int __a, vector signed int __b) {
1803 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1807 static __inline__ vector bool int __ATTRS_o_ai
1808 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1809 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1813 static __inline__ signed int __ATTRS_o_ai
1814 vec_cntlz_lsbb(vector signed char __a) {
1815 #ifdef __LITTLE_ENDIAN__
1816 return __builtin_altivec_vctzlsbb(__a);
1818 return __builtin_altivec_vclzlsbb(__a);
1822 static __inline__ signed int __ATTRS_o_ai
1823 vec_cntlz_lsbb(vector unsigned char __a) {
1824 #ifdef __LITTLE_ENDIAN__
1825 return __builtin_altivec_vctzlsbb(__a);
1827 return __builtin_altivec_vclzlsbb(__a);
1831 static __inline__ signed int __ATTRS_o_ai
1832 vec_cnttz_lsbb(vector signed char __a) {
1833 #ifdef __LITTLE_ENDIAN__
1834 return __builtin_altivec_vclzlsbb(__a);
1836 return __builtin_altivec_vctzlsbb(__a);
1840 static __inline__ signed int __ATTRS_o_ai
1841 vec_cnttz_lsbb(vector unsigned char __a) {
1842 #ifdef __LITTLE_ENDIAN__
1843 return __builtin_altivec_vclzlsbb(__a);
1845 return __builtin_altivec_vctzlsbb(__a);
1849 static __inline__ vector unsigned int __ATTRS_o_ai
1850 vec_parity_lsbb(vector unsigned int __a) {
1851 return __builtin_altivec_vprtybw(__a);
1854 static __inline__ vector unsigned int __ATTRS_o_ai
1855 vec_parity_lsbb(vector signed int __a) {
1856 return __builtin_altivec_vprtybw(__a);
1859 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1860 vec_parity_lsbb(vector unsigned __int128 __a) {
1861 return __builtin_altivec_vprtybq(__a);
1864 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1865 vec_parity_lsbb(vector signed __int128 __a) {
1866 return __builtin_altivec_vprtybq(__a);
1869 static __inline__ vector unsigned long long __ATTRS_o_ai
1870 vec_parity_lsbb(vector unsigned long long __a) {
1871 return __builtin_altivec_vprtybd(__a);
1874 static __inline__ vector unsigned long long __ATTRS_o_ai
1875 vec_parity_lsbb(vector signed long long __a) {
1876 return __builtin_altivec_vprtybd(__a);
1882 static __inline__ vector bool char __ATTRS_o_ai
1883 vec_cmpne(vector bool char __a, vector bool char __b) {
1884 return ~(vec_cmpeq(__a, __b));
1887 static __inline__ vector bool char __ATTRS_o_ai
1888 vec_cmpne(vector signed char __a, vector signed char __b) {
1889 return ~(vec_cmpeq(__a, __b));
1892 static __inline__ vector bool char __ATTRS_o_ai
1893 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1894 return ~(vec_cmpeq(__a, __b));
1897 static __inline__ vector bool short __ATTRS_o_ai
1898 vec_cmpne(vector bool short __a, vector bool short __b) {
1899 return ~(vec_cmpeq(__a, __b));
1902 static __inline__ vector bool short __ATTRS_o_ai
1903 vec_cmpne(vector signed short __a, vector signed short __b) {
1904 return ~(vec_cmpeq(__a, __b));
1907 static __inline__ vector bool short __ATTRS_o_ai
1908 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1909 return ~(vec_cmpeq(__a, __b));
1912 static __inline__ vector bool int __ATTRS_o_ai
1913 vec_cmpne(vector bool int __a, vector bool int __b) {
1914 return ~(vec_cmpeq(__a, __b));
1917 static __inline__ vector bool int __ATTRS_o_ai
1918 vec_cmpne(vector signed int __a, vector signed int __b) {
1919 return ~(vec_cmpeq(__a, __b));
1922 static __inline__ vector bool int __ATTRS_o_ai
1923 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1924 return ~(vec_cmpeq(__a, __b));
1927 static __inline__ vector bool int __ATTRS_o_ai
1928 vec_cmpne(vector float __a, vector float __b) {
1929 return ~(vec_cmpeq(__a, __b));
1933 #ifdef __POWER8_VECTOR__
1934 static __inline__ vector bool long long __ATTRS_o_ai
1935 vec_cmpne(vector bool long long __a, vector bool long long __b) {
1936 return (vector bool long long)
1937 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1940 static __inline__ vector bool long long __ATTRS_o_ai
1941 vec_cmpne(vector signed long long __a, vector signed long long __b) {
1942 return (vector bool long long)
1943 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1946 static __inline__ vector bool long long __ATTRS_o_ai
1947 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1948 return (vector bool long long)
1949 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1954 static __inline__ vector bool long long __ATTRS_o_ai
1955 vec_cmpne(vector double __a, vector double __b) {
1956 return (vector bool long long)
1957 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1963 static __inline__ vector bool char __ATTRS_o_ai
1964 vec_cmpgt(vector signed char __a, vector signed char __b) {
1965 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1968 static __inline__ vector bool char __ATTRS_o_ai
1969 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1970 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1973 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1975 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1978 static __inline__ vector bool short __ATTRS_o_ai
1979 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1980 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1983 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1985 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1988 static __inline__ vector bool int __ATTRS_o_ai
1989 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1990 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1993 #ifdef __POWER8_VECTOR__
1994 static __inline__ vector bool long long __ATTRS_o_ai
1995 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1996 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1999 static __inline__ vector bool long long __ATTRS_o_ai
2000 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2001 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2005 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
2008 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
2010 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2015 static __inline__ vector bool long long __ATTRS_o_ai
2016 vec_cmpgt(vector double __a, vector double __b) {
2017 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
2023 static __inline__ vector bool char __ATTRS_o_ai
2024 vec_cmpge(vector signed char __a, vector signed char __b) {
2025 return ~(vec_cmpgt(__b, __a));
2028 static __inline__ vector bool char __ATTRS_o_ai
2029 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
2030 return ~(vec_cmpgt(__b, __a));
2033 static __inline__ vector bool short __ATTRS_o_ai
2034 vec_cmpge(vector signed short __a, vector signed short __b) {
2035 return ~(vec_cmpgt(__b, __a));
2038 static __inline__ vector bool short __ATTRS_o_ai
2039 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
2040 return ~(vec_cmpgt(__b, __a));
2043 static __inline__ vector bool int __ATTRS_o_ai
2044 vec_cmpge(vector signed int __a, vector signed int __b) {
2045 return ~(vec_cmpgt(__b, __a));
2048 static __inline__ vector bool int __ATTRS_o_ai
2049 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2050 return ~(vec_cmpgt(__b, __a));
2053 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2056 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2058 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2063 static __inline__ vector bool long long __ATTRS_o_ai
2064 vec_cmpge(vector double __a, vector double __b) {
2065 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2069 #ifdef __POWER8_VECTOR__
2070 static __inline__ vector bool long long __ATTRS_o_ai
2071 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2072 return ~(vec_cmpgt(__b, __a));
2075 static __inline__ vector bool long long __ATTRS_o_ai
2076 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2077 return ~(vec_cmpgt(__b, __a));
2083 static __inline__ vector bool int __attribute__((__always_inline__))
2084 vec_vcmpgefp(vector float __a, vector float __b) {
2085 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2090 static __inline__ vector bool char __attribute__((__always_inline__))
2091 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2092 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2097 static __inline__ vector bool char __attribute__((__always_inline__))
2098 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2099 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2104 static __inline__ vector bool short __attribute__((__always_inline__))
2105 vec_vcmpgtsh(vector short __a, vector short __b) {
2106 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2111 static __inline__ vector bool short __attribute__((__always_inline__))
2112 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2113 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2118 static __inline__ vector bool int __attribute__((__always_inline__))
2119 vec_vcmpgtsw(vector int __a, vector int __b) {
2120 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2125 static __inline__ vector bool int __attribute__((__always_inline__))
2126 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2127 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2132 static __inline__ vector bool int __attribute__((__always_inline__))
2133 vec_vcmpgtfp(vector float __a, vector float __b) {
2134 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2139 static __inline__ vector bool char __ATTRS_o_ai
2140 vec_cmple(vector signed char __a, vector signed char __b) {
2141 return vec_cmpge(__b, __a);
2144 static __inline__ vector bool char __ATTRS_o_ai
2145 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2146 return vec_cmpge(__b, __a);
2149 static __inline__ vector bool short __ATTRS_o_ai
2150 vec_cmple(vector signed short __a, vector signed short __b) {
2151 return vec_cmpge(__b, __a);
2154 static __inline__ vector bool short __ATTRS_o_ai
2155 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2156 return vec_cmpge(__b, __a);
2159 static __inline__ vector bool int __ATTRS_o_ai
2160 vec_cmple(vector signed int __a, vector signed int __b) {
2161 return vec_cmpge(__b, __a);
2164 static __inline__ vector bool int __ATTRS_o_ai
2165 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2166 return vec_cmpge(__b, __a);
2169 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2171 return vec_cmpge(__b, __a);
2175 static __inline__ vector bool long long __ATTRS_o_ai
2176 vec_cmple(vector double __a, vector double __b) {
2177 return vec_cmpge(__b, __a);
2181 #ifdef __POWER8_VECTOR__
2182 static __inline__ vector bool long long __ATTRS_o_ai
2183 vec_cmple(vector signed long long __a, vector signed long long __b) {
2184 return vec_cmpge(__b, __a);
2187 static __inline__ vector bool long long __ATTRS_o_ai
2188 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2189 return vec_cmpge(__b, __a);
2195 static __inline__ vector bool char __ATTRS_o_ai
2196 vec_cmplt(vector signed char __a, vector signed char __b) {
2197 return vec_cmpgt(__b, __a);
2200 static __inline__ vector bool char __ATTRS_o_ai
2201 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2202 return vec_cmpgt(__b, __a);
2205 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2207 return vec_cmpgt(__b, __a);
2210 static __inline__ vector bool short __ATTRS_o_ai
2211 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2212 return vec_cmpgt(__b, __a);
2215 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2217 return vec_cmpgt(__b, __a);
2220 static __inline__ vector bool int __ATTRS_o_ai
2221 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2222 return vec_cmpgt(__b, __a);
2225 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2227 return vec_cmpgt(__b, __a);
2231 static __inline__ vector bool long long __ATTRS_o_ai
2232 vec_cmplt(vector double __a, vector double __b) {
2233 return vec_cmpgt(__b, __a);
2237 #ifdef __POWER8_VECTOR__
2238 static __inline__ vector bool long long __ATTRS_o_ai
2239 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2240 return vec_cmpgt(__b, __a);
2243 static __inline__ vector bool long long __ATTRS_o_ai
2244 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2245 return vec_cmpgt(__b, __a);
2250 static __inline__ vector signed char __ATTRS_o_ai
2251 vec_popcnt(vector signed char __a) {
2252 return __builtin_altivec_vpopcntb(__a);
2254 static __inline__ vector unsigned char __ATTRS_o_ai
2255 vec_popcnt(vector unsigned char __a) {
2256 return __builtin_altivec_vpopcntb(__a);
2258 static __inline__ vector signed short __ATTRS_o_ai
2259 vec_popcnt(vector signed short __a) {
2260 return __builtin_altivec_vpopcnth(__a);
2262 static __inline__ vector unsigned short __ATTRS_o_ai
2263 vec_popcnt(vector unsigned short __a) {
2264 return __builtin_altivec_vpopcnth(__a);
2266 static __inline__ vector signed int __ATTRS_o_ai
2267 vec_popcnt(vector signed int __a) {
2268 return __builtin_altivec_vpopcntw(__a);
2270 static __inline__ vector unsigned int __ATTRS_o_ai
2271 vec_popcnt(vector unsigned int __a) {
2272 return __builtin_altivec_vpopcntw(__a);
2274 static __inline__ vector signed long long __ATTRS_o_ai
2275 vec_popcnt(vector signed long long __a) {
2276 return __builtin_altivec_vpopcntd(__a);
2278 static __inline__ vector unsigned long long __ATTRS_o_ai
2279 vec_popcnt(vector unsigned long long __a) {
2280 return __builtin_altivec_vpopcntd(__a);
2285 static __inline__ vector signed char __ATTRS_o_ai
2286 vec_cntlz(vector signed char __a) {
2287 return __builtin_altivec_vclzb(__a);
2289 static __inline__ vector unsigned char __ATTRS_o_ai
2290 vec_cntlz(vector unsigned char __a) {
2291 return __builtin_altivec_vclzb(__a);
2293 static __inline__ vector signed short __ATTRS_o_ai
2294 vec_cntlz(vector signed short __a) {
2295 return __builtin_altivec_vclzh(__a);
2297 static __inline__ vector unsigned short __ATTRS_o_ai
2298 vec_cntlz(vector unsigned short __a) {
2299 return __builtin_altivec_vclzh(__a);
2301 static __inline__ vector signed int __ATTRS_o_ai
2302 vec_cntlz(vector signed int __a) {
2303 return __builtin_altivec_vclzw(__a);
2305 static __inline__ vector unsigned int __ATTRS_o_ai
2306 vec_cntlz(vector unsigned int __a) {
2307 return __builtin_altivec_vclzw(__a);
2309 static __inline__ vector signed long long __ATTRS_o_ai
2310 vec_cntlz(vector signed long long __a) {
2311 return __builtin_altivec_vclzd(__a);
2313 static __inline__ vector unsigned long long __ATTRS_o_ai
2314 vec_cntlz(vector unsigned long long __a) {
2315 return __builtin_altivec_vclzd(__a);
2319 #ifdef __POWER9_VECTOR__
2323 static __inline__ vector signed char __ATTRS_o_ai
2324 vec_cnttz(vector signed char __a) {
2325 return __builtin_altivec_vctzb(__a);
2327 static __inline__ vector unsigned char __ATTRS_o_ai
2328 vec_cnttz(vector unsigned char __a) {
2329 return __builtin_altivec_vctzb(__a);
2331 static __inline__ vector signed short __ATTRS_o_ai
2332 vec_cnttz(vector signed short __a) {
2333 return __builtin_altivec_vctzh(__a);
2335 static __inline__ vector unsigned short __ATTRS_o_ai
2336 vec_cnttz(vector unsigned short __a) {
2337 return __builtin_altivec_vctzh(__a);
2339 static __inline__ vector signed int __ATTRS_o_ai
2340 vec_cnttz(vector signed int __a) {
2341 return __builtin_altivec_vctzw(__a);
2343 static __inline__ vector unsigned int __ATTRS_o_ai
2344 vec_cnttz(vector unsigned int __a) {
2345 return __builtin_altivec_vctzw(__a);
2347 static __inline__ vector signed long long __ATTRS_o_ai
2348 vec_cnttz(vector signed long long __a) {
2349 return __builtin_altivec_vctzd(__a);
2351 static __inline__ vector unsigned long long __ATTRS_o_ai
2352 vec_cnttz(vector unsigned long long __a) {
2353 return __builtin_altivec_vctzd(__a);
2356 /* vec_first_match_index */
2358 static __inline__ unsigned __ATTRS_o_ai
2359 vec_first_match_index(vector signed char __a, vector signed char __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) >> 3;
2369 return __res[0] >> 3;
2372 static __inline__ unsigned __ATTRS_o_ai
2373 vec_first_match_index(vector unsigned char __a, vector unsigned char __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) >> 3;
2383 return __res[0] >> 3;
2386 static __inline__ unsigned __ATTRS_o_ai
2387 vec_first_match_index(vector signed short __a, vector signed short __b) {
2388 vector unsigned long long __res =
2389 #ifdef __LITTLE_ENDIAN__
2390 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2392 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2394 if (__res[0] == 64) {
2395 return (__res[1] + 64) >> 4;
2397 return __res[0] >> 4;
2400 static __inline__ unsigned __ATTRS_o_ai
2401 vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2402 vector unsigned long long __res =
2403 #ifdef __LITTLE_ENDIAN__
2404 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2406 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2408 if (__res[0] == 64) {
2409 return (__res[1] + 64) >> 4;
2411 return __res[0] >> 4;
2414 static __inline__ unsigned __ATTRS_o_ai
2415 vec_first_match_index(vector signed int __a, vector signed int __b) {
2416 vector unsigned long long __res =
2417 #ifdef __LITTLE_ENDIAN__
2418 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2420 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2422 if (__res[0] == 64) {
2423 return (__res[1] + 64) >> 5;
2425 return __res[0] >> 5;
2428 static __inline__ unsigned __ATTRS_o_ai
2429 vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2430 vector unsigned long long __res =
2431 #ifdef __LITTLE_ENDIAN__
2432 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2434 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2436 if (__res[0] == 64) {
2437 return (__res[1] + 64) >> 5;
2439 return __res[0] >> 5;
2442 /* vec_first_match_or_eos_index */
2444 static __inline__ unsigned __ATTRS_o_ai
2445 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2446 /* Compare the result of the comparison of two vectors with either and OR the
2447 result. Either the elements are equal or one will equal the comparison
2448 result if either is zero.
2450 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2451 vector bool char __tmp2 = __tmp1 |
2452 vec_cmpeq((vector signed char)__tmp1, __a) |
2453 vec_cmpeq((vector signed char)__tmp1, __b);
2455 vector unsigned long long __res =
2456 #ifdef __LITTLE_ENDIAN__
2457 vec_cnttz((vector unsigned long long)__tmp2);
2459 vec_cntlz((vector unsigned long long)__tmp2);
2461 if (__res[0] == 64) {
2462 return (__res[1] + 64) >> 3;
2464 return __res[0] >> 3;
2467 static __inline__ unsigned __ATTRS_o_ai
2468 vec_first_match_or_eos_index(vector unsigned char __a,
2469 vector unsigned char __b) {
2470 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2471 vector bool char __tmp2 = __tmp1 |
2472 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2473 vec_cmpeq((vector unsigned char)__tmp1, __b);
2475 vector unsigned long long __res =
2476 #ifdef __LITTLE_ENDIAN__
2477 vec_cnttz((vector unsigned long long)__tmp2);
2479 vec_cntlz((vector unsigned long long)__tmp2);
2481 if (__res[0] == 64) {
2482 return (__res[1] + 64) >> 3;
2484 return __res[0] >> 3;
2487 static __inline__ unsigned __ATTRS_o_ai
2488 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2489 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2490 vector bool short __tmp2 = __tmp1 |
2491 vec_cmpeq((vector signed short)__tmp1, __a) |
2492 vec_cmpeq((vector signed short)__tmp1, __b);
2494 vector unsigned long long __res =
2495 #ifdef __LITTLE_ENDIAN__
2496 vec_cnttz((vector unsigned long long)__tmp2);
2498 vec_cntlz((vector unsigned long long)__tmp2);
2500 if (__res[0] == 64) {
2501 return (__res[1] + 64) >> 4;
2503 return __res[0] >> 4;
2506 static __inline__ unsigned __ATTRS_o_ai
2507 vec_first_match_or_eos_index(vector unsigned short __a,
2508 vector unsigned short __b) {
2509 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2510 vector bool short __tmp2 = __tmp1 |
2511 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2512 vec_cmpeq((vector unsigned short)__tmp1, __b);
2514 vector unsigned long long __res =
2515 #ifdef __LITTLE_ENDIAN__
2516 vec_cnttz((vector unsigned long long)__tmp2);
2518 vec_cntlz((vector unsigned long long)__tmp2);
2520 if (__res[0] == 64) {
2521 return (__res[1] + 64) >> 4;
2523 return __res[0] >> 4;
2526 static __inline__ unsigned __ATTRS_o_ai
2527 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2528 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2529 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2530 vec_cmpeq((vector signed int)__tmp1, __b);
2532 vector unsigned long long __res =
2533 #ifdef __LITTLE_ENDIAN__
2534 vec_cnttz((vector unsigned long long)__tmp2);
2536 vec_cntlz((vector unsigned long long)__tmp2);
2538 if (__res[0] == 64) {
2539 return (__res[1] + 64) >> 5;
2541 return __res[0] >> 5;
2544 static __inline__ unsigned __ATTRS_o_ai
2545 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2546 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2547 vector bool int __tmp2 = __tmp1 |
2548 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2549 vec_cmpeq((vector unsigned int)__tmp1, __b);
2551 vector unsigned long long __res =
2552 #ifdef __LITTLE_ENDIAN__
2553 vec_cnttz((vector unsigned long long)__tmp2);
2555 vec_cntlz((vector unsigned long long)__tmp2);
2557 if (__res[0] == 64) {
2558 return (__res[1] + 64) >> 5;
2560 return __res[0] >> 5;
2563 /* vec_first_mismatch_index */
2565 static __inline__ unsigned __ATTRS_o_ai
2566 vec_first_mismatch_index(vector signed char __a, vector signed char __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) >> 3;
2576 return __res[0] >> 3;
2579 static __inline__ unsigned __ATTRS_o_ai
2580 vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __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) >> 3;
2590 return __res[0] >> 3;
2593 static __inline__ unsigned __ATTRS_o_ai
2594 vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2595 vector unsigned long long __res =
2596 #ifdef __LITTLE_ENDIAN__
2597 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2599 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2601 if (__res[0] == 64) {
2602 return (__res[1] + 64) >> 4;
2604 return __res[0] >> 4;
2607 static __inline__ unsigned __ATTRS_o_ai
2608 vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2609 vector unsigned long long __res =
2610 #ifdef __LITTLE_ENDIAN__
2611 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2613 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2615 if (__res[0] == 64) {
2616 return (__res[1] + 64) >> 4;
2618 return __res[0] >> 4;
2621 static __inline__ unsigned __ATTRS_o_ai
2622 vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2623 vector unsigned long long __res =
2624 #ifdef __LITTLE_ENDIAN__
2625 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2627 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2629 if (__res[0] == 64) {
2630 return (__res[1] + 64) >> 5;
2632 return __res[0] >> 5;
2635 static __inline__ unsigned __ATTRS_o_ai
2636 vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2637 vector unsigned long long __res =
2638 #ifdef __LITTLE_ENDIAN__
2639 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2641 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2643 if (__res[0] == 64) {
2644 return (__res[1] + 64) >> 5;
2646 return __res[0] >> 5;
2649 /* vec_first_mismatch_or_eos_index */
2651 static __inline__ unsigned __ATTRS_o_ai
2652 vec_first_mismatch_or_eos_index(vector signed char __a,
2653 vector signed char __b) {
2654 vector unsigned long long __res =
2655 #ifdef __LITTLE_ENDIAN__
2656 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2658 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2660 if (__res[0] == 64) {
2661 return (__res[1] + 64) >> 3;
2663 return __res[0] >> 3;
2666 static __inline__ unsigned __ATTRS_o_ai
2667 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2668 vector unsigned char __b) {
2669 vector unsigned long long __res =
2670 #ifdef __LITTLE_ENDIAN__
2671 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2673 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2675 if (__res[0] == 64) {
2676 return (__res[1] + 64) >> 3;
2678 return __res[0] >> 3;
2681 static __inline__ unsigned __ATTRS_o_ai
2682 vec_first_mismatch_or_eos_index(vector signed short __a,
2683 vector signed short __b) {
2684 vector unsigned long long __res =
2685 #ifdef __LITTLE_ENDIAN__
2686 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2688 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2690 if (__res[0] == 64) {
2691 return (__res[1] + 64) >> 4;
2693 return __res[0] >> 4;
2696 static __inline__ unsigned __ATTRS_o_ai
2697 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2698 vector unsigned short __b) {
2699 vector unsigned long long __res =
2700 #ifdef __LITTLE_ENDIAN__
2701 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2703 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2705 if (__res[0] == 64) {
2706 return (__res[1] + 64) >> 4;
2708 return __res[0] >> 4;
2711 static __inline__ unsigned __ATTRS_o_ai
2712 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2713 vector unsigned long long __res =
2714 #ifdef __LITTLE_ENDIAN__
2715 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2717 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2719 if (__res[0] == 64) {
2720 return (__res[1] + 64) >> 5;
2722 return __res[0] >> 5;
2725 static __inline__ unsigned __ATTRS_o_ai
2726 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2727 vector unsigned int __b) {
2728 vector unsigned long long __res =
2729 #ifdef __LITTLE_ENDIAN__
2730 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2732 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2734 if (__res[0] == 64) {
2735 return (__res[1] + 64) >> 5;
2737 return __res[0] >> 5;
2740 static __inline__ vector double __ATTRS_o_ai
2741 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2742 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2745 static __inline__ vector double __ATTRS_o_ai
2746 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2747 return __builtin_vsx_xviexpdp(__a,__b);
2750 static __inline__ vector float __ATTRS_o_ai
2751 vec_insert_exp(vector float __a, vector unsigned int __b) {
2752 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2755 static __inline__ vector float __ATTRS_o_ai
2756 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2757 return __builtin_vsx_xviexpsp(__a,__b);
2760 #if defined(__powerpc64__)
2761 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,
2763 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2766 static __inline__ vector unsigned char __ATTRS_o_ai
2767 vec_xl_len(const unsigned char *__a, size_t __b) {
2768 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2771 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,
2773 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2776 static __inline__ vector unsigned short __ATTRS_o_ai
2777 vec_xl_len(const unsigned short *__a, size_t __b) {
2778 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2781 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,
2783 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2786 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,
2788 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2791 static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t __b) {
2792 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2795 static __inline__ vector signed __int128 __ATTRS_o_ai
2796 vec_xl_len(const signed __int128 *__a, size_t __b) {
2797 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2800 static __inline__ vector unsigned __int128 __ATTRS_o_ai
2801 vec_xl_len(const unsigned __int128 *__a, size_t __b) {
2802 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2805 static __inline__ vector signed long long __ATTRS_o_ai
2806 vec_xl_len(const signed long long *__a, size_t __b) {
2807 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2810 static __inline__ vector unsigned long long __ATTRS_o_ai
2811 vec_xl_len(const unsigned long long *__a, size_t __b) {
2812 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2815 static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,
2817 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2820 static __inline__ vector unsigned char __ATTRS_o_ai
2821 vec_xl_len_r(const unsigned char *__a, size_t __b) {
2822 vector unsigned char __res =
2823 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2824 #ifdef __LITTLE_ENDIAN__
2825 vector unsigned char __mask =
2826 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2827 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2828 (vector int)__res, (vector int)__res, __mask);
2834 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2837 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2840 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2841 signed char *__b, size_t __c) {
2842 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2845 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2846 signed short *__b, size_t __c) {
2847 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2850 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2851 unsigned short *__b,
2853 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2856 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2857 signed int *__b, size_t __c) {
2858 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2861 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2862 unsigned int *__b, size_t __c) {
2863 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2866 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2868 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2871 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2872 signed __int128 *__b,
2874 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2877 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2878 unsigned __int128 *__b,
2880 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2883 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2884 signed long long *__b,
2886 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2889 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2890 unsigned long long *__b,
2892 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2895 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2897 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2900 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2903 #ifdef __LITTLE_ENDIAN__
2904 vector unsigned char __mask =
2905 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2906 vector unsigned char __res =
2907 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2908 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2910 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2919 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2921 return __builtin_vsx_xvcpsgnsp(__a, __b);
2924 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2925 vector double __b) {
2926 return __builtin_vsx_xvcpsgndp(__a, __b);
2933 #define vec_ctf(__a, __b) \
2934 _Generic((__a), vector int \
2935 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2936 vector unsigned int \
2937 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2939 vector unsigned long long \
2940 : (__builtin_convertvector((vector unsigned long long)(__a), \
2942 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2944 vector signed long long \
2945 : (__builtin_convertvector((vector signed long long)(__a), \
2947 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2950 #define vec_ctf(__a, __b) \
2951 _Generic((__a), vector int \
2952 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2953 vector unsigned int \
2954 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2960 #define vec_vcfux __builtin_altivec_vcfux
2964 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2969 #define vec_cts(__a, __b) \
2970 _Generic((__a), vector float \
2971 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
2974 vector double __ret = \
2975 (vector double)(__a) * \
2976 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2978 __builtin_convertvector(__ret, vector signed long long); \
2981 #define vec_cts __builtin_altivec_vctsxs
2986 #define vec_vctsxs __builtin_altivec_vctsxs
2991 #define vec_ctu(__a, __b) \
2992 _Generic((__a), vector float \
2993 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
2996 vector double __ret = \
2997 (vector double)(__a) * \
2998 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3000 __builtin_convertvector(__ret, vector unsigned long long); \
3003 #define vec_ctu __builtin_altivec_vctuxs
3008 #define vec_vctuxs __builtin_altivec_vctuxs
3012 static __inline__ vector signed int __ATTRS_o_ai
3013 vec_sld(vector signed int, vector signed int, unsigned const int __c);
3015 static __inline__ vector signed int __ATTRS_o_ai
3016 vec_signed(vector float __a) {
3017 return __builtin_convertvector(__a, vector signed int);
3021 static __inline__ vector signed long long __ATTRS_o_ai
3022 vec_signed(vector double __a) {
3023 return __builtin_convertvector(__a, vector signed long long);
3026 static __inline__ vector signed int __attribute__((__always_inline__))
3027 vec_signed2(vector double __a, vector double __b) {
3028 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
3031 static __inline__ vector signed int __ATTRS_o_ai
3032 vec_signede(vector double __a) {
3033 #ifdef __LITTLE_ENDIAN__
3034 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3035 return vec_sld(__ret, __ret, 12);
3037 return __builtin_vsx_xvcvdpsxws(__a);
3041 static __inline__ vector signed int __ATTRS_o_ai
3042 vec_signedo(vector double __a) {
3043 #ifdef __LITTLE_ENDIAN__
3044 return __builtin_vsx_xvcvdpsxws(__a);
3046 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3047 return vec_sld(__ret, __ret, 12);
3054 static __inline__ vector unsigned int __ATTRS_o_ai
3055 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3057 static __inline__ vector unsigned int __ATTRS_o_ai
3058 vec_unsigned(vector float __a) {
3059 return __builtin_convertvector(__a, vector unsigned int);
3063 static __inline__ vector unsigned long long __ATTRS_o_ai
3064 vec_unsigned(vector double __a) {
3065 return __builtin_convertvector(__a, vector unsigned long long);
3068 static __inline__ vector unsigned int __attribute__((__always_inline__))
3069 vec_unsigned2(vector double __a, vector double __b) {
3070 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3073 static __inline__ vector unsigned int __ATTRS_o_ai
3074 vec_unsignede(vector double __a) {
3075 #ifdef __LITTLE_ENDIAN__
3076 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3077 return vec_sld(__ret, __ret, 12);
3079 return __builtin_vsx_xvcvdpuxws(__a);
3083 static __inline__ vector unsigned int __ATTRS_o_ai
3084 vec_unsignedo(vector double __a) {
3085 #ifdef __LITTLE_ENDIAN__
3086 return __builtin_vsx_xvcvdpuxws(__a);
3088 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3089 return vec_sld(__ret, __ret, 12);
3096 static __inline__ vector float __ATTRS_o_ai
3097 vec_sld(vector float, vector float, unsigned const int __c);
3099 static __inline__ vector float __ATTRS_o_ai
3100 vec_float(vector signed int __a) {
3101 return __builtin_convertvector(__a, vector float);
3104 static __inline__ vector float __ATTRS_o_ai
3105 vec_float(vector unsigned int __a) {
3106 return __builtin_convertvector(__a, vector float);
3110 static __inline__ vector float __ATTRS_o_ai
3111 vec_float2(vector signed long long __a, vector signed long long __b) {
3112 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3115 static __inline__ vector float __ATTRS_o_ai
3116 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3117 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3120 static __inline__ vector float __ATTRS_o_ai
3121 vec_float2(vector double __a, vector double __b) {
3122 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3125 static __inline__ vector float __ATTRS_o_ai
3126 vec_floate(vector signed long long __a) {
3127 #ifdef __LITTLE_ENDIAN__
3128 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3129 return vec_sld(__ret, __ret, 12);
3131 return __builtin_vsx_xvcvsxdsp(__a);
3135 static __inline__ vector float __ATTRS_o_ai
3136 vec_floate(vector unsigned long long __a) {
3137 #ifdef __LITTLE_ENDIAN__
3138 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3139 return vec_sld(__ret, __ret, 12);
3141 return __builtin_vsx_xvcvuxdsp(__a);
3145 static __inline__ vector float __ATTRS_o_ai
3146 vec_floate(vector double __a) {
3147 #ifdef __LITTLE_ENDIAN__
3148 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3149 return vec_sld(__ret, __ret, 12);
3151 return __builtin_vsx_xvcvdpsp(__a);
3155 static __inline__ vector float __ATTRS_o_ai
3156 vec_floato(vector signed long long __a) {
3157 #ifdef __LITTLE_ENDIAN__
3158 return __builtin_vsx_xvcvsxdsp(__a);
3160 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3161 return vec_sld(__ret, __ret, 12);
3165 static __inline__ vector float __ATTRS_o_ai
3166 vec_floato(vector unsigned long long __a) {
3167 #ifdef __LITTLE_ENDIAN__
3168 return __builtin_vsx_xvcvuxdsp(__a);
3170 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3171 return vec_sld(__ret, __ret, 12);
3175 static __inline__ vector float __ATTRS_o_ai
3176 vec_floato(vector double __a) {
3177 #ifdef __LITTLE_ENDIAN__
3178 return __builtin_vsx_xvcvdpsp(__a);
3180 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3181 return vec_sld(__ret, __ret, 12);
3189 static __inline__ vector double __ATTRS_o_ai
3190 vec_double(vector signed long long __a) {
3191 return __builtin_convertvector(__a, vector double);
3194 static __inline__ vector double __ATTRS_o_ai
3195 vec_double(vector unsigned long long __a) {
3196 return __builtin_convertvector(__a, vector double);
3199 static __inline__ vector double __ATTRS_o_ai
3200 vec_doublee(vector signed int __a) {
3201 #ifdef __LITTLE_ENDIAN__
3202 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3204 return __builtin_vsx_xvcvsxwdp(__a);
3208 static __inline__ vector double __ATTRS_o_ai
3209 vec_doublee(vector unsigned int __a) {
3210 #ifdef __LITTLE_ENDIAN__
3211 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3213 return __builtin_vsx_xvcvuxwdp(__a);
3217 static __inline__ vector double __ATTRS_o_ai
3218 vec_doublee(vector float __a) {
3219 #ifdef __LITTLE_ENDIAN__
3220 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3222 return __builtin_vsx_xvcvspdp(__a);
3226 static __inline__ vector double __ATTRS_o_ai
3227 vec_doubleh(vector signed int __a) {
3228 vector double __ret = {__a[0], __a[1]};
3232 static __inline__ vector double __ATTRS_o_ai
3233 vec_doubleh(vector unsigned int __a) {
3234 vector double __ret = {__a[0], __a[1]};
3238 static __inline__ vector double __ATTRS_o_ai
3239 vec_doubleh(vector float __a) {
3240 vector double __ret = {__a[0], __a[1]};
3244 static __inline__ vector double __ATTRS_o_ai
3245 vec_doublel(vector signed int __a) {
3246 vector double __ret = {__a[2], __a[3]};
3250 static __inline__ vector double __ATTRS_o_ai
3251 vec_doublel(vector unsigned int __a) {
3252 vector double __ret = {__a[2], __a[3]};
3256 static __inline__ vector double __ATTRS_o_ai
3257 vec_doublel(vector float __a) {
3258 vector double __ret = {__a[2], __a[3]};
3262 static __inline__ vector double __ATTRS_o_ai
3263 vec_doubleo(vector signed int __a) {
3264 #ifdef __LITTLE_ENDIAN__
3265 return __builtin_vsx_xvcvsxwdp(__a);
3267 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3271 static __inline__ vector double __ATTRS_o_ai
3272 vec_doubleo(vector unsigned int __a) {
3273 #ifdef __LITTLE_ENDIAN__
3274 return __builtin_vsx_xvcvuxwdp(__a);
3276 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3280 static __inline__ vector double __ATTRS_o_ai
3281 vec_doubleo(vector float __a) {
3282 #ifdef __LITTLE_ENDIAN__
3283 return __builtin_vsx_xvcvspdp(__a);
3285 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3292 /* Integer vector divides (vectors are scalarized, elements divided
3293 and the vectors reassembled).
3295 static __inline__ vector signed char __ATTRS_o_ai
3296 vec_div(vector signed char __a, vector signed char __b) {
3300 static __inline__ vector unsigned char __ATTRS_o_ai
3301 vec_div(vector unsigned char __a, vector unsigned char __b) {
3305 static __inline__ vector signed short __ATTRS_o_ai
3306 vec_div(vector signed short __a, vector signed short __b) {
3310 static __inline__ vector unsigned short __ATTRS_o_ai
3311 vec_div(vector unsigned short __a, vector unsigned short __b) {
3315 static __inline__ vector signed int __ATTRS_o_ai
3316 vec_div(vector signed int __a, vector signed int __b) {
3320 static __inline__ vector unsigned int __ATTRS_o_ai
3321 vec_div(vector unsigned int __a, vector unsigned int __b) {
3326 static __inline__ vector signed long long __ATTRS_o_ai
3327 vec_div(vector signed long long __a, vector signed long long __b) {
3331 static __inline__ vector unsigned long long __ATTRS_o_ai
3332 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3336 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3341 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3342 vector double __b) {
3349 #define vec_dss __builtin_altivec_dss
3353 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3354 __builtin_altivec_dssall();
3358 #define vec_dst(__PTR, __CW, __STR) \
3360 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3363 #define vec_dstst(__PTR, __CW, __STR) \
3365 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3368 #define vec_dststt(__PTR, __CW, __STR) \
3370 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3373 #define vec_dstt(__PTR, __CW, __STR) \
3375 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3379 #ifdef __POWER8_VECTOR__
3380 static __inline__ vector signed char __ATTRS_o_ai
3381 vec_eqv(vector signed char __a, vector signed char __b) {
3382 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3383 (vector unsigned int)__b);
3386 static __inline__ vector unsigned char __ATTRS_o_ai
3387 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3388 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3389 (vector unsigned int)__b);
3392 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3393 vector bool char __b) {
3394 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3395 (vector unsigned int)__b);
3398 static __inline__ vector signed short __ATTRS_o_ai
3399 vec_eqv(vector signed short __a, vector signed short __b) {
3400 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3401 (vector unsigned int)__b);
3404 static __inline__ vector unsigned short __ATTRS_o_ai
3405 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3406 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3407 (vector unsigned int)__b);
3410 static __inline__ vector bool short __ATTRS_o_ai
3411 vec_eqv(vector bool short __a, vector bool short __b) {
3412 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3413 (vector unsigned int)__b);
3416 static __inline__ vector signed int __ATTRS_o_ai
3417 vec_eqv(vector signed int __a, vector signed int __b) {
3418 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3419 (vector unsigned int)__b);
3422 static __inline__ vector unsigned int __ATTRS_o_ai
3423 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3424 return __builtin_vsx_xxleqv(__a, __b);
3427 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3428 vector bool int __b) {
3429 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3430 (vector unsigned int)__b);
3433 static __inline__ vector signed long long __ATTRS_o_ai
3434 vec_eqv(vector signed long long __a, vector signed long long __b) {
3435 return (vector signed long long)__builtin_vsx_xxleqv(
3436 (vector unsigned int)__a, (vector unsigned int)__b);
3439 static __inline__ vector unsigned long long __ATTRS_o_ai
3440 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3441 return (vector unsigned long long)__builtin_vsx_xxleqv(
3442 (vector unsigned int)__a, (vector unsigned int)__b);
3445 static __inline__ vector bool long long __ATTRS_o_ai
3446 vec_eqv(vector bool long long __a, vector bool long long __b) {
3447 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3448 (vector unsigned int)__b);
3451 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3453 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3454 (vector unsigned int)__b);
3457 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3458 vector double __b) {
3459 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3460 (vector unsigned int)__b);
3466 static __inline__ vector float __attribute__((__always_inline__))
3467 vec_expte(vector float __a) {
3468 return __builtin_altivec_vexptefp(__a);
3473 static __inline__ vector float __attribute__((__always_inline__))
3474 vec_vexptefp(vector float __a) {
3475 return __builtin_altivec_vexptefp(__a);
3480 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3482 return __builtin_vsx_xvrspim(__a);
3484 return __builtin_altivec_vrfim(__a);
3489 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3490 return __builtin_vsx_xvrdpim(__a);
3496 static __inline__ vector float __attribute__((__always_inline__))
3497 vec_vrfim(vector float __a) {
3498 return __builtin_altivec_vrfim(__a);
3503 static __inline__ vector signed char __ATTRS_o_ai
3504 vec_ld(int __a, const vector signed char *__b) {
3505 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3508 static __inline__ vector signed char __ATTRS_o_ai
3509 vec_ld(int __a, const signed char *__b) {
3510 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3513 static __inline__ vector unsigned char __ATTRS_o_ai
3514 vec_ld(int __a, const vector unsigned char *__b) {
3515 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3518 static __inline__ vector unsigned char __ATTRS_o_ai
3519 vec_ld(int __a, const unsigned char *__b) {
3520 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3523 static __inline__ vector bool char __ATTRS_o_ai
3524 vec_ld(int __a, const vector bool char *__b) {
3525 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3528 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3529 const vector short *__b) {
3530 return (vector short)__builtin_altivec_lvx(__a, __b);
3533 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3534 return (vector short)__builtin_altivec_lvx(__a, __b);
3537 static __inline__ vector unsigned short __ATTRS_o_ai
3538 vec_ld(int __a, const vector unsigned short *__b) {
3539 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3542 static __inline__ vector unsigned short __ATTRS_o_ai
3543 vec_ld(int __a, const unsigned short *__b) {
3544 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3547 static __inline__ vector bool short __ATTRS_o_ai
3548 vec_ld(int __a, const vector bool short *__b) {
3549 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3552 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3553 const vector pixel *__b) {
3554 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3557 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3558 const vector int *__b) {
3559 return (vector int)__builtin_altivec_lvx(__a, __b);
3562 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3563 return (vector int)__builtin_altivec_lvx(__a, __b);
3566 static __inline__ vector unsigned int __ATTRS_o_ai
3567 vec_ld(int __a, const vector unsigned int *__b) {
3568 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3571 static __inline__ vector unsigned int __ATTRS_o_ai
3572 vec_ld(int __a, const unsigned int *__b) {
3573 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3576 static __inline__ vector bool int __ATTRS_o_ai
3577 vec_ld(int __a, const vector bool int *__b) {
3578 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3581 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3582 const vector float *__b) {
3583 return (vector float)__builtin_altivec_lvx(__a, __b);
3586 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3587 return (vector float)__builtin_altivec_lvx(__a, __b);
3592 static __inline__ vector signed char __ATTRS_o_ai
3593 vec_lvx(int __a, const vector signed char *__b) {
3594 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3597 static __inline__ vector signed char __ATTRS_o_ai
3598 vec_lvx(int __a, const signed char *__b) {
3599 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3602 static __inline__ vector unsigned char __ATTRS_o_ai
3603 vec_lvx(int __a, const vector unsigned char *__b) {
3604 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3607 static __inline__ vector unsigned char __ATTRS_o_ai
3608 vec_lvx(int __a, const unsigned char *__b) {
3609 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3612 static __inline__ vector bool char __ATTRS_o_ai
3613 vec_lvx(int __a, const vector bool char *__b) {
3614 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3617 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3618 const vector short *__b) {
3619 return (vector short)__builtin_altivec_lvx(__a, __b);
3622 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3623 return (vector short)__builtin_altivec_lvx(__a, __b);
3626 static __inline__ vector unsigned short __ATTRS_o_ai
3627 vec_lvx(int __a, const vector unsigned short *__b) {
3628 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3631 static __inline__ vector unsigned short __ATTRS_o_ai
3632 vec_lvx(int __a, const unsigned short *__b) {
3633 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3636 static __inline__ vector bool short __ATTRS_o_ai
3637 vec_lvx(int __a, const vector bool short *__b) {
3638 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3641 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3642 const vector pixel *__b) {
3643 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3646 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3647 const vector int *__b) {
3648 return (vector int)__builtin_altivec_lvx(__a, __b);
3651 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3652 return (vector int)__builtin_altivec_lvx(__a, __b);
3655 static __inline__ vector unsigned int __ATTRS_o_ai
3656 vec_lvx(int __a, const vector unsigned int *__b) {
3657 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3660 static __inline__ vector unsigned int __ATTRS_o_ai
3661 vec_lvx(int __a, const unsigned int *__b) {
3662 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3665 static __inline__ vector bool int __ATTRS_o_ai
3666 vec_lvx(int __a, const vector bool int *__b) {
3667 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3670 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3671 const vector float *__b) {
3672 return (vector float)__builtin_altivec_lvx(__a, __b);
3675 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3676 return (vector float)__builtin_altivec_lvx(__a, __b);
3681 static __inline__ vector signed char __ATTRS_o_ai
3682 vec_lde(int __a, const signed char *__b) {
3683 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3686 static __inline__ vector unsigned char __ATTRS_o_ai
3687 vec_lde(int __a, const unsigned char *__b) {
3688 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3691 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3692 return (vector short)__builtin_altivec_lvehx(__a, __b);
3695 static __inline__ vector unsigned short __ATTRS_o_ai
3696 vec_lde(int __a, const unsigned short *__b) {
3697 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3700 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3701 return (vector int)__builtin_altivec_lvewx(__a, __b);
3704 static __inline__ vector unsigned int __ATTRS_o_ai
3705 vec_lde(int __a, const unsigned int *__b) {
3706 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3709 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3710 return (vector float)__builtin_altivec_lvewx(__a, __b);
3715 static __inline__ vector signed char __ATTRS_o_ai
3716 vec_lvebx(int __a, const signed char *__b) {
3717 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3720 static __inline__ vector unsigned char __ATTRS_o_ai
3721 vec_lvebx(int __a, const unsigned char *__b) {
3722 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3727 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3729 return (vector short)__builtin_altivec_lvehx(__a, __b);
3732 static __inline__ vector unsigned short __ATTRS_o_ai
3733 vec_lvehx(int __a, const unsigned short *__b) {
3734 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3739 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3740 return (vector int)__builtin_altivec_lvewx(__a, __b);
3743 static __inline__ vector unsigned int __ATTRS_o_ai
3744 vec_lvewx(int __a, const unsigned int *__b) {
3745 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3748 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3750 return (vector float)__builtin_altivec_lvewx(__a, __b);
3755 static __inline__ vector signed char __ATTRS_o_ai
3756 vec_ldl(int __a, const vector signed char *__b) {
3757 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3760 static __inline__ vector signed char __ATTRS_o_ai
3761 vec_ldl(int __a, const signed char *__b) {
3762 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3765 static __inline__ vector unsigned char __ATTRS_o_ai
3766 vec_ldl(int __a, const vector unsigned char *__b) {
3767 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3770 static __inline__ vector unsigned char __ATTRS_o_ai
3771 vec_ldl(int __a, const unsigned char *__b) {
3772 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3775 static __inline__ vector bool char __ATTRS_o_ai
3776 vec_ldl(int __a, const vector bool char *__b) {
3777 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3780 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3781 const vector short *__b) {
3782 return (vector short)__builtin_altivec_lvxl(__a, __b);
3785 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3786 return (vector short)__builtin_altivec_lvxl(__a, __b);
3789 static __inline__ vector unsigned short __ATTRS_o_ai
3790 vec_ldl(int __a, const vector unsigned short *__b) {
3791 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3794 static __inline__ vector unsigned short __ATTRS_o_ai
3795 vec_ldl(int __a, const unsigned short *__b) {
3796 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3799 static __inline__ vector bool short __ATTRS_o_ai
3800 vec_ldl(int __a, const vector bool short *__b) {
3801 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3804 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3805 const vector pixel *__b) {
3806 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3809 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3810 const vector int *__b) {
3811 return (vector int)__builtin_altivec_lvxl(__a, __b);
3814 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3815 return (vector int)__builtin_altivec_lvxl(__a, __b);
3818 static __inline__ vector unsigned int __ATTRS_o_ai
3819 vec_ldl(int __a, const vector unsigned int *__b) {
3820 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3823 static __inline__ vector unsigned int __ATTRS_o_ai
3824 vec_ldl(int __a, const unsigned int *__b) {
3825 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3828 static __inline__ vector bool int __ATTRS_o_ai
3829 vec_ldl(int __a, const vector bool int *__b) {
3830 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3833 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3834 const vector float *__b) {
3835 return (vector float)__builtin_altivec_lvxl(__a, __b);
3838 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3839 return (vector float)__builtin_altivec_lvxl(__a, __b);
3844 static __inline__ vector signed char __ATTRS_o_ai
3845 vec_lvxl(int __a, const vector signed char *__b) {
3846 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3849 static __inline__ vector signed char __ATTRS_o_ai
3850 vec_lvxl(int __a, const signed char *__b) {
3851 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3854 static __inline__ vector unsigned char __ATTRS_o_ai
3855 vec_lvxl(int __a, const vector unsigned char *__b) {
3856 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3859 static __inline__ vector unsigned char __ATTRS_o_ai
3860 vec_lvxl(int __a, const unsigned char *__b) {
3861 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3864 static __inline__ vector bool char __ATTRS_o_ai
3865 vec_lvxl(int __a, const vector bool char *__b) {
3866 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3869 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3870 const vector short *__b) {
3871 return (vector short)__builtin_altivec_lvxl(__a, __b);
3874 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3876 return (vector short)__builtin_altivec_lvxl(__a, __b);
3879 static __inline__ vector unsigned short __ATTRS_o_ai
3880 vec_lvxl(int __a, const vector unsigned short *__b) {
3881 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3884 static __inline__ vector unsigned short __ATTRS_o_ai
3885 vec_lvxl(int __a, const unsigned short *__b) {
3886 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3889 static __inline__ vector bool short __ATTRS_o_ai
3890 vec_lvxl(int __a, const vector bool short *__b) {
3891 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3894 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3895 const vector pixel *__b) {
3896 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3899 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3900 const vector int *__b) {
3901 return (vector int)__builtin_altivec_lvxl(__a, __b);
3904 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3905 return (vector int)__builtin_altivec_lvxl(__a, __b);
3908 static __inline__ vector unsigned int __ATTRS_o_ai
3909 vec_lvxl(int __a, const vector unsigned int *__b) {
3910 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3913 static __inline__ vector unsigned int __ATTRS_o_ai
3914 vec_lvxl(int __a, const unsigned int *__b) {
3915 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3918 static __inline__ vector bool int __ATTRS_o_ai
3919 vec_lvxl(int __a, const vector bool int *__b) {
3920 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3923 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3924 const vector float *__b) {
3925 return (vector float)__builtin_altivec_lvxl(__a, __b);
3928 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3930 return (vector float)__builtin_altivec_lvxl(__a, __b);
3935 static __inline__ vector float __attribute__((__always_inline__))
3936 vec_loge(vector float __a) {
3937 return __builtin_altivec_vlogefp(__a);
3942 static __inline__ vector float __attribute__((__always_inline__))
3943 vec_vlogefp(vector float __a) {
3944 return __builtin_altivec_vlogefp(__a);
3949 #ifdef __LITTLE_ENDIAN__
3950 static __inline__ vector unsigned char __ATTRS_o_ai
3951 __attribute__((__deprecated__("use assignment for unaligned little endian \
3952 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3953 vector unsigned char mask =
3954 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3955 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3956 7, 6, 5, 4, 3, 2, 1, 0};
3957 return vec_perm(mask, mask, reverse);
3960 static __inline__ vector unsigned char __ATTRS_o_ai
3961 vec_lvsl(int __a, const signed char *__b) {
3962 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3966 #ifdef __LITTLE_ENDIAN__
3967 static __inline__ vector unsigned char __ATTRS_o_ai
3968 __attribute__((__deprecated__("use assignment for unaligned little endian \
3969 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3970 vector unsigned char mask =
3971 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3972 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3973 7, 6, 5, 4, 3, 2, 1, 0};
3974 return vec_perm(mask, mask, reverse);
3977 static __inline__ vector unsigned char __ATTRS_o_ai
3978 vec_lvsl(int __a, const unsigned char *__b) {
3979 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3983 #ifdef __LITTLE_ENDIAN__
3984 static __inline__ vector unsigned char __ATTRS_o_ai
3985 __attribute__((__deprecated__("use assignment for unaligned little endian \
3986 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3987 vector unsigned char mask =
3988 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3989 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3990 7, 6, 5, 4, 3, 2, 1, 0};
3991 return vec_perm(mask, mask, reverse);
3994 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3996 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4000 #ifdef __LITTLE_ENDIAN__
4001 static __inline__ vector unsigned char __ATTRS_o_ai
4002 __attribute__((__deprecated__("use assignment for unaligned little endian \
4003 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
4004 vector unsigned char mask =
4005 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4006 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4007 7, 6, 5, 4, 3, 2, 1, 0};
4008 return vec_perm(mask, mask, reverse);
4011 static __inline__ vector unsigned char __ATTRS_o_ai
4012 vec_lvsl(int __a, const unsigned short *__b) {
4013 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4017 #ifdef __LITTLE_ENDIAN__
4018 static __inline__ vector unsigned char __ATTRS_o_ai
4019 __attribute__((__deprecated__("use assignment for unaligned little endian \
4020 loads/stores"))) vec_lvsl(int __a, const int *__b) {
4021 vector unsigned char mask =
4022 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4023 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4024 7, 6, 5, 4, 3, 2, 1, 0};
4025 return vec_perm(mask, mask, reverse);
4028 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4030 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4034 #ifdef __LITTLE_ENDIAN__
4035 static __inline__ vector unsigned char __ATTRS_o_ai
4036 __attribute__((__deprecated__("use assignment for unaligned little endian \
4037 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
4038 vector unsigned char mask =
4039 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4040 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4041 7, 6, 5, 4, 3, 2, 1, 0};
4042 return vec_perm(mask, mask, reverse);
4045 static __inline__ vector unsigned char __ATTRS_o_ai
4046 vec_lvsl(int __a, const unsigned int *__b) {
4047 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4051 #ifdef __LITTLE_ENDIAN__
4052 static __inline__ vector unsigned char __ATTRS_o_ai
4053 __attribute__((__deprecated__("use assignment for unaligned little endian \
4054 loads/stores"))) vec_lvsl(int __a, const float *__b) {
4055 vector unsigned char mask =
4056 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4057 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4058 7, 6, 5, 4, 3, 2, 1, 0};
4059 return vec_perm(mask, mask, reverse);
4062 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4064 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4070 #ifdef __LITTLE_ENDIAN__
4071 static __inline__ vector unsigned char __ATTRS_o_ai
4072 __attribute__((__deprecated__("use assignment for unaligned little endian \
4073 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4074 vector unsigned char mask =
4075 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4076 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4077 7, 6, 5, 4, 3, 2, 1, 0};
4078 return vec_perm(mask, mask, reverse);
4081 static __inline__ vector unsigned char __ATTRS_o_ai
4082 vec_lvsr(int __a, const signed char *__b) {
4083 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4087 #ifdef __LITTLE_ENDIAN__
4088 static __inline__ vector unsigned char __ATTRS_o_ai
4089 __attribute__((__deprecated__("use assignment for unaligned little endian \
4090 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4091 vector unsigned char mask =
4092 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4093 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4094 7, 6, 5, 4, 3, 2, 1, 0};
4095 return vec_perm(mask, mask, reverse);
4098 static __inline__ vector unsigned char __ATTRS_o_ai
4099 vec_lvsr(int __a, const unsigned char *__b) {
4100 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4104 #ifdef __LITTLE_ENDIAN__
4105 static __inline__ vector unsigned char __ATTRS_o_ai
4106 __attribute__((__deprecated__("use assignment for unaligned little endian \
4107 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4108 vector unsigned char mask =
4109 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4110 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4111 7, 6, 5, 4, 3, 2, 1, 0};
4112 return vec_perm(mask, mask, reverse);
4115 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4117 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4121 #ifdef __LITTLE_ENDIAN__
4122 static __inline__ vector unsigned char __ATTRS_o_ai
4123 __attribute__((__deprecated__("use assignment for unaligned little endian \
4124 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4125 vector unsigned char mask =
4126 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4127 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4128 7, 6, 5, 4, 3, 2, 1, 0};
4129 return vec_perm(mask, mask, reverse);
4132 static __inline__ vector unsigned char __ATTRS_o_ai
4133 vec_lvsr(int __a, const unsigned short *__b) {
4134 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4138 #ifdef __LITTLE_ENDIAN__
4139 static __inline__ vector unsigned char __ATTRS_o_ai
4140 __attribute__((__deprecated__("use assignment for unaligned little endian \
4141 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4142 vector unsigned char mask =
4143 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4144 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4145 7, 6, 5, 4, 3, 2, 1, 0};
4146 return vec_perm(mask, mask, reverse);
4149 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4151 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4155 #ifdef __LITTLE_ENDIAN__
4156 static __inline__ vector unsigned char __ATTRS_o_ai
4157 __attribute__((__deprecated__("use assignment for unaligned little endian \
4158 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4159 vector unsigned char mask =
4160 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4161 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4162 7, 6, 5, 4, 3, 2, 1, 0};
4163 return vec_perm(mask, mask, reverse);
4166 static __inline__ vector unsigned char __ATTRS_o_ai
4167 vec_lvsr(int __a, const unsigned int *__b) {
4168 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4172 #ifdef __LITTLE_ENDIAN__
4173 static __inline__ vector unsigned char __ATTRS_o_ai
4174 __attribute__((__deprecated__("use assignment for unaligned little endian \
4175 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4176 vector unsigned char mask =
4177 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4178 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4179 7, 6, 5, 4, 3, 2, 1, 0};
4180 return vec_perm(mask, mask, reverse);
4183 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4185 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4190 static __inline__ vector signed short __ATTRS_o_ai
4191 vec_mladd(vector signed short, vector signed short, vector signed short);
4192 static __inline__ vector signed short __ATTRS_o_ai
4193 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4194 static __inline__ vector signed short __ATTRS_o_ai
4195 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4196 static __inline__ vector unsigned short __ATTRS_o_ai
4197 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4199 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4200 vector signed short __a, vector signed short __b, vector signed short __c) {
4201 return vec_mladd(__a, __b, __c);
4204 static __inline__ vector signed short __ATTRS_o_ai
4205 vec_madd(vector signed short __a, vector unsigned short __b,
4206 vector unsigned short __c) {
4207 return vec_mladd(__a, __b, __c);
4210 static __inline__ vector signed short __ATTRS_o_ai
4211 vec_madd(vector unsigned short __a, vector signed short __b,
4212 vector signed short __c) {
4213 return vec_mladd(__a, __b, __c);
4216 static __inline__ vector unsigned short __ATTRS_o_ai
4217 vec_madd(vector unsigned short __a, vector unsigned short __b,
4218 vector unsigned short __c) {
4219 return vec_mladd(__a, __b, __c);
4222 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4226 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4228 return __builtin_altivec_vmaddfp(__a, __b, __c);
4233 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4235 vector double __c) {
4236 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4242 static __inline__ vector float __attribute__((__always_inline__))
4243 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4244 return __builtin_altivec_vmaddfp(__a, __b, __c);
4249 static __inline__ vector signed short __attribute__((__always_inline__))
4250 vec_madds(vector signed short __a, vector signed short __b,
4251 vector signed short __c) {
4252 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4256 static __inline__ vector signed short __attribute__((__always_inline__))
4257 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4258 vector signed short __c) {
4259 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4265 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4268 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4271 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4273 vector double __c) {
4274 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4280 static __inline__ vector signed char __ATTRS_o_ai
4281 vec_max(vector signed char __a, vector signed char __b) {
4282 return __builtin_altivec_vmaxsb(__a, __b);
4285 static __inline__ vector signed char __ATTRS_o_ai
4286 vec_max(vector bool char __a, vector signed char __b) {
4287 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4290 static __inline__ vector signed char __ATTRS_o_ai
4291 vec_max(vector signed char __a, vector bool char __b) {
4292 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4295 static __inline__ vector unsigned char __ATTRS_o_ai
4296 vec_max(vector unsigned char __a, vector unsigned char __b) {
4297 return __builtin_altivec_vmaxub(__a, __b);
4300 static __inline__ vector unsigned char __ATTRS_o_ai
4301 vec_max(vector bool char __a, vector unsigned char __b) {
4302 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4305 static __inline__ vector unsigned char __ATTRS_o_ai
4306 vec_max(vector unsigned char __a, vector bool char __b) {
4307 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4310 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4312 return __builtin_altivec_vmaxsh(__a, __b);
4315 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4317 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4320 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4321 vector bool short __b) {
4322 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4325 static __inline__ vector unsigned short __ATTRS_o_ai
4326 vec_max(vector unsigned short __a, vector unsigned short __b) {
4327 return __builtin_altivec_vmaxuh(__a, __b);
4330 static __inline__ vector unsigned short __ATTRS_o_ai
4331 vec_max(vector bool short __a, vector unsigned short __b) {
4332 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4335 static __inline__ vector unsigned short __ATTRS_o_ai
4336 vec_max(vector unsigned short __a, vector bool short __b) {
4337 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4340 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4342 return __builtin_altivec_vmaxsw(__a, __b);
4345 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4347 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4350 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4351 vector bool int __b) {
4352 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4355 static __inline__ vector unsigned int __ATTRS_o_ai
4356 vec_max(vector unsigned int __a, vector unsigned int __b) {
4357 return __builtin_altivec_vmaxuw(__a, __b);
4360 static __inline__ vector unsigned int __ATTRS_o_ai
4361 vec_max(vector bool int __a, vector unsigned int __b) {
4362 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4365 static __inline__ vector unsigned int __ATTRS_o_ai
4366 vec_max(vector unsigned int __a, vector bool int __b) {
4367 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4370 #ifdef __POWER8_VECTOR__
4371 static __inline__ vector signed long long __ATTRS_o_ai
4372 vec_max(vector signed long long __a, vector signed long long __b) {
4373 return __builtin_altivec_vmaxsd(__a, __b);
4376 static __inline__ vector signed long long __ATTRS_o_ai
4377 vec_max(vector bool long long __a, vector signed long long __b) {
4378 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4381 static __inline__ vector signed long long __ATTRS_o_ai
4382 vec_max(vector signed long long __a, vector bool long long __b) {
4383 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4386 static __inline__ vector unsigned long long __ATTRS_o_ai
4387 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4388 return __builtin_altivec_vmaxud(__a, __b);
4391 static __inline__ vector unsigned long long __ATTRS_o_ai
4392 vec_max(vector bool long long __a, vector unsigned long long __b) {
4393 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4396 static __inline__ vector unsigned long long __ATTRS_o_ai
4397 vec_max(vector unsigned long long __a, vector bool long long __b) {
4398 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4402 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4405 return __builtin_vsx_xvmaxsp(__a, __b);
4407 return __builtin_altivec_vmaxfp(__a, __b);
4412 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4413 vector double __b) {
4414 return __builtin_vsx_xvmaxdp(__a, __b);
4420 static __inline__ vector signed char __ATTRS_o_ai
4421 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4422 return __builtin_altivec_vmaxsb(__a, __b);
4425 static __inline__ vector signed char __ATTRS_o_ai
4426 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4427 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4430 static __inline__ vector signed char __ATTRS_o_ai
4431 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4432 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4437 static __inline__ vector unsigned char __ATTRS_o_ai
4438 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4439 return __builtin_altivec_vmaxub(__a, __b);
4442 static __inline__ vector unsigned char __ATTRS_o_ai
4443 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4444 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4447 static __inline__ vector unsigned char __ATTRS_o_ai
4448 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4449 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4454 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4456 return __builtin_altivec_vmaxsh(__a, __b);
4459 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4461 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4464 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4465 vector bool short __b) {
4466 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4471 static __inline__ vector unsigned short __ATTRS_o_ai
4472 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4473 return __builtin_altivec_vmaxuh(__a, __b);
4476 static __inline__ vector unsigned short __ATTRS_o_ai
4477 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4478 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4481 static __inline__ vector unsigned short __ATTRS_o_ai
4482 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4483 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4488 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4490 return __builtin_altivec_vmaxsw(__a, __b);
4493 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4495 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4498 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4499 vector bool int __b) {
4500 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4505 static __inline__ vector unsigned int __ATTRS_o_ai
4506 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4507 return __builtin_altivec_vmaxuw(__a, __b);
4510 static __inline__ vector unsigned int __ATTRS_o_ai
4511 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4512 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4515 static __inline__ vector unsigned int __ATTRS_o_ai
4516 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4517 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4522 static __inline__ vector float __attribute__((__always_inline__))
4523 vec_vmaxfp(vector float __a, vector float __b) {
4525 return __builtin_vsx_xvmaxsp(__a, __b);
4527 return __builtin_altivec_vmaxfp(__a, __b);
4533 static __inline__ vector signed char __ATTRS_o_ai
4534 vec_mergeh(vector signed char __a, vector signed char __b) {
4535 return vec_perm(__a, __b,
4536 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4537 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4538 0x06, 0x16, 0x07, 0x17));
4541 static __inline__ vector unsigned char __ATTRS_o_ai
4542 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4543 return vec_perm(__a, __b,
4544 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4545 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4546 0x06, 0x16, 0x07, 0x17));
4549 static __inline__ vector bool char __ATTRS_o_ai
4550 vec_mergeh(vector bool char __a, vector bool char __b) {
4551 return vec_perm(__a, __b,
4552 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4553 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4554 0x06, 0x16, 0x07, 0x17));
4557 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4559 return vec_perm(__a, __b,
4560 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4561 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4562 0x06, 0x07, 0x16, 0x17));
4565 static __inline__ vector unsigned short __ATTRS_o_ai
4566 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4567 return vec_perm(__a, __b,
4568 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4569 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4570 0x06, 0x07, 0x16, 0x17));
4573 static __inline__ vector bool short __ATTRS_o_ai
4574 vec_mergeh(vector bool short __a, vector bool short __b) {
4575 return vec_perm(__a, __b,
4576 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4577 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4578 0x06, 0x07, 0x16, 0x17));
4581 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4583 return vec_perm(__a, __b,
4584 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4585 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4586 0x06, 0x07, 0x16, 0x17));
4589 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4591 return vec_perm(__a, __b,
4592 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4593 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4594 0x14, 0x15, 0x16, 0x17));
4597 static __inline__ vector unsigned int __ATTRS_o_ai
4598 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4599 return vec_perm(__a, __b,
4600 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4601 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4602 0x14, 0x15, 0x16, 0x17));
4605 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4606 vector bool int __b) {
4607 return vec_perm(__a, __b,
4608 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4609 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4610 0x14, 0x15, 0x16, 0x17));
4613 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4615 return vec_perm(__a, __b,
4616 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4617 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4618 0x14, 0x15, 0x16, 0x17));
4622 static __inline__ vector signed long long __ATTRS_o_ai
4623 vec_mergeh(vector signed long long __a, vector signed long long __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));
4630 static __inline__ vector signed long long __ATTRS_o_ai
4631 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4632 return vec_perm(__a, (vector signed long long)__b,
4633 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4634 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4635 0x14, 0x15, 0x16, 0x17));
4638 static __inline__ vector signed long long __ATTRS_o_ai
4639 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4640 return vec_perm((vector signed long long)__a, __b,
4641 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4642 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4643 0x14, 0x15, 0x16, 0x17));
4646 static __inline__ vector unsigned long long __ATTRS_o_ai
4647 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4648 return vec_perm(__a, __b,
4649 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4650 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4651 0x14, 0x15, 0x16, 0x17));
4654 static __inline__ vector unsigned long long __ATTRS_o_ai
4655 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4656 return vec_perm(__a, (vector unsigned long long)__b,
4657 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4658 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4659 0x14, 0x15, 0x16, 0x17));
4662 static __inline__ vector unsigned long long __ATTRS_o_ai
4663 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4664 return vec_perm((vector unsigned long long)__a, __b,
4665 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4666 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4667 0x14, 0x15, 0x16, 0x17));
4670 static __inline__ vector bool long long __ATTRS_o_ai
4671 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4672 return vec_perm(__a, __b,
4673 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4674 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4675 0x14, 0x15, 0x16, 0x17));
4678 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4679 vector double __b) {
4680 return vec_perm(__a, __b,
4681 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4682 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4683 0x14, 0x15, 0x16, 0x17));
4685 static __inline__ vector double __ATTRS_o_ai
4686 vec_mergeh(vector double __a, vector bool long long __b) {
4687 return vec_perm(__a, (vector double)__b,
4688 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4689 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4690 0x14, 0x15, 0x16, 0x17));
4692 static __inline__ vector double __ATTRS_o_ai
4693 vec_mergeh(vector bool long long __a, vector double __b) {
4694 return vec_perm((vector double)__a, __b,
4695 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4696 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4697 0x14, 0x15, 0x16, 0x17));
4703 #define __builtin_altivec_vmrghb vec_vmrghb
4705 static __inline__ vector signed char __ATTRS_o_ai
4706 vec_vmrghb(vector signed char __a, vector signed char __b) {
4707 return vec_perm(__a, __b,
4708 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4709 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4710 0x06, 0x16, 0x07, 0x17));
4713 static __inline__ vector unsigned char __ATTRS_o_ai
4714 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4715 return vec_perm(__a, __b,
4716 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4717 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4718 0x06, 0x16, 0x07, 0x17));
4721 static __inline__ vector bool char __ATTRS_o_ai
4722 vec_vmrghb(vector bool char __a, vector bool char __b) {
4723 return vec_perm(__a, __b,
4724 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4725 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4726 0x06, 0x16, 0x07, 0x17));
4731 #define __builtin_altivec_vmrghh vec_vmrghh
4733 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4735 return vec_perm(__a, __b,
4736 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4737 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4738 0x06, 0x07, 0x16, 0x17));
4741 static __inline__ vector unsigned short __ATTRS_o_ai
4742 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4743 return vec_perm(__a, __b,
4744 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4745 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4746 0x06, 0x07, 0x16, 0x17));
4749 static __inline__ vector bool short __ATTRS_o_ai
4750 vec_vmrghh(vector bool short __a, vector bool short __b) {
4751 return vec_perm(__a, __b,
4752 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4753 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4754 0x06, 0x07, 0x16, 0x17));
4757 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4759 return vec_perm(__a, __b,
4760 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4761 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4762 0x06, 0x07, 0x16, 0x17));
4767 #define __builtin_altivec_vmrghw vec_vmrghw
4769 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4771 return vec_perm(__a, __b,
4772 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4773 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4774 0x14, 0x15, 0x16, 0x17));
4777 static __inline__ vector unsigned int __ATTRS_o_ai
4778 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4779 return vec_perm(__a, __b,
4780 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4781 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4782 0x14, 0x15, 0x16, 0x17));
4785 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4786 vector bool int __b) {
4787 return vec_perm(__a, __b,
4788 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4789 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4790 0x14, 0x15, 0x16, 0x17));
4793 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4795 return vec_perm(__a, __b,
4796 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4797 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4798 0x14, 0x15, 0x16, 0x17));
4803 static __inline__ vector signed char __ATTRS_o_ai
4804 vec_mergel(vector signed char __a, vector signed char __b) {
4805 return vec_perm(__a, __b,
4806 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4807 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4808 0x0E, 0x1E, 0x0F, 0x1F));
4811 static __inline__ vector unsigned char __ATTRS_o_ai
4812 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4813 return vec_perm(__a, __b,
4814 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4815 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4816 0x0E, 0x1E, 0x0F, 0x1F));
4819 static __inline__ vector bool char __ATTRS_o_ai
4820 vec_mergel(vector bool char __a, vector bool char __b) {
4821 return vec_perm(__a, __b,
4822 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4823 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4824 0x0E, 0x1E, 0x0F, 0x1F));
4827 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4829 return vec_perm(__a, __b,
4830 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4831 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4832 0x0E, 0x0F, 0x1E, 0x1F));
4835 static __inline__ vector unsigned short __ATTRS_o_ai
4836 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4837 return vec_perm(__a, __b,
4838 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4839 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4840 0x0E, 0x0F, 0x1E, 0x1F));
4843 static __inline__ vector bool short __ATTRS_o_ai
4844 vec_mergel(vector bool short __a, vector bool short __b) {
4845 return vec_perm(__a, __b,
4846 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4847 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4848 0x0E, 0x0F, 0x1E, 0x1F));
4851 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4853 return vec_perm(__a, __b,
4854 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4855 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4856 0x0E, 0x0F, 0x1E, 0x1F));
4859 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4861 return vec_perm(__a, __b,
4862 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4863 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4864 0x1C, 0x1D, 0x1E, 0x1F));
4867 static __inline__ vector unsigned int __ATTRS_o_ai
4868 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4869 return vec_perm(__a, __b,
4870 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4871 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4872 0x1C, 0x1D, 0x1E, 0x1F));
4875 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4876 vector bool int __b) {
4877 return vec_perm(__a, __b,
4878 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4879 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4880 0x1C, 0x1D, 0x1E, 0x1F));
4883 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4885 return vec_perm(__a, __b,
4886 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4887 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4888 0x1C, 0x1D, 0x1E, 0x1F));
4892 static __inline__ vector signed long long __ATTRS_o_ai
4893 vec_mergel(vector signed long long __a, vector signed long long __b) {
4894 return vec_perm(__a, __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 signed long long __ATTRS_o_ai
4900 vec_mergel(vector signed long long __a, vector bool long long __b) {
4901 return vec_perm(__a, (vector signed long long)__b,
4902 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4903 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4904 0x1C, 0x1D, 0x1E, 0x1F));
4906 static __inline__ vector signed long long __ATTRS_o_ai
4907 vec_mergel(vector bool long long __a, vector signed long long __b) {
4908 return vec_perm((vector signed long long)__a, __b,
4909 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4910 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4911 0x1C, 0x1D, 0x1E, 0x1F));
4913 static __inline__ vector unsigned long long __ATTRS_o_ai
4914 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4915 return vec_perm(__a, __b,
4916 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4917 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4918 0x1C, 0x1D, 0x1E, 0x1F));
4920 static __inline__ vector unsigned long long __ATTRS_o_ai
4921 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4922 return vec_perm(__a, (vector unsigned long long)__b,
4923 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4924 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4925 0x1C, 0x1D, 0x1E, 0x1F));
4927 static __inline__ vector unsigned long long __ATTRS_o_ai
4928 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4929 return vec_perm((vector unsigned long long)__a, __b,
4930 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4931 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4932 0x1C, 0x1D, 0x1E, 0x1F));
4934 static __inline__ vector bool long long __ATTRS_o_ai
4935 vec_mergel(vector bool long long __a, vector bool long long __b) {
4936 return vec_perm(__a, __b,
4937 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4938 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4939 0x1C, 0x1D, 0x1E, 0x1F));
4941 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4942 vector double __b) {
4943 return vec_perm(__a, __b,
4944 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4945 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4946 0x1C, 0x1D, 0x1E, 0x1F));
4948 static __inline__ vector double __ATTRS_o_ai
4949 vec_mergel(vector double __a, vector bool long long __b) {
4950 return vec_perm(__a, (vector double)__b,
4951 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4952 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4953 0x1C, 0x1D, 0x1E, 0x1F));
4955 static __inline__ vector double __ATTRS_o_ai
4956 vec_mergel(vector bool long long __a, vector double __b) {
4957 return vec_perm((vector double)__a, __b,
4958 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4959 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4960 0x1C, 0x1D, 0x1E, 0x1F));
4966 #define __builtin_altivec_vmrglb vec_vmrglb
4968 static __inline__ vector signed char __ATTRS_o_ai
4969 vec_vmrglb(vector signed char __a, vector signed char __b) {
4970 return vec_perm(__a, __b,
4971 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4972 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4973 0x0E, 0x1E, 0x0F, 0x1F));
4976 static __inline__ vector unsigned char __ATTRS_o_ai
4977 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4978 return vec_perm(__a, __b,
4979 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4980 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4981 0x0E, 0x1E, 0x0F, 0x1F));
4984 static __inline__ vector bool char __ATTRS_o_ai
4985 vec_vmrglb(vector bool char __a, vector bool char __b) {
4986 return vec_perm(__a, __b,
4987 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4988 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4989 0x0E, 0x1E, 0x0F, 0x1F));
4994 #define __builtin_altivec_vmrglh vec_vmrglh
4996 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4998 return vec_perm(__a, __b,
4999 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5000 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5001 0x0E, 0x0F, 0x1E, 0x1F));
5004 static __inline__ vector unsigned short __ATTRS_o_ai
5005 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
5006 return vec_perm(__a, __b,
5007 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5008 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5009 0x0E, 0x0F, 0x1E, 0x1F));
5012 static __inline__ vector bool short __ATTRS_o_ai
5013 vec_vmrglh(vector bool short __a, vector bool short __b) {
5014 return vec_perm(__a, __b,
5015 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5016 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5017 0x0E, 0x0F, 0x1E, 0x1F));
5020 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
5022 return vec_perm(__a, __b,
5023 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5024 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5025 0x0E, 0x0F, 0x1E, 0x1F));
5030 #define __builtin_altivec_vmrglw vec_vmrglw
5032 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
5034 return vec_perm(__a, __b,
5035 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5036 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5037 0x1C, 0x1D, 0x1E, 0x1F));
5040 static __inline__ vector unsigned int __ATTRS_o_ai
5041 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
5042 return vec_perm(__a, __b,
5043 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5044 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5045 0x1C, 0x1D, 0x1E, 0x1F));
5048 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5049 vector bool int __b) {
5050 return vec_perm(__a, __b,
5051 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5052 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5053 0x1C, 0x1D, 0x1E, 0x1F));
5056 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5058 return vec_perm(__a, __b,
5059 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5060 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5061 0x1C, 0x1D, 0x1E, 0x1F));
5064 #ifdef __POWER8_VECTOR__
5067 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5068 vector bool int __b) {
5069 return vec_perm(__a, __b,
5070 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5071 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5072 0x18, 0x19, 0x1A, 0x1B));
5075 static __inline__ vector signed int __ATTRS_o_ai
5076 vec_mergee(vector signed int __a, vector signed int __b) {
5077 return vec_perm(__a, __b,
5078 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5079 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5080 0x18, 0x19, 0x1A, 0x1B));
5083 static __inline__ vector unsigned int __ATTRS_o_ai
5084 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5085 return vec_perm(__a, __b,
5086 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5087 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5088 0x18, 0x19, 0x1A, 0x1B));
5091 static __inline__ vector bool long long __ATTRS_o_ai
5092 vec_mergee(vector bool long long __a, vector bool long long __b) {
5093 return vec_mergeh(__a, __b);
5096 static __inline__ vector signed long long __ATTRS_o_ai
5097 vec_mergee(vector signed long long __a, vector signed long long __b) {
5098 return vec_mergeh(__a, __b);
5101 static __inline__ vector unsigned long long __ATTRS_o_ai
5102 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5103 return vec_mergeh(__a, __b);
5106 static __inline__ vector float __ATTRS_o_ai
5107 vec_mergee(vector float __a, vector float __b) {
5108 return vec_perm(__a, __b,
5109 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5110 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5111 0x18, 0x19, 0x1A, 0x1B));
5114 static __inline__ vector double __ATTRS_o_ai
5115 vec_mergee(vector double __a, vector double __b) {
5116 return vec_mergeh(__a, __b);
5121 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5122 vector bool int __b) {
5123 return vec_perm(__a, __b,
5124 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5125 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5126 0x1C, 0x1D, 0x1E, 0x1F));
5129 static __inline__ vector signed int __ATTRS_o_ai
5130 vec_mergeo(vector signed int __a, vector signed int __b) {
5131 return vec_perm(__a, __b,
5132 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5133 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5134 0x1C, 0x1D, 0x1E, 0x1F));
5137 static __inline__ vector unsigned int __ATTRS_o_ai
5138 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5139 return vec_perm(__a, __b,
5140 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5141 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5142 0x1C, 0x1D, 0x1E, 0x1F));
5145 static __inline__ vector bool long long __ATTRS_o_ai
5146 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5147 return vec_mergel(__a, __b);
5150 static __inline__ vector signed long long __ATTRS_o_ai
5151 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5152 return vec_mergel(__a, __b);
5155 static __inline__ vector unsigned long long __ATTRS_o_ai
5156 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5157 return vec_mergel(__a, __b);
5160 static __inline__ vector float __ATTRS_o_ai
5161 vec_mergeo(vector float __a, vector float __b) {
5162 return vec_perm(__a, __b,
5163 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5164 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5165 0x1C, 0x1D, 0x1E, 0x1F));
5168 static __inline__ vector double __ATTRS_o_ai
5169 vec_mergeo(vector double __a, vector double __b) {
5170 return vec_mergel(__a, __b);
5177 static __inline__ vector unsigned short __attribute__((__always_inline__))
5179 return __builtin_altivec_mfvscr();
5184 static __inline__ vector signed char __ATTRS_o_ai
5185 vec_min(vector signed char __a, vector signed char __b) {
5186 return __builtin_altivec_vminsb(__a, __b);
5189 static __inline__ vector signed char __ATTRS_o_ai
5190 vec_min(vector bool char __a, vector signed char __b) {
5191 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5194 static __inline__ vector signed char __ATTRS_o_ai
5195 vec_min(vector signed char __a, vector bool char __b) {
5196 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5199 static __inline__ vector unsigned char __ATTRS_o_ai
5200 vec_min(vector unsigned char __a, vector unsigned char __b) {
5201 return __builtin_altivec_vminub(__a, __b);
5204 static __inline__ vector unsigned char __ATTRS_o_ai
5205 vec_min(vector bool char __a, vector unsigned char __b) {
5206 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5209 static __inline__ vector unsigned char __ATTRS_o_ai
5210 vec_min(vector unsigned char __a, vector bool char __b) {
5211 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5214 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5216 return __builtin_altivec_vminsh(__a, __b);
5219 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5221 return __builtin_altivec_vminsh((vector short)__a, __b);
5224 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5225 vector bool short __b) {
5226 return __builtin_altivec_vminsh(__a, (vector short)__b);
5229 static __inline__ vector unsigned short __ATTRS_o_ai
5230 vec_min(vector unsigned short __a, vector unsigned short __b) {
5231 return __builtin_altivec_vminuh(__a, __b);
5234 static __inline__ vector unsigned short __ATTRS_o_ai
5235 vec_min(vector bool short __a, vector unsigned short __b) {
5236 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5239 static __inline__ vector unsigned short __ATTRS_o_ai
5240 vec_min(vector unsigned short __a, vector bool short __b) {
5241 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5244 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5246 return __builtin_altivec_vminsw(__a, __b);
5249 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5251 return __builtin_altivec_vminsw((vector int)__a, __b);
5254 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5255 vector bool int __b) {
5256 return __builtin_altivec_vminsw(__a, (vector int)__b);
5259 static __inline__ vector unsigned int __ATTRS_o_ai
5260 vec_min(vector unsigned int __a, vector unsigned int __b) {
5261 return __builtin_altivec_vminuw(__a, __b);
5264 static __inline__ vector unsigned int __ATTRS_o_ai
5265 vec_min(vector bool int __a, vector unsigned int __b) {
5266 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5269 static __inline__ vector unsigned int __ATTRS_o_ai
5270 vec_min(vector unsigned int __a, vector bool int __b) {
5271 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5274 #ifdef __POWER8_VECTOR__
5275 static __inline__ vector signed long long __ATTRS_o_ai
5276 vec_min(vector signed long long __a, vector signed long long __b) {
5277 return __builtin_altivec_vminsd(__a, __b);
5280 static __inline__ vector signed long long __ATTRS_o_ai
5281 vec_min(vector bool long long __a, vector signed long long __b) {
5282 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5285 static __inline__ vector signed long long __ATTRS_o_ai
5286 vec_min(vector signed long long __a, vector bool long long __b) {
5287 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5290 static __inline__ vector unsigned long long __ATTRS_o_ai
5291 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5292 return __builtin_altivec_vminud(__a, __b);
5295 static __inline__ vector unsigned long long __ATTRS_o_ai
5296 vec_min(vector bool long long __a, vector unsigned long long __b) {
5297 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5300 static __inline__ vector unsigned long long __ATTRS_o_ai
5301 vec_min(vector unsigned long long __a, vector bool long long __b) {
5302 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5306 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5309 return __builtin_vsx_xvminsp(__a, __b);
5311 return __builtin_altivec_vminfp(__a, __b);
5316 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5317 vector double __b) {
5318 return __builtin_vsx_xvmindp(__a, __b);
5324 static __inline__ vector signed char __ATTRS_o_ai
5325 vec_vminsb(vector signed char __a, vector signed char __b) {
5326 return __builtin_altivec_vminsb(__a, __b);
5329 static __inline__ vector signed char __ATTRS_o_ai
5330 vec_vminsb(vector bool char __a, vector signed char __b) {
5331 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5334 static __inline__ vector signed char __ATTRS_o_ai
5335 vec_vminsb(vector signed char __a, vector bool char __b) {
5336 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5341 static __inline__ vector unsigned char __ATTRS_o_ai
5342 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5343 return __builtin_altivec_vminub(__a, __b);
5346 static __inline__ vector unsigned char __ATTRS_o_ai
5347 vec_vminub(vector bool char __a, vector unsigned char __b) {
5348 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5351 static __inline__ vector unsigned char __ATTRS_o_ai
5352 vec_vminub(vector unsigned char __a, vector bool char __b) {
5353 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5358 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5360 return __builtin_altivec_vminsh(__a, __b);
5363 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5365 return __builtin_altivec_vminsh((vector short)__a, __b);
5368 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5369 vector bool short __b) {
5370 return __builtin_altivec_vminsh(__a, (vector short)__b);
5375 static __inline__ vector unsigned short __ATTRS_o_ai
5376 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5377 return __builtin_altivec_vminuh(__a, __b);
5380 static __inline__ vector unsigned short __ATTRS_o_ai
5381 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5382 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5385 static __inline__ vector unsigned short __ATTRS_o_ai
5386 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5387 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5392 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5394 return __builtin_altivec_vminsw(__a, __b);
5397 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5399 return __builtin_altivec_vminsw((vector int)__a, __b);
5402 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5403 vector bool int __b) {
5404 return __builtin_altivec_vminsw(__a, (vector int)__b);
5409 static __inline__ vector unsigned int __ATTRS_o_ai
5410 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5411 return __builtin_altivec_vminuw(__a, __b);
5414 static __inline__ vector unsigned int __ATTRS_o_ai
5415 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5416 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5419 static __inline__ vector unsigned int __ATTRS_o_ai
5420 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5421 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5426 static __inline__ vector float __attribute__((__always_inline__))
5427 vec_vminfp(vector float __a, vector float __b) {
5429 return __builtin_vsx_xvminsp(__a, __b);
5431 return __builtin_altivec_vminfp(__a, __b);
5437 #define __builtin_altivec_vmladduhm vec_mladd
5439 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5442 return __a * __b + __c;
5445 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5446 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5447 return __a * (vector short)__b + (vector short)__c;
5450 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5453 return (vector short)__a * __b + __c;
5456 static __inline__ vector unsigned short __ATTRS_o_ai
5457 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5458 vector unsigned short __c) {
5459 return __a * __b + __c;
5464 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5467 return __a * __b + __c;
5470 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5471 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5472 return __a * (vector short)__b + (vector short)__c;
5475 static __inline__ vector short __ATTRS_o_ai
5476 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5477 return (vector short)__a * __b + __c;
5480 static __inline__ vector unsigned short __ATTRS_o_ai
5481 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5482 vector unsigned short __c) {
5483 return __a * __b + __c;
5488 static __inline__ vector short __attribute__((__always_inline__))
5489 vec_mradds(vector short __a, vector short __b, vector short __c) {
5490 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5493 /* vec_vmhraddshs */
5495 static __inline__ vector short __attribute__((__always_inline__))
5496 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5497 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5502 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5503 vector unsigned char __b,
5505 return __builtin_altivec_vmsummbm(__a, __b, __c);
5508 static __inline__ vector unsigned int __ATTRS_o_ai
5509 vec_msum(vector unsigned char __a, vector unsigned char __b,
5510 vector unsigned int __c) {
5511 return __builtin_altivec_vmsumubm(__a, __b, __c);
5514 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5517 return __builtin_altivec_vmsumshm(__a, __b, __c);
5520 static __inline__ vector unsigned int __ATTRS_o_ai
5521 vec_msum(vector unsigned short __a, vector unsigned short __b,
5522 vector unsigned int __c) {
5523 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5528 static __inline__ vector int __attribute__((__always_inline__))
5529 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5530 return __builtin_altivec_vmsummbm(__a, __b, __c);
5535 static __inline__ vector unsigned int __attribute__((__always_inline__))
5536 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5537 vector unsigned int __c) {
5538 return __builtin_altivec_vmsumubm(__a, __b, __c);
5543 static __inline__ vector int __attribute__((__always_inline__))
5544 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5545 return __builtin_altivec_vmsumshm(__a, __b, __c);
5550 static __inline__ vector unsigned int __attribute__((__always_inline__))
5551 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5552 vector unsigned int __c) {
5553 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5558 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5561 return __builtin_altivec_vmsumshs(__a, __b, __c);
5564 static __inline__ vector unsigned int __ATTRS_o_ai
5565 vec_msums(vector unsigned short __a, vector unsigned short __b,
5566 vector unsigned int __c) {
5567 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5572 static __inline__ vector int __attribute__((__always_inline__))
5573 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5574 return __builtin_altivec_vmsumshs(__a, __b, __c);
5579 static __inline__ vector unsigned int __attribute__((__always_inline__))
5580 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5581 vector unsigned int __c) {
5582 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5587 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5588 __builtin_altivec_mtvscr((vector int)__a);
5591 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5592 __builtin_altivec_mtvscr((vector int)__a);
5595 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5596 __builtin_altivec_mtvscr((vector int)__a);
5599 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5600 __builtin_altivec_mtvscr((vector int)__a);
5603 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5604 __builtin_altivec_mtvscr((vector int)__a);
5607 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5608 __builtin_altivec_mtvscr((vector int)__a);
5611 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5612 __builtin_altivec_mtvscr((vector int)__a);
5615 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5616 __builtin_altivec_mtvscr((vector int)__a);
5619 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5620 __builtin_altivec_mtvscr((vector int)__a);
5623 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5624 __builtin_altivec_mtvscr((vector int)__a);
5627 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5628 __builtin_altivec_mtvscr((vector int)__a);
5633 /* Integer vector multiplication will involve multiplication of the odd/even
5634 elements separately, then truncating the results and moving to the
5637 static __inline__ vector signed char __ATTRS_o_ai
5638 vec_mul(vector signed char __a, vector signed char __b) {
5642 static __inline__ vector unsigned char __ATTRS_o_ai
5643 vec_mul(vector unsigned char __a, vector unsigned char __b) {
5647 static __inline__ vector signed short __ATTRS_o_ai
5648 vec_mul(vector signed short __a, vector signed short __b) {
5652 static __inline__ vector unsigned short __ATTRS_o_ai
5653 vec_mul(vector unsigned short __a, vector unsigned short __b) {
5657 static __inline__ vector signed int __ATTRS_o_ai
5658 vec_mul(vector signed int __a, vector signed int __b) {
5662 static __inline__ vector unsigned int __ATTRS_o_ai
5663 vec_mul(vector unsigned int __a, vector unsigned int __b) {
5668 static __inline__ vector signed long long __ATTRS_o_ai
5669 vec_mul(vector signed long long __a, vector signed long long __b) {
5673 static __inline__ vector unsigned long long __ATTRS_o_ai
5674 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5679 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5685 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5686 vector double __b) {
5691 /* The vmulos* and vmules* instructions have a big endian bias, so
5692 we must reverse the meaning of "even" and "odd" for little endian. */
5696 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5697 vector signed char __b) {
5698 #ifdef __LITTLE_ENDIAN__
5699 return __builtin_altivec_vmulosb(__a, __b);
5701 return __builtin_altivec_vmulesb(__a, __b);
5705 static __inline__ vector unsigned short __ATTRS_o_ai
5706 vec_mule(vector unsigned char __a, vector unsigned char __b) {
5707 #ifdef __LITTLE_ENDIAN__
5708 return __builtin_altivec_vmuloub(__a, __b);
5710 return __builtin_altivec_vmuleub(__a, __b);
5714 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5716 #ifdef __LITTLE_ENDIAN__
5717 return __builtin_altivec_vmulosh(__a, __b);
5719 return __builtin_altivec_vmulesh(__a, __b);
5723 static __inline__ vector unsigned int __ATTRS_o_ai
5724 vec_mule(vector unsigned short __a, vector unsigned short __b) {
5725 #ifdef __LITTLE_ENDIAN__
5726 return __builtin_altivec_vmulouh(__a, __b);
5728 return __builtin_altivec_vmuleuh(__a, __b);
5732 #ifdef __POWER8_VECTOR__
5733 static __inline__ vector signed long long __ATTRS_o_ai
5734 vec_mule(vector signed int __a, vector signed int __b) {
5735 #ifdef __LITTLE_ENDIAN__
5736 return __builtin_altivec_vmulosw(__a, __b);
5738 return __builtin_altivec_vmulesw(__a, __b);
5742 static __inline__ vector unsigned long long __ATTRS_o_ai
5743 vec_mule(vector unsigned int __a, vector unsigned int __b) {
5744 #ifdef __LITTLE_ENDIAN__
5745 return __builtin_altivec_vmulouw(__a, __b);
5747 return __builtin_altivec_vmuleuw(__a, __b);
5754 static __inline__ vector short __attribute__((__always_inline__))
5755 vec_vmulesb(vector signed char __a, vector signed char __b) {
5756 #ifdef __LITTLE_ENDIAN__
5757 return __builtin_altivec_vmulosb(__a, __b);
5759 return __builtin_altivec_vmulesb(__a, __b);
5765 static __inline__ vector unsigned short __attribute__((__always_inline__))
5766 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5767 #ifdef __LITTLE_ENDIAN__
5768 return __builtin_altivec_vmuloub(__a, __b);
5770 return __builtin_altivec_vmuleub(__a, __b);
5776 static __inline__ vector int __attribute__((__always_inline__))
5777 vec_vmulesh(vector short __a, vector short __b) {
5778 #ifdef __LITTLE_ENDIAN__
5779 return __builtin_altivec_vmulosh(__a, __b);
5781 return __builtin_altivec_vmulesh(__a, __b);
5787 static __inline__ vector unsigned int __attribute__((__always_inline__))
5788 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5789 #ifdef __LITTLE_ENDIAN__
5790 return __builtin_altivec_vmulouh(__a, __b);
5792 return __builtin_altivec_vmuleuh(__a, __b);
5798 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5799 vector signed char __b) {
5800 #ifdef __LITTLE_ENDIAN__
5801 return __builtin_altivec_vmulesb(__a, __b);
5803 return __builtin_altivec_vmulosb(__a, __b);
5807 static __inline__ vector unsigned short __ATTRS_o_ai
5808 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5809 #ifdef __LITTLE_ENDIAN__
5810 return __builtin_altivec_vmuleub(__a, __b);
5812 return __builtin_altivec_vmuloub(__a, __b);
5816 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5818 #ifdef __LITTLE_ENDIAN__
5819 return __builtin_altivec_vmulesh(__a, __b);
5821 return __builtin_altivec_vmulosh(__a, __b);
5825 static __inline__ vector unsigned int __ATTRS_o_ai
5826 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5827 #ifdef __LITTLE_ENDIAN__
5828 return __builtin_altivec_vmuleuh(__a, __b);
5830 return __builtin_altivec_vmulouh(__a, __b);
5834 #ifdef __POWER8_VECTOR__
5835 static __inline__ vector signed long long __ATTRS_o_ai
5836 vec_mulo(vector signed int __a, vector signed int __b) {
5837 #ifdef __LITTLE_ENDIAN__
5838 return __builtin_altivec_vmulesw(__a, __b);
5840 return __builtin_altivec_vmulosw(__a, __b);
5844 static __inline__ vector unsigned long long __ATTRS_o_ai
5845 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5846 #ifdef __LITTLE_ENDIAN__
5847 return __builtin_altivec_vmuleuw(__a, __b);
5849 return __builtin_altivec_vmulouw(__a, __b);
5856 static __inline__ vector short __attribute__((__always_inline__))
5857 vec_vmulosb(vector signed char __a, vector signed char __b) {
5858 #ifdef __LITTLE_ENDIAN__
5859 return __builtin_altivec_vmulesb(__a, __b);
5861 return __builtin_altivec_vmulosb(__a, __b);
5867 static __inline__ vector unsigned short __attribute__((__always_inline__))
5868 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5869 #ifdef __LITTLE_ENDIAN__
5870 return __builtin_altivec_vmuleub(__a, __b);
5872 return __builtin_altivec_vmuloub(__a, __b);
5878 static __inline__ vector int __attribute__((__always_inline__))
5879 vec_vmulosh(vector short __a, vector short __b) {
5880 #ifdef __LITTLE_ENDIAN__
5881 return __builtin_altivec_vmulesh(__a, __b);
5883 return __builtin_altivec_vmulosh(__a, __b);
5889 static __inline__ vector unsigned int __attribute__((__always_inline__))
5890 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5891 #ifdef __LITTLE_ENDIAN__
5892 return __builtin_altivec_vmuleuh(__a, __b);
5894 return __builtin_altivec_vmulouh(__a, __b);
5900 #ifdef __POWER8_VECTOR__
5901 static __inline__ vector signed char __ATTRS_o_ai
5902 vec_nand(vector signed char __a, vector signed char __b) {
5903 return ~(__a & __b);
5906 static __inline__ vector signed char __ATTRS_o_ai
5907 vec_nand(vector signed char __a, vector bool char __b) {
5908 return ~(__a & __b);
5911 static __inline__ vector signed char __ATTRS_o_ai
5912 vec_nand(vector bool char __a, vector signed char __b) {
5913 return ~(__a & __b);
5916 static __inline__ vector unsigned char __ATTRS_o_ai
5917 vec_nand(vector unsigned char __a, vector unsigned char __b) {
5918 return ~(__a & __b);
5921 static __inline__ vector unsigned char __ATTRS_o_ai
5922 vec_nand(vector unsigned char __a, vector bool char __b) {
5923 return ~(__a & __b);
5926 static __inline__ vector unsigned char __ATTRS_o_ai
5927 vec_nand(vector bool char __a, vector unsigned char __b) {
5928 return ~(__a & __b);
5931 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5932 vector bool char __b) {
5933 return ~(__a & __b);
5936 static __inline__ vector signed short __ATTRS_o_ai
5937 vec_nand(vector signed short __a, vector signed short __b) {
5938 return ~(__a & __b);
5941 static __inline__ vector signed short __ATTRS_o_ai
5942 vec_nand(vector signed short __a, vector bool short __b) {
5943 return ~(__a & __b);
5946 static __inline__ vector signed short __ATTRS_o_ai
5947 vec_nand(vector bool short __a, vector signed short __b) {
5948 return ~(__a & __b);
5951 static __inline__ vector unsigned short __ATTRS_o_ai
5952 vec_nand(vector unsigned short __a, vector unsigned short __b) {
5953 return ~(__a & __b);
5956 static __inline__ vector unsigned short __ATTRS_o_ai
5957 vec_nand(vector unsigned short __a, vector bool short __b) {
5958 return ~(__a & __b);
5961 static __inline__ vector bool short __ATTRS_o_ai
5962 vec_nand(vector bool short __a, vector bool short __b) {
5963 return ~(__a & __b);
5966 static __inline__ vector signed int __ATTRS_o_ai
5967 vec_nand(vector signed int __a, vector signed int __b) {
5968 return ~(__a & __b);
5971 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5972 vector bool int __b) {
5973 return ~(__a & __b);
5976 static __inline__ vector signed int __ATTRS_o_ai
5977 vec_nand(vector bool int __a, vector signed int __b) {
5978 return ~(__a & __b);
5981 static __inline__ vector unsigned int __ATTRS_o_ai
5982 vec_nand(vector unsigned int __a, vector unsigned int __b) {
5983 return ~(__a & __b);
5986 static __inline__ vector unsigned int __ATTRS_o_ai
5987 vec_nand(vector unsigned int __a, vector bool int __b) {
5988 return ~(__a & __b);
5991 static __inline__ vector unsigned int __ATTRS_o_ai
5992 vec_nand(vector bool int __a, vector unsigned int __b) {
5993 return ~(__a & __b);
5996 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5997 vector bool int __b) {
5998 return ~(__a & __b);
6001 static __inline__ vector float __ATTRS_o_ai
6002 vec_nand(vector float __a, vector float __b) {
6003 return (vector float)(~((vector unsigned int)__a &
6004 (vector unsigned int)__b));
6007 static __inline__ vector signed long long __ATTRS_o_ai
6008 vec_nand(vector signed long long __a, vector signed long long __b) {
6009 return ~(__a & __b);
6012 static __inline__ vector signed long long __ATTRS_o_ai
6013 vec_nand(vector signed long long __a, vector bool long long __b) {
6014 return ~(__a & __b);
6017 static __inline__ vector signed long long __ATTRS_o_ai
6018 vec_nand(vector bool long long __a, vector signed long long __b) {
6019 return ~(__a & __b);
6022 static __inline__ vector unsigned long long __ATTRS_o_ai
6023 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
6024 return ~(__a & __b);
6027 static __inline__ vector unsigned long long __ATTRS_o_ai
6028 vec_nand(vector unsigned long long __a, vector bool long long __b) {
6029 return ~(__a & __b);
6032 static __inline__ vector unsigned long long __ATTRS_o_ai
6033 vec_nand(vector bool long long __a, vector unsigned long long __b) {
6034 return ~(__a & __b);
6037 static __inline__ vector bool long long __ATTRS_o_ai
6038 vec_nand(vector bool long long __a, vector bool long long __b) {
6039 return ~(__a & __b);
6042 static __inline__ vector double __ATTRS_o_ai
6043 vec_nand(vector double __a, vector double __b) {
6044 return (vector double)(~((vector unsigned long long)__a &
6045 (vector unsigned long long)__b));
6053 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6056 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6059 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6061 vector double __c) {
6062 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6068 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6072 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6074 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6079 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6081 vector double __c) {
6082 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6088 static __inline__ vector float __attribute__((__always_inline__))
6089 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6090 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6095 #define __builtin_altivec_vnor vec_nor
6097 static __inline__ vector signed char __ATTRS_o_ai
6098 vec_nor(vector signed char __a, vector signed char __b) {
6099 return ~(__a | __b);
6102 static __inline__ vector unsigned char __ATTRS_o_ai
6103 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6104 return ~(__a | __b);
6107 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6108 vector bool char __b) {
6109 return ~(__a | __b);
6112 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6114 return ~(__a | __b);
6117 static __inline__ vector unsigned short __ATTRS_o_ai
6118 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6119 return ~(__a | __b);
6122 static __inline__ vector bool short __ATTRS_o_ai
6123 vec_nor(vector bool short __a, vector bool short __b) {
6124 return ~(__a | __b);
6127 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6129 return ~(__a | __b);
6132 static __inline__ vector unsigned int __ATTRS_o_ai
6133 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6134 return ~(__a | __b);
6137 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6138 vector bool int __b) {
6139 return ~(__a | __b);
6142 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6144 vector unsigned int __res =
6145 ~((vector unsigned int)__a | (vector unsigned int)__b);
6146 return (vector float)__res;
6150 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6151 vector double __b) {
6152 vector unsigned long long __res =
6153 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6154 return (vector double)__res;
6160 static __inline__ vector signed char __ATTRS_o_ai
6161 vec_vnor(vector signed char __a, vector signed char __b) {
6162 return ~(__a | __b);
6165 static __inline__ vector unsigned char __ATTRS_o_ai
6166 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6167 return ~(__a | __b);
6170 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6171 vector bool char __b) {
6172 return ~(__a | __b);
6175 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6177 return ~(__a | __b);
6180 static __inline__ vector unsigned short __ATTRS_o_ai
6181 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6182 return ~(__a | __b);
6185 static __inline__ vector bool short __ATTRS_o_ai
6186 vec_vnor(vector bool short __a, vector bool short __b) {
6187 return ~(__a | __b);
6190 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6192 return ~(__a | __b);
6195 static __inline__ vector unsigned int __ATTRS_o_ai
6196 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6197 return ~(__a | __b);
6200 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6201 vector bool int __b) {
6202 return ~(__a | __b);
6205 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6207 vector unsigned int __res =
6208 ~((vector unsigned int)__a | (vector unsigned int)__b);
6209 return (vector float)__res;
6213 static __inline__ vector signed long long __ATTRS_o_ai
6214 vec_nor(vector signed long long __a, vector signed long long __b) {
6215 return ~(__a | __b);
6218 static __inline__ vector unsigned long long __ATTRS_o_ai
6219 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6220 return ~(__a | __b);
6223 static __inline__ vector bool long long __ATTRS_o_ai
6224 vec_nor(vector bool long long __a, vector bool long long __b) {
6225 return ~(__a | __b);
6231 #define __builtin_altivec_vor vec_or
6233 static __inline__ vector signed char __ATTRS_o_ai
6234 vec_or(vector signed char __a, vector signed char __b) {
6238 static __inline__ vector signed char __ATTRS_o_ai
6239 vec_or(vector bool char __a, vector signed char __b) {
6240 return (vector signed char)__a | __b;
6243 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6244 vector bool char __b) {
6245 return __a | (vector signed char)__b;
6248 static __inline__ vector unsigned char __ATTRS_o_ai
6249 vec_or(vector unsigned char __a, vector unsigned char __b) {
6253 static __inline__ vector unsigned char __ATTRS_o_ai
6254 vec_or(vector bool char __a, vector unsigned char __b) {
6255 return (vector unsigned char)__a | __b;
6258 static __inline__ vector unsigned char __ATTRS_o_ai
6259 vec_or(vector unsigned char __a, vector bool char __b) {
6260 return __a | (vector unsigned char)__b;
6263 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6264 vector bool char __b) {
6268 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6273 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6275 return (vector short)__a | __b;
6278 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6279 vector bool short __b) {
6280 return __a | (vector short)__b;
6283 static __inline__ vector unsigned short __ATTRS_o_ai
6284 vec_or(vector unsigned short __a, vector unsigned short __b) {
6288 static __inline__ vector unsigned short __ATTRS_o_ai
6289 vec_or(vector bool short __a, vector unsigned short __b) {
6290 return (vector unsigned short)__a | __b;
6293 static __inline__ vector unsigned short __ATTRS_o_ai
6294 vec_or(vector unsigned short __a, vector bool short __b) {
6295 return __a | (vector unsigned short)__b;
6298 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6299 vector bool short __b) {
6303 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6308 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6310 return (vector int)__a | __b;
6313 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6314 vector bool int __b) {
6315 return __a | (vector int)__b;
6318 static __inline__ vector unsigned int __ATTRS_o_ai
6319 vec_or(vector unsigned int __a, vector unsigned int __b) {
6323 static __inline__ vector unsigned int __ATTRS_o_ai
6324 vec_or(vector bool int __a, vector unsigned int __b) {
6325 return (vector unsigned int)__a | __b;
6328 static __inline__ vector unsigned int __ATTRS_o_ai
6329 vec_or(vector unsigned int __a, vector bool int __b) {
6330 return __a | (vector unsigned int)__b;
6333 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6334 vector bool int __b) {
6338 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6340 vector unsigned int __res =
6341 (vector unsigned int)__a | (vector unsigned int)__b;
6342 return (vector float)__res;
6345 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6347 vector unsigned int __res =
6348 (vector unsigned int)__a | (vector unsigned int)__b;
6349 return (vector float)__res;
6352 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6353 vector bool int __b) {
6354 vector unsigned int __res =
6355 (vector unsigned int)__a | (vector unsigned int)__b;
6356 return (vector float)__res;
6360 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6361 vector double __b) {
6362 return (vector double)((vector unsigned long long)__a |
6363 (vector unsigned long long)__b);
6366 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6367 vector bool long long __b) {
6368 return (vector double)((vector unsigned long long)__a |
6369 (vector unsigned long long)__b);
6372 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6373 vector double __b) {
6374 return (vector double)((vector unsigned long long)__a |
6375 (vector unsigned long long)__b);
6378 static __inline__ vector signed long long __ATTRS_o_ai
6379 vec_or(vector signed long long __a, vector signed long long __b) {
6383 static __inline__ vector signed long long __ATTRS_o_ai
6384 vec_or(vector bool long long __a, vector signed long long __b) {
6385 return (vector signed long long)__a | __b;
6388 static __inline__ vector signed long long __ATTRS_o_ai
6389 vec_or(vector signed long long __a, vector bool long long __b) {
6390 return __a | (vector signed long long)__b;
6393 static __inline__ vector unsigned long long __ATTRS_o_ai
6394 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6398 static __inline__ vector unsigned long long __ATTRS_o_ai
6399 vec_or(vector bool long long __a, vector unsigned long long __b) {
6400 return (vector unsigned long long)__a | __b;
6403 static __inline__ vector unsigned long long __ATTRS_o_ai
6404 vec_or(vector unsigned long long __a, vector bool long long __b) {
6405 return __a | (vector unsigned long long)__b;
6408 static __inline__ vector bool long long __ATTRS_o_ai
6409 vec_or(vector bool long long __a, vector bool long long __b) {
6414 #ifdef __POWER8_VECTOR__
6415 static __inline__ vector signed char __ATTRS_o_ai
6416 vec_orc(vector signed char __a, vector signed char __b) {
6420 static __inline__ vector signed char __ATTRS_o_ai
6421 vec_orc(vector signed char __a, vector bool char __b) {
6425 static __inline__ vector signed char __ATTRS_o_ai
6426 vec_orc(vector bool char __a, vector signed char __b) {
6430 static __inline__ vector unsigned char __ATTRS_o_ai
6431 vec_orc(vector unsigned char __a, vector unsigned char __b) {
6435 static __inline__ vector unsigned char __ATTRS_o_ai
6436 vec_orc(vector unsigned char __a, vector bool char __b) {
6440 static __inline__ vector unsigned char __ATTRS_o_ai
6441 vec_orc(vector bool char __a, vector unsigned char __b) {
6445 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6446 vector bool char __b) {
6450 static __inline__ vector signed short __ATTRS_o_ai
6451 vec_orc(vector signed short __a, vector signed short __b) {
6455 static __inline__ vector signed short __ATTRS_o_ai
6456 vec_orc(vector signed short __a, vector bool short __b) {
6460 static __inline__ vector signed short __ATTRS_o_ai
6461 vec_orc(vector bool short __a, vector signed short __b) {
6465 static __inline__ vector unsigned short __ATTRS_o_ai
6466 vec_orc(vector unsigned short __a, vector unsigned short __b) {
6470 static __inline__ vector unsigned short __ATTRS_o_ai
6471 vec_orc(vector unsigned short __a, vector bool short __b) {
6475 static __inline__ vector unsigned short __ATTRS_o_ai
6476 vec_orc(vector bool short __a, vector unsigned short __b) {
6480 static __inline__ vector bool short __ATTRS_o_ai
6481 vec_orc(vector bool short __a, vector bool short __b) {
6485 static __inline__ vector signed int __ATTRS_o_ai
6486 vec_orc(vector signed int __a, vector signed int __b) {
6490 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6491 vector bool int __b) {
6495 static __inline__ vector signed int __ATTRS_o_ai
6496 vec_orc(vector bool int __a, vector signed int __b) {
6500 static __inline__ vector unsigned int __ATTRS_o_ai
6501 vec_orc(vector unsigned int __a, vector unsigned int __b) {
6505 static __inline__ vector unsigned int __ATTRS_o_ai
6506 vec_orc(vector unsigned int __a, vector bool int __b) {
6510 static __inline__ vector unsigned int __ATTRS_o_ai
6511 vec_orc(vector bool int __a, vector unsigned int __b) {
6515 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6516 vector bool int __b) {
6520 static __inline__ vector float __ATTRS_o_ai
6521 vec_orc(vector bool int __a, vector float __b) {
6522 return (vector float)(__a | ~(vector unsigned int)__b);
6525 static __inline__ vector float __ATTRS_o_ai
6526 vec_orc(vector float __a, vector bool int __b) {
6527 return (vector float)((vector unsigned int)__a | ~__b);
6530 static __inline__ vector signed long long __ATTRS_o_ai
6531 vec_orc(vector signed long long __a, vector signed long long __b) {
6535 static __inline__ vector signed long long __ATTRS_o_ai
6536 vec_orc(vector signed long long __a, vector bool long long __b) {
6540 static __inline__ vector signed long long __ATTRS_o_ai
6541 vec_orc(vector bool long long __a, vector signed long long __b) {
6545 static __inline__ vector unsigned long long __ATTRS_o_ai
6546 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6550 static __inline__ vector unsigned long long __ATTRS_o_ai
6551 vec_orc(vector unsigned long long __a, vector bool long long __b) {
6555 static __inline__ vector unsigned long long __ATTRS_o_ai
6556 vec_orc(vector bool long long __a, vector unsigned long long __b) {
6560 static __inline__ vector bool long long __ATTRS_o_ai
6561 vec_orc(vector bool long long __a, vector bool long long __b) {
6565 static __inline__ vector double __ATTRS_o_ai
6566 vec_orc(vector double __a, vector bool long long __b) {
6567 return (vector double)((vector unsigned long long)__a | ~__b);
6570 static __inline__ vector double __ATTRS_o_ai
6571 vec_orc(vector bool long long __a, vector double __b) {
6572 return (vector double)(__a | ~(vector unsigned long long)__b);
6578 static __inline__ vector signed char __ATTRS_o_ai
6579 vec_vor(vector signed char __a, vector signed char __b) {
6583 static __inline__ vector signed char __ATTRS_o_ai
6584 vec_vor(vector bool char __a, vector signed char __b) {
6585 return (vector signed char)__a | __b;
6588 static __inline__ vector signed char __ATTRS_o_ai
6589 vec_vor(vector signed char __a, vector bool char __b) {
6590 return __a | (vector signed char)__b;
6593 static __inline__ vector unsigned char __ATTRS_o_ai
6594 vec_vor(vector unsigned char __a, vector unsigned char __b) {
6598 static __inline__ vector unsigned char __ATTRS_o_ai
6599 vec_vor(vector bool char __a, vector unsigned char __b) {
6600 return (vector unsigned char)__a | __b;
6603 static __inline__ vector unsigned char __ATTRS_o_ai
6604 vec_vor(vector unsigned char __a, vector bool char __b) {
6605 return __a | (vector unsigned char)__b;
6608 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6609 vector bool char __b) {
6613 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6618 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6620 return (vector short)__a | __b;
6623 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6624 vector bool short __b) {
6625 return __a | (vector short)__b;
6628 static __inline__ vector unsigned short __ATTRS_o_ai
6629 vec_vor(vector unsigned short __a, vector unsigned short __b) {
6633 static __inline__ vector unsigned short __ATTRS_o_ai
6634 vec_vor(vector bool short __a, vector unsigned short __b) {
6635 return (vector unsigned short)__a | __b;
6638 static __inline__ vector unsigned short __ATTRS_o_ai
6639 vec_vor(vector unsigned short __a, vector bool short __b) {
6640 return __a | (vector unsigned short)__b;
6643 static __inline__ vector bool short __ATTRS_o_ai
6644 vec_vor(vector bool short __a, vector bool short __b) {
6648 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6653 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6655 return (vector int)__a | __b;
6658 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6659 vector bool int __b) {
6660 return __a | (vector int)__b;
6663 static __inline__ vector unsigned int __ATTRS_o_ai
6664 vec_vor(vector unsigned int __a, vector unsigned int __b) {
6668 static __inline__ vector unsigned int __ATTRS_o_ai
6669 vec_vor(vector bool int __a, vector unsigned int __b) {
6670 return (vector unsigned int)__a | __b;
6673 static __inline__ vector unsigned int __ATTRS_o_ai
6674 vec_vor(vector unsigned int __a, vector bool int __b) {
6675 return __a | (vector unsigned int)__b;
6678 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6679 vector bool int __b) {
6683 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6685 vector unsigned int __res =
6686 (vector unsigned int)__a | (vector unsigned int)__b;
6687 return (vector float)__res;
6690 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6692 vector unsigned int __res =
6693 (vector unsigned int)__a | (vector unsigned int)__b;
6694 return (vector float)__res;
6697 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6698 vector bool int __b) {
6699 vector unsigned int __res =
6700 (vector unsigned int)__a | (vector unsigned int)__b;
6701 return (vector float)__res;
6705 static __inline__ vector signed long long __ATTRS_o_ai
6706 vec_vor(vector signed long long __a, vector signed long long __b) {
6710 static __inline__ vector signed long long __ATTRS_o_ai
6711 vec_vor(vector bool long long __a, vector signed long long __b) {
6712 return (vector signed long long)__a | __b;
6715 static __inline__ vector signed long long __ATTRS_o_ai
6716 vec_vor(vector signed long long __a, vector bool long long __b) {
6717 return __a | (vector signed long long)__b;
6720 static __inline__ vector unsigned long long __ATTRS_o_ai
6721 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6725 static __inline__ vector unsigned long long __ATTRS_o_ai
6726 vec_vor(vector bool long long __a, vector unsigned long long __b) {
6727 return (vector unsigned long long)__a | __b;
6730 static __inline__ vector unsigned long long __ATTRS_o_ai
6731 vec_vor(vector unsigned long long __a, vector bool long long __b) {
6732 return __a | (vector unsigned long long)__b;
6735 static __inline__ vector bool long long __ATTRS_o_ai
6736 vec_vor(vector bool long long __a, vector bool long long __b) {
6743 /* The various vector pack instructions have a big-endian bias, so for
6744 little endian we must handle reversed element numbering. */
6746 static __inline__ vector signed char __ATTRS_o_ai
6747 vec_pack(vector signed short __a, vector signed short __b) {
6748 #ifdef __LITTLE_ENDIAN__
6749 return (vector signed char)vec_perm(
6751 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6752 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6754 return (vector signed char)vec_perm(
6756 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6757 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6761 static __inline__ vector unsigned char __ATTRS_o_ai
6762 vec_pack(vector unsigned short __a, vector unsigned short __b) {
6763 #ifdef __LITTLE_ENDIAN__
6764 return (vector unsigned char)vec_perm(
6766 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6767 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6769 return (vector unsigned char)vec_perm(
6771 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6772 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6776 static __inline__ vector bool char __ATTRS_o_ai
6777 vec_pack(vector bool short __a, vector bool short __b) {
6778 #ifdef __LITTLE_ENDIAN__
6779 return (vector bool char)vec_perm(
6781 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6782 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6784 return (vector bool char)vec_perm(
6786 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6787 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6791 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6793 #ifdef __LITTLE_ENDIAN__
6794 return (vector short)vec_perm(
6796 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6797 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6799 return (vector short)vec_perm(
6801 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6802 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6806 static __inline__ vector unsigned short __ATTRS_o_ai
6807 vec_pack(vector unsigned int __a, vector unsigned int __b) {
6808 #ifdef __LITTLE_ENDIAN__
6809 return (vector unsigned short)vec_perm(
6811 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6812 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6814 return (vector unsigned short)vec_perm(
6816 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6817 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6821 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6822 vector bool int __b) {
6823 #ifdef __LITTLE_ENDIAN__
6824 return (vector bool short)vec_perm(
6826 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6827 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6829 return (vector bool short)vec_perm(
6831 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6832 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6837 static __inline__ vector signed int __ATTRS_o_ai
6838 vec_pack(vector signed long long __a, vector signed long long __b) {
6839 #ifdef __LITTLE_ENDIAN__
6840 return (vector signed int)vec_perm(
6842 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6843 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6845 return (vector signed int)vec_perm(
6847 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6848 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6851 static __inline__ vector unsigned int __ATTRS_o_ai
6852 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6853 #ifdef __LITTLE_ENDIAN__
6854 return (vector unsigned int)vec_perm(
6856 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6857 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6859 return (vector unsigned int)vec_perm(
6861 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6862 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6866 static __inline__ vector bool int __ATTRS_o_ai
6867 vec_pack(vector bool long long __a, vector bool long long __b) {
6868 #ifdef __LITTLE_ENDIAN__
6869 return (vector bool int)vec_perm(
6871 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6872 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6874 return (vector bool int)vec_perm(
6876 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6877 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6881 static __inline__ vector float __ATTRS_o_ai
6882 vec_pack(vector double __a, vector double __b) {
6883 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6887 #ifdef __POWER9_VECTOR__
6888 static __inline__ vector unsigned short __ATTRS_o_ai
6889 vec_pack_to_short_fp32(vector float __a, vector float __b) {
6890 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6891 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6892 #ifdef __LITTLE_ENDIAN__
6893 return (vector unsigned short)vec_mergee(__resa, __resb);
6895 return (vector unsigned short)vec_mergeo(__resa, __resb);
6902 #define __builtin_altivec_vpkuhum vec_vpkuhum
6904 static __inline__ vector signed char __ATTRS_o_ai
6905 vec_vpkuhum(vector signed short __a, vector signed short __b) {
6906 #ifdef __LITTLE_ENDIAN__
6907 return (vector signed char)vec_perm(
6909 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6910 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6912 return (vector signed char)vec_perm(
6914 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6915 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6919 static __inline__ vector unsigned char __ATTRS_o_ai
6920 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6921 #ifdef __LITTLE_ENDIAN__
6922 return (vector unsigned char)vec_perm(
6924 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6925 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6927 return (vector unsigned char)vec_perm(
6929 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6930 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6934 static __inline__ vector bool char __ATTRS_o_ai
6935 vec_vpkuhum(vector bool short __a, vector bool short __b) {
6936 #ifdef __LITTLE_ENDIAN__
6937 return (vector bool char)vec_perm(
6939 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6940 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6942 return (vector bool char)vec_perm(
6944 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6945 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6951 #define __builtin_altivec_vpkuwum vec_vpkuwum
6953 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6955 #ifdef __LITTLE_ENDIAN__
6956 return (vector short)vec_perm(
6958 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6959 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6961 return (vector short)vec_perm(
6963 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6964 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6968 static __inline__ vector unsigned short __ATTRS_o_ai
6969 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6970 #ifdef __LITTLE_ENDIAN__
6971 return (vector unsigned short)vec_perm(
6973 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6974 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6976 return (vector unsigned short)vec_perm(
6978 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6979 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6983 static __inline__ vector bool short __ATTRS_o_ai
6984 vec_vpkuwum(vector bool int __a, vector bool int __b) {
6985 #ifdef __LITTLE_ENDIAN__
6986 return (vector bool short)vec_perm(
6988 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6989 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6991 return (vector bool short)vec_perm(
6993 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6994 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7000 #ifdef __POWER8_VECTOR__
7001 #define __builtin_altivec_vpkudum vec_vpkudum
7003 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
7004 vector long long __b) {
7005 #ifdef __LITTLE_ENDIAN__
7006 return (vector int)vec_perm(
7008 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7009 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7011 return (vector int)vec_perm(
7013 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7014 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7018 static __inline__ vector unsigned int __ATTRS_o_ai
7019 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
7020 #ifdef __LITTLE_ENDIAN__
7021 return (vector unsigned int)vec_perm(
7023 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7024 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7026 return (vector unsigned int)vec_perm(
7028 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7029 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7033 static __inline__ vector bool int __ATTRS_o_ai
7034 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
7035 #ifdef __LITTLE_ENDIAN__
7036 return (vector bool int)vec_perm(
7037 (vector long long)__a, (vector long long)__b,
7038 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7039 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7041 return (vector bool int)vec_perm(
7042 (vector long long)__a, (vector long long)__b,
7043 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7044 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7051 static __inline__ vector pixel __attribute__((__always_inline__))
7052 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7053 #ifdef __LITTLE_ENDIAN__
7054 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7056 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7062 static __inline__ vector pixel __attribute__((__always_inline__))
7063 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7064 #ifdef __LITTLE_ENDIAN__
7065 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7067 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7073 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7075 #ifdef __LITTLE_ENDIAN__
7076 return __builtin_altivec_vpkshss(__b, __a);
7078 return __builtin_altivec_vpkshss(__a, __b);
7082 static __inline__ vector unsigned char __ATTRS_o_ai
7083 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7084 #ifdef __LITTLE_ENDIAN__
7085 return __builtin_altivec_vpkuhus(__b, __a);
7087 return __builtin_altivec_vpkuhus(__a, __b);
7091 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7093 #ifdef __LITTLE_ENDIAN__
7094 return __builtin_altivec_vpkswss(__b, __a);
7096 return __builtin_altivec_vpkswss(__a, __b);
7100 static __inline__ vector unsigned short __ATTRS_o_ai
7101 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7102 #ifdef __LITTLE_ENDIAN__
7103 return __builtin_altivec_vpkuwus(__b, __a);
7105 return __builtin_altivec_vpkuwus(__a, __b);
7109 #ifdef __POWER8_VECTOR__
7110 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7111 vector long long __b) {
7112 #ifdef __LITTLE_ENDIAN__
7113 return __builtin_altivec_vpksdss(__b, __a);
7115 return __builtin_altivec_vpksdss(__a, __b);
7119 static __inline__ vector unsigned int __ATTRS_o_ai
7120 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7121 #ifdef __LITTLE_ENDIAN__
7122 return __builtin_altivec_vpkudus(__b, __a);
7124 return __builtin_altivec_vpkudus(__a, __b);
7131 static __inline__ vector signed char __attribute__((__always_inline__))
7132 vec_vpkshss(vector short __a, vector short __b) {
7133 #ifdef __LITTLE_ENDIAN__
7134 return __builtin_altivec_vpkshss(__b, __a);
7136 return __builtin_altivec_vpkshss(__a, __b);
7142 #ifdef __POWER8_VECTOR__
7143 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7144 vector long long __b) {
7145 #ifdef __LITTLE_ENDIAN__
7146 return __builtin_altivec_vpksdss(__b, __a);
7148 return __builtin_altivec_vpksdss(__a, __b);
7155 static __inline__ vector unsigned char __attribute__((__always_inline__))
7156 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7157 #ifdef __LITTLE_ENDIAN__
7158 return __builtin_altivec_vpkuhus(__b, __a);
7160 return __builtin_altivec_vpkuhus(__a, __b);
7166 #ifdef __POWER8_VECTOR__
7167 static __inline__ vector unsigned int __attribute__((__always_inline__))
7168 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7169 #ifdef __LITTLE_ENDIAN__
7170 return __builtin_altivec_vpkudus(__b, __a);
7172 return __builtin_altivec_vpkudus(__a, __b);
7179 static __inline__ vector signed short __attribute__((__always_inline__))
7180 vec_vpkswss(vector int __a, vector int __b) {
7181 #ifdef __LITTLE_ENDIAN__
7182 return __builtin_altivec_vpkswss(__b, __a);
7184 return __builtin_altivec_vpkswss(__a, __b);
7190 static __inline__ vector unsigned short __attribute__((__always_inline__))
7191 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7192 #ifdef __LITTLE_ENDIAN__
7193 return __builtin_altivec_vpkuwus(__b, __a);
7195 return __builtin_altivec_vpkuwus(__a, __b);
7201 static __inline__ vector unsigned char __ATTRS_o_ai
7202 vec_packsu(vector short __a, vector short __b) {
7203 #ifdef __LITTLE_ENDIAN__
7204 return __builtin_altivec_vpkshus(__b, __a);
7206 return __builtin_altivec_vpkshus(__a, __b);
7210 static __inline__ vector unsigned char __ATTRS_o_ai
7211 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7212 #ifdef __LITTLE_ENDIAN__
7213 return __builtin_altivec_vpkuhus(__b, __a);
7215 return __builtin_altivec_vpkuhus(__a, __b);
7219 static __inline__ vector unsigned short __ATTRS_o_ai
7220 vec_packsu(vector int __a, vector int __b) {
7221 #ifdef __LITTLE_ENDIAN__
7222 return __builtin_altivec_vpkswus(__b, __a);
7224 return __builtin_altivec_vpkswus(__a, __b);
7228 static __inline__ vector unsigned short __ATTRS_o_ai
7229 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7230 #ifdef __LITTLE_ENDIAN__
7231 return __builtin_altivec_vpkuwus(__b, __a);
7233 return __builtin_altivec_vpkuwus(__a, __b);
7237 #ifdef __POWER8_VECTOR__
7238 static __inline__ vector unsigned int __ATTRS_o_ai
7239 vec_packsu(vector long long __a, vector long long __b) {
7240 #ifdef __LITTLE_ENDIAN__
7241 return __builtin_altivec_vpksdus(__b, __a);
7243 return __builtin_altivec_vpksdus(__a, __b);
7247 static __inline__ vector unsigned int __ATTRS_o_ai
7248 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7249 #ifdef __LITTLE_ENDIAN__
7250 return __builtin_altivec_vpkudus(__b, __a);
7252 return __builtin_altivec_vpkudus(__a, __b);
7259 static __inline__ vector unsigned char __ATTRS_o_ai
7260 vec_vpkshus(vector short __a, vector short __b) {
7261 #ifdef __LITTLE_ENDIAN__
7262 return __builtin_altivec_vpkshus(__b, __a);
7264 return __builtin_altivec_vpkshus(__a, __b);
7268 static __inline__ vector unsigned char __ATTRS_o_ai
7269 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7270 #ifdef __LITTLE_ENDIAN__
7271 return __builtin_altivec_vpkuhus(__b, __a);
7273 return __builtin_altivec_vpkuhus(__a, __b);
7279 static __inline__ vector unsigned short __ATTRS_o_ai
7280 vec_vpkswus(vector int __a, vector int __b) {
7281 #ifdef __LITTLE_ENDIAN__
7282 return __builtin_altivec_vpkswus(__b, __a);
7284 return __builtin_altivec_vpkswus(__a, __b);
7288 static __inline__ vector unsigned short __ATTRS_o_ai
7289 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7290 #ifdef __LITTLE_ENDIAN__
7291 return __builtin_altivec_vpkuwus(__b, __a);
7293 return __builtin_altivec_vpkuwus(__a, __b);
7299 #ifdef __POWER8_VECTOR__
7300 static __inline__ vector unsigned int __ATTRS_o_ai
7301 vec_vpksdus(vector long long __a, vector long long __b) {
7302 #ifdef __LITTLE_ENDIAN__
7303 return __builtin_altivec_vpksdus(__b, __a);
7305 return __builtin_altivec_vpksdus(__a, __b);
7312 // The vperm instruction is defined architecturally with a big-endian bias.
7313 // For little endian, we swap the input operands and invert the permute
7314 // control vector. Only the rightmost 5 bits matter, so we could use
7315 // a vector of all 31s instead of all 255s to perform the inversion.
7316 // However, when the PCV is not a constant, using 255 has an advantage
7317 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7318 // later, possibly a vec_nand).
7320 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7321 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7322 #ifdef __LITTLE_ENDIAN__
7323 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7324 255, 255, 255, 255, 255, 255, 255, 255};
7325 __d = vec_xor(__c, __d);
7326 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7327 (vector int)__a, __d);
7329 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7330 (vector int)__b, __c);
7334 static __inline__ vector unsigned char __ATTRS_o_ai
7335 vec_perm(vector unsigned char __a, vector unsigned char __b,
7336 vector unsigned char __c) {
7337 #ifdef __LITTLE_ENDIAN__
7338 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7339 255, 255, 255, 255, 255, 255, 255, 255};
7340 __d = vec_xor(__c, __d);
7341 return (vector unsigned char)__builtin_altivec_vperm_4si(
7342 (vector int)__b, (vector int)__a, __d);
7344 return (vector unsigned char)__builtin_altivec_vperm_4si(
7345 (vector int)__a, (vector int)__b, __c);
7349 static __inline__ vector bool char __ATTRS_o_ai
7350 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7351 #ifdef __LITTLE_ENDIAN__
7352 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7353 255, 255, 255, 255, 255, 255, 255, 255};
7354 __d = vec_xor(__c, __d);
7355 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7356 (vector int)__a, __d);
7358 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7359 (vector int)__b, __c);
7363 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7364 vector signed short __b,
7365 vector unsigned char __c) {
7366 #ifdef __LITTLE_ENDIAN__
7367 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7368 255, 255, 255, 255, 255, 255, 255, 255};
7369 __d = vec_xor(__c, __d);
7370 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7371 (vector int)__a, __d);
7373 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7374 (vector int)__b, __c);
7378 static __inline__ vector unsigned short __ATTRS_o_ai
7379 vec_perm(vector unsigned short __a, vector unsigned short __b,
7380 vector unsigned char __c) {
7381 #ifdef __LITTLE_ENDIAN__
7382 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7383 255, 255, 255, 255, 255, 255, 255, 255};
7384 __d = vec_xor(__c, __d);
7385 return (vector unsigned short)__builtin_altivec_vperm_4si(
7386 (vector int)__b, (vector int)__a, __d);
7388 return (vector unsigned short)__builtin_altivec_vperm_4si(
7389 (vector int)__a, (vector int)__b, __c);
7393 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7394 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7395 #ifdef __LITTLE_ENDIAN__
7396 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7397 255, 255, 255, 255, 255, 255, 255, 255};
7398 __d = vec_xor(__c, __d);
7399 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7400 (vector int)__a, __d);
7402 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7403 (vector int)__b, __c);
7407 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7409 vector unsigned char __c) {
7410 #ifdef __LITTLE_ENDIAN__
7411 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7412 255, 255, 255, 255, 255, 255, 255, 255};
7413 __d = vec_xor(__c, __d);
7414 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7415 (vector int)__a, __d);
7417 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7418 (vector int)__b, __c);
7422 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7423 vector signed int __b,
7424 vector unsigned char __c) {
7425 #ifdef __LITTLE_ENDIAN__
7426 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7427 255, 255, 255, 255, 255, 255, 255, 255};
7428 __d = vec_xor(__c, __d);
7429 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7431 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7435 static __inline__ vector unsigned int __ATTRS_o_ai
7436 vec_perm(vector unsigned int __a, vector unsigned int __b,
7437 vector unsigned char __c) {
7438 #ifdef __LITTLE_ENDIAN__
7439 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7440 255, 255, 255, 255, 255, 255, 255, 255};
7441 __d = vec_xor(__c, __d);
7442 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7443 (vector int)__a, __d);
7445 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7446 (vector int)__b, __c);
7450 static __inline__ vector bool int __ATTRS_o_ai
7451 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7452 #ifdef __LITTLE_ENDIAN__
7453 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7454 255, 255, 255, 255, 255, 255, 255, 255};
7455 __d = vec_xor(__c, __d);
7456 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
7457 (vector int)__a, __d);
7459 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7460 (vector int)__b, __c);
7464 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7466 vector unsigned char __c) {
7467 #ifdef __LITTLE_ENDIAN__
7468 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7469 255, 255, 255, 255, 255, 255, 255, 255};
7470 __d = vec_xor(__c, __d);
7471 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7472 (vector int)__a, __d);
7474 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7475 (vector int)__b, __c);
7480 static __inline__ vector long long __ATTRS_o_ai
7481 vec_perm(vector signed long long __a, vector signed long long __b,
7482 vector unsigned char __c) {
7483 #ifdef __LITTLE_ENDIAN__
7484 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7485 255, 255, 255, 255, 255, 255, 255, 255};
7486 __d = vec_xor(__c, __d);
7487 return (vector signed long long)__builtin_altivec_vperm_4si(
7488 (vector int)__b, (vector int)__a, __d);
7490 return (vector signed long long)__builtin_altivec_vperm_4si(
7491 (vector int)__a, (vector int)__b, __c);
7495 static __inline__ vector unsigned long long __ATTRS_o_ai
7496 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7497 vector unsigned char __c) {
7498 #ifdef __LITTLE_ENDIAN__
7499 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7500 255, 255, 255, 255, 255, 255, 255, 255};
7501 __d = vec_xor(__c, __d);
7502 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7503 (vector int)__b, (vector int)__a, __d);
7505 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7506 (vector int)__a, (vector int)__b, __c);
7510 static __inline__ vector bool long long __ATTRS_o_ai
7511 vec_perm(vector bool long long __a, vector bool long long __b,
7512 vector unsigned char __c) {
7513 #ifdef __LITTLE_ENDIAN__
7514 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7515 255, 255, 255, 255, 255, 255, 255, 255};
7516 __d = vec_xor(__c, __d);
7517 return (vector bool long long)__builtin_altivec_vperm_4si(
7518 (vector int)__b, (vector int)__a, __d);
7520 return (vector bool long long)__builtin_altivec_vperm_4si(
7521 (vector int)__a, (vector int)__b, __c);
7525 static __inline__ vector double __ATTRS_o_ai
7526 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
7527 #ifdef __LITTLE_ENDIAN__
7528 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7529 255, 255, 255, 255, 255, 255, 255, 255};
7530 __d = vec_xor(__c, __d);
7531 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
7532 (vector int)__a, __d);
7534 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7535 (vector int)__b, __c);
7542 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7543 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7544 return vec_perm(__a, __b, __c);
7547 static __inline__ vector unsigned char __ATTRS_o_ai
7548 vec_vperm(vector unsigned char __a, vector unsigned char __b,
7549 vector unsigned char __c) {
7550 return vec_perm(__a, __b, __c);
7553 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7554 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7555 return vec_perm(__a, __b, __c);
7558 static __inline__ vector short __ATTRS_o_ai
7559 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7560 return vec_perm(__a, __b, __c);
7563 static __inline__ vector unsigned short __ATTRS_o_ai
7564 vec_vperm(vector unsigned short __a, vector unsigned short __b,
7565 vector unsigned char __c) {
7566 return vec_perm(__a, __b, __c);
7569 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7570 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7571 return vec_perm(__a, __b, __c);
7574 static __inline__ vector pixel __ATTRS_o_ai
7575 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7576 return vec_perm(__a, __b, __c);
7579 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7581 vector unsigned char __c) {
7582 return vec_perm(__a, __b, __c);
7585 static __inline__ vector unsigned int __ATTRS_o_ai
7586 vec_vperm(vector unsigned int __a, vector unsigned int __b,
7587 vector unsigned char __c) {
7588 return vec_perm(__a, __b, __c);
7591 static __inline__ vector bool int __ATTRS_o_ai
7592 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7593 return vec_perm(__a, __b, __c);
7596 static __inline__ vector float __ATTRS_o_ai
7597 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7598 return vec_perm(__a, __b, __c);
7602 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7603 vector long long __a, vector long long __b, vector unsigned char __c) {
7604 return vec_perm(__a, __b, __c);
7607 static __inline__ vector unsigned long long __ATTRS_o_ai
7608 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7609 vector unsigned char __c) {
7610 return vec_perm(__a, __b, __c);
7613 static __inline__ vector double __ATTRS_o_ai
7614 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7615 return vec_perm(__a, __b, __c);
7621 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7623 return __builtin_vsx_xvresp(__a);
7625 return __builtin_altivec_vrefp(__a);
7630 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7631 return __builtin_vsx_xvredp(__a);
7637 static __inline__ vector float __attribute__((__always_inline__))
7638 vec_vrefp(vector float __a) {
7639 return __builtin_altivec_vrefp(__a);
7644 static __inline__ vector signed char __ATTRS_o_ai
7645 vec_rl(vector signed char __a, vector unsigned char __b) {
7646 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7649 static __inline__ vector unsigned char __ATTRS_o_ai
7650 vec_rl(vector unsigned char __a, vector unsigned char __b) {
7651 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7654 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7655 vector unsigned short __b) {
7656 return __builtin_altivec_vrlh(__a, __b);
7659 static __inline__ vector unsigned short __ATTRS_o_ai
7660 vec_rl(vector unsigned short __a, vector unsigned short __b) {
7661 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7664 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7665 vector unsigned int __b) {
7666 return __builtin_altivec_vrlw(__a, __b);
7669 static __inline__ vector unsigned int __ATTRS_o_ai
7670 vec_rl(vector unsigned int __a, vector unsigned int __b) {
7671 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7674 #ifdef __POWER8_VECTOR__
7675 static __inline__ vector signed long long __ATTRS_o_ai
7676 vec_rl(vector signed long long __a, vector unsigned long long __b) {
7677 return __builtin_altivec_vrld(__a, __b);
7680 static __inline__ vector unsigned long long __ATTRS_o_ai
7681 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7682 return __builtin_altivec_vrld(__a, __b);
7687 #ifdef __POWER9_VECTOR__
7688 static __inline__ vector unsigned int __ATTRS_o_ai
7689 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7690 vector unsigned int __c) {
7691 return __builtin_altivec_vrlwmi(__a, __c, __b);
7694 static __inline__ vector unsigned long long __ATTRS_o_ai
7695 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7696 vector unsigned long long __c) {
7697 return __builtin_altivec_vrldmi(__a, __c, __b);
7701 static __inline__ vector unsigned int __ATTRS_o_ai
7702 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7703 vector unsigned int __c) {
7704 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7705 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7708 static __inline__ vector unsigned long long __ATTRS_o_ai
7709 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7710 vector unsigned long long __c) {
7711 vector unsigned long long OneByte = { 0x8, 0x8 };
7712 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7718 static __inline__ vector signed char __ATTRS_o_ai
7719 vec_vrlb(vector signed char __a, vector unsigned char __b) {
7720 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7723 static __inline__ vector unsigned char __ATTRS_o_ai
7724 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7725 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7730 static __inline__ vector short __ATTRS_o_ai
7731 vec_vrlh(vector short __a, vector unsigned short __b) {
7732 return __builtin_altivec_vrlh(__a, __b);
7735 static __inline__ vector unsigned short __ATTRS_o_ai
7736 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7737 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7742 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7743 vector unsigned int __b) {
7744 return __builtin_altivec_vrlw(__a, __b);
7747 static __inline__ vector unsigned int __ATTRS_o_ai
7748 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7749 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7754 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7756 return __builtin_vsx_xvrspi(__a);
7758 return __builtin_altivec_vrfin(__a);
7763 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7764 return __builtin_vsx_xvrdpi(__a);
7769 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7770 return __builtin_vsx_xvrspic(__a);
7773 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7774 return __builtin_vsx_xvrdpic(__a);
7779 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7780 return __builtin_vsx_xvrspi(__a);
7783 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7784 return __builtin_vsx_xvrdpi(__a);
7790 static __inline__ vector float __attribute__((__always_inline__))
7791 vec_vrfin(vector float __a) {
7792 return __builtin_altivec_vrfin(__a);
7798 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7799 return __builtin_vsx_xvsqrtsp(__a);
7802 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7803 return __builtin_vsx_xvsqrtdp(__a);
7809 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7811 return __builtin_vsx_xvrsqrtesp(__a);
7813 return __builtin_altivec_vrsqrtefp(__a);
7818 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7819 return __builtin_vsx_xvrsqrtedp(__a);
7825 static __inline__ __vector float __attribute__((__always_inline__))
7826 vec_vrsqrtefp(vector float __a) {
7827 return __builtin_altivec_vrsqrtefp(__a);
7832 #define __builtin_altivec_vsel_4si vec_sel
7834 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7835 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7836 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7839 static __inline__ vector signed char __ATTRS_o_ai
7840 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7841 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7844 static __inline__ vector unsigned char __ATTRS_o_ai
7845 vec_sel(vector unsigned char __a, vector unsigned char __b,
7846 vector unsigned char __c) {
7847 return (__a & ~__c) | (__b & __c);
7850 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7851 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7852 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7855 static __inline__ vector bool char __ATTRS_o_ai
7856 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7857 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7860 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7861 vector bool char __b,
7862 vector bool char __c) {
7863 return (__a & ~__c) | (__b & __c);
7866 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7868 vector unsigned short __c) {
7869 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7872 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7874 vector bool short __c) {
7875 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7878 static __inline__ vector unsigned short __ATTRS_o_ai
7879 vec_sel(vector unsigned short __a, vector unsigned short __b,
7880 vector unsigned short __c) {
7881 return (__a & ~__c) | (__b & __c);
7884 static __inline__ vector unsigned short __ATTRS_o_ai
7885 vec_sel(vector unsigned short __a, vector unsigned short __b,
7886 vector bool short __c) {
7887 return (__a & ~(vector unsigned short)__c) |
7888 (__b & (vector unsigned short)__c);
7891 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7892 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7893 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7896 static __inline__ vector bool short __ATTRS_o_ai
7897 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7898 return (__a & ~__c) | (__b & __c);
7901 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7903 vector unsigned int __c) {
7904 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7907 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7909 vector bool int __c) {
7910 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7913 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7914 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7915 return (__a & ~__c) | (__b & __c);
7918 static __inline__ vector unsigned int __ATTRS_o_ai
7919 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7920 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7923 static __inline__ vector bool int __ATTRS_o_ai
7924 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7925 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7928 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7929 vector bool int __b,
7930 vector bool int __c) {
7931 return (__a & ~__c) | (__b & __c);
7934 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7936 vector unsigned int __c) {
7937 vector int __res = ((vector int)__a & ~(vector int)__c) |
7938 ((vector int)__b & (vector int)__c);
7939 return (vector float)__res;
7942 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7944 vector bool int __c) {
7945 vector int __res = ((vector int)__a & ~(vector int)__c) |
7946 ((vector int)__b & (vector int)__c);
7947 return (vector float)__res;
7951 static __inline__ vector double __ATTRS_o_ai
7952 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7953 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7954 ((vector long long)__b & (vector long long)__c);
7955 return (vector double)__res;
7958 static __inline__ vector double __ATTRS_o_ai
7959 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7960 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7961 ((vector long long)__b & (vector long long)__c);
7962 return (vector double)__res;
7968 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7969 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7970 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7973 static __inline__ vector signed char __ATTRS_o_ai
7974 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7975 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7978 static __inline__ vector unsigned char __ATTRS_o_ai
7979 vec_vsel(vector unsigned char __a, vector unsigned char __b,
7980 vector unsigned char __c) {
7981 return (__a & ~__c) | (__b & __c);
7984 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7985 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7986 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7989 static __inline__ vector bool char __ATTRS_o_ai
7990 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7991 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7994 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7995 vector bool char __b,
7996 vector bool char __c) {
7997 return (__a & ~__c) | (__b & __c);
8000 static __inline__ vector short __ATTRS_o_ai
8001 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
8002 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8005 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
8007 vector bool short __c) {
8008 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8011 static __inline__ vector unsigned short __ATTRS_o_ai
8012 vec_vsel(vector unsigned short __a, vector unsigned short __b,
8013 vector unsigned short __c) {
8014 return (__a & ~__c) | (__b & __c);
8017 static __inline__ vector unsigned short __ATTRS_o_ai
8018 vec_vsel(vector unsigned short __a, vector unsigned short __b,
8019 vector bool short __c) {
8020 return (__a & ~(vector unsigned short)__c) |
8021 (__b & (vector unsigned short)__c);
8024 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
8025 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8026 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8029 static __inline__ vector bool short __ATTRS_o_ai
8030 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
8031 return (__a & ~__c) | (__b & __c);
8034 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8036 vector unsigned int __c) {
8037 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8040 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8042 vector bool int __c) {
8043 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8046 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8047 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8048 return (__a & ~__c) | (__b & __c);
8051 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8052 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8053 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8056 static __inline__ vector bool int __ATTRS_o_ai
8057 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8058 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8061 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8062 vector bool int __b,
8063 vector bool int __c) {
8064 return (__a & ~__c) | (__b & __c);
8067 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8069 vector unsigned int __c) {
8070 vector int __res = ((vector int)__a & ~(vector int)__c) |
8071 ((vector int)__b & (vector int)__c);
8072 return (vector float)__res;
8075 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8077 vector bool int __c) {
8078 vector int __res = ((vector int)__a & ~(vector int)__c) |
8079 ((vector int)__b & (vector int)__c);
8080 return (vector float)__res;
8085 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8086 // than the length of __a.
8087 static __inline__ vector unsigned char __ATTRS_o_ai
8088 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8089 return __a << (__b %
8090 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8093 static __inline__ vector signed char __ATTRS_o_ai
8094 vec_sl(vector signed char __a, vector unsigned char __b) {
8095 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8098 static __inline__ vector unsigned short __ATTRS_o_ai
8099 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8100 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8104 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8105 vector unsigned short __b) {
8106 return (vector short)vec_sl((vector unsigned short)__a, __b);
8109 static __inline__ vector unsigned int __ATTRS_o_ai
8110 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8111 return __a << (__b %
8112 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8115 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8116 vector unsigned int __b) {
8117 return (vector int)vec_sl((vector unsigned int)__a, __b);
8120 #ifdef __POWER8_VECTOR__
8121 static __inline__ vector unsigned long long __ATTRS_o_ai
8122 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8123 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8127 static __inline__ vector long long __ATTRS_o_ai
8128 vec_sl(vector long long __a, vector unsigned long long __b) {
8129 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8135 #define __builtin_altivec_vslb vec_vslb
8137 static __inline__ vector signed char __ATTRS_o_ai
8138 vec_vslb(vector signed char __a, vector unsigned char __b) {
8139 return vec_sl(__a, __b);
8142 static __inline__ vector unsigned char __ATTRS_o_ai
8143 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8144 return vec_sl(__a, __b);
8149 #define __builtin_altivec_vslh vec_vslh
8151 static __inline__ vector short __ATTRS_o_ai
8152 vec_vslh(vector short __a, vector unsigned short __b) {
8153 return vec_sl(__a, __b);
8156 static __inline__ vector unsigned short __ATTRS_o_ai
8157 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8158 return vec_sl(__a, __b);
8163 #define __builtin_altivec_vslw vec_vslw
8165 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8166 vector unsigned int __b) {
8167 return vec_sl(__a, __b);
8170 static __inline__ vector unsigned int __ATTRS_o_ai
8171 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8172 return vec_sl(__a, __b);
8177 #define __builtin_altivec_vsldoi_4si vec_sld
8179 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8180 vector signed char __a, vector signed char __b, unsigned const int __c) {
8181 unsigned char __d = __c & 0x0F;
8182 #ifdef __LITTLE_ENDIAN__
8184 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8185 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8186 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8187 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8191 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8192 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8193 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8197 static __inline__ vector unsigned char __ATTRS_o_ai
8198 vec_sld(vector unsigned char __a, vector unsigned char __b,
8199 unsigned const int __c) {
8200 unsigned char __d = __c & 0x0F;
8201 #ifdef __LITTLE_ENDIAN__
8203 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8204 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8205 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8206 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8210 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8211 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8212 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8216 static __inline__ vector bool char __ATTRS_o_ai
8217 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8218 unsigned char __d = __c & 0x0F;
8219 #ifdef __LITTLE_ENDIAN__
8221 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8222 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8223 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8224 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8228 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8229 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8230 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8234 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8235 vector signed short __a, vector signed short __b, 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 unsigned short __ATTRS_o_ai
8253 vec_sld(vector unsigned short __a, vector unsigned short __b,
8254 unsigned const int __c) {
8255 unsigned char __d = __c & 0x0F;
8256 #ifdef __LITTLE_ENDIAN__
8258 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8259 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8260 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8261 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8265 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8266 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8267 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8271 static __inline__ vector bool short __ATTRS_o_ai
8272 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8273 unsigned char __d = __c & 0x0F;
8274 #ifdef __LITTLE_ENDIAN__
8276 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8277 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8278 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8279 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8283 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8284 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8285 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8289 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8291 unsigned const int __c) {
8292 unsigned char __d = __c & 0x0F;
8293 #ifdef __LITTLE_ENDIAN__
8295 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8296 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8297 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8298 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8302 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8303 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8304 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8308 static __inline__ vector signed int __ATTRS_o_ai
8309 vec_sld(vector signed int __a, vector signed int __b, 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));
8326 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8327 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8328 unsigned char __d = __c & 0x0F;
8329 #ifdef __LITTLE_ENDIAN__
8331 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8332 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8333 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8334 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8338 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8339 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8340 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8344 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8345 vector bool int __b,
8346 unsigned const int __c) {
8347 unsigned char __d = __c & 0x0F;
8348 #ifdef __LITTLE_ENDIAN__
8350 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8351 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8352 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8353 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8357 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8358 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8359 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8363 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8365 unsigned const int __c) {
8366 unsigned char __d = __c & 0x0F;
8367 #ifdef __LITTLE_ENDIAN__
8369 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8370 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8371 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8372 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8376 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8377 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8378 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8383 static __inline__ vector bool long long __ATTRS_o_ai
8384 vec_sld(vector bool long long __a, vector bool long long __b,
8385 unsigned const int __c) {
8386 unsigned char __d = __c & 0x0F;
8387 #ifdef __LITTLE_ENDIAN__
8389 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8390 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8391 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8392 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8396 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8397 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8398 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8402 static __inline__ vector signed long long __ATTRS_o_ai
8403 vec_sld(vector signed long long __a, vector signed long long __b,
8404 unsigned const int __c) {
8405 unsigned char __d = __c & 0x0F;
8406 #ifdef __LITTLE_ENDIAN__
8408 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8409 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8410 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8411 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8415 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8416 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8417 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8421 static __inline__ vector unsigned long long __ATTRS_o_ai
8422 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8423 unsigned const int __c) {
8424 unsigned char __d = __c & 0x0F;
8425 #ifdef __LITTLE_ENDIAN__
8427 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8428 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8429 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8430 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8434 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8435 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8436 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8440 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8442 unsigned const int __c) {
8443 unsigned char __d = __c & 0x0F;
8444 #ifdef __LITTLE_ENDIAN__
8446 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8447 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8448 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8449 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8453 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8454 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8455 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8461 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8462 vector signed char __a, vector signed char __b, unsigned const int __c) {
8463 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8466 static __inline__ vector unsigned char __ATTRS_o_ai
8467 vec_sldw(vector unsigned char __a, vector unsigned char __b,
8468 unsigned const int __c) {
8469 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8472 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8473 vector signed short __a, vector signed short __b, unsigned const int __c) {
8474 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8477 static __inline__ vector unsigned short __ATTRS_o_ai
8478 vec_sldw(vector unsigned short __a, vector unsigned short __b,
8479 unsigned const int __c) {
8480 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8483 static __inline__ vector signed int __ATTRS_o_ai
8484 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8485 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8488 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8489 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8490 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8494 static __inline__ vector signed long long __ATTRS_o_ai
8495 vec_sldw(vector signed long long __a, vector signed long long __b,
8496 unsigned const int __c) {
8497 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8500 static __inline__ vector unsigned long long __ATTRS_o_ai
8501 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8502 unsigned const int __c) {
8503 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8507 #ifdef __POWER9_VECTOR__
8509 static __inline__ vector unsigned char __ATTRS_o_ai
8510 vec_slv(vector unsigned char __a, vector unsigned char __b) {
8511 return __builtin_altivec_vslv(__a, __b);
8515 static __inline__ vector unsigned char __ATTRS_o_ai
8516 vec_srv(vector unsigned char __a, vector unsigned char __b) {
8517 return __builtin_altivec_vsrv(__a, __b);
8523 static __inline__ vector signed char __ATTRS_o_ai
8524 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8525 unsigned char __d = __c & 0x0F;
8526 #ifdef __LITTLE_ENDIAN__
8528 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8529 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8530 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8531 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8535 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8536 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8537 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8541 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8542 vector unsigned char __a, vector unsigned char __b, 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 short __ATTRS_o_ai vec_vsldoi(vector short __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 short __ATTRS_o_ai vec_vsldoi(
8579 vector unsigned short __a, vector unsigned short __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 pixel __ATTRS_o_ai vec_vsldoi(vector pixel __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));
8615 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8617 unsigned char __c) {
8618 unsigned char __d = __c & 0x0F;
8619 #ifdef __LITTLE_ENDIAN__
8621 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8622 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8623 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8624 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8628 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8629 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8630 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8634 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8635 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8636 unsigned char __d = __c & 0x0F;
8637 #ifdef __LITTLE_ENDIAN__
8639 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8640 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8641 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8642 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8646 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8647 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8648 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8652 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8654 unsigned char __c) {
8655 unsigned char __d = __c & 0x0F;
8656 #ifdef __LITTLE_ENDIAN__
8658 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8659 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8660 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8661 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8665 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8666 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8667 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8673 static __inline__ vector signed char __ATTRS_o_ai
8674 vec_sll(vector signed char __a, vector unsigned char __b) {
8675 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8679 static __inline__ vector signed char __ATTRS_o_ai
8680 vec_sll(vector signed char __a, vector unsigned short __b) {
8681 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8685 static __inline__ vector signed char __ATTRS_o_ai
8686 vec_sll(vector signed char __a, vector unsigned int __b) {
8687 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8691 static __inline__ vector unsigned char __ATTRS_o_ai
8692 vec_sll(vector unsigned char __a, vector unsigned char __b) {
8693 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8697 static __inline__ vector unsigned char __ATTRS_o_ai
8698 vec_sll(vector unsigned char __a, vector unsigned short __b) {
8699 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8703 static __inline__ vector unsigned char __ATTRS_o_ai
8704 vec_sll(vector unsigned char __a, vector unsigned int __b) {
8705 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8709 static __inline__ vector bool char __ATTRS_o_ai
8710 vec_sll(vector bool char __a, vector unsigned char __b) {
8711 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8715 static __inline__ vector bool char __ATTRS_o_ai
8716 vec_sll(vector bool char __a, vector unsigned short __b) {
8717 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8721 static __inline__ vector bool char __ATTRS_o_ai
8722 vec_sll(vector bool char __a, vector unsigned int __b) {
8723 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8727 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8728 vector unsigned char __b) {
8729 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8732 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8733 vector unsigned short __b) {
8734 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8737 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8738 vector unsigned int __b) {
8739 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8742 static __inline__ vector unsigned short __ATTRS_o_ai
8743 vec_sll(vector unsigned short __a, vector unsigned char __b) {
8744 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8748 static __inline__ vector unsigned short __ATTRS_o_ai
8749 vec_sll(vector unsigned short __a, vector unsigned short __b) {
8750 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8754 static __inline__ vector unsigned short __ATTRS_o_ai
8755 vec_sll(vector unsigned short __a, vector unsigned int __b) {
8756 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8760 static __inline__ vector bool short __ATTRS_o_ai
8761 vec_sll(vector bool short __a, vector unsigned char __b) {
8762 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8766 static __inline__ vector bool short __ATTRS_o_ai
8767 vec_sll(vector bool short __a, vector unsigned short __b) {
8768 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8772 static __inline__ vector bool short __ATTRS_o_ai
8773 vec_sll(vector bool short __a, vector unsigned int __b) {
8774 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8778 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8779 vector unsigned char __b) {
8780 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8783 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8784 vector unsigned short __b) {
8785 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8788 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8789 vector unsigned int __b) {
8790 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8793 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8794 vector unsigned char __b) {
8795 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8798 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8799 vector unsigned short __b) {
8800 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8803 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8804 vector unsigned int __b) {
8805 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8808 static __inline__ vector unsigned int __ATTRS_o_ai
8809 vec_sll(vector unsigned int __a, vector unsigned char __b) {
8810 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8814 static __inline__ vector unsigned int __ATTRS_o_ai
8815 vec_sll(vector unsigned int __a, vector unsigned short __b) {
8816 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8820 static __inline__ vector unsigned int __ATTRS_o_ai
8821 vec_sll(vector unsigned int __a, vector unsigned int __b) {
8822 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8826 static __inline__ vector bool int __ATTRS_o_ai
8827 vec_sll(vector bool int __a, vector unsigned char __b) {
8828 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8832 static __inline__ vector bool int __ATTRS_o_ai
8833 vec_sll(vector bool int __a, vector unsigned short __b) {
8834 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8838 static __inline__ vector bool int __ATTRS_o_ai
8839 vec_sll(vector bool int __a, vector unsigned int __b) {
8840 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8845 static __inline__ vector signed long long __ATTRS_o_ai
8846 vec_sll(vector signed long long __a, vector unsigned char __b) {
8847 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8851 static __inline__ vector unsigned long long __ATTRS_o_ai
8852 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8853 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8860 static __inline__ vector signed char __ATTRS_o_ai
8861 vec_vsl(vector signed char __a, vector unsigned char __b) {
8862 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8866 static __inline__ vector signed char __ATTRS_o_ai
8867 vec_vsl(vector signed char __a, vector unsigned short __b) {
8868 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8872 static __inline__ vector signed char __ATTRS_o_ai
8873 vec_vsl(vector signed char __a, vector unsigned int __b) {
8874 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8878 static __inline__ vector unsigned char __ATTRS_o_ai
8879 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8880 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8884 static __inline__ vector unsigned char __ATTRS_o_ai
8885 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8886 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8890 static __inline__ vector unsigned char __ATTRS_o_ai
8891 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8892 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8896 static __inline__ vector bool char __ATTRS_o_ai
8897 vec_vsl(vector bool char __a, vector unsigned char __b) {
8898 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8902 static __inline__ vector bool char __ATTRS_o_ai
8903 vec_vsl(vector bool char __a, vector unsigned short __b) {
8904 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8908 static __inline__ vector bool char __ATTRS_o_ai
8909 vec_vsl(vector bool char __a, vector unsigned int __b) {
8910 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8914 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8915 vector unsigned char __b) {
8916 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8919 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8920 vector unsigned short __b) {
8921 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8924 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8925 vector unsigned int __b) {
8926 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8929 static __inline__ vector unsigned short __ATTRS_o_ai
8930 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8931 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8935 static __inline__ vector unsigned short __ATTRS_o_ai
8936 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8937 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8941 static __inline__ vector unsigned short __ATTRS_o_ai
8942 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8943 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8947 static __inline__ vector bool short __ATTRS_o_ai
8948 vec_vsl(vector bool short __a, vector unsigned char __b) {
8949 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8953 static __inline__ vector bool short __ATTRS_o_ai
8954 vec_vsl(vector bool short __a, vector unsigned short __b) {
8955 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8959 static __inline__ vector bool short __ATTRS_o_ai
8960 vec_vsl(vector bool short __a, vector unsigned int __b) {
8961 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8965 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8966 vector unsigned char __b) {
8967 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8970 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8971 vector unsigned short __b) {
8972 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8975 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8976 vector unsigned int __b) {
8977 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8980 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8981 vector unsigned char __b) {
8982 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8985 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8986 vector unsigned short __b) {
8987 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8990 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8991 vector unsigned int __b) {
8992 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8995 static __inline__ vector unsigned int __ATTRS_o_ai
8996 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8997 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9001 static __inline__ vector unsigned int __ATTRS_o_ai
9002 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
9003 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9007 static __inline__ vector unsigned int __ATTRS_o_ai
9008 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
9009 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9013 static __inline__ vector bool int __ATTRS_o_ai
9014 vec_vsl(vector bool int __a, vector unsigned char __b) {
9015 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9019 static __inline__ vector bool int __ATTRS_o_ai
9020 vec_vsl(vector bool int __a, vector unsigned short __b) {
9021 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9025 static __inline__ vector bool int __ATTRS_o_ai
9026 vec_vsl(vector bool int __a, vector unsigned int __b) {
9027 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9033 static __inline__ vector signed char __ATTRS_o_ai
9034 vec_slo(vector signed char __a, vector signed char __b) {
9035 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9039 static __inline__ vector signed char __ATTRS_o_ai
9040 vec_slo(vector signed char __a, vector unsigned char __b) {
9041 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9045 static __inline__ vector unsigned char __ATTRS_o_ai
9046 vec_slo(vector unsigned char __a, vector signed char __b) {
9047 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9051 static __inline__ vector unsigned char __ATTRS_o_ai
9052 vec_slo(vector unsigned char __a, vector unsigned char __b) {
9053 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9057 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9058 vector signed char __b) {
9059 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9062 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9063 vector unsigned char __b) {
9064 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9067 static __inline__ vector unsigned short __ATTRS_o_ai
9068 vec_slo(vector unsigned short __a, vector signed char __b) {
9069 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9073 static __inline__ vector unsigned short __ATTRS_o_ai
9074 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9075 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9079 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9080 vector signed char __b) {
9081 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9084 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9085 vector unsigned char __b) {
9086 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9089 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9090 vector signed char __b) {
9091 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9094 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9095 vector unsigned char __b) {
9096 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9099 static __inline__ vector unsigned int __ATTRS_o_ai
9100 vec_slo(vector unsigned int __a, vector signed char __b) {
9101 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9105 static __inline__ vector unsigned int __ATTRS_o_ai
9106 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9107 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9111 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9112 vector signed char __b) {
9113 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9116 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9117 vector unsigned char __b) {
9118 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9122 static __inline__ vector signed long long __ATTRS_o_ai
9123 vec_slo(vector signed long long __a, vector signed char __b) {
9124 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9128 static __inline__ vector signed long long __ATTRS_o_ai
9129 vec_slo(vector signed long long __a, vector unsigned char __b) {
9130 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9134 static __inline__ vector unsigned long long __ATTRS_o_ai
9135 vec_slo(vector unsigned long long __a, vector signed char __b) {
9136 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9140 static __inline__ vector unsigned long long __ATTRS_o_ai
9141 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9142 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9149 static __inline__ vector signed char __ATTRS_o_ai
9150 vec_vslo(vector signed char __a, vector signed char __b) {
9151 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9155 static __inline__ vector signed char __ATTRS_o_ai
9156 vec_vslo(vector signed char __a, vector unsigned char __b) {
9157 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9161 static __inline__ vector unsigned char __ATTRS_o_ai
9162 vec_vslo(vector unsigned char __a, vector signed char __b) {
9163 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9167 static __inline__ vector unsigned char __ATTRS_o_ai
9168 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9169 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9173 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9174 vector signed char __b) {
9175 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9178 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9179 vector unsigned char __b) {
9180 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9183 static __inline__ vector unsigned short __ATTRS_o_ai
9184 vec_vslo(vector unsigned short __a, vector signed char __b) {
9185 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9189 static __inline__ vector unsigned short __ATTRS_o_ai
9190 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9191 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9195 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9196 vector signed char __b) {
9197 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9200 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9201 vector unsigned char __b) {
9202 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9205 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9206 vector signed char __b) {
9207 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9210 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9211 vector unsigned char __b) {
9212 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9215 static __inline__ vector unsigned int __ATTRS_o_ai
9216 vec_vslo(vector unsigned int __a, vector signed char __b) {
9217 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9221 static __inline__ vector unsigned int __ATTRS_o_ai
9222 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9223 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9227 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9228 vector signed char __b) {
9229 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9232 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9233 vector unsigned char __b) {
9234 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9239 static __inline__ vector signed char __ATTRS_o_ai
9240 vec_splat(vector signed char __a, unsigned const int __b) {
9241 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9244 static __inline__ vector unsigned char __ATTRS_o_ai
9245 vec_splat(vector unsigned char __a, unsigned const int __b) {
9246 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9249 static __inline__ vector bool char __ATTRS_o_ai
9250 vec_splat(vector bool char __a, unsigned const int __b) {
9251 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9254 static __inline__ vector signed short __ATTRS_o_ai
9255 vec_splat(vector signed short __a, unsigned const int __b) {
9256 unsigned char b0 = (__b & 0x07) * 2;
9257 unsigned char b1 = b0 + 1;
9258 return vec_perm(__a, __a,
9259 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9260 b0, b1, b0, b1, b0, b1));
9263 static __inline__ vector unsigned short __ATTRS_o_ai
9264 vec_splat(vector unsigned short __a, unsigned const int __b) {
9265 unsigned char b0 = (__b & 0x07) * 2;
9266 unsigned char b1 = b0 + 1;
9267 return vec_perm(__a, __a,
9268 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9269 b0, b1, b0, b1, b0, b1));
9272 static __inline__ vector bool short __ATTRS_o_ai
9273 vec_splat(vector bool short __a, unsigned const int __b) {
9274 unsigned char b0 = (__b & 0x07) * 2;
9275 unsigned char b1 = b0 + 1;
9276 return vec_perm(__a, __a,
9277 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9278 b0, b1, b0, b1, b0, b1));
9281 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9282 unsigned const int __b) {
9283 unsigned char b0 = (__b & 0x07) * 2;
9284 unsigned char b1 = b0 + 1;
9285 return vec_perm(__a, __a,
9286 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9287 b0, b1, b0, b1, b0, b1));
9290 static __inline__ vector signed int __ATTRS_o_ai
9291 vec_splat(vector signed int __a, unsigned const int __b) {
9292 unsigned char b0 = (__b & 0x03) * 4;
9293 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9294 return vec_perm(__a, __a,
9295 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9296 b2, b3, b0, b1, b2, b3));
9299 static __inline__ vector unsigned int __ATTRS_o_ai
9300 vec_splat(vector unsigned int __a, unsigned const int __b) {
9301 unsigned char b0 = (__b & 0x03) * 4;
9302 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9303 return vec_perm(__a, __a,
9304 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9305 b2, b3, b0, b1, b2, b3));
9308 static __inline__ vector bool int __ATTRS_o_ai
9309 vec_splat(vector bool int __a, unsigned const int __b) {
9310 unsigned char b0 = (__b & 0x03) * 4;
9311 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9312 return vec_perm(__a, __a,
9313 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9314 b2, b3, b0, b1, b2, b3));
9317 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9318 unsigned const int __b) {
9319 unsigned char b0 = (__b & 0x03) * 4;
9320 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9321 return vec_perm(__a, __a,
9322 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9323 b2, b3, b0, b1, b2, b3));
9327 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9328 unsigned const int __b) {
9329 unsigned char b0 = (__b & 0x01) * 8;
9330 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9331 b6 = b0 + 6, b7 = b0 + 7;
9332 return vec_perm(__a, __a,
9333 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9334 b2, b3, b4, b5, b6, b7));
9336 static __inline__ vector bool long long __ATTRS_o_ai
9337 vec_splat(vector bool long long __a, unsigned const int __b) {
9338 unsigned char b0 = (__b & 0x01) * 8;
9339 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9340 b6 = b0 + 6, b7 = b0 + 7;
9341 return vec_perm(__a, __a,
9342 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9343 b2, b3, b4, b5, b6, b7));
9345 static __inline__ vector signed long long __ATTRS_o_ai
9346 vec_splat(vector signed long long __a, unsigned const int __b) {
9347 unsigned char b0 = (__b & 0x01) * 8;
9348 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9349 b6 = b0 + 6, b7 = b0 + 7;
9350 return vec_perm(__a, __a,
9351 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9352 b2, b3, b4, b5, b6, b7));
9354 static __inline__ vector unsigned long long __ATTRS_o_ai
9355 vec_splat(vector unsigned long long __a, unsigned const int __b) {
9356 unsigned char b0 = (__b & 0x01) * 8;
9357 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9358 b6 = b0 + 6, b7 = b0 + 7;
9359 return vec_perm(__a, __a,
9360 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9361 b2, b3, b4, b5, b6, b7));
9367 #define __builtin_altivec_vspltb vec_vspltb
9369 static __inline__ vector signed char __ATTRS_o_ai
9370 vec_vspltb(vector signed char __a, unsigned char __b) {
9371 return vec_perm(__a, __a, (vector unsigned char)(__b));
9374 static __inline__ vector unsigned char __ATTRS_o_ai
9375 vec_vspltb(vector unsigned char __a, unsigned char __b) {
9376 return vec_perm(__a, __a, (vector unsigned char)(__b));
9379 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9380 unsigned char __b) {
9381 return vec_perm(__a, __a, (vector unsigned char)(__b));
9386 #define __builtin_altivec_vsplth vec_vsplth
9388 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9389 unsigned char __b) {
9391 unsigned char b1 = __b + 1;
9392 return vec_perm(__a, __a,
9393 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9394 __b, b1, __b, b1, __b, b1, __b, b1));
9397 static __inline__ vector unsigned short __ATTRS_o_ai
9398 vec_vsplth(vector unsigned short __a, unsigned char __b) {
9400 unsigned char b1 = __b + 1;
9401 return vec_perm(__a, __a,
9402 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9403 __b, b1, __b, b1, __b, b1, __b, b1));
9406 static __inline__ vector bool short __ATTRS_o_ai
9407 vec_vsplth(vector bool short __a, unsigned char __b) {
9409 unsigned char b1 = __b + 1;
9410 return vec_perm(__a, __a,
9411 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9412 __b, b1, __b, b1, __b, b1, __b, b1));
9415 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9416 unsigned char __b) {
9418 unsigned char b1 = __b + 1;
9419 return vec_perm(__a, __a,
9420 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9421 __b, b1, __b, b1, __b, b1, __b, b1));
9426 #define __builtin_altivec_vspltw vec_vspltw
9428 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9429 unsigned char __b) {
9431 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9432 return vec_perm(__a, __a,
9433 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9434 b1, b2, b3, __b, b1, b2, b3));
9437 static __inline__ vector unsigned int __ATTRS_o_ai
9438 vec_vspltw(vector unsigned int __a, unsigned char __b) {
9440 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9441 return vec_perm(__a, __a,
9442 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9443 b1, b2, b3, __b, b1, b2, b3));
9446 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9447 unsigned char __b) {
9449 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9450 return vec_perm(__a, __a,
9451 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9452 b1, b2, b3, __b, b1, b2, b3));
9455 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9456 unsigned char __b) {
9458 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9459 return vec_perm(__a, __a,
9460 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9461 b1, b2, b3, __b, b1, b2, b3));
9466 #define __builtin_altivec_vspltisb vec_splat_s8
9468 // FIXME: parameter should be treated as 5-bit signed literal
9469 static __inline__ vector signed char __ATTRS_o_ai
9470 vec_splat_s8(signed char __a) {
9471 return (vector signed char)(__a);
9476 // FIXME: parameter should be treated as 5-bit signed literal
9477 static __inline__ vector signed char __ATTRS_o_ai
9478 vec_vspltisb(signed char __a) {
9479 return (vector signed char)(__a);
9484 #define __builtin_altivec_vspltish vec_splat_s16
9486 // FIXME: parameter should be treated as 5-bit signed literal
9487 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9488 return (vector short)(__a);
9493 // FIXME: parameter should be treated as 5-bit signed literal
9494 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9495 return (vector short)(__a);
9500 #define __builtin_altivec_vspltisw vec_splat_s32
9502 // FIXME: parameter should be treated as 5-bit signed literal
9503 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9504 return (vector int)(__a);
9509 // FIXME: parameter should be treated as 5-bit signed literal
9510 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9511 return (vector int)(__a);
9516 // FIXME: parameter should be treated as 5-bit signed literal
9517 static __inline__ vector unsigned char __ATTRS_o_ai
9518 vec_splat_u8(unsigned char __a) {
9519 return (vector unsigned char)(__a);
9524 // FIXME: parameter should be treated as 5-bit signed literal
9525 static __inline__ vector unsigned short __ATTRS_o_ai
9526 vec_splat_u16(signed char __a) {
9527 return (vector unsigned short)(__a);
9532 // FIXME: parameter should be treated as 5-bit signed literal
9533 static __inline__ vector unsigned int __ATTRS_o_ai
9534 vec_splat_u32(signed char __a) {
9535 return (vector unsigned int)(__a);
9540 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
9541 // than the length of __a.
9542 static __inline__ vector unsigned char __ATTRS_o_ai
9543 vec_sr(vector unsigned char __a, vector unsigned char __b) {
9545 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
9548 static __inline__ vector signed char __ATTRS_o_ai
9549 vec_sr(vector signed char __a, vector unsigned char __b) {
9550 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
9553 static __inline__ vector unsigned short __ATTRS_o_ai
9554 vec_sr(vector unsigned short __a, vector unsigned short __b) {
9556 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
9559 static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
9560 vector unsigned short __b) {
9561 return (vector short)vec_sr((vector unsigned short)__a, __b);
9564 static __inline__ vector unsigned int __ATTRS_o_ai
9565 vec_sr(vector unsigned int __a, vector unsigned int __b) {
9567 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
9570 static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
9571 vector unsigned int __b) {
9572 return (vector int)vec_sr((vector unsigned int)__a, __b);
9575 #ifdef __POWER8_VECTOR__
9576 static __inline__ vector unsigned long long __ATTRS_o_ai
9577 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9578 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
9582 static __inline__ vector long long __ATTRS_o_ai
9583 vec_sr(vector long long __a, vector unsigned long long __b) {
9584 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9590 #define __builtin_altivec_vsrb vec_vsrb
9592 static __inline__ vector signed char __ATTRS_o_ai
9593 vec_vsrb(vector signed char __a, vector unsigned char __b) {
9594 return vec_sr(__a, __b);
9597 static __inline__ vector unsigned char __ATTRS_o_ai
9598 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9599 return vec_sr(__a, __b);
9604 #define __builtin_altivec_vsrh vec_vsrh
9606 static __inline__ vector short __ATTRS_o_ai
9607 vec_vsrh(vector short __a, vector unsigned short __b) {
9608 return vec_sr(__a, __b);
9611 static __inline__ vector unsigned short __ATTRS_o_ai
9612 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9613 return vec_sr(__a, __b);
9618 #define __builtin_altivec_vsrw vec_vsrw
9620 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9621 vector unsigned int __b) {
9622 return vec_sr(__a, __b);
9625 static __inline__ vector unsigned int __ATTRS_o_ai
9626 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9627 return vec_sr(__a, __b);
9632 static __inline__ vector signed char __ATTRS_o_ai
9633 vec_sra(vector signed char __a, vector unsigned char __b) {
9634 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9637 static __inline__ vector unsigned char __ATTRS_o_ai
9638 vec_sra(vector unsigned char __a, vector unsigned char __b) {
9639 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9642 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9643 vector unsigned short __b) {
9644 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9647 static __inline__ vector unsigned short __ATTRS_o_ai
9648 vec_sra(vector unsigned short __a, vector unsigned short __b) {
9649 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9652 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9653 vector unsigned int __b) {
9654 return __builtin_altivec_vsraw(__a, __b);
9657 static __inline__ vector unsigned int __ATTRS_o_ai
9658 vec_sra(vector unsigned int __a, vector unsigned int __b) {
9659 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9662 #ifdef __POWER8_VECTOR__
9663 static __inline__ vector signed long long __ATTRS_o_ai
9664 vec_sra(vector signed long long __a, vector unsigned long long __b) {
9668 static __inline__ vector unsigned long long __ATTRS_o_ai
9669 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9670 return (vector unsigned long long)((vector signed long long)__a >> __b);
9676 static __inline__ vector signed char __ATTRS_o_ai
9677 vec_vsrab(vector signed char __a, vector unsigned char __b) {
9678 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9681 static __inline__ vector unsigned char __ATTRS_o_ai
9682 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9683 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9688 static __inline__ vector short __ATTRS_o_ai
9689 vec_vsrah(vector short __a, vector unsigned short __b) {
9690 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9693 static __inline__ vector unsigned short __ATTRS_o_ai
9694 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9695 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9700 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9701 vector unsigned int __b) {
9702 return __builtin_altivec_vsraw(__a, __b);
9705 static __inline__ vector unsigned int __ATTRS_o_ai
9706 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9707 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9712 static __inline__ vector signed char __ATTRS_o_ai
9713 vec_srl(vector signed char __a, vector unsigned char __b) {
9714 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9718 static __inline__ vector signed char __ATTRS_o_ai
9719 vec_srl(vector signed char __a, vector unsigned short __b) {
9720 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9724 static __inline__ vector signed char __ATTRS_o_ai
9725 vec_srl(vector signed char __a, vector unsigned int __b) {
9726 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9730 static __inline__ vector unsigned char __ATTRS_o_ai
9731 vec_srl(vector unsigned char __a, vector unsigned char __b) {
9732 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9736 static __inline__ vector unsigned char __ATTRS_o_ai
9737 vec_srl(vector unsigned char __a, vector unsigned short __b) {
9738 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9742 static __inline__ vector unsigned char __ATTRS_o_ai
9743 vec_srl(vector unsigned char __a, vector unsigned int __b) {
9744 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9748 static __inline__ vector bool char __ATTRS_o_ai
9749 vec_srl(vector bool char __a, vector unsigned char __b) {
9750 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9754 static __inline__ vector bool char __ATTRS_o_ai
9755 vec_srl(vector bool char __a, vector unsigned short __b) {
9756 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9760 static __inline__ vector bool char __ATTRS_o_ai
9761 vec_srl(vector bool char __a, vector unsigned int __b) {
9762 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9766 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9767 vector unsigned char __b) {
9768 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9771 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9772 vector unsigned short __b) {
9773 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9776 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9777 vector unsigned int __b) {
9778 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9781 static __inline__ vector unsigned short __ATTRS_o_ai
9782 vec_srl(vector unsigned short __a, vector unsigned char __b) {
9783 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9787 static __inline__ vector unsigned short __ATTRS_o_ai
9788 vec_srl(vector unsigned short __a, vector unsigned short __b) {
9789 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9793 static __inline__ vector unsigned short __ATTRS_o_ai
9794 vec_srl(vector unsigned short __a, vector unsigned int __b) {
9795 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9799 static __inline__ vector bool short __ATTRS_o_ai
9800 vec_srl(vector bool short __a, vector unsigned char __b) {
9801 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9805 static __inline__ vector bool short __ATTRS_o_ai
9806 vec_srl(vector bool short __a, vector unsigned short __b) {
9807 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9811 static __inline__ vector bool short __ATTRS_o_ai
9812 vec_srl(vector bool short __a, vector unsigned int __b) {
9813 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9817 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9818 vector unsigned char __b) {
9819 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9822 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9823 vector unsigned short __b) {
9824 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9827 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9828 vector unsigned int __b) {
9829 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9832 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9833 vector unsigned char __b) {
9834 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9837 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9838 vector unsigned short __b) {
9839 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9842 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9843 vector unsigned int __b) {
9844 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9847 static __inline__ vector unsigned int __ATTRS_o_ai
9848 vec_srl(vector unsigned int __a, vector unsigned char __b) {
9849 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9853 static __inline__ vector unsigned int __ATTRS_o_ai
9854 vec_srl(vector unsigned int __a, vector unsigned short __b) {
9855 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9859 static __inline__ vector unsigned int __ATTRS_o_ai
9860 vec_srl(vector unsigned int __a, vector unsigned int __b) {
9861 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9865 static __inline__ vector bool int __ATTRS_o_ai
9866 vec_srl(vector bool int __a, vector unsigned char __b) {
9867 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9871 static __inline__ vector bool int __ATTRS_o_ai
9872 vec_srl(vector bool int __a, vector unsigned short __b) {
9873 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9877 static __inline__ vector bool int __ATTRS_o_ai
9878 vec_srl(vector bool int __a, vector unsigned int __b) {
9879 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9884 static __inline__ vector signed long long __ATTRS_o_ai
9885 vec_srl(vector signed long long __a, vector unsigned char __b) {
9886 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9890 static __inline__ vector unsigned long long __ATTRS_o_ai
9891 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9892 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9899 static __inline__ vector signed char __ATTRS_o_ai
9900 vec_vsr(vector signed char __a, vector unsigned char __b) {
9901 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9905 static __inline__ vector signed char __ATTRS_o_ai
9906 vec_vsr(vector signed char __a, vector unsigned short __b) {
9907 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9911 static __inline__ vector signed char __ATTRS_o_ai
9912 vec_vsr(vector signed char __a, vector unsigned int __b) {
9913 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9917 static __inline__ vector unsigned char __ATTRS_o_ai
9918 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9919 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9923 static __inline__ vector unsigned char __ATTRS_o_ai
9924 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9925 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9929 static __inline__ vector unsigned char __ATTRS_o_ai
9930 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9931 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9935 static __inline__ vector bool char __ATTRS_o_ai
9936 vec_vsr(vector bool char __a, vector unsigned char __b) {
9937 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9941 static __inline__ vector bool char __ATTRS_o_ai
9942 vec_vsr(vector bool char __a, vector unsigned short __b) {
9943 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9947 static __inline__ vector bool char __ATTRS_o_ai
9948 vec_vsr(vector bool char __a, vector unsigned int __b) {
9949 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9953 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9954 vector unsigned char __b) {
9955 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9958 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9959 vector unsigned short __b) {
9960 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9963 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9964 vector unsigned int __b) {
9965 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9968 static __inline__ vector unsigned short __ATTRS_o_ai
9969 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9970 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9974 static __inline__ vector unsigned short __ATTRS_o_ai
9975 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9976 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9980 static __inline__ vector unsigned short __ATTRS_o_ai
9981 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9982 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9986 static __inline__ vector bool short __ATTRS_o_ai
9987 vec_vsr(vector bool short __a, vector unsigned char __b) {
9988 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9992 static __inline__ vector bool short __ATTRS_o_ai
9993 vec_vsr(vector bool short __a, vector unsigned short __b) {
9994 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9998 static __inline__ vector bool short __ATTRS_o_ai
9999 vec_vsr(vector bool short __a, vector unsigned int __b) {
10000 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10004 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10005 vector unsigned char __b) {
10006 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10009 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10010 vector unsigned short __b) {
10011 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10014 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10015 vector unsigned int __b) {
10016 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10019 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10020 vector unsigned char __b) {
10021 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10024 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10025 vector unsigned short __b) {
10026 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10029 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10030 vector unsigned int __b) {
10031 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10034 static __inline__ vector unsigned int __ATTRS_o_ai
10035 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
10036 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10040 static __inline__ vector unsigned int __ATTRS_o_ai
10041 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
10042 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10046 static __inline__ vector unsigned int __ATTRS_o_ai
10047 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10048 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10052 static __inline__ vector bool int __ATTRS_o_ai
10053 vec_vsr(vector bool int __a, vector unsigned char __b) {
10054 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10058 static __inline__ vector bool int __ATTRS_o_ai
10059 vec_vsr(vector bool int __a, vector unsigned short __b) {
10060 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10064 static __inline__ vector bool int __ATTRS_o_ai
10065 vec_vsr(vector bool int __a, vector unsigned int __b) {
10066 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10072 static __inline__ vector signed char __ATTRS_o_ai
10073 vec_sro(vector signed char __a, vector signed char __b) {
10074 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10078 static __inline__ vector signed char __ATTRS_o_ai
10079 vec_sro(vector signed char __a, vector unsigned char __b) {
10080 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10084 static __inline__ vector unsigned char __ATTRS_o_ai
10085 vec_sro(vector unsigned char __a, vector signed char __b) {
10086 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10090 static __inline__ vector unsigned char __ATTRS_o_ai
10091 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10092 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10096 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10097 vector signed char __b) {
10098 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10101 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10102 vector unsigned char __b) {
10103 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10106 static __inline__ vector unsigned short __ATTRS_o_ai
10107 vec_sro(vector unsigned short __a, vector signed char __b) {
10108 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10112 static __inline__ vector unsigned short __ATTRS_o_ai
10113 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10114 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10118 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10119 vector signed char __b) {
10120 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10123 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10124 vector unsigned char __b) {
10125 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10128 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10129 vector signed char __b) {
10130 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10133 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10134 vector unsigned char __b) {
10135 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10138 static __inline__ vector unsigned int __ATTRS_o_ai
10139 vec_sro(vector unsigned int __a, vector signed char __b) {
10140 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10144 static __inline__ vector unsigned int __ATTRS_o_ai
10145 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10146 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10150 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10151 vector signed char __b) {
10152 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10155 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10156 vector unsigned char __b) {
10157 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10161 static __inline__ vector signed long long __ATTRS_o_ai
10162 vec_sro(vector signed long long __a, vector signed char __b) {
10163 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10167 static __inline__ vector signed long long __ATTRS_o_ai
10168 vec_sro(vector signed long long __a, vector unsigned char __b) {
10169 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10173 static __inline__ vector unsigned long long __ATTRS_o_ai
10174 vec_sro(vector unsigned long long __a, vector signed char __b) {
10175 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10179 static __inline__ vector unsigned long long __ATTRS_o_ai
10180 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10181 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10188 static __inline__ vector signed char __ATTRS_o_ai
10189 vec_vsro(vector signed char __a, vector signed char __b) {
10190 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10194 static __inline__ vector signed char __ATTRS_o_ai
10195 vec_vsro(vector signed char __a, vector unsigned char __b) {
10196 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10200 static __inline__ vector unsigned char __ATTRS_o_ai
10201 vec_vsro(vector unsigned char __a, vector signed char __b) {
10202 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10206 static __inline__ vector unsigned char __ATTRS_o_ai
10207 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10208 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10212 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10213 vector signed char __b) {
10214 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10217 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10218 vector unsigned char __b) {
10219 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10222 static __inline__ vector unsigned short __ATTRS_o_ai
10223 vec_vsro(vector unsigned short __a, vector signed char __b) {
10224 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10228 static __inline__ vector unsigned short __ATTRS_o_ai
10229 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10230 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10234 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10235 vector signed char __b) {
10236 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10239 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10240 vector unsigned char __b) {
10241 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10244 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10245 vector signed char __b) {
10246 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10249 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10250 vector unsigned char __b) {
10251 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10254 static __inline__ vector unsigned int __ATTRS_o_ai
10255 vec_vsro(vector unsigned int __a, vector signed char __b) {
10256 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10260 static __inline__ vector unsigned int __ATTRS_o_ai
10261 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10262 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10266 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10267 vector signed char __b) {
10268 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10271 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10272 vector unsigned char __b) {
10273 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10278 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10279 vector signed char *__c) {
10280 __builtin_altivec_stvx((vector int)__a, __b, __c);
10283 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10284 signed char *__c) {
10285 __builtin_altivec_stvx((vector int)__a, __b, __c);
10288 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10289 vector unsigned char *__c) {
10290 __builtin_altivec_stvx((vector int)__a, __b, __c);
10293 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10294 unsigned char *__c) {
10295 __builtin_altivec_stvx((vector int)__a, __b, __c);
10298 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10299 signed char *__c) {
10300 __builtin_altivec_stvx((vector int)__a, __b, __c);
10303 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10304 unsigned char *__c) {
10305 __builtin_altivec_stvx((vector int)__a, __b, __c);
10308 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10309 vector bool char *__c) {
10310 __builtin_altivec_stvx((vector int)__a, __b, __c);
10313 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10314 vector short *__c) {
10315 __builtin_altivec_stvx((vector int)__a, __b, __c);
10318 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10320 __builtin_altivec_stvx((vector int)__a, __b, __c);
10323 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10324 vector unsigned short *__c) {
10325 __builtin_altivec_stvx((vector int)__a, __b, __c);
10328 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10329 unsigned short *__c) {
10330 __builtin_altivec_stvx((vector int)__a, __b, __c);
10333 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10335 __builtin_altivec_stvx((vector int)__a, __b, __c);
10338 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10339 unsigned short *__c) {
10340 __builtin_altivec_stvx((vector int)__a, __b, __c);
10343 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10344 vector bool short *__c) {
10345 __builtin_altivec_stvx((vector int)__a, __b, __c);
10348 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10350 __builtin_altivec_stvx((vector int)__a, __b, __c);
10353 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10354 unsigned short *__c) {
10355 __builtin_altivec_stvx((vector int)__a, __b, __c);
10358 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10359 vector pixel *__c) {
10360 __builtin_altivec_stvx((vector int)__a, __b, __c);
10363 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10365 __builtin_altivec_stvx(__a, __b, __c);
10368 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10369 __builtin_altivec_stvx(__a, __b, __c);
10372 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10373 vector unsigned int *__c) {
10374 __builtin_altivec_stvx((vector int)__a, __b, __c);
10377 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10378 unsigned int *__c) {
10379 __builtin_altivec_stvx((vector int)__a, __b, __c);
10382 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10384 __builtin_altivec_stvx((vector int)__a, __b, __c);
10387 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10388 unsigned int *__c) {
10389 __builtin_altivec_stvx((vector int)__a, __b, __c);
10392 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10393 vector bool int *__c) {
10394 __builtin_altivec_stvx((vector int)__a, __b, __c);
10397 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10398 vector float *__c) {
10399 __builtin_altivec_stvx((vector int)__a, __b, __c);
10402 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10404 __builtin_altivec_stvx((vector int)__a, __b, __c);
10409 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10410 vector signed char *__c) {
10411 __builtin_altivec_stvx((vector int)__a, __b, __c);
10414 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10415 signed char *__c) {
10416 __builtin_altivec_stvx((vector int)__a, __b, __c);
10419 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10420 vector unsigned char *__c) {
10421 __builtin_altivec_stvx((vector int)__a, __b, __c);
10424 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10425 unsigned char *__c) {
10426 __builtin_altivec_stvx((vector int)__a, __b, __c);
10429 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10430 signed char *__c) {
10431 __builtin_altivec_stvx((vector int)__a, __b, __c);
10434 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10435 unsigned char *__c) {
10436 __builtin_altivec_stvx((vector int)__a, __b, __c);
10439 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10440 vector bool char *__c) {
10441 __builtin_altivec_stvx((vector int)__a, __b, __c);
10444 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10445 vector short *__c) {
10446 __builtin_altivec_stvx((vector int)__a, __b, __c);
10449 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10451 __builtin_altivec_stvx((vector int)__a, __b, __c);
10454 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10455 vector unsigned short *__c) {
10456 __builtin_altivec_stvx((vector int)__a, __b, __c);
10459 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10460 unsigned short *__c) {
10461 __builtin_altivec_stvx((vector int)__a, __b, __c);
10464 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10466 __builtin_altivec_stvx((vector int)__a, __b, __c);
10469 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10470 unsigned short *__c) {
10471 __builtin_altivec_stvx((vector int)__a, __b, __c);
10474 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10475 vector bool short *__c) {
10476 __builtin_altivec_stvx((vector int)__a, __b, __c);
10479 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10481 __builtin_altivec_stvx((vector int)__a, __b, __c);
10484 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10485 unsigned short *__c) {
10486 __builtin_altivec_stvx((vector int)__a, __b, __c);
10489 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10490 vector pixel *__c) {
10491 __builtin_altivec_stvx((vector int)__a, __b, __c);
10494 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10496 __builtin_altivec_stvx(__a, __b, __c);
10499 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10501 __builtin_altivec_stvx(__a, __b, __c);
10504 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10505 vector unsigned int *__c) {
10506 __builtin_altivec_stvx((vector int)__a, __b, __c);
10509 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10510 unsigned int *__c) {
10511 __builtin_altivec_stvx((vector int)__a, __b, __c);
10514 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10516 __builtin_altivec_stvx((vector int)__a, __b, __c);
10519 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10520 unsigned int *__c) {
10521 __builtin_altivec_stvx((vector int)__a, __b, __c);
10524 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10525 vector bool int *__c) {
10526 __builtin_altivec_stvx((vector int)__a, __b, __c);
10529 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10530 vector float *__c) {
10531 __builtin_altivec_stvx((vector int)__a, __b, __c);
10534 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10536 __builtin_altivec_stvx((vector int)__a, __b, __c);
10541 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10542 signed char *__c) {
10543 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10546 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10547 unsigned char *__c) {
10548 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10551 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10552 signed char *__c) {
10553 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10556 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10557 unsigned char *__c) {
10558 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10561 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10563 __builtin_altivec_stvehx(__a, __b, __c);
10566 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10567 unsigned short *__c) {
10568 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10571 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10573 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10576 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10577 unsigned short *__c) {
10578 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10581 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10583 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10586 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10587 unsigned short *__c) {
10588 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10591 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10592 __builtin_altivec_stvewx(__a, __b, __c);
10595 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10596 unsigned int *__c) {
10597 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10600 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10602 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10605 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10606 unsigned int *__c) {
10607 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10610 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10612 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10617 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10618 signed char *__c) {
10619 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10622 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10623 int __b, unsigned char *__c) {
10624 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10627 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10628 signed char *__c) {
10629 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10632 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10633 unsigned char *__c) {
10634 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10639 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10641 __builtin_altivec_stvehx(__a, __b, __c);
10644 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10645 int __b, unsigned short *__c) {
10646 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10649 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10651 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10654 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10655 unsigned short *__c) {
10656 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10659 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10661 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10664 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10665 unsigned short *__c) {
10666 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10671 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10673 __builtin_altivec_stvewx(__a, __b, __c);
10676 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10677 unsigned int *__c) {
10678 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10681 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10683 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10686 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10687 unsigned int *__c) {
10688 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10691 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10693 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10698 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10699 vector signed char *__c) {
10700 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10703 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10704 signed char *__c) {
10705 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10708 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10709 vector unsigned char *__c) {
10710 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10713 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10714 unsigned char *__c) {
10715 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10718 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10719 signed char *__c) {
10720 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10723 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10724 unsigned char *__c) {
10725 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10728 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10729 vector bool char *__c) {
10730 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10733 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10734 vector short *__c) {
10735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10738 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10740 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10743 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10744 vector unsigned short *__c) {
10745 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10748 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10749 unsigned short *__c) {
10750 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10753 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10755 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10758 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10759 unsigned short *__c) {
10760 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10763 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10764 vector bool short *__c) {
10765 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10768 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10770 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10773 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10774 unsigned short *__c) {
10775 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10778 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10779 vector pixel *__c) {
10780 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10783 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10785 __builtin_altivec_stvxl(__a, __b, __c);
10788 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10789 __builtin_altivec_stvxl(__a, __b, __c);
10792 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10793 vector unsigned int *__c) {
10794 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10797 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10798 unsigned int *__c) {
10799 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10802 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10804 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10807 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10808 unsigned int *__c) {
10809 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10812 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10813 vector bool int *__c) {
10814 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10817 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10818 vector float *__c) {
10819 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10822 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10824 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10829 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10830 vector signed char *__c) {
10831 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10834 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10835 signed char *__c) {
10836 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10839 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10840 vector unsigned char *__c) {
10841 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10844 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10845 unsigned char *__c) {
10846 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10849 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10850 signed char *__c) {
10851 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10854 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10855 unsigned char *__c) {
10856 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10859 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10860 vector bool char *__c) {
10861 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10864 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10865 vector short *__c) {
10866 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10869 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10871 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10874 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10876 vector unsigned short *__c) {
10877 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10880 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10881 int __b, unsigned short *__c) {
10882 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10885 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10887 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10890 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10891 unsigned short *__c) {
10892 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10895 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10896 vector bool short *__c) {
10897 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10900 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10902 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10905 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10906 unsigned short *__c) {
10907 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10910 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10911 vector pixel *__c) {
10912 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10915 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10917 __builtin_altivec_stvxl(__a, __b, __c);
10920 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10922 __builtin_altivec_stvxl(__a, __b, __c);
10925 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10926 vector unsigned int *__c) {
10927 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10930 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10931 unsigned int *__c) {
10932 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10935 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10937 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10940 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10941 unsigned int *__c) {
10942 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10945 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10946 vector bool int *__c) {
10947 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10950 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10951 vector float *__c) {
10952 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10955 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10957 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10962 static __inline__ vector signed char __ATTRS_o_ai
10963 vec_sub(vector signed char __a, vector signed char __b) {
10967 static __inline__ vector signed char __ATTRS_o_ai
10968 vec_sub(vector bool char __a, vector signed char __b) {
10969 return (vector signed char)__a - __b;
10972 static __inline__ vector signed char __ATTRS_o_ai
10973 vec_sub(vector signed char __a, vector bool char __b) {
10974 return __a - (vector signed char)__b;
10977 static __inline__ vector unsigned char __ATTRS_o_ai
10978 vec_sub(vector unsigned char __a, vector unsigned char __b) {
10982 static __inline__ vector unsigned char __ATTRS_o_ai
10983 vec_sub(vector bool char __a, vector unsigned char __b) {
10984 return (vector unsigned char)__a - __b;
10987 static __inline__ vector unsigned char __ATTRS_o_ai
10988 vec_sub(vector unsigned char __a, vector bool char __b) {
10989 return __a - (vector unsigned char)__b;
10992 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10993 vector short __b) {
10997 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10998 vector short __b) {
10999 return (vector short)__a - __b;
11002 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11003 vector bool short __b) {
11004 return __a - (vector short)__b;
11007 static __inline__ vector unsigned short __ATTRS_o_ai
11008 vec_sub(vector unsigned short __a, vector unsigned short __b) {
11012 static __inline__ vector unsigned short __ATTRS_o_ai
11013 vec_sub(vector bool short __a, vector unsigned short __b) {
11014 return (vector unsigned short)__a - __b;
11017 static __inline__ vector unsigned short __ATTRS_o_ai
11018 vec_sub(vector unsigned short __a, vector bool short __b) {
11019 return __a - (vector unsigned short)__b;
11022 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11027 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
11029 return (vector int)__a - __b;
11032 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11033 vector bool int __b) {
11034 return __a - (vector int)__b;
11037 static __inline__ vector unsigned int __ATTRS_o_ai
11038 vec_sub(vector unsigned int __a, vector unsigned int __b) {
11042 static __inline__ vector unsigned int __ATTRS_o_ai
11043 vec_sub(vector bool int __a, vector unsigned int __b) {
11044 return (vector unsigned int)__a - __b;
11047 static __inline__ vector unsigned int __ATTRS_o_ai
11048 vec_sub(vector unsigned int __a, vector bool int __b) {
11049 return __a - (vector unsigned int)__b;
11052 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11053 static __inline__ vector signed __int128 __ATTRS_o_ai
11054 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11058 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11059 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11062 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11065 static __inline__ vector signed long long __ATTRS_o_ai
11066 vec_sub(vector signed long long __a, vector signed long long __b) {
11070 static __inline__ vector unsigned long long __ATTRS_o_ai
11071 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11075 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11076 vector double __b) {
11081 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11082 vector float __b) {
11088 #define __builtin_altivec_vsububm vec_vsububm
11090 static __inline__ vector signed char __ATTRS_o_ai
11091 vec_vsububm(vector signed char __a, vector signed char __b) {
11095 static __inline__ vector signed char __ATTRS_o_ai
11096 vec_vsububm(vector bool char __a, vector signed char __b) {
11097 return (vector signed char)__a - __b;
11100 static __inline__ vector signed char __ATTRS_o_ai
11101 vec_vsububm(vector signed char __a, vector bool char __b) {
11102 return __a - (vector signed char)__b;
11105 static __inline__ vector unsigned char __ATTRS_o_ai
11106 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11110 static __inline__ vector unsigned char __ATTRS_o_ai
11111 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11112 return (vector unsigned char)__a - __b;
11115 static __inline__ vector unsigned char __ATTRS_o_ai
11116 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11117 return __a - (vector unsigned char)__b;
11122 #define __builtin_altivec_vsubuhm vec_vsubuhm
11124 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11125 vector short __b) {
11129 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11130 vector short __b) {
11131 return (vector short)__a - __b;
11134 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11135 vector bool short __b) {
11136 return __a - (vector short)__b;
11139 static __inline__ vector unsigned short __ATTRS_o_ai
11140 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11144 static __inline__ vector unsigned short __ATTRS_o_ai
11145 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11146 return (vector unsigned short)__a - __b;
11149 static __inline__ vector unsigned short __ATTRS_o_ai
11150 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11151 return __a - (vector unsigned short)__b;
11156 #define __builtin_altivec_vsubuwm vec_vsubuwm
11158 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11163 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11165 return (vector int)__a - __b;
11168 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11169 vector bool int __b) {
11170 return __a - (vector int)__b;
11173 static __inline__ vector unsigned int __ATTRS_o_ai
11174 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11178 static __inline__ vector unsigned int __ATTRS_o_ai
11179 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11180 return (vector unsigned int)__a - __b;
11183 static __inline__ vector unsigned int __ATTRS_o_ai
11184 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11185 return __a - (vector unsigned int)__b;
11190 #define __builtin_altivec_vsubfp vec_vsubfp
11192 static __inline__ vector float __attribute__((__always_inline__))
11193 vec_vsubfp(vector float __a, vector float __b) {
11199 static __inline__ vector signed int __ATTRS_o_ai
11200 vec_subc(vector signed int __a, vector signed int __b) {
11201 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11202 (vector unsigned int) __b);
11205 static __inline__ vector unsigned int __ATTRS_o_ai
11206 vec_subc(vector unsigned int __a, vector unsigned int __b) {
11207 return __builtin_altivec_vsubcuw(__a, __b);
11210 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11211 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11212 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11213 return __builtin_altivec_vsubcuq(__a, __b);
11216 static __inline__ vector signed __int128 __ATTRS_o_ai
11217 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11218 return __builtin_altivec_vsubcuq(__a, __b);
11220 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11224 static __inline__ vector unsigned int __attribute__((__always_inline__))
11225 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11226 return __builtin_altivec_vsubcuw(__a, __b);
11231 static __inline__ vector signed char __ATTRS_o_ai
11232 vec_subs(vector signed char __a, vector signed char __b) {
11233 return __builtin_altivec_vsubsbs(__a, __b);
11236 static __inline__ vector signed char __ATTRS_o_ai
11237 vec_subs(vector bool char __a, vector signed char __b) {
11238 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11241 static __inline__ vector signed char __ATTRS_o_ai
11242 vec_subs(vector signed char __a, vector bool char __b) {
11243 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11246 static __inline__ vector unsigned char __ATTRS_o_ai
11247 vec_subs(vector unsigned char __a, vector unsigned char __b) {
11248 return __builtin_altivec_vsububs(__a, __b);
11251 static __inline__ vector unsigned char __ATTRS_o_ai
11252 vec_subs(vector bool char __a, vector unsigned char __b) {
11253 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11256 static __inline__ vector unsigned char __ATTRS_o_ai
11257 vec_subs(vector unsigned char __a, vector bool char __b) {
11258 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11261 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11262 vector short __b) {
11263 return __builtin_altivec_vsubshs(__a, __b);
11266 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11267 vector short __b) {
11268 return __builtin_altivec_vsubshs((vector short)__a, __b);
11271 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11272 vector bool short __b) {
11273 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11276 static __inline__ vector unsigned short __ATTRS_o_ai
11277 vec_subs(vector unsigned short __a, vector unsigned short __b) {
11278 return __builtin_altivec_vsubuhs(__a, __b);
11281 static __inline__ vector unsigned short __ATTRS_o_ai
11282 vec_subs(vector bool short __a, vector unsigned short __b) {
11283 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11286 static __inline__ vector unsigned short __ATTRS_o_ai
11287 vec_subs(vector unsigned short __a, vector bool short __b) {
11288 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11291 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11293 return __builtin_altivec_vsubsws(__a, __b);
11296 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11298 return __builtin_altivec_vsubsws((vector int)__a, __b);
11301 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11302 vector bool int __b) {
11303 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11306 static __inline__ vector unsigned int __ATTRS_o_ai
11307 vec_subs(vector unsigned int __a, vector unsigned int __b) {
11308 return __builtin_altivec_vsubuws(__a, __b);
11311 static __inline__ vector unsigned int __ATTRS_o_ai
11312 vec_subs(vector bool int __a, vector unsigned int __b) {
11313 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11316 static __inline__ vector unsigned int __ATTRS_o_ai
11317 vec_subs(vector unsigned int __a, vector bool int __b) {
11318 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11323 static __inline__ vector signed char __ATTRS_o_ai
11324 vec_vsubsbs(vector signed char __a, vector signed char __b) {
11325 return __builtin_altivec_vsubsbs(__a, __b);
11328 static __inline__ vector signed char __ATTRS_o_ai
11329 vec_vsubsbs(vector bool char __a, vector signed char __b) {
11330 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11333 static __inline__ vector signed char __ATTRS_o_ai
11334 vec_vsubsbs(vector signed char __a, vector bool char __b) {
11335 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11340 static __inline__ vector unsigned char __ATTRS_o_ai
11341 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11342 return __builtin_altivec_vsububs(__a, __b);
11345 static __inline__ vector unsigned char __ATTRS_o_ai
11346 vec_vsububs(vector bool char __a, vector unsigned char __b) {
11347 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11350 static __inline__ vector unsigned char __ATTRS_o_ai
11351 vec_vsububs(vector unsigned char __a, vector bool char __b) {
11352 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11357 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11358 vector short __b) {
11359 return __builtin_altivec_vsubshs(__a, __b);
11362 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11363 vector short __b) {
11364 return __builtin_altivec_vsubshs((vector short)__a, __b);
11367 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11368 vector bool short __b) {
11369 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11374 static __inline__ vector unsigned short __ATTRS_o_ai
11375 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11376 return __builtin_altivec_vsubuhs(__a, __b);
11379 static __inline__ vector unsigned short __ATTRS_o_ai
11380 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11381 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11384 static __inline__ vector unsigned short __ATTRS_o_ai
11385 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11386 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11391 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11393 return __builtin_altivec_vsubsws(__a, __b);
11396 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11398 return __builtin_altivec_vsubsws((vector int)__a, __b);
11401 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11402 vector bool int __b) {
11403 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11408 static __inline__ vector unsigned int __ATTRS_o_ai
11409 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11410 return __builtin_altivec_vsubuws(__a, __b);
11413 static __inline__ vector unsigned int __ATTRS_o_ai
11414 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11415 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11418 static __inline__ vector unsigned int __ATTRS_o_ai
11419 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11420 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11423 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11426 static __inline__ vector signed __int128 __ATTRS_o_ai
11427 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11431 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11432 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11439 static __inline__ vector signed __int128 __ATTRS_o_ai
11440 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11441 vector signed __int128 __c) {
11442 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11445 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11446 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11447 vector unsigned __int128 __c) {
11448 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11451 static __inline__ vector signed __int128 __ATTRS_o_ai
11452 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11453 vector signed __int128 __c) {
11454 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11457 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11458 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11459 vector unsigned __int128 __c) {
11460 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11465 static __inline__ vector signed __int128 __ATTRS_o_ai
11466 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11467 return __builtin_altivec_vsubcuq(__a, __b);
11470 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11471 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11472 return __builtin_altivec_vsubcuq(__a, __b);
11477 static __inline__ vector signed __int128 __ATTRS_o_ai
11478 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11479 vector signed __int128 __c) {
11480 return __builtin_altivec_vsubecuq(__a, __b, __c);
11483 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11484 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11485 vector unsigned __int128 __c) {
11486 return __builtin_altivec_vsubecuq(__a, __b, __c);
11489 static __inline__ vector signed int __ATTRS_o_ai
11490 vec_subec(vector signed int __a, vector signed int __b,
11491 vector signed int __c) {
11492 return vec_addec(__a, ~__b, __c);
11495 static __inline__ vector unsigned int __ATTRS_o_ai
11496 vec_subec(vector unsigned int __a, vector unsigned int __b,
11497 vector unsigned int __c) {
11498 return vec_addec(__a, ~__b, __c);
11501 static __inline__ vector signed __int128 __ATTRS_o_ai
11502 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11503 vector signed __int128 __c) {
11504 return __builtin_altivec_vsubecuq(__a, __b, __c);
11507 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11508 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11509 vector unsigned __int128 __c) {
11510 return __builtin_altivec_vsubecuq(__a, __b, __c);
11512 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11514 static __inline__ vector signed int __ATTRS_o_ai
11515 vec_sube(vector signed int __a, vector signed int __b,
11516 vector signed int __c) {
11517 vector signed int __mask = {1, 1, 1, 1};
11518 vector signed int __carry = __c & __mask;
11519 return vec_adde(__a, ~__b, __carry);
11522 static __inline__ vector unsigned int __ATTRS_o_ai
11523 vec_sube(vector unsigned int __a, vector unsigned int __b,
11524 vector unsigned int __c) {
11525 vector unsigned int __mask = {1, 1, 1, 1};
11526 vector unsigned int __carry = __c & __mask;
11527 return vec_adde(__a, ~__b, __carry);
11531 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11533 return __builtin_altivec_vsum4sbs(__a, __b);
11536 static __inline__ vector unsigned int __ATTRS_o_ai
11537 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11538 return __builtin_altivec_vsum4ubs(__a, __b);
11541 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11543 return __builtin_altivec_vsum4shs(__a, __b);
11548 static __inline__ vector int __attribute__((__always_inline__))
11549 vec_vsum4sbs(vector signed char __a, vector int __b) {
11550 return __builtin_altivec_vsum4sbs(__a, __b);
11555 static __inline__ vector unsigned int __attribute__((__always_inline__))
11556 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11557 return __builtin_altivec_vsum4ubs(__a, __b);
11562 static __inline__ vector int __attribute__((__always_inline__))
11563 vec_vsum4shs(vector signed short __a, vector int __b) {
11564 return __builtin_altivec_vsum4shs(__a, __b);
11569 /* The vsum2sws instruction has a big-endian bias, so that the second
11570 input vector and the result always reference big-endian elements
11571 1 and 3 (little-endian element 0 and 2). For ease of porting the
11572 programmer wants elements 1 and 3 in both cases, so for little
11573 endian we must perform some permutes. */
11575 static __inline__ vector signed int __attribute__((__always_inline__))
11576 vec_sum2s(vector int __a, vector int __b) {
11577 #ifdef __LITTLE_ENDIAN__
11578 vector int __c = (vector signed int)vec_perm(
11579 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11581 __c = __builtin_altivec_vsum2sws(__a, __c);
11582 return (vector signed int)vec_perm(
11583 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11586 return __builtin_altivec_vsum2sws(__a, __b);
11592 static __inline__ vector signed int __attribute__((__always_inline__))
11593 vec_vsum2sws(vector int __a, vector int __b) {
11594 #ifdef __LITTLE_ENDIAN__
11595 vector int __c = (vector signed int)vec_perm(
11596 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11598 __c = __builtin_altivec_vsum2sws(__a, __c);
11599 return (vector signed int)vec_perm(
11600 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11603 return __builtin_altivec_vsum2sws(__a, __b);
11609 /* The vsumsws instruction has a big-endian bias, so that the second
11610 input vector and the result always reference big-endian element 3
11611 (little-endian element 0). For ease of porting the programmer
11612 wants element 3 in both cases, so for little endian we must perform
11615 static __inline__ vector signed int __attribute__((__always_inline__))
11616 vec_sums(vector signed int __a, vector signed int __b) {
11617 #ifdef __LITTLE_ENDIAN__
11618 __b = (vector signed int)vec_splat(__b, 3);
11619 __b = __builtin_altivec_vsumsws(__a, __b);
11620 return (vector signed int)(0, 0, 0, __b[0]);
11622 return __builtin_altivec_vsumsws(__a, __b);
11628 static __inline__ vector signed int __attribute__((__always_inline__))
11629 vec_vsumsws(vector signed int __a, vector signed int __b) {
11630 #ifdef __LITTLE_ENDIAN__
11631 __b = (vector signed int)vec_splat(__b, 3);
11632 __b = __builtin_altivec_vsumsws(__a, __b);
11633 return (vector signed int)(0, 0, 0, __b[0]);
11635 return __builtin_altivec_vsumsws(__a, __b);
11641 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11643 return __builtin_vsx_xvrspiz(__a);
11645 return __builtin_altivec_vrfiz(__a);
11650 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11651 return __builtin_vsx_xvrdpiz(__a);
11657 static __inline__ vector float __attribute__((__always_inline__))
11658 vec_vrfiz(vector float __a) {
11659 return __builtin_altivec_vrfiz(__a);
11664 /* The vector unpack instructions all have a big-endian bias, so for
11665 little endian we must reverse the meanings of "high" and "low." */
11667 static __inline__ vector short __ATTRS_o_ai
11668 vec_unpackh(vector signed char __a) {
11669 #ifdef __LITTLE_ENDIAN__
11670 return __builtin_altivec_vupklsb((vector char)__a);
11672 return __builtin_altivec_vupkhsb((vector char)__a);
11676 static __inline__ vector bool short __ATTRS_o_ai
11677 vec_unpackh(vector bool char __a) {
11678 #ifdef __LITTLE_ENDIAN__
11679 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11681 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11685 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11686 #ifdef __LITTLE_ENDIAN__
11687 return __builtin_altivec_vupklsh(__a);
11689 return __builtin_altivec_vupkhsh(__a);
11693 static __inline__ vector bool int __ATTRS_o_ai
11694 vec_unpackh(vector bool short __a) {
11695 #ifdef __LITTLE_ENDIAN__
11696 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11698 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11702 static __inline__ vector unsigned int __ATTRS_o_ai
11703 vec_unpackh(vector pixel __a) {
11704 #ifdef __LITTLE_ENDIAN__
11705 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11707 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11711 #ifdef __POWER8_VECTOR__
11712 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11713 #ifdef __LITTLE_ENDIAN__
11714 return __builtin_altivec_vupklsw(__a);
11716 return __builtin_altivec_vupkhsw(__a);
11720 static __inline__ vector bool long long __ATTRS_o_ai
11721 vec_unpackh(vector bool int __a) {
11722 #ifdef __LITTLE_ENDIAN__
11723 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11725 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11729 static __inline__ vector double __ATTRS_o_ai
11730 vec_unpackh(vector float __a) {
11731 return (vector double)(__a[0], __a[1]);
11737 static __inline__ vector short __ATTRS_o_ai
11738 vec_vupkhsb(vector signed char __a) {
11739 #ifdef __LITTLE_ENDIAN__
11740 return __builtin_altivec_vupklsb((vector char)__a);
11742 return __builtin_altivec_vupkhsb((vector char)__a);
11746 static __inline__ vector bool short __ATTRS_o_ai
11747 vec_vupkhsb(vector bool char __a) {
11748 #ifdef __LITTLE_ENDIAN__
11749 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11751 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11757 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11758 #ifdef __LITTLE_ENDIAN__
11759 return __builtin_altivec_vupklsh(__a);
11761 return __builtin_altivec_vupkhsh(__a);
11765 static __inline__ vector bool int __ATTRS_o_ai
11766 vec_vupkhsh(vector bool short __a) {
11767 #ifdef __LITTLE_ENDIAN__
11768 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11770 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11774 static __inline__ vector unsigned int __ATTRS_o_ai
11775 vec_vupkhsh(vector pixel __a) {
11776 #ifdef __LITTLE_ENDIAN__
11777 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11779 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11785 #ifdef __POWER8_VECTOR__
11786 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11787 #ifdef __LITTLE_ENDIAN__
11788 return __builtin_altivec_vupklsw(__a);
11790 return __builtin_altivec_vupkhsw(__a);
11794 static __inline__ vector bool long long __ATTRS_o_ai
11795 vec_vupkhsw(vector bool int __a) {
11796 #ifdef __LITTLE_ENDIAN__
11797 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11799 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11806 static __inline__ vector short __ATTRS_o_ai
11807 vec_unpackl(vector signed char __a) {
11808 #ifdef __LITTLE_ENDIAN__
11809 return __builtin_altivec_vupkhsb((vector char)__a);
11811 return __builtin_altivec_vupklsb((vector char)__a);
11815 static __inline__ vector bool short __ATTRS_o_ai
11816 vec_unpackl(vector bool char __a) {
11817 #ifdef __LITTLE_ENDIAN__
11818 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11820 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11824 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11825 #ifdef __LITTLE_ENDIAN__
11826 return __builtin_altivec_vupkhsh(__a);
11828 return __builtin_altivec_vupklsh(__a);
11832 static __inline__ vector bool int __ATTRS_o_ai
11833 vec_unpackl(vector bool short __a) {
11834 #ifdef __LITTLE_ENDIAN__
11835 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11837 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11841 static __inline__ vector unsigned int __ATTRS_o_ai
11842 vec_unpackl(vector pixel __a) {
11843 #ifdef __LITTLE_ENDIAN__
11844 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11846 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11850 #ifdef __POWER8_VECTOR__
11851 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11852 #ifdef __LITTLE_ENDIAN__
11853 return __builtin_altivec_vupkhsw(__a);
11855 return __builtin_altivec_vupklsw(__a);
11859 static __inline__ vector bool long long __ATTRS_o_ai
11860 vec_unpackl(vector bool int __a) {
11861 #ifdef __LITTLE_ENDIAN__
11862 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11864 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11868 static __inline__ vector double __ATTRS_o_ai
11869 vec_unpackl(vector float __a) {
11870 return (vector double)(__a[2], __a[3]);
11876 static __inline__ vector short __ATTRS_o_ai
11877 vec_vupklsb(vector signed char __a) {
11878 #ifdef __LITTLE_ENDIAN__
11879 return __builtin_altivec_vupkhsb((vector char)__a);
11881 return __builtin_altivec_vupklsb((vector char)__a);
11885 static __inline__ vector bool short __ATTRS_o_ai
11886 vec_vupklsb(vector bool char __a) {
11887 #ifdef __LITTLE_ENDIAN__
11888 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11890 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11896 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11897 #ifdef __LITTLE_ENDIAN__
11898 return __builtin_altivec_vupkhsh(__a);
11900 return __builtin_altivec_vupklsh(__a);
11904 static __inline__ vector bool int __ATTRS_o_ai
11905 vec_vupklsh(vector bool short __a) {
11906 #ifdef __LITTLE_ENDIAN__
11907 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11909 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11913 static __inline__ vector unsigned int __ATTRS_o_ai
11914 vec_vupklsh(vector pixel __a) {
11915 #ifdef __LITTLE_ENDIAN__
11916 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11918 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11924 #ifdef __POWER8_VECTOR__
11925 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11926 #ifdef __LITTLE_ENDIAN__
11927 return __builtin_altivec_vupkhsw(__a);
11929 return __builtin_altivec_vupklsw(__a);
11933 static __inline__ vector bool long long __ATTRS_o_ai
11934 vec_vupklsw(vector bool int __a) {
11935 #ifdef __LITTLE_ENDIAN__
11936 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11938 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11947 static __inline__ vector bool int __ATTRS_o_ai
11948 vec_vsx_ld(int __a, const vector bool int *__b) {
11949 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11952 static __inline__ vector signed int __ATTRS_o_ai
11953 vec_vsx_ld(int __a, const vector signed int *__b) {
11954 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11957 static __inline__ vector signed int __ATTRS_o_ai
11958 vec_vsx_ld(int __a, const signed int *__b) {
11959 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11962 static __inline__ vector unsigned int __ATTRS_o_ai
11963 vec_vsx_ld(int __a, const vector unsigned int *__b) {
11964 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11967 static __inline__ vector unsigned int __ATTRS_o_ai
11968 vec_vsx_ld(int __a, const unsigned int *__b) {
11969 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11972 static __inline__ vector float __ATTRS_o_ai
11973 vec_vsx_ld(int __a, const vector float *__b) {
11974 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11977 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11978 const float *__b) {
11979 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11982 static __inline__ vector signed long long __ATTRS_o_ai
11983 vec_vsx_ld(int __a, const vector signed long long *__b) {
11984 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11987 static __inline__ vector unsigned long long __ATTRS_o_ai
11988 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11989 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11992 static __inline__ vector double __ATTRS_o_ai
11993 vec_vsx_ld(int __a, const vector double *__b) {
11994 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11997 static __inline__ vector double __ATTRS_o_ai
11998 vec_vsx_ld(int __a, const double *__b) {
11999 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
12002 static __inline__ vector bool short __ATTRS_o_ai
12003 vec_vsx_ld(int __a, const vector bool short *__b) {
12004 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
12007 static __inline__ vector signed short __ATTRS_o_ai
12008 vec_vsx_ld(int __a, const vector signed short *__b) {
12009 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12012 static __inline__ vector signed short __ATTRS_o_ai
12013 vec_vsx_ld(int __a, const signed short *__b) {
12014 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12017 static __inline__ vector unsigned short __ATTRS_o_ai
12018 vec_vsx_ld(int __a, const vector unsigned short *__b) {
12019 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12022 static __inline__ vector unsigned short __ATTRS_o_ai
12023 vec_vsx_ld(int __a, const unsigned short *__b) {
12024 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12027 static __inline__ vector bool char __ATTRS_o_ai
12028 vec_vsx_ld(int __a, const vector bool char *__b) {
12029 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
12032 static __inline__ vector signed char __ATTRS_o_ai
12033 vec_vsx_ld(int __a, const vector signed char *__b) {
12034 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12037 static __inline__ vector signed char __ATTRS_o_ai
12038 vec_vsx_ld(int __a, const signed char *__b) {
12039 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12042 static __inline__ vector unsigned char __ATTRS_o_ai
12043 vec_vsx_ld(int __a, const vector unsigned char *__b) {
12044 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12047 static __inline__ vector unsigned char __ATTRS_o_ai
12048 vec_vsx_ld(int __a, const unsigned char *__b) {
12049 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12058 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12059 vector bool int *__c) {
12060 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12063 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12065 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12068 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12069 unsigned int *__c) {
12070 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12073 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12074 vector signed int *__c) {
12075 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12078 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12080 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12083 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12084 vector unsigned int *__c) {
12085 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12088 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12089 unsigned int *__c) {
12090 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12093 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12094 vector float *__c) {
12095 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12098 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12100 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12103 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12105 vector signed long long *__c) {
12106 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12109 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12111 vector unsigned long long *__c) {
12112 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12115 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12116 vector double *__c) {
12117 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12120 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12122 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12125 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12126 vector bool short *__c) {
12127 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12130 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12131 signed short *__c) {
12132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12135 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12136 unsigned short *__c) {
12137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12139 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12140 vector signed short *__c) {
12141 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12144 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12145 signed short *__c) {
12146 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12149 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12151 vector unsigned short *__c) {
12152 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12155 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12156 int __b, unsigned short *__c) {
12157 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12160 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12161 vector bool char *__c) {
12162 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12165 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12166 signed char *__c) {
12167 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12170 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12171 unsigned char *__c) {
12172 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12175 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12176 vector signed char *__c) {
12177 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12180 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12181 signed char *__c) {
12182 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12185 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12187 vector unsigned char *__c) {
12188 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12191 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12192 int __b, unsigned char *__c) {
12193 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12199 #define vec_xxpermdi __builtin_vsx_xxpermdi
12200 #define vec_xxsldwi __builtin_vsx_xxsldwi
12205 #define __builtin_altivec_vxor vec_xor
12207 static __inline__ vector signed char __ATTRS_o_ai
12208 vec_xor(vector signed char __a, vector signed char __b) {
12212 static __inline__ vector signed char __ATTRS_o_ai
12213 vec_xor(vector bool char __a, vector signed char __b) {
12214 return (vector signed char)__a ^ __b;
12217 static __inline__ vector signed char __ATTRS_o_ai
12218 vec_xor(vector signed char __a, vector bool char __b) {
12219 return __a ^ (vector signed char)__b;
12222 static __inline__ vector unsigned char __ATTRS_o_ai
12223 vec_xor(vector unsigned char __a, vector unsigned char __b) {
12227 static __inline__ vector unsigned char __ATTRS_o_ai
12228 vec_xor(vector bool char __a, vector unsigned char __b) {
12229 return (vector unsigned char)__a ^ __b;
12232 static __inline__ vector unsigned char __ATTRS_o_ai
12233 vec_xor(vector unsigned char __a, vector bool char __b) {
12234 return __a ^ (vector unsigned char)__b;
12237 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12238 vector bool char __b) {
12242 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12243 vector short __b) {
12247 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12248 vector short __b) {
12249 return (vector short)__a ^ __b;
12252 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12253 vector bool short __b) {
12254 return __a ^ (vector short)__b;
12257 static __inline__ vector unsigned short __ATTRS_o_ai
12258 vec_xor(vector unsigned short __a, vector unsigned short __b) {
12262 static __inline__ vector unsigned short __ATTRS_o_ai
12263 vec_xor(vector bool short __a, vector unsigned short __b) {
12264 return (vector unsigned short)__a ^ __b;
12267 static __inline__ vector unsigned short __ATTRS_o_ai
12268 vec_xor(vector unsigned short __a, vector bool short __b) {
12269 return __a ^ (vector unsigned short)__b;
12272 static __inline__ vector bool short __ATTRS_o_ai
12273 vec_xor(vector bool short __a, vector bool short __b) {
12277 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12282 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12284 return (vector int)__a ^ __b;
12287 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12288 vector bool int __b) {
12289 return __a ^ (vector int)__b;
12292 static __inline__ vector unsigned int __ATTRS_o_ai
12293 vec_xor(vector unsigned int __a, vector unsigned int __b) {
12297 static __inline__ vector unsigned int __ATTRS_o_ai
12298 vec_xor(vector bool int __a, vector unsigned int __b) {
12299 return (vector unsigned int)__a ^ __b;
12302 static __inline__ vector unsigned int __ATTRS_o_ai
12303 vec_xor(vector unsigned int __a, vector bool int __b) {
12304 return __a ^ (vector unsigned int)__b;
12307 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12308 vector bool int __b) {
12312 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12313 vector float __b) {
12314 vector unsigned int __res =
12315 (vector unsigned int)__a ^ (vector unsigned int)__b;
12316 return (vector float)__res;
12319 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12320 vector float __b) {
12321 vector unsigned int __res =
12322 (vector unsigned int)__a ^ (vector unsigned int)__b;
12323 return (vector float)__res;
12326 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12327 vector bool int __b) {
12328 vector unsigned int __res =
12329 (vector unsigned int)__a ^ (vector unsigned int)__b;
12330 return (vector float)__res;
12334 static __inline__ vector signed long long __ATTRS_o_ai
12335 vec_xor(vector signed long long __a, vector signed long long __b) {
12339 static __inline__ vector signed long long __ATTRS_o_ai
12340 vec_xor(vector bool long long __a, vector signed long long __b) {
12341 return (vector signed long long)__a ^ __b;
12344 static __inline__ vector signed long long __ATTRS_o_ai
12345 vec_xor(vector signed long long __a, vector bool long long __b) {
12346 return __a ^ (vector signed long long)__b;
12349 static __inline__ vector unsigned long long __ATTRS_o_ai
12350 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12354 static __inline__ vector unsigned long long __ATTRS_o_ai
12355 vec_xor(vector bool long long __a, vector unsigned long long __b) {
12356 return (vector unsigned long long)__a ^ __b;
12359 static __inline__ vector unsigned long long __ATTRS_o_ai
12360 vec_xor(vector unsigned long long __a, vector bool long long __b) {
12361 return __a ^ (vector unsigned long long)__b;
12364 static __inline__ vector bool long long __ATTRS_o_ai
12365 vec_xor(vector bool long long __a, vector bool long long __b) {
12369 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12370 vector double __b) {
12371 return (vector double)((vector unsigned long long)__a ^
12372 (vector unsigned long long)__b);
12375 static __inline__ vector double __ATTRS_o_ai
12376 vec_xor(vector double __a, vector bool long long __b) {
12377 return (vector double)((vector unsigned long long)__a ^
12378 (vector unsigned long long)__b);
12381 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12382 vector double __b) {
12383 return (vector double)((vector unsigned long long)__a ^
12384 (vector unsigned long long)__b);
12390 static __inline__ vector signed char __ATTRS_o_ai
12391 vec_vxor(vector signed char __a, vector signed char __b) {
12395 static __inline__ vector signed char __ATTRS_o_ai
12396 vec_vxor(vector bool char __a, vector signed char __b) {
12397 return (vector signed char)__a ^ __b;
12400 static __inline__ vector signed char __ATTRS_o_ai
12401 vec_vxor(vector signed char __a, vector bool char __b) {
12402 return __a ^ (vector signed char)__b;
12405 static __inline__ vector unsigned char __ATTRS_o_ai
12406 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12410 static __inline__ vector unsigned char __ATTRS_o_ai
12411 vec_vxor(vector bool char __a, vector unsigned char __b) {
12412 return (vector unsigned char)__a ^ __b;
12415 static __inline__ vector unsigned char __ATTRS_o_ai
12416 vec_vxor(vector unsigned char __a, vector bool char __b) {
12417 return __a ^ (vector unsigned char)__b;
12420 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12421 vector bool char __b) {
12425 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12426 vector short __b) {
12430 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12431 vector short __b) {
12432 return (vector short)__a ^ __b;
12435 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12436 vector bool short __b) {
12437 return __a ^ (vector short)__b;
12440 static __inline__ vector unsigned short __ATTRS_o_ai
12441 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12445 static __inline__ vector unsigned short __ATTRS_o_ai
12446 vec_vxor(vector bool short __a, vector unsigned short __b) {
12447 return (vector unsigned short)__a ^ __b;
12450 static __inline__ vector unsigned short __ATTRS_o_ai
12451 vec_vxor(vector unsigned short __a, vector bool short __b) {
12452 return __a ^ (vector unsigned short)__b;
12455 static __inline__ vector bool short __ATTRS_o_ai
12456 vec_vxor(vector bool short __a, vector bool short __b) {
12460 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12465 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12467 return (vector int)__a ^ __b;
12470 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12471 vector bool int __b) {
12472 return __a ^ (vector int)__b;
12475 static __inline__ vector unsigned int __ATTRS_o_ai
12476 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12480 static __inline__ vector unsigned int __ATTRS_o_ai
12481 vec_vxor(vector bool int __a, vector unsigned int __b) {
12482 return (vector unsigned int)__a ^ __b;
12485 static __inline__ vector unsigned int __ATTRS_o_ai
12486 vec_vxor(vector unsigned int __a, vector bool int __b) {
12487 return __a ^ (vector unsigned int)__b;
12490 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12491 vector bool int __b) {
12495 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12496 vector float __b) {
12497 vector unsigned int __res =
12498 (vector unsigned int)__a ^ (vector unsigned int)__b;
12499 return (vector float)__res;
12502 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12503 vector float __b) {
12504 vector unsigned int __res =
12505 (vector unsigned int)__a ^ (vector unsigned int)__b;
12506 return (vector float)__res;
12509 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12510 vector bool int __b) {
12511 vector unsigned int __res =
12512 (vector unsigned int)__a ^ (vector unsigned int)__b;
12513 return (vector float)__res;
12517 static __inline__ vector signed long long __ATTRS_o_ai
12518 vec_vxor(vector signed long long __a, vector signed long long __b) {
12522 static __inline__ vector signed long long __ATTRS_o_ai
12523 vec_vxor(vector bool long long __a, vector signed long long __b) {
12524 return (vector signed long long)__a ^ __b;
12527 static __inline__ vector signed long long __ATTRS_o_ai
12528 vec_vxor(vector signed long long __a, vector bool long long __b) {
12529 return __a ^ (vector signed long long)__b;
12532 static __inline__ vector unsigned long long __ATTRS_o_ai
12533 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12537 static __inline__ vector unsigned long long __ATTRS_o_ai
12538 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12539 return (vector unsigned long long)__a ^ __b;
12542 static __inline__ vector unsigned long long __ATTRS_o_ai
12543 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12544 return __a ^ (vector unsigned long long)__b;
12547 static __inline__ vector bool long long __ATTRS_o_ai
12548 vec_vxor(vector bool long long __a, vector bool long long __b) {
12553 /* ------------------------ extensions for CBEA ----------------------------- */
12557 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12562 static __inline__ unsigned char __ATTRS_o_ai
12563 vec_extract(vector unsigned char __a, int __b) {
12567 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12572 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12577 static __inline__ unsigned short __ATTRS_o_ai
12578 vec_extract(vector unsigned short __a, int __b) {
12582 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12587 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12592 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12597 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12603 static __inline__ signed long long __ATTRS_o_ai
12604 vec_extract(vector signed long long __a, int __b) {
12608 static __inline__ unsigned long long __ATTRS_o_ai
12609 vec_extract(vector unsigned long long __a, int __b) {
12613 static __inline__ unsigned long long __ATTRS_o_ai
12614 vec_extract(vector bool long long __a, int __b) {
12618 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12623 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12627 #ifdef __POWER9_VECTOR__
12629 #define vec_insert4b __builtin_vsx_insertword
12630 #define vec_extract4b __builtin_vsx_extractuword
12632 /* vec_extract_exp */
12634 static __inline__ vector unsigned int __ATTRS_o_ai
12635 vec_extract_exp(vector float __a) {
12636 return __builtin_vsx_xvxexpsp(__a);
12639 static __inline__ vector unsigned long long __ATTRS_o_ai
12640 vec_extract_exp(vector double __a) {
12641 return __builtin_vsx_xvxexpdp(__a);
12644 /* vec_extract_sig */
12646 static __inline__ vector unsigned int __ATTRS_o_ai
12647 vec_extract_sig(vector float __a) {
12648 return __builtin_vsx_xvxsigsp(__a);
12651 static __inline__ vector unsigned long long __ATTRS_o_ai
12652 vec_extract_sig (vector double __a) {
12653 return __builtin_vsx_xvxsigdp(__a);
12656 static __inline__ vector float __ATTRS_o_ai
12657 vec_extract_fp32_from_shorth(vector unsigned short __a) {
12658 vector unsigned short __b =
12659 #ifdef __LITTLE_ENDIAN__
12660 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12662 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12664 return __builtin_vsx_xvcvhpsp(__b);
12667 static __inline__ vector float __ATTRS_o_ai
12668 vec_extract_fp32_from_shortl(vector unsigned short __a) {
12669 vector unsigned short __b =
12670 #ifdef __LITTLE_ENDIAN__
12671 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12673 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12675 return __builtin_vsx_xvcvhpsp(__b);
12677 #endif /* __POWER9_VECTOR__ */
12681 static __inline__ vector signed char __ATTRS_o_ai
12682 vec_insert(signed char __a, vector signed char __b, int __c) {
12687 static __inline__ vector unsigned char __ATTRS_o_ai
12688 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12693 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12694 vector bool char __b,
12700 static __inline__ vector signed short __ATTRS_o_ai
12701 vec_insert(signed short __a, vector signed short __b, int __c) {
12706 static __inline__ vector unsigned short __ATTRS_o_ai
12707 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12712 static __inline__ vector bool short __ATTRS_o_ai
12713 vec_insert(unsigned short __a, vector bool short __b, int __c) {
12718 static __inline__ vector signed int __ATTRS_o_ai
12719 vec_insert(signed int __a, vector signed int __b, int __c) {
12724 static __inline__ vector unsigned int __ATTRS_o_ai
12725 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12730 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12731 vector bool int __b,
12738 static __inline__ vector signed long long __ATTRS_o_ai
12739 vec_insert(signed long long __a, vector signed long long __b, int __c) {
12744 static __inline__ vector unsigned long long __ATTRS_o_ai
12745 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12750 static __inline__ vector bool long long __ATTRS_o_ai
12751 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12755 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12763 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12772 static __inline__ vector signed char __ATTRS_o_ai
12773 vec_lvlx(int __a, const signed char *__b) {
12774 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12775 vec_lvsl(__a, __b));
12778 static __inline__ vector signed char __ATTRS_o_ai
12779 vec_lvlx(int __a, const vector signed char *__b) {
12780 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12781 vec_lvsl(__a, (unsigned char *)__b));
12784 static __inline__ vector unsigned char __ATTRS_o_ai
12785 vec_lvlx(int __a, const unsigned char *__b) {
12786 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12787 vec_lvsl(__a, __b));
12790 static __inline__ vector unsigned char __ATTRS_o_ai
12791 vec_lvlx(int __a, const vector unsigned char *__b) {
12792 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12793 vec_lvsl(__a, (unsigned char *)__b));
12796 static __inline__ vector bool char __ATTRS_o_ai
12797 vec_lvlx(int __a, const vector bool char *__b) {
12798 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12799 vec_lvsl(__a, (unsigned char *)__b));
12802 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12803 const short *__b) {
12804 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12807 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12808 const vector short *__b) {
12809 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12810 vec_lvsl(__a, (unsigned char *)__b));
12813 static __inline__ vector unsigned short __ATTRS_o_ai
12814 vec_lvlx(int __a, const unsigned short *__b) {
12815 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12816 vec_lvsl(__a, __b));
12819 static __inline__ vector unsigned short __ATTRS_o_ai
12820 vec_lvlx(int __a, const vector unsigned short *__b) {
12821 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12822 vec_lvsl(__a, (unsigned char *)__b));
12825 static __inline__ vector bool short __ATTRS_o_ai
12826 vec_lvlx(int __a, const vector bool short *__b) {
12827 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12828 vec_lvsl(__a, (unsigned char *)__b));
12831 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12832 const vector pixel *__b) {
12833 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12834 vec_lvsl(__a, (unsigned char *)__b));
12837 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12838 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12841 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12842 const vector int *__b) {
12843 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12844 vec_lvsl(__a, (unsigned char *)__b));
12847 static __inline__ vector unsigned int __ATTRS_o_ai
12848 vec_lvlx(int __a, const unsigned int *__b) {
12849 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12850 vec_lvsl(__a, __b));
12853 static __inline__ vector unsigned int __ATTRS_o_ai
12854 vec_lvlx(int __a, const vector unsigned int *__b) {
12855 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12856 vec_lvsl(__a, (unsigned char *)__b));
12859 static __inline__ vector bool int __ATTRS_o_ai
12860 vec_lvlx(int __a, const vector bool int *__b) {
12861 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12862 vec_lvsl(__a, (unsigned char *)__b));
12865 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12866 const float *__b) {
12867 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12870 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12871 const vector float *__b) {
12872 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12873 vec_lvsl(__a, (unsigned char *)__b));
12878 static __inline__ vector signed char __ATTRS_o_ai
12879 vec_lvlxl(int __a, const signed char *__b) {
12880 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12881 vec_lvsl(__a, __b));
12884 static __inline__ vector signed char __ATTRS_o_ai
12885 vec_lvlxl(int __a, const vector signed char *__b) {
12886 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12887 vec_lvsl(__a, (unsigned char *)__b));
12890 static __inline__ vector unsigned char __ATTRS_o_ai
12891 vec_lvlxl(int __a, const unsigned char *__b) {
12892 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12893 vec_lvsl(__a, __b));
12896 static __inline__ vector unsigned char __ATTRS_o_ai
12897 vec_lvlxl(int __a, const vector unsigned char *__b) {
12898 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12899 vec_lvsl(__a, (unsigned char *)__b));
12902 static __inline__ vector bool char __ATTRS_o_ai
12903 vec_lvlxl(int __a, const vector bool char *__b) {
12904 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12905 vec_lvsl(__a, (unsigned char *)__b));
12908 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12909 const short *__b) {
12910 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12913 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12914 const vector short *__b) {
12915 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12916 vec_lvsl(__a, (unsigned char *)__b));
12919 static __inline__ vector unsigned short __ATTRS_o_ai
12920 vec_lvlxl(int __a, const unsigned short *__b) {
12921 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12922 vec_lvsl(__a, __b));
12925 static __inline__ vector unsigned short __ATTRS_o_ai
12926 vec_lvlxl(int __a, const vector unsigned short *__b) {
12927 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12928 vec_lvsl(__a, (unsigned char *)__b));
12931 static __inline__ vector bool short __ATTRS_o_ai
12932 vec_lvlxl(int __a, const vector bool short *__b) {
12933 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12934 vec_lvsl(__a, (unsigned char *)__b));
12937 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12938 const vector pixel *__b) {
12939 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12940 vec_lvsl(__a, (unsigned char *)__b));
12943 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12944 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12947 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12948 const vector int *__b) {
12949 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12950 vec_lvsl(__a, (unsigned char *)__b));
12953 static __inline__ vector unsigned int __ATTRS_o_ai
12954 vec_lvlxl(int __a, const unsigned int *__b) {
12955 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12956 vec_lvsl(__a, __b));
12959 static __inline__ vector unsigned int __ATTRS_o_ai
12960 vec_lvlxl(int __a, const vector unsigned int *__b) {
12961 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12962 vec_lvsl(__a, (unsigned char *)__b));
12965 static __inline__ vector bool int __ATTRS_o_ai
12966 vec_lvlxl(int __a, const vector bool int *__b) {
12967 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12968 vec_lvsl(__a, (unsigned char *)__b));
12971 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12972 const float *__b) {
12973 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12976 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12977 vector float *__b) {
12978 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12979 vec_lvsl(__a, (unsigned char *)__b));
12984 static __inline__ vector signed char __ATTRS_o_ai
12985 vec_lvrx(int __a, const signed char *__b) {
12986 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12987 vec_lvsl(__a, __b));
12990 static __inline__ vector signed char __ATTRS_o_ai
12991 vec_lvrx(int __a, const vector signed char *__b) {
12992 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12993 vec_lvsl(__a, (unsigned char *)__b));
12996 static __inline__ vector unsigned char __ATTRS_o_ai
12997 vec_lvrx(int __a, const unsigned char *__b) {
12998 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12999 vec_lvsl(__a, __b));
13002 static __inline__ vector unsigned char __ATTRS_o_ai
13003 vec_lvrx(int __a, const vector unsigned char *__b) {
13004 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
13005 vec_lvsl(__a, (unsigned char *)__b));
13008 static __inline__ vector bool char __ATTRS_o_ai
13009 vec_lvrx(int __a, const vector bool char *__b) {
13010 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
13011 vec_lvsl(__a, (unsigned char *)__b));
13014 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13015 const short *__b) {
13016 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13019 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13020 const vector short *__b) {
13021 return vec_perm((vector short)(0), vec_ld(__a, __b),
13022 vec_lvsl(__a, (unsigned char *)__b));
13025 static __inline__ vector unsigned short __ATTRS_o_ai
13026 vec_lvrx(int __a, const unsigned short *__b) {
13027 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13028 vec_lvsl(__a, __b));
13031 static __inline__ vector unsigned short __ATTRS_o_ai
13032 vec_lvrx(int __a, const vector unsigned short *__b) {
13033 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13034 vec_lvsl(__a, (unsigned char *)__b));
13037 static __inline__ vector bool short __ATTRS_o_ai
13038 vec_lvrx(int __a, const vector bool short *__b) {
13039 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
13040 vec_lvsl(__a, (unsigned char *)__b));
13043 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
13044 const vector pixel *__b) {
13045 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
13046 vec_lvsl(__a, (unsigned char *)__b));
13049 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
13050 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13053 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
13054 const vector int *__b) {
13055 return vec_perm((vector int)(0), vec_ld(__a, __b),
13056 vec_lvsl(__a, (unsigned char *)__b));
13059 static __inline__ vector unsigned int __ATTRS_o_ai
13060 vec_lvrx(int __a, const unsigned int *__b) {
13061 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13062 vec_lvsl(__a, __b));
13065 static __inline__ vector unsigned int __ATTRS_o_ai
13066 vec_lvrx(int __a, const vector unsigned int *__b) {
13067 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13068 vec_lvsl(__a, (unsigned char *)__b));
13071 static __inline__ vector bool int __ATTRS_o_ai
13072 vec_lvrx(int __a, const vector bool int *__b) {
13073 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13074 vec_lvsl(__a, (unsigned char *)__b));
13077 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13078 const float *__b) {
13079 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13082 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13083 const vector float *__b) {
13084 return vec_perm((vector float)(0), vec_ld(__a, __b),
13085 vec_lvsl(__a, (unsigned char *)__b));
13090 static __inline__ vector signed char __ATTRS_o_ai
13091 vec_lvrxl(int __a, const signed char *__b) {
13092 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13093 vec_lvsl(__a, __b));
13096 static __inline__ vector signed char __ATTRS_o_ai
13097 vec_lvrxl(int __a, const vector signed char *__b) {
13098 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13099 vec_lvsl(__a, (unsigned char *)__b));
13102 static __inline__ vector unsigned char __ATTRS_o_ai
13103 vec_lvrxl(int __a, const unsigned char *__b) {
13104 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13105 vec_lvsl(__a, __b));
13108 static __inline__ vector unsigned char __ATTRS_o_ai
13109 vec_lvrxl(int __a, const vector unsigned char *__b) {
13110 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13111 vec_lvsl(__a, (unsigned char *)__b));
13114 static __inline__ vector bool char __ATTRS_o_ai
13115 vec_lvrxl(int __a, const vector bool char *__b) {
13116 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13117 vec_lvsl(__a, (unsigned char *)__b));
13120 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13121 const short *__b) {
13122 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13125 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13126 const vector short *__b) {
13127 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13128 vec_lvsl(__a, (unsigned char *)__b));
13131 static __inline__ vector unsigned short __ATTRS_o_ai
13132 vec_lvrxl(int __a, const unsigned short *__b) {
13133 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13134 vec_lvsl(__a, __b));
13137 static __inline__ vector unsigned short __ATTRS_o_ai
13138 vec_lvrxl(int __a, const vector unsigned short *__b) {
13139 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13140 vec_lvsl(__a, (unsigned char *)__b));
13143 static __inline__ vector bool short __ATTRS_o_ai
13144 vec_lvrxl(int __a, const vector bool short *__b) {
13145 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13146 vec_lvsl(__a, (unsigned char *)__b));
13149 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13150 const vector pixel *__b) {
13151 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13152 vec_lvsl(__a, (unsigned char *)__b));
13155 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13156 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13159 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13160 const vector int *__b) {
13161 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13162 vec_lvsl(__a, (unsigned char *)__b));
13165 static __inline__ vector unsigned int __ATTRS_o_ai
13166 vec_lvrxl(int __a, const unsigned int *__b) {
13167 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13168 vec_lvsl(__a, __b));
13171 static __inline__ vector unsigned int __ATTRS_o_ai
13172 vec_lvrxl(int __a, const vector unsigned int *__b) {
13173 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13174 vec_lvsl(__a, (unsigned char *)__b));
13177 static __inline__ vector bool int __ATTRS_o_ai
13178 vec_lvrxl(int __a, const vector bool int *__b) {
13179 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13180 vec_lvsl(__a, (unsigned char *)__b));
13183 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13184 const float *__b) {
13185 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13188 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13189 const vector float *__b) {
13190 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13191 vec_lvsl(__a, (unsigned char *)__b));
13196 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13197 signed char *__c) {
13198 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13202 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13203 vector signed char *__c) {
13205 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13209 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13210 unsigned char *__c) {
13211 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13215 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13216 vector unsigned char *__c) {
13218 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13222 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13223 vector bool char *__c) {
13225 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13229 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13231 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13235 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13236 vector short *__c) {
13238 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13242 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13243 int __b, unsigned short *__c) {
13244 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13248 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13250 vector unsigned short *__c) {
13252 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13256 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
13257 vector bool short *__c) {
13259 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13263 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13264 vector pixel *__c) {
13266 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13270 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13272 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13276 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13279 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13283 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13284 unsigned int *__c) {
13285 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13289 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13290 vector unsigned int *__c) {
13292 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13296 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13297 vector bool int *__c) {
13299 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13303 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13304 vector float *__c) {
13306 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13312 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13313 signed char *__c) {
13314 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13318 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13319 vector signed char *__c) {
13321 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13325 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13326 int __b, unsigned char *__c) {
13327 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13331 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13333 vector unsigned char *__c) {
13335 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13339 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
13340 vector bool char *__c) {
13342 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13346 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13348 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13352 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13353 vector short *__c) {
13355 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13359 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13360 int __b, unsigned short *__c) {
13361 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13365 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13367 vector unsigned short *__c) {
13369 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13373 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
13374 vector bool short *__c) {
13376 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13380 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13381 vector pixel *__c) {
13383 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13387 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13389 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13393 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13396 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13400 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13401 unsigned int *__c) {
13402 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13406 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13407 vector unsigned int *__c) {
13409 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13413 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13414 vector bool int *__c) {
13416 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13420 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13421 vector float *__c) {
13423 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13429 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13430 signed char *__c) {
13431 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13435 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13436 vector signed char *__c) {
13438 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13442 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13443 unsigned char *__c) {
13444 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13448 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13449 vector unsigned char *__c) {
13451 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13455 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13456 vector bool char *__c) {
13458 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13462 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13464 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13468 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13469 vector short *__c) {
13471 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13475 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13476 int __b, unsigned short *__c) {
13477 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13481 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13483 vector unsigned short *__c) {
13485 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13489 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
13490 vector bool short *__c) {
13492 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13496 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13497 vector pixel *__c) {
13499 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13503 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13505 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13509 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13512 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13516 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13517 unsigned int *__c) {
13518 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13522 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13523 vector unsigned int *__c) {
13525 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13529 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13530 vector bool int *__c) {
13532 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13536 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13537 vector float *__c) {
13539 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13545 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13546 signed char *__c) {
13547 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13551 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13552 vector signed char *__c) {
13554 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13558 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13559 int __b, unsigned char *__c) {
13560 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13564 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13566 vector unsigned char *__c) {
13568 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13572 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
13573 vector bool char *__c) {
13575 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13579 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13581 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13585 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13586 vector short *__c) {
13588 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13592 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13593 int __b, unsigned short *__c) {
13594 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13598 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13600 vector unsigned short *__c) {
13602 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13606 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
13607 vector bool short *__c) {
13609 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13613 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13614 vector pixel *__c) {
13616 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13620 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13622 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13626 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13629 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13633 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13634 unsigned int *__c) {
13635 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13639 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13640 vector unsigned int *__c) {
13642 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13646 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13647 vector bool int *__c) {
13649 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13653 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13654 vector float *__c) {
13656 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13662 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13664 vector signed char __res = (vector signed char)(0);
13669 static __inline__ vector unsigned char __ATTRS_o_ai
13670 vec_promote(unsigned char __a, int __b) {
13671 vector unsigned char __res = (vector unsigned char)(0);
13676 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13677 vector short __res = (vector short)(0);
13682 static __inline__ vector unsigned short __ATTRS_o_ai
13683 vec_promote(unsigned short __a, int __b) {
13684 vector unsigned short __res = (vector unsigned short)(0);
13689 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13690 vector int __res = (vector int)(0);
13695 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13697 vector unsigned int __res = (vector unsigned int)(0);
13702 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13703 vector float __res = (vector float)(0);
13710 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13711 return (vector signed char)(__a);
13714 static __inline__ vector unsigned char __ATTRS_o_ai
13715 vec_splats(unsigned char __a) {
13716 return (vector unsigned char)(__a);
13719 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13720 return (vector short)(__a);
13723 static __inline__ vector unsigned short __ATTRS_o_ai
13724 vec_splats(unsigned short __a) {
13725 return (vector unsigned short)(__a);
13728 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13729 return (vector int)(__a);
13732 static __inline__ vector unsigned int __ATTRS_o_ai
13733 vec_splats(unsigned int __a) {
13734 return (vector unsigned int)(__a);
13738 static __inline__ vector signed long long __ATTRS_o_ai
13739 vec_splats(signed long long __a) {
13740 return (vector signed long long)(__a);
13743 static __inline__ vector unsigned long long __ATTRS_o_ai
13744 vec_splats(unsigned long long __a) {
13745 return (vector unsigned long long)(__a);
13748 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13749 static __inline__ vector signed __int128 __ATTRS_o_ai
13750 vec_splats(signed __int128 __a) {
13751 return (vector signed __int128)(__a);
13754 static __inline__ vector unsigned __int128 __ATTRS_o_ai
13755 vec_splats(unsigned __int128 __a) {
13756 return (vector unsigned __int128)(__a);
13761 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13762 return (vector double)(__a);
13766 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13767 return (vector float)(__a);
13770 /* ----------------------------- predicates --------------------------------- */
13774 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13775 vector signed char __b) {
13776 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13780 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13781 vector bool char __b) {
13782 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13786 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13787 vector unsigned char __b) {
13788 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13792 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13793 vector bool char __b) {
13794 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13798 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13799 vector signed char __b) {
13800 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13804 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13805 vector unsigned char __b) {
13806 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13810 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13811 vector bool char __b) {
13812 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13816 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13817 vector short __b) {
13818 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13821 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13822 vector bool short __b) {
13823 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13826 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13827 vector unsigned short __b) {
13828 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13829 (vector short)__b);
13832 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13833 vector bool short __b) {
13834 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13835 (vector short)__b);
13838 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13839 vector short __b) {
13840 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13841 (vector short)__b);
13844 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13845 vector unsigned short __b) {
13846 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13847 (vector short)__b);
13850 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13851 vector bool short __b) {
13852 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13853 (vector short)__b);
13856 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13857 vector pixel __b) {
13858 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13859 (vector short)__b);
13862 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13863 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13866 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13867 vector bool int __b) {
13868 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13871 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13872 vector unsigned int __b) {
13873 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13877 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13878 vector bool int __b) {
13879 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13883 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13885 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13889 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13890 vector unsigned int __b) {
13891 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13895 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13896 vector bool int __b) {
13897 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13901 #ifdef __POWER8_VECTOR__
13902 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13903 vector signed long long __b) {
13904 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13907 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13908 vector bool long long __b) {
13909 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13912 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13913 vector unsigned long long __b) {
13914 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13915 (vector long long)__b);
13918 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13919 vector bool long long __b) {
13920 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13921 (vector long long)__b);
13924 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13925 vector long long __b) {
13926 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13927 (vector long long)__b);
13930 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13931 vector unsigned long long __b) {
13932 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13933 (vector long long)__b);
13936 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13937 vector bool long long __b) {
13938 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13939 (vector long long)__b);
13943 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13944 vector float __b) {
13946 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13948 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13953 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13954 vector double __b) {
13955 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13961 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13962 vector signed char __b) {
13963 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13966 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13967 vector bool char __b) {
13968 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13971 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13972 vector unsigned char __b) {
13973 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13976 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13977 vector bool char __b) {
13978 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13981 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13982 vector signed char __b) {
13983 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13984 (vector unsigned char)__a);
13987 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13988 vector unsigned char __b) {
13989 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13992 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13993 vector bool char __b) {
13994 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13995 (vector unsigned char)__a);
13998 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13999 vector short __b) {
14000 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
14003 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
14004 vector bool short __b) {
14005 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
14008 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14009 vector unsigned short __b) {
14010 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
14013 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14014 vector bool short __b) {
14015 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14019 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14020 vector short __b) {
14021 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14022 (vector unsigned short)__a);
14025 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14026 vector unsigned short __b) {
14027 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
14028 (vector unsigned short)__a);
14031 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14032 vector bool short __b) {
14033 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14034 (vector unsigned short)__a);
14037 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
14038 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
14041 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
14042 vector bool int __b) {
14043 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
14046 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14047 vector unsigned int __b) {
14048 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
14051 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14052 vector bool int __b) {
14053 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14056 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14058 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14059 (vector unsigned int)__a);
14062 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14063 vector unsigned int __b) {
14064 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14067 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14068 vector bool int __b) {
14069 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14070 (vector unsigned int)__a);
14073 #ifdef __POWER8_VECTOR__
14074 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14075 vector signed long long __b) {
14076 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14078 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14079 vector bool long long __b) {
14080 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14084 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14085 vector unsigned long long __b) {
14086 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14089 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14090 vector bool long long __b) {
14091 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14095 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14096 vector signed long long __b) {
14097 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14098 (vector unsigned long long)__a);
14101 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14102 vector unsigned long long __b) {
14103 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14104 (vector unsigned long long)__a);
14107 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14108 vector bool long long __b) {
14109 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14110 (vector unsigned long long)__a);
14114 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14115 vector float __b) {
14117 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14119 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14124 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14125 vector double __b) {
14126 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14132 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14133 vector signed char __b) {
14134 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14137 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14138 vector bool char __b) {
14139 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14142 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14143 vector unsigned char __b) {
14144 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14147 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14148 vector bool char __b) {
14149 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14152 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14153 vector signed char __b) {
14154 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14155 (vector unsigned char)__b);
14158 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14159 vector unsigned char __b) {
14160 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14163 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14164 vector bool char __b) {
14165 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14166 (vector unsigned char)__b);
14169 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14170 vector short __b) {
14171 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14174 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14175 vector bool short __b) {
14176 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14179 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14180 vector unsigned short __b) {
14181 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14184 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14185 vector bool short __b) {
14186 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14187 (vector unsigned short)__b);
14190 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14191 vector short __b) {
14192 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14193 (vector unsigned short)__b);
14196 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14197 vector unsigned short __b) {
14198 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14202 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14203 vector bool short __b) {
14204 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14205 (vector unsigned short)__b);
14208 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14209 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14212 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14213 vector bool int __b) {
14214 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14217 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14218 vector unsigned int __b) {
14219 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14222 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14223 vector bool int __b) {
14224 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14227 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14229 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14230 (vector unsigned int)__b);
14233 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14234 vector unsigned int __b) {
14235 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14238 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14239 vector bool int __b) {
14240 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14241 (vector unsigned int)__b);
14244 #ifdef __POWER8_VECTOR__
14245 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14246 vector signed long long __b) {
14247 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14249 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14250 vector bool long long __b) {
14251 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14252 (vector signed long long)__b);
14255 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14256 vector unsigned long long __b) {
14257 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14260 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14261 vector bool long long __b) {
14262 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14263 (vector unsigned long long)__b);
14266 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14267 vector signed long long __b) {
14268 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14269 (vector unsigned long long)__b);
14272 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14273 vector unsigned long long __b) {
14274 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14278 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14279 vector bool long long __b) {
14280 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14281 (vector unsigned long long)__b);
14285 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14286 vector float __b) {
14288 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14290 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14295 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14296 vector double __b) {
14297 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14303 static __inline__ int __attribute__((__always_inline__))
14304 vec_all_in(vector float __a, vector float __b) {
14305 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14310 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14311 vector signed char __b) {
14312 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14315 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14316 vector bool char __b) {
14317 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14320 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14321 vector unsigned char __b) {
14322 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14325 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14326 vector bool char __b) {
14327 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14330 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14331 vector signed char __b) {
14332 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14333 (vector unsigned char)__b);
14336 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14337 vector unsigned char __b) {
14338 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14341 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14342 vector bool char __b) {
14343 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14344 (vector unsigned char)__b);
14347 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14348 vector short __b) {
14349 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14352 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14353 vector bool short __b) {
14354 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14357 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14358 vector unsigned short __b) {
14359 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14362 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14363 vector bool short __b) {
14364 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14365 (vector unsigned short)__b);
14368 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14369 vector short __b) {
14370 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14371 (vector unsigned short)__b);
14374 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14375 vector unsigned short __b) {
14376 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14380 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14381 vector bool short __b) {
14382 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14383 (vector unsigned short)__b);
14386 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14387 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14390 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14391 vector bool int __b) {
14392 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14395 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14396 vector unsigned int __b) {
14397 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14400 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14401 vector bool int __b) {
14402 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14405 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14407 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14408 (vector unsigned int)__b);
14411 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14412 vector unsigned int __b) {
14413 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14416 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14417 vector bool int __b) {
14418 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14419 (vector unsigned int)__b);
14422 #ifdef __POWER8_VECTOR__
14423 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14424 vector signed long long __b) {
14425 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14428 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14429 vector unsigned long long __b) {
14430 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14433 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14434 vector bool long long __b) {
14435 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14436 (vector signed long long)__b);
14439 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14440 vector bool long long __b) {
14441 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14442 (vector unsigned long long)__b);
14445 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14446 vector signed long long __b) {
14447 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14448 (vector unsigned long long)__b);
14451 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14452 vector unsigned long long __b) {
14453 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14457 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14458 vector bool long long __b) {
14459 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14460 (vector unsigned long long)__b);
14464 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14465 vector float __b) {
14467 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14469 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14474 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14475 vector double __b) {
14476 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14482 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14483 vector signed char __b) {
14484 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14487 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14488 vector bool char __b) {
14489 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14492 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14493 vector unsigned char __b) {
14494 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14497 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14498 vector bool char __b) {
14499 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14502 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14503 vector signed char __b) {
14504 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14505 (vector unsigned char)__a);
14508 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14509 vector unsigned char __b) {
14510 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14513 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14514 vector bool char __b) {
14515 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14516 (vector unsigned char)__a);
14519 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14520 vector short __b) {
14521 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14524 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14525 vector bool short __b) {
14526 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14529 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14530 vector unsigned short __b) {
14531 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14534 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14535 vector bool short __b) {
14536 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14540 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14541 vector short __b) {
14542 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14543 (vector unsigned short)__a);
14546 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14547 vector unsigned short __b) {
14548 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14549 (vector unsigned short)__a);
14552 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14553 vector bool short __b) {
14554 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14555 (vector unsigned short)__a);
14558 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14559 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14562 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14563 vector bool int __b) {
14564 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14567 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14568 vector unsigned int __b) {
14569 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14572 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14573 vector bool int __b) {
14574 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14577 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14579 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14580 (vector unsigned int)__a);
14583 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14584 vector unsigned int __b) {
14585 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14588 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14589 vector bool int __b) {
14590 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14591 (vector unsigned int)__a);
14594 #ifdef __POWER8_VECTOR__
14595 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14596 vector signed long long __b) {
14597 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14600 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14601 vector unsigned long long __b) {
14602 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14605 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14606 vector bool long long __b) {
14607 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14611 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14612 vector bool long long __b) {
14613 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14617 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14618 vector signed long long __b) {
14619 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14620 (vector unsigned long long)__a);
14623 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14624 vector unsigned long long __b) {
14625 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14626 (vector unsigned long long)__a);
14629 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14630 vector bool long long __b) {
14631 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14632 (vector unsigned long long)__a);
14636 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14637 vector float __b) {
14639 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14641 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14646 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14647 vector double __b) {
14648 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14654 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14656 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14658 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14663 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14664 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14670 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14671 vector signed char __b) {
14672 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14676 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14677 vector bool char __b) {
14678 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14682 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14683 vector unsigned char __b) {
14684 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14688 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14689 vector bool char __b) {
14690 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14694 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14695 vector signed char __b) {
14696 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14700 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14701 vector unsigned char __b) {
14702 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14706 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14707 vector bool char __b) {
14708 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14712 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14713 vector short __b) {
14714 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14717 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14718 vector bool short __b) {
14719 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14722 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14723 vector unsigned short __b) {
14724 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14725 (vector short)__b);
14728 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14729 vector bool short __b) {
14730 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14731 (vector short)__b);
14734 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14735 vector short __b) {
14736 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14737 (vector short)__b);
14740 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14741 vector unsigned short __b) {
14742 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14743 (vector short)__b);
14746 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14747 vector bool short __b) {
14748 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14749 (vector short)__b);
14752 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14753 vector pixel __b) {
14754 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14755 (vector short)__b);
14758 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14759 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14762 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14763 vector bool int __b) {
14764 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14767 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14768 vector unsigned int __b) {
14769 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14773 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14774 vector bool int __b) {
14775 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14779 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14781 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14785 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14786 vector unsigned int __b) {
14787 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14791 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14792 vector bool int __b) {
14793 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14797 #ifdef __POWER8_VECTOR__
14798 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14799 vector signed long long __b) {
14800 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14803 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14804 vector unsigned long long __b) {
14805 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14806 (vector long long)__b);
14809 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14810 vector bool long long __b) {
14811 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14812 (vector signed long long)__b);
14815 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14816 vector bool long long __b) {
14817 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14818 (vector signed long long)__b);
14821 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14822 vector signed long long __b) {
14823 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14824 (vector signed long long)__b);
14827 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14828 vector unsigned long long __b) {
14829 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14830 (vector signed long long)__b);
14833 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14834 vector bool long long __b) {
14835 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14836 (vector signed long long)__b);
14840 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14841 vector float __b) {
14843 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);
14845 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14850 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14851 vector double __b) {
14852 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14858 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14859 vector float __b) {
14861 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14863 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14868 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14869 vector double __b) {
14870 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14876 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14877 vector float __b) {
14879 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14881 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14886 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14887 vector double __b) {
14888 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14894 static __inline__ int __attribute__((__always_inline__))
14895 vec_all_nle(vector float __a, vector float __b) {
14896 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14901 static __inline__ int __attribute__((__always_inline__))
14902 vec_all_nlt(vector float __a, vector float __b) {
14903 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14906 /* vec_all_numeric */
14908 static __inline__ int __attribute__((__always_inline__))
14909 vec_all_numeric(vector float __a) {
14910 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14915 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14916 vector signed char __b) {
14917 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14921 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14922 vector bool char __b) {
14923 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14927 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14928 vector unsigned char __b) {
14929 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14933 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14934 vector bool char __b) {
14935 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14939 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14940 vector signed char __b) {
14941 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14945 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14946 vector unsigned char __b) {
14947 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14951 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14952 vector bool char __b) {
14953 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14957 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14958 vector short __b) {
14959 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14962 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14963 vector bool short __b) {
14964 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14967 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14968 vector unsigned short __b) {
14969 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14970 (vector short)__b);
14973 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14974 vector bool short __b) {
14975 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14976 (vector short)__b);
14979 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14980 vector short __b) {
14981 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14982 (vector short)__b);
14985 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14986 vector unsigned short __b) {
14987 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14988 (vector short)__b);
14991 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14992 vector bool short __b) {
14993 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14994 (vector short)__b);
14997 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14998 vector pixel __b) {
14999 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15000 (vector short)__b);
15003 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
15004 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
15007 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
15008 vector bool int __b) {
15009 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
15012 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
15013 vector unsigned int __b) {
15014 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15018 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
15019 vector bool int __b) {
15020 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15024 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15026 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15030 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15031 vector unsigned int __b) {
15032 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15036 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15037 vector bool int __b) {
15038 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15042 #ifdef __POWER8_VECTOR__
15043 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15044 vector signed long long __b) {
15045 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
15048 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15049 vector unsigned long long __b) {
15050 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
15051 (vector long long)__b);
15054 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15055 vector bool long long __b) {
15056 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
15057 (vector signed long long)__b);
15060 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15061 vector bool long long __b) {
15062 return __builtin_altivec_vcmpequd_p(
15063 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15066 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15067 vector signed long long __b) {
15068 return __builtin_altivec_vcmpequd_p(
15069 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15072 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15073 vector unsigned long long __b) {
15074 return __builtin_altivec_vcmpequd_p(
15075 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15078 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15079 vector bool long long __b) {
15080 return __builtin_altivec_vcmpequd_p(
15081 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15085 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15086 vector float __b) {
15088 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15090 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15095 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15096 vector double __b) {
15097 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15103 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15104 vector signed char __b) {
15105 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15108 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15109 vector bool char __b) {
15110 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15114 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15115 vector unsigned char __b) {
15116 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15119 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15120 vector bool char __b) {
15121 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15125 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15126 vector signed char __b) {
15127 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15128 (vector unsigned char)__a);
15131 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15132 vector unsigned char __b) {
15133 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15134 (vector unsigned char)__a);
15137 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15138 vector bool char __b) {
15139 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15140 (vector unsigned char)__a);
15143 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15144 vector short __b) {
15145 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15148 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15149 vector bool short __b) {
15150 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15153 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15154 vector unsigned short __b) {
15155 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15158 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15159 vector bool short __b) {
15160 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15164 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15165 vector short __b) {
15166 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15167 (vector unsigned short)__a);
15170 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15171 vector unsigned short __b) {
15172 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15173 (vector unsigned short)__a);
15176 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15177 vector bool short __b) {
15178 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15179 (vector unsigned short)__a);
15182 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15183 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15186 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15187 vector bool int __b) {
15188 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15191 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15192 vector unsigned int __b) {
15193 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15196 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15197 vector bool int __b) {
15198 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15202 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15204 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15205 (vector unsigned int)__a);
15208 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15209 vector unsigned int __b) {
15210 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15211 (vector unsigned int)__a);
15214 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15215 vector bool int __b) {
15216 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15217 (vector unsigned int)__a);
15220 #ifdef __POWER8_VECTOR__
15221 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15222 vector signed long long __b) {
15223 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15226 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15227 vector unsigned long long __b) {
15228 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15231 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15232 vector bool long long __b) {
15233 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15234 (vector signed long long)__b, __a);
15237 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15238 vector bool long long __b) {
15239 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15240 (vector unsigned long long)__b, __a);
15243 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15244 vector signed long long __b) {
15245 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15246 (vector unsigned long long)__b,
15247 (vector unsigned long long)__a);
15250 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15251 vector unsigned long long __b) {
15252 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15253 (vector unsigned long long)__a);
15256 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15257 vector bool long long __b) {
15258 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15259 (vector unsigned long long)__b,
15260 (vector unsigned long long)__a);
15264 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15265 vector float __b) {
15267 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15269 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15274 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15275 vector double __b) {
15276 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15282 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15283 vector signed char __b) {
15284 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15287 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15288 vector bool char __b) {
15289 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15290 (vector signed char)__b);
15293 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15294 vector unsigned char __b) {
15295 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15298 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15299 vector bool char __b) {
15300 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15301 (vector unsigned char)__b);
15304 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15305 vector signed char __b) {
15306 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15307 (vector unsigned char)__b);
15310 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15311 vector unsigned char __b) {
15312 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15316 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15317 vector bool char __b) {
15318 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15319 (vector unsigned char)__b);
15322 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15323 vector short __b) {
15324 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15327 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15328 vector bool short __b) {
15329 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15332 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15333 vector unsigned short __b) {
15334 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15337 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15338 vector bool short __b) {
15339 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15340 (vector unsigned short)__b);
15343 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15344 vector short __b) {
15345 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15346 (vector unsigned short)__b);
15349 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15350 vector unsigned short __b) {
15351 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15355 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15356 vector bool short __b) {
15357 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15358 (vector unsigned short)__b);
15361 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15362 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15365 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15366 vector bool int __b) {
15367 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15370 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15371 vector unsigned int __b) {
15372 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15375 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15376 vector bool int __b) {
15377 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15378 (vector unsigned int)__b);
15381 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15383 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15384 (vector unsigned int)__b);
15387 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15388 vector unsigned int __b) {
15389 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15393 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15394 vector bool int __b) {
15395 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15396 (vector unsigned int)__b);
15399 #ifdef __POWER8_VECTOR__
15400 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15401 vector signed long long __b) {
15402 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15405 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15406 vector unsigned long long __b) {
15407 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15410 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15411 vector bool long long __b) {
15412 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15413 (vector signed long long)__b);
15416 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15417 vector bool long long __b) {
15418 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15419 (vector unsigned long long)__b);
15422 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15423 vector signed long long __b) {
15424 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15425 (vector unsigned long long)__a,
15426 (vector unsigned long long)__b);
15429 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15430 vector unsigned long long __b) {
15431 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15432 (vector unsigned long long)__a, __b);
15435 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15436 vector bool long long __b) {
15437 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15438 (vector unsigned long long)__a,
15439 (vector unsigned long long)__b);
15443 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15444 vector float __b) {
15446 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15448 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15453 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15454 vector double __b) {
15455 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15461 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15462 vector signed char __b) {
15463 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15466 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15467 vector bool char __b) {
15468 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15469 (vector signed char)__b);
15472 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15473 vector unsigned char __b) {
15474 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15477 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15478 vector bool char __b) {
15479 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15480 (vector unsigned char)__b);
15483 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15484 vector signed char __b) {
15485 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15486 (vector unsigned char)__b);
15489 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15490 vector unsigned char __b) {
15491 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15495 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15496 vector bool char __b) {
15497 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15498 (vector unsigned char)__b);
15501 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15502 vector short __b) {
15503 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15506 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15507 vector bool short __b) {
15508 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15511 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15512 vector unsigned short __b) {
15513 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15516 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15517 vector bool short __b) {
15518 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15519 (vector unsigned short)__b);
15522 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15523 vector short __b) {
15524 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15525 (vector unsigned short)__b);
15528 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15529 vector unsigned short __b) {
15530 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15534 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15535 vector bool short __b) {
15536 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15537 (vector unsigned short)__b);
15540 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15541 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15544 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15545 vector bool int __b) {
15546 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15549 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15550 vector unsigned int __b) {
15551 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15554 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15555 vector bool int __b) {
15556 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15557 (vector unsigned int)__b);
15560 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15562 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15563 (vector unsigned int)__b);
15566 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15567 vector unsigned int __b) {
15568 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15572 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15573 vector bool int __b) {
15574 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15575 (vector unsigned int)__b);
15578 #ifdef __POWER8_VECTOR__
15579 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15580 vector signed long long __b) {
15581 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15584 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15585 vector unsigned long long __b) {
15586 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15589 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15590 vector bool long long __b) {
15591 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15592 (vector signed long long)__b);
15595 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15596 vector bool long long __b) {
15597 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15598 (vector unsigned long long)__b);
15601 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15602 vector signed long long __b) {
15603 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15604 (vector unsigned long long)__a,
15605 (vector unsigned long long)__b);
15608 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15609 vector unsigned long long __b) {
15610 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15611 (vector unsigned long long)__a, __b);
15614 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15615 vector bool long long __b) {
15616 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15617 (vector unsigned long long)__a,
15618 (vector unsigned long long)__b);
15622 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15623 vector float __b) {
15625 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15627 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15632 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15633 vector double __b) {
15634 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15640 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15641 vector signed char __b) {
15642 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15645 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15646 vector bool char __b) {
15647 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15651 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15652 vector unsigned char __b) {
15653 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15656 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15657 vector bool char __b) {
15658 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15662 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15663 vector signed char __b) {
15664 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15665 (vector unsigned char)__a);
15668 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15669 vector unsigned char __b) {
15670 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15671 (vector unsigned char)__a);
15674 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15675 vector bool char __b) {
15676 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15677 (vector unsigned char)__a);
15680 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15681 vector short __b) {
15682 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15685 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15686 vector bool short __b) {
15687 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15690 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15691 vector unsigned short __b) {
15692 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15695 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15696 vector bool short __b) {
15697 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15701 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15702 vector short __b) {
15703 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15704 (vector unsigned short)__a);
15707 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15708 vector unsigned short __b) {
15709 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15710 (vector unsigned short)__a);
15713 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15714 vector bool short __b) {
15715 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15716 (vector unsigned short)__a);
15719 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15720 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15723 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15724 vector bool int __b) {
15725 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15728 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15729 vector unsigned int __b) {
15730 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15733 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15734 vector bool int __b) {
15735 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15739 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15741 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15742 (vector unsigned int)__a);
15745 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15746 vector unsigned int __b) {
15747 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15748 (vector unsigned int)__a);
15751 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15752 vector bool int __b) {
15753 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15754 (vector unsigned int)__a);
15757 #ifdef __POWER8_VECTOR__
15758 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15759 vector signed long long __b) {
15760 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15763 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15764 vector unsigned long long __b) {
15765 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15768 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15769 vector bool long long __b) {
15770 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15771 (vector signed long long)__b, __a);
15774 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15775 vector bool long long __b) {
15776 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15777 (vector unsigned long long)__b, __a);
15780 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15781 vector signed long long __b) {
15782 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15783 (vector unsigned long long)__b,
15784 (vector unsigned long long)__a);
15787 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15788 vector unsigned long long __b) {
15789 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15790 (vector unsigned long long)__a);
15793 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15794 vector bool long long __b) {
15795 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15796 (vector unsigned long long)__b,
15797 (vector unsigned long long)__a);
15801 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15802 vector float __b) {
15804 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15806 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15811 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15812 vector double __b) {
15813 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15819 static __inline__ int __attribute__((__always_inline__))
15820 vec_any_nan(vector float __a) {
15821 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15826 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15827 vector signed char __b) {
15828 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15832 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15833 vector bool char __b) {
15834 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15838 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15839 vector unsigned char __b) {
15840 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15844 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15845 vector bool char __b) {
15846 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15850 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15851 vector signed char __b) {
15852 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15856 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15857 vector unsigned char __b) {
15858 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15862 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15863 vector bool char __b) {
15864 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15868 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15869 vector short __b) {
15870 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15873 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15874 vector bool short __b) {
15875 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15878 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15879 vector unsigned short __b) {
15880 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15881 (vector short)__b);
15884 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15885 vector bool short __b) {
15886 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15887 (vector short)__b);
15890 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15891 vector short __b) {
15892 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15893 (vector short)__b);
15896 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15897 vector unsigned short __b) {
15898 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15899 (vector short)__b);
15902 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15903 vector bool short __b) {
15904 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15905 (vector short)__b);
15908 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15909 vector pixel __b) {
15910 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15911 (vector short)__b);
15914 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15915 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15918 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15919 vector bool int __b) {
15920 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15923 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15924 vector unsigned int __b) {
15925 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15929 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15930 vector bool int __b) {
15931 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15935 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15937 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15941 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15942 vector unsigned int __b) {
15943 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15947 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15948 vector bool int __b) {
15949 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15953 #ifdef __POWER8_VECTOR__
15954 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15955 vector signed long long __b) {
15956 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15959 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15960 vector unsigned long long __b) {
15961 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15962 (vector long long)__b);
15965 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15966 vector bool long long __b) {
15967 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15968 (vector signed long long)__b);
15971 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15972 vector bool long long __b) {
15973 return __builtin_altivec_vcmpequd_p(
15974 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15977 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15978 vector signed long long __b) {
15979 return __builtin_altivec_vcmpequd_p(
15980 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15983 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15984 vector unsigned long long __b) {
15985 return __builtin_altivec_vcmpequd_p(
15986 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15989 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15990 vector bool long long __b) {
15991 return __builtin_altivec_vcmpequd_p(
15992 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15996 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15997 vector float __b) {
15999 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
16001 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
16006 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
16007 vector double __b) {
16008 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
16014 static __inline__ int __attribute__((__always_inline__))
16015 vec_any_nge(vector float __a, vector float __b) {
16016 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
16021 static __inline__ int __attribute__((__always_inline__))
16022 vec_any_ngt(vector float __a, vector float __b) {
16023 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
16028 static __inline__ int __attribute__((__always_inline__))
16029 vec_any_nle(vector float __a, vector float __b) {
16030 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
16035 static __inline__ int __attribute__((__always_inline__))
16036 vec_any_nlt(vector float __a, vector float __b) {
16037 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
16040 /* vec_any_numeric */
16042 static __inline__ int __attribute__((__always_inline__))
16043 vec_any_numeric(vector float __a) {
16044 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
16049 static __inline__ int __attribute__((__always_inline__))
16050 vec_any_out(vector float __a, vector float __b) {
16051 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
16054 /* Power 8 Crypto functions
16055 Note: We diverge from the current GCC implementation with regard
16056 to cryptography and related functions as follows:
16057 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
16058 - The remaining ones are only available on Power8 and up so
16059 require -mpower8-vector
16060 The justification for this is that export requirements require that
16061 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16062 support). As a result, we need to be able to turn off support for those.
16063 The remaining ones (currently controlled by -mcrypto for GCC) still
16064 need to be provided on compliant hardware even if Vector.Crypto is not
16068 #define vec_sbox_be __builtin_altivec_crypto_vsbox
16069 #define vec_cipher_be __builtin_altivec_crypto_vcipher
16070 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16071 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16072 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16074 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16075 __builtin_crypto_vsbox(vector unsigned long long __a) {
16076 return __builtin_altivec_crypto_vsbox(__a);
16079 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16080 __builtin_crypto_vcipher(vector unsigned long long __a,
16081 vector unsigned long long __b) {
16082 return __builtin_altivec_crypto_vcipher(__a, __b);
16085 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16086 __builtin_crypto_vcipherlast(vector unsigned long long __a,
16087 vector unsigned long long __b) {
16088 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16091 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16092 __builtin_crypto_vncipher(vector unsigned long long __a,
16093 vector unsigned long long __b) {
16094 return __builtin_altivec_crypto_vncipher(__a, __b);
16097 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16098 __builtin_crypto_vncipherlast(vector unsigned long long __a,
16099 vector unsigned long long __b) {
16100 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16103 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16104 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16106 #define vec_shasigma_be(X, Y, Z) \
16107 _Generic((X), vector unsigned int \
16108 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16109 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16112 #ifdef __POWER8_VECTOR__
16113 static __inline__ vector bool char __ATTRS_o_ai
16114 vec_permxor(vector bool char __a, vector bool char __b,
16115 vector bool char __c) {
16116 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16119 static __inline__ vector signed char __ATTRS_o_ai
16120 vec_permxor(vector signed char __a, vector signed char __b,
16121 vector signed char __c) {
16122 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16125 static __inline__ vector unsigned char __ATTRS_o_ai
16126 vec_permxor(vector unsigned char __a, vector unsigned char __b,
16127 vector unsigned char __c) {
16128 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16131 static __inline__ vector unsigned char __ATTRS_o_ai
16132 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16133 vector unsigned char __c) {
16134 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16137 static __inline__ vector unsigned short __ATTRS_o_ai
16138 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16139 vector unsigned short __c) {
16140 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16141 (vector unsigned char)__a, (vector unsigned char)__b,
16142 (vector unsigned char)__c);
16145 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16146 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16147 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16148 (vector unsigned char)__a, (vector unsigned char)__b,
16149 (vector unsigned char)__c);
16152 static __inline__ vector unsigned long long __ATTRS_o_ai
16153 __builtin_crypto_vpermxor(vector unsigned long long __a,
16154 vector unsigned long long __b,
16155 vector unsigned long long __c) {
16156 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16157 (vector unsigned char)__a, (vector unsigned char)__b,
16158 (vector unsigned char)__c);
16161 static __inline__ vector unsigned char __ATTRS_o_ai
16162 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16163 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16166 static __inline__ vector unsigned short __ATTRS_o_ai
16167 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16168 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16171 static __inline__ vector unsigned int __ATTRS_o_ai
16172 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16173 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16176 static __inline__ vector unsigned long long __ATTRS_o_ai
16177 __builtin_crypto_vpmsumb(vector unsigned long long __a,
16178 vector unsigned long long __b) {
16179 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16182 static __inline__ vector signed char __ATTRS_o_ai
16183 vec_vgbbd(vector signed char __a) {
16184 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16187 #define vec_pmsum_be __builtin_crypto_vpmsumb
16188 #define vec_gb __builtin_altivec_vgbbd
16190 static __inline__ vector unsigned char __ATTRS_o_ai
16191 vec_vgbbd(vector unsigned char __a) {
16192 return __builtin_altivec_vgbbd(__a);
16195 static __inline__ vector long long __ATTRS_o_ai
16196 vec_vbpermq(vector signed char __a, vector signed char __b) {
16197 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16198 (vector unsigned char)__b);
16201 static __inline__ vector long long __ATTRS_o_ai
16202 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16203 return __builtin_altivec_vbpermq(__a, __b);
16206 #ifdef __powerpc64__
16207 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16208 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16209 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16210 (vector unsigned char)__b);
16218 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16219 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16223 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16224 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16228 static inline __ATTRS_o_ai vector unsigned char
16229 vec_reve(vector unsigned char __a) {
16230 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16234 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16235 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16238 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16239 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16242 static inline __ATTRS_o_ai vector unsigned int
16243 vec_reve(vector unsigned int __a) {
16244 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16247 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16248 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16251 static inline __ATTRS_o_ai vector signed short
16252 vec_reve(vector signed short __a) {
16253 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16256 static inline __ATTRS_o_ai vector unsigned short
16257 vec_reve(vector unsigned short __a) {
16258 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16261 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16262 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16266 static inline __ATTRS_o_ai vector bool long long
16267 vec_reve(vector bool long long __a) {
16268 return __builtin_shufflevector(__a, __a, 1, 0);
16271 static inline __ATTRS_o_ai vector signed long long
16272 vec_reve(vector signed long long __a) {
16273 return __builtin_shufflevector(__a, __a, 1, 0);
16276 static inline __ATTRS_o_ai vector unsigned long long
16277 vec_reve(vector unsigned long long __a) {
16278 return __builtin_shufflevector(__a, __a, 1, 0);
16281 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16282 return __builtin_shufflevector(__a, __a, 1, 0);
16287 static __inline__ vector bool char __ATTRS_o_ai
16288 vec_revb(vector bool char __a) {
16292 static __inline__ vector signed char __ATTRS_o_ai
16293 vec_revb(vector signed char __a) {
16297 static __inline__ vector unsigned char __ATTRS_o_ai
16298 vec_revb(vector unsigned char __a) {
16302 static __inline__ vector bool short __ATTRS_o_ai
16303 vec_revb(vector bool short __a) {
16304 vector unsigned char __indices =
16305 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16306 return vec_perm(__a, __a, __indices);
16309 static __inline__ vector signed short __ATTRS_o_ai
16310 vec_revb(vector signed short __a) {
16311 vector unsigned char __indices =
16312 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16313 return vec_perm(__a, __a, __indices);
16316 static __inline__ vector unsigned short __ATTRS_o_ai
16317 vec_revb(vector unsigned short __a) {
16318 vector unsigned char __indices =
16319 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16320 return vec_perm(__a, __a, __indices);
16323 static __inline__ vector bool int __ATTRS_o_ai
16324 vec_revb(vector bool int __a) {
16325 vector unsigned char __indices =
16326 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16327 return vec_perm(__a, __a, __indices);
16330 static __inline__ vector signed int __ATTRS_o_ai
16331 vec_revb(vector signed int __a) {
16332 vector unsigned char __indices =
16333 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16334 return vec_perm(__a, __a, __indices);
16337 static __inline__ vector unsigned int __ATTRS_o_ai
16338 vec_revb(vector unsigned int __a) {
16339 vector unsigned char __indices =
16340 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16341 return vec_perm(__a, __a, __indices);
16344 static __inline__ vector float __ATTRS_o_ai
16345 vec_revb(vector float __a) {
16346 vector unsigned char __indices =
16347 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16348 return vec_perm(__a, __a, __indices);
16352 static __inline__ vector bool long long __ATTRS_o_ai
16353 vec_revb(vector bool long long __a) {
16354 vector unsigned char __indices =
16355 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16356 return vec_perm(__a, __a, __indices);
16359 static __inline__ vector signed long long __ATTRS_o_ai
16360 vec_revb(vector signed long long __a) {
16361 vector unsigned char __indices =
16362 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16363 return vec_perm(__a, __a, __indices);
16366 static __inline__ vector unsigned long long __ATTRS_o_ai
16367 vec_revb(vector unsigned long long __a) {
16368 vector unsigned char __indices =
16369 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16370 return vec_perm(__a, __a, __indices);
16373 static __inline__ vector double __ATTRS_o_ai
16374 vec_revb(vector double __a) {
16375 vector unsigned char __indices =
16376 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16377 return vec_perm(__a, __a, __indices);
16379 #endif /* End __VSX__ */
16381 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16382 static __inline__ vector signed __int128 __ATTRS_o_ai
16383 vec_revb(vector signed __int128 __a) {
16384 vector unsigned char __indices =
16385 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16386 return (vector signed __int128)vec_perm((vector signed int)__a,
16387 (vector signed int)__a,
16391 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16392 vec_revb(vector unsigned __int128 __a) {
16393 vector unsigned char __indices =
16394 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16395 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16396 (vector signed int)__a,
16399 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16403 typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16404 typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16405 typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
16406 typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
16407 typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16408 typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16409 typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16411 static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16412 const signed char *__ptr) {
16413 return *(unaligned_vec_schar *)(__ptr + __offset);
16416 static inline __ATTRS_o_ai vector unsigned char
16417 vec_xl(signed long long __offset, const unsigned char *__ptr) {
16418 return *(unaligned_vec_uchar*)(__ptr + __offset);
16421 static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16422 const signed short *__ptr) {
16423 signed char *__addr = (signed char *)__ptr + __offset;
16424 return *(unaligned_vec_sshort *)__addr;
16427 static inline __ATTRS_o_ai vector unsigned short
16428 vec_xl(signed long long __offset, const unsigned short *__ptr) {
16429 signed char *__addr = (signed char *)__ptr + __offset;
16430 return *(unaligned_vec_ushort *)__addr;
16433 static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16434 const signed int *__ptr) {
16435 signed char *__addr = (signed char *)__ptr + __offset;
16436 return *(unaligned_vec_sint *)__addr;
16439 static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16440 const unsigned int *__ptr) {
16441 signed char *__addr = (signed char *)__ptr + __offset;
16442 return *(unaligned_vec_uint *)__addr;
16445 static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16446 const float *__ptr) {
16447 signed char *__addr = (signed char *)__ptr + __offset;
16448 return *(unaligned_vec_float *)__addr;
16452 typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
16453 typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16454 typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16456 static inline __ATTRS_o_ai vector signed long long
16457 vec_xl(signed long long __offset, const signed long long *__ptr) {
16458 signed char *__addr = (signed char *)__ptr + __offset;
16459 return *(unaligned_vec_sll *)__addr;
16462 static inline __ATTRS_o_ai vector unsigned long long
16463 vec_xl(signed long long __offset, const unsigned long long *__ptr) {
16464 signed char *__addr = (signed char *)__ptr + __offset;
16465 return *(unaligned_vec_ull *)__addr;
16468 static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16469 const double *__ptr) {
16470 signed char *__addr = (signed char *)__ptr + __offset;
16471 return *(unaligned_vec_double *)__addr;
16475 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16476 typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16477 typedef vector unsigned __int128 unaligned_vec_ui128
16478 __attribute__((aligned(1)));
16479 static inline __ATTRS_o_ai vector signed __int128
16480 vec_xl(signed long long __offset, const signed __int128 *__ptr) {
16481 signed char *__addr = (signed char *)__ptr + __offset;
16482 return *(unaligned_vec_si128 *)__addr;
16485 static inline __ATTRS_o_ai vector unsigned __int128
16486 vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
16487 signed char *__addr = (signed char *)__ptr + __offset;
16488 return *(unaligned_vec_ui128 *)__addr;
16494 #ifdef __LITTLE_ENDIAN__
16495 static __inline__ vector signed char __ATTRS_o_ai
16496 vec_xl_be(signed long long __offset, const signed char *__ptr) {
16497 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16498 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16499 13, 12, 11, 10, 9, 8);
16502 static __inline__ vector unsigned char __ATTRS_o_ai
16503 vec_xl_be(signed long long __offset, const unsigned char *__ptr) {
16504 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16505 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16506 13, 12, 11, 10, 9, 8);
16509 static __inline__ vector signed short __ATTRS_o_ai
16510 vec_xl_be(signed long long __offset, const signed short *__ptr) {
16511 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16512 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16515 static __inline__ vector unsigned short __ATTRS_o_ai
16516 vec_xl_be(signed long long __offset, const unsigned short *__ptr) {
16517 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16518 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16521 static __inline__ vector signed int __ATTRS_o_ai
16522 vec_xl_be(signed long long __offset, const signed int *__ptr) {
16523 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16526 static __inline__ vector unsigned int __ATTRS_o_ai
16527 vec_xl_be(signed long long __offset, const unsigned int *__ptr) {
16528 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16531 static __inline__ vector float __ATTRS_o_ai
16532 vec_xl_be(signed long long __offset, const float *__ptr) {
16533 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16537 static __inline__ vector signed long long __ATTRS_o_ai
16538 vec_xl_be(signed long long __offset, const signed long long *__ptr) {
16539 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16542 static __inline__ vector unsigned long long __ATTRS_o_ai
16543 vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {
16544 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16547 static __inline__ vector double __ATTRS_o_ai
16548 vec_xl_be(signed long long __offset, const double *__ptr) {
16549 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16553 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16554 static __inline__ vector signed __int128 __ATTRS_o_ai
16555 vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
16556 return vec_xl(__offset, __ptr);
16559 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16560 vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
16561 return vec_xl(__offset, __ptr);
16565 #define vec_xl_be vec_xl
16570 static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16571 signed long long __offset,
16572 signed char *__ptr) {
16573 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
16576 static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16577 signed long long __offset,
16578 unsigned char *__ptr) {
16579 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
16582 static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16583 signed long long __offset,
16584 signed short *__ptr) {
16585 signed char *__addr = (signed char *)__ptr + __offset;
16586 *(unaligned_vec_sshort *)__addr = __vec;
16589 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16590 signed long long __offset,
16591 unsigned short *__ptr) {
16592 signed char *__addr = (signed char *)__ptr + __offset;
16593 *(unaligned_vec_ushort *)__addr = __vec;
16596 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16597 signed long long __offset,
16598 signed int *__ptr) {
16599 signed char *__addr = (signed char *)__ptr + __offset;
16600 *(unaligned_vec_sint *)__addr = __vec;
16603 static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16604 signed long long __offset,
16605 unsigned int *__ptr) {
16606 signed char *__addr = (signed char *)__ptr + __offset;
16607 *(unaligned_vec_uint *)__addr = __vec;
16610 static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16611 signed long long __offset,
16613 signed char *__addr = (signed char *)__ptr + __offset;
16614 *(unaligned_vec_float *)__addr = __vec;
16618 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16619 signed long long __offset,
16620 signed long long *__ptr) {
16621 signed char *__addr = (signed char *)__ptr + __offset;
16622 *(unaligned_vec_sll *)__addr = __vec;
16625 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16626 signed long long __offset,
16627 unsigned long long *__ptr) {
16628 signed char *__addr = (signed char *)__ptr + __offset;
16629 *(unaligned_vec_ull *)__addr = __vec;
16632 static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16633 signed long long __offset,
16635 signed char *__addr = (signed char *)__ptr + __offset;
16636 *(unaligned_vec_double *)__addr = __vec;
16640 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16641 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16642 signed long long __offset,
16643 signed __int128 *__ptr) {
16644 signed char *__addr = (signed char *)__ptr + __offset;
16645 *(unaligned_vec_si128 *)__addr = __vec;
16648 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16649 signed long long __offset,
16650 unsigned __int128 *__ptr) {
16651 signed char *__addr = (signed char *)__ptr + __offset;
16652 *(unaligned_vec_ui128 *)__addr = __vec;
16658 #ifdef __LITTLE_ENDIAN__
16659 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16660 signed long long __offset,
16661 signed char *__ptr) {
16662 vector signed char __tmp =
16663 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16664 13, 12, 11, 10, 9, 8);
16665 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16666 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16669 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16670 signed long long __offset,
16671 unsigned char *__ptr) {
16672 vector unsigned char __tmp =
16673 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16674 13, 12, 11, 10, 9, 8);
16675 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16676 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16679 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16680 signed long long __offset,
16681 signed short *__ptr) {
16682 vector signed short __tmp =
16683 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16684 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16685 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16688 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16689 signed long long __offset,
16690 unsigned short *__ptr) {
16691 vector unsigned short __tmp =
16692 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16693 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16694 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16697 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16698 signed long long __offset,
16699 signed int *__ptr) {
16700 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16703 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16704 signed long long __offset,
16705 unsigned int *__ptr) {
16706 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16709 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16710 signed long long __offset,
16712 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16716 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16717 signed long long __offset,
16718 signed long long *__ptr) {
16719 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16722 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16723 signed long long __offset,
16724 unsigned long long *__ptr) {
16725 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16728 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16729 signed long long __offset,
16731 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16735 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16736 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16737 signed long long __offset,
16738 signed __int128 *__ptr) {
16739 vec_xst(__vec, __offset, __ptr);
16742 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16743 signed long long __offset,
16744 unsigned __int128 *__ptr) {
16745 vec_xst(__vec, __offset, __ptr);
16749 #define vec_xst_be vec_xst
16752 #ifdef __POWER9_VECTOR__
16753 #define vec_test_data_class(__a, __b) \
16755 (__a), vector float \
16756 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
16758 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
16761 #endif /* #ifdef __POWER9_VECTOR__ */
16763 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16768 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16774 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16775 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16780 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16784 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16788 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16792 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16793 return - vec_abs(__a);
16797 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16798 return - vec_abs(__a);
16803 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16804 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16805 return __builtin_altivec_vminsd(__a, -__a);
16809 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16810 return __builtin_altivec_vminsw(__a, -__a);
16813 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16814 return __builtin_altivec_vminsh(__a, -__a);
16817 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16818 return __builtin_altivec_vminsb(__a, -__a);
16821 #ifdef __POWER10_VECTOR__
16824 static __inline__ vector unsigned long long __ATTRS_o_ai
16825 vec_pdep(vector unsigned long long __a, vector unsigned long long __b) {
16826 return __builtin_altivec_vpdepd(__a, __b);
16831 static __inline__ vector unsigned long long __ATTRS_o_ai
16832 vec_pext(vector unsigned long long __a, vector unsigned long long __b) {
16833 return __builtin_altivec_vpextd(__a, __b);
16838 static __inline__ vector unsigned long long __ATTRS_o_ai
16839 vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
16840 return __builtin_altivec_vcfuged(__a, __b);
16845 #define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
16847 /* vec_ternarylogic */
16849 #define vec_ternarylogic(__a, __b, __c, __imm) \
16850 _Generic((__a), vector unsigned char \
16851 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16852 (vector unsigned long long)(__b), \
16853 (vector unsigned long long)(__c), (__imm)), \
16854 vector unsigned short \
16855 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16856 (vector unsigned long long)(__b), \
16857 (vector unsigned long long)(__c), (__imm)), \
16858 vector unsigned int \
16859 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16860 (vector unsigned long long)(__b), \
16861 (vector unsigned long long)(__c), (__imm)), \
16862 vector unsigned long long \
16863 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16864 (vector unsigned long long)(__b), \
16865 (vector unsigned long long)(__c), (__imm)), \
16866 vector unsigned __int128 \
16867 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16868 (vector unsigned long long)(__b), \
16869 (vector unsigned long long)(__c), (__imm)))
16870 #endif /* __VSX__ */
16875 #define vec_genpcvm(__a, __imm) \
16876 _Generic((__a), vector unsigned char \
16877 : __builtin_vsx_xxgenpcvbm((__a), (int)(__imm)), \
16878 vector unsigned short \
16879 : __builtin_vsx_xxgenpcvhm((__a), (int)(__imm)), \
16880 vector unsigned int \
16881 : __builtin_vsx_xxgenpcvwm((__a), (int)(__imm)), \
16882 vector unsigned long long \
16883 : __builtin_vsx_xxgenpcvdm((__a), (int)(__imm)))
16884 #endif /* __VSX__ */
16888 static __inline__ vector signed char __ATTRS_o_ai
16889 vec_clrl(vector signed char __a, unsigned int __n) {
16890 #ifdef __LITTLE_ENDIAN__
16891 return __builtin_altivec_vclrrb(__a, __n);
16893 return __builtin_altivec_vclrlb( __a, __n);
16897 static __inline__ vector unsigned char __ATTRS_o_ai
16898 vec_clrl(vector unsigned char __a, unsigned int __n) {
16899 #ifdef __LITTLE_ENDIAN__
16900 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
16902 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
16908 static __inline__ vector signed char __ATTRS_o_ai
16909 vec_clrr(vector signed char __a, unsigned int __n) {
16910 #ifdef __LITTLE_ENDIAN__
16911 return __builtin_altivec_vclrlb(__a, __n);
16913 return __builtin_altivec_vclrrb( __a, __n);
16917 static __inline__ vector unsigned char __ATTRS_o_ai
16918 vec_clrr(vector unsigned char __a, unsigned int __n) {
16919 #ifdef __LITTLE_ENDIAN__
16920 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
16922 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
16928 static __inline__ vector unsigned long long __ATTRS_o_ai
16929 vec_cntlzm(vector unsigned long long __a, vector unsigned long long __b) {
16930 return __builtin_altivec_vclzdm(__a, __b);
16935 static __inline__ vector unsigned long long __ATTRS_o_ai
16936 vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
16937 return __builtin_altivec_vctzdm(__a, __b);
16942 #define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))
16946 #define vec_srdb(__a, __b, __c) __builtin_altivec_vsrdbi(__a, __b, (__c & 0x7))
16950 static __inline__ vector unsigned char __ATTRS_o_ai
16951 vec_insertl(unsigned char __a, vector unsigned char __b, unsigned int __c) {
16952 #ifdef __LITTLE_ENDIAN__
16953 return __builtin_altivec_vinsbrx(__b, __c, __a);
16955 return __builtin_altivec_vinsblx(__b, __c, __a);
16959 static __inline__ vector unsigned short __ATTRS_o_ai
16960 vec_insertl(unsigned short __a, vector unsigned short __b, unsigned int __c) {
16961 #ifdef __LITTLE_ENDIAN__
16962 return __builtin_altivec_vinshrx(__b, __c, __a);
16964 return __builtin_altivec_vinshlx(__b, __c, __a);
16968 static __inline__ vector unsigned int __ATTRS_o_ai
16969 vec_insertl(unsigned int __a, vector unsigned int __b, unsigned int __c) {
16970 #ifdef __LITTLE_ENDIAN__
16971 return __builtin_altivec_vinswrx(__b, __c, __a);
16973 return __builtin_altivec_vinswlx(__b, __c, __a);
16977 static __inline__ vector unsigned long long __ATTRS_o_ai
16978 vec_insertl(unsigned long long __a, vector unsigned long long __b,
16979 unsigned int __c) {
16980 #ifdef __LITTLE_ENDIAN__
16981 return __builtin_altivec_vinsdrx(__b, __c, __a);
16983 return __builtin_altivec_vinsdlx(__b, __c, __a);
16987 static __inline__ vector unsigned char __ATTRS_o_ai
16988 vec_insertl(vector unsigned char __a, vector unsigned char __b,
16989 unsigned int __c) {
16990 #ifdef __LITTLE_ENDIAN__
16991 return __builtin_altivec_vinsbvrx(__b, __c, __a);
16993 return __builtin_altivec_vinsbvlx(__b, __c, __a);
16997 static __inline__ vector unsigned short __ATTRS_o_ai
16998 vec_insertl(vector unsigned short __a, vector unsigned short __b,
16999 unsigned int __c) {
17000 #ifdef __LITTLE_ENDIAN__
17001 return __builtin_altivec_vinshvrx(__b, __c, __a);
17003 return __builtin_altivec_vinshvlx(__b, __c, __a);
17007 static __inline__ vector unsigned int __ATTRS_o_ai
17008 vec_insertl(vector unsigned int __a, vector unsigned int __b,
17009 unsigned int __c) {
17010 #ifdef __LITTLE_ENDIAN__
17011 return __builtin_altivec_vinswvrx(__b, __c, __a);
17013 return __builtin_altivec_vinswvlx(__b, __c, __a);
17019 static __inline__ vector unsigned char __ATTRS_o_ai
17020 vec_inserth(unsigned char __a, vector unsigned char __b, unsigned int __c) {
17021 #ifdef __LITTLE_ENDIAN__
17022 return __builtin_altivec_vinsblx(__b, __c, __a);
17024 return __builtin_altivec_vinsbrx(__b, __c, __a);
17028 static __inline__ vector unsigned short __ATTRS_o_ai
17029 vec_inserth(unsigned short __a, vector unsigned short __b, unsigned int __c) {
17030 #ifdef __LITTLE_ENDIAN__
17031 return __builtin_altivec_vinshlx(__b, __c, __a);
17033 return __builtin_altivec_vinshrx(__b, __c, __a);
17037 static __inline__ vector unsigned int __ATTRS_o_ai
17038 vec_inserth(unsigned int __a, vector unsigned int __b, unsigned int __c) {
17039 #ifdef __LITTLE_ENDIAN__
17040 return __builtin_altivec_vinswlx(__b, __c, __a);
17042 return __builtin_altivec_vinswrx(__b, __c, __a);
17046 static __inline__ vector unsigned long long __ATTRS_o_ai
17047 vec_inserth(unsigned long long __a, vector unsigned long long __b,
17048 unsigned int __c) {
17049 #ifdef __LITTLE_ENDIAN__
17050 return __builtin_altivec_vinsdlx(__b, __c, __a);
17052 return __builtin_altivec_vinsdrx(__b, __c, __a);
17056 static __inline__ vector unsigned char __ATTRS_o_ai
17057 vec_inserth(vector unsigned char __a, vector unsigned char __b,
17058 unsigned int __c) {
17059 #ifdef __LITTLE_ENDIAN__
17060 return __builtin_altivec_vinsbvlx(__b, __c, __a);
17062 return __builtin_altivec_vinsbvrx(__b, __c, __a);
17066 static __inline__ vector unsigned short __ATTRS_o_ai
17067 vec_inserth(vector unsigned short __a, vector unsigned short __b,
17068 unsigned int __c) {
17069 #ifdef __LITTLE_ENDIAN__
17070 return __builtin_altivec_vinshvlx(__b, __c, __a);
17072 return __builtin_altivec_vinshvrx(__b, __c, __a);
17076 static __inline__ vector unsigned int __ATTRS_o_ai
17077 vec_inserth(vector unsigned int __a, vector unsigned int __b,
17078 unsigned int __c) {
17079 #ifdef __LITTLE_ENDIAN__
17080 return __builtin_altivec_vinswvlx(__b, __c, __a);
17082 return __builtin_altivec_vinswvrx(__b, __c, __a);
17090 #define vec_permx(__a, __b, __c, __d) \
17091 __builtin_vsx_xxpermx((__a), (__b), (__c), (__d))
17095 static __inline__ vector signed char __ATTRS_o_ai
17096 vec_blendv(vector signed char __a, vector signed char __b,
17097 vector unsigned char __c) {
17098 return __builtin_vsx_xxblendvb(__a, __b, __c);
17101 static __inline__ vector unsigned char __ATTRS_o_ai
17102 vec_blendv(vector unsigned char __a, vector unsigned char __b,
17103 vector unsigned char __c) {
17104 return __builtin_vsx_xxblendvb(__a, __b, __c);
17107 static __inline__ vector signed short __ATTRS_o_ai
17108 vec_blendv(vector signed short __a, vector signed short __b,
17109 vector unsigned short __c) {
17110 return __builtin_vsx_xxblendvh(__a, __b, __c);
17113 static __inline__ vector unsigned short __ATTRS_o_ai
17114 vec_blendv(vector unsigned short __a, vector unsigned short __b,
17115 vector unsigned short __c) {
17116 return __builtin_vsx_xxblendvh(__a, __b, __c);
17119 static __inline__ vector signed int __ATTRS_o_ai
17120 vec_blendv(vector signed int __a, vector signed int __b,
17121 vector unsigned int __c) {
17122 return __builtin_vsx_xxblendvw(__a, __b, __c);
17125 static __inline__ vector unsigned int __ATTRS_o_ai
17126 vec_blendv(vector unsigned int __a, vector unsigned int __b,
17127 vector unsigned int __c) {
17128 return __builtin_vsx_xxblendvw(__a, __b, __c);
17131 static __inline__ vector signed long long __ATTRS_o_ai
17132 vec_blendv(vector signed long long __a, vector signed long long __b,
17133 vector unsigned long long __c) {
17134 return __builtin_vsx_xxblendvd(__a, __b, __c);
17137 static __inline__ vector unsigned long long __ATTRS_o_ai
17138 vec_blendv(vector unsigned long long __a, vector unsigned long long __b,
17139 vector unsigned long long __c) {
17140 return __builtin_vsx_xxblendvd(__a, __b, __c);
17143 static __inline__ vector float __ATTRS_o_ai
17144 vec_blendv(vector float __a, vector float __b, vector unsigned int __c) {
17145 return __builtin_vsx_xxblendvw(__a, __b, __c);
17148 static __inline__ vector double __ATTRS_o_ai
17149 vec_blendv(vector double __a, vector double __b,
17150 vector unsigned long long __c) {
17151 return __builtin_vsx_xxblendvd(__a, __b, __c);
17156 #define vec_splati(__a) \
17157 _Generic((__a), signed int \
17158 : ((vector signed int)__a), unsigned int \
17159 : ((vector unsigned int)__a), float \
17160 : ((vector float)__a))
17164 static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {
17165 return ((vector double)((double)__a));
17168 /* vec_splati_ins */
17170 static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(
17171 vector signed int __a, const unsigned int __b, const signed int __c) {
17172 #ifdef __LITTLE_ENDIAN__
17173 __a[1 - __b] = __c;
17174 __a[3 - __b] = __c;
17177 __a[2 + __b] = __c;
17182 static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(
17183 vector unsigned int __a, const unsigned int __b, const unsigned int __c) {
17184 #ifdef __LITTLE_ENDIAN__
17185 __a[1 - __b] = __c;
17186 __a[3 - __b] = __c;
17189 __a[2 + __b] = __c;
17194 static __inline__ vector float __ATTRS_o_ai
17195 vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {
17196 #ifdef __LITTLE_ENDIAN__
17197 __a[1 - __b] = __c;
17198 __a[3 - __b] = __c;
17201 __a[2 + __b] = __c;
17206 /* vec_test_lsbb_all_ones */
17208 static __inline__ int __ATTRS_o_ai
17209 vec_test_lsbb_all_ones(vector unsigned char __a) {
17210 return __builtin_vsx_xvtlsbb(__a, 1);
17213 /* vec_test_lsbb_all_zeros */
17215 static __inline__ int __ATTRS_o_ai
17216 vec_test_lsbb_all_zeros(vector unsigned char __a) {
17217 return __builtin_vsx_xvtlsbb(__a, 0);
17219 #endif /* __VSX__ */
17220 #endif /* __POWER10_VECTOR__ */
17222 #undef __ATTRS_o_ai
17224 #endif /* __ALTIVEC_H */