1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 \*===----------------------------------------------------------------------===*/
27 #error "AltiVec support not enabled"
30 /* Constants for mapping CR6 bits to predicate result. */
33 #define __CR6_EQ_REV 1
35 #define __CR6_LT_REV 3
37 /* Constants for vec_test_data_class */
38 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
39 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
40 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
41 __VEC_CLASS_FP_SUBNORMAL_N)
42 #define __VEC_CLASS_FP_ZERO_N (1<<2)
43 #define __VEC_CLASS_FP_ZERO_P (1<<3)
44 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
45 __VEC_CLASS_FP_ZERO_N)
46 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
47 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
48 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
49 __VEC_CLASS_FP_INFINITY_N)
50 #define __VEC_CLASS_FP_NAN (1<<6)
51 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
52 __VEC_CLASS_FP_SUBNORMAL | \
53 __VEC_CLASS_FP_ZERO | \
54 __VEC_CLASS_FP_INFINITY)
56 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
58 #ifdef __POWER9_VECTOR__
62 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
63 vector signed char __a, vector signed char __b, vector unsigned char __c);
65 static __inline__ vector unsigned char __ATTRS_o_ai
66 vec_perm(vector unsigned char __a, vector unsigned char __b,
67 vector unsigned char __c);
69 static __inline__ vector bool char __ATTRS_o_ai
70 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
72 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
73 vector signed short __b,
74 vector unsigned char __c);
76 static __inline__ vector unsigned short __ATTRS_o_ai
77 vec_perm(vector unsigned short __a, vector unsigned short __b,
78 vector unsigned char __c);
80 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
81 vector bool short __a, vector bool short __b, vector unsigned char __c);
83 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
85 vector unsigned char __c);
87 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
88 vector signed int __b,
89 vector unsigned char __c);
91 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
92 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
94 static __inline__ vector bool int __ATTRS_o_ai
95 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
97 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
99 vector unsigned char __c);
102 static __inline__ vector long long __ATTRS_o_ai
103 vec_perm(vector signed long long __a, vector signed long long __b,
104 vector unsigned char __c);
106 static __inline__ vector unsigned long long __ATTRS_o_ai
107 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
108 vector unsigned char __c);
110 static __inline__ vector bool long long __ATTRS_o_ai
111 vec_perm(vector bool long long __a, vector bool long long __b,
112 vector unsigned char __c);
114 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
116 vector unsigned char __c);
119 static __inline__ vector unsigned char __ATTRS_o_ai
120 vec_xor(vector unsigned char __a, vector unsigned char __b);
124 #define __builtin_altivec_abs_v16qi vec_abs
125 #define __builtin_altivec_abs_v8hi vec_abs
126 #define __builtin_altivec_abs_v4si vec_abs
128 static __inline__ vector signed char __ATTRS_o_ai
129 vec_abs(vector signed char __a) {
130 return __builtin_altivec_vmaxsb(__a, -__a);
133 static __inline__ vector signed short __ATTRS_o_ai
134 vec_abs(vector signed short __a) {
135 return __builtin_altivec_vmaxsh(__a, -__a);
138 static __inline__ vector signed int __ATTRS_o_ai
139 vec_abs(vector signed int __a) {
140 return __builtin_altivec_vmaxsw(__a, -__a);
143 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
144 static __inline__ vector signed long long __ATTRS_o_ai
145 vec_abs(vector signed long long __a) {
146 return __builtin_altivec_vmaxsd(__a, -__a);
150 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
152 return __builtin_vsx_xvabssp(__a);
154 vector unsigned int __res =
155 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
156 return (vector float)__res;
161 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
162 return __builtin_vsx_xvabsdp(__a);
167 #define __builtin_altivec_abss_v16qi vec_abss
168 #define __builtin_altivec_abss_v8hi vec_abss
169 #define __builtin_altivec_abss_v4si vec_abss
171 static __inline__ vector signed char __ATTRS_o_ai
172 vec_abss(vector signed char __a) {
173 return __builtin_altivec_vmaxsb(
174 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
177 static __inline__ vector signed short __ATTRS_o_ai
178 vec_abss(vector signed short __a) {
179 return __builtin_altivec_vmaxsh(
180 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
183 static __inline__ vector signed int __ATTRS_o_ai
184 vec_abss(vector signed int __a) {
185 return __builtin_altivec_vmaxsw(
186 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
190 #if defined(__POWER9_VECTOR__)
192 static __inline__ vector unsigned char __ATTRS_o_ai
193 vec_absd(vector unsigned char __a, vector unsigned char __b) {
194 return __builtin_altivec_vabsdub(__a, __b);
197 static __inline__ vector unsigned short __ATTRS_o_ai
198 vec_absd(vector unsigned short __a, vector unsigned short __b) {
199 return __builtin_altivec_vabsduh(__a, __b);
202 static __inline__ vector unsigned int __ATTRS_o_ai
203 vec_absd(vector unsigned int __a, vector unsigned int __b) {
204 return __builtin_altivec_vabsduw(__a, __b);
207 #endif /* End __POWER9_VECTOR__ */
211 static __inline__ vector signed char __ATTRS_o_ai
212 vec_add(vector signed char __a, vector signed char __b) {
216 static __inline__ vector signed char __ATTRS_o_ai
217 vec_add(vector bool char __a, vector signed char __b) {
218 return (vector signed char)__a + __b;
221 static __inline__ vector signed char __ATTRS_o_ai
222 vec_add(vector signed char __a, vector bool char __b) {
223 return __a + (vector signed char)__b;
226 static __inline__ vector unsigned char __ATTRS_o_ai
227 vec_add(vector unsigned char __a, vector unsigned char __b) {
231 static __inline__ vector unsigned char __ATTRS_o_ai
232 vec_add(vector bool char __a, vector unsigned char __b) {
233 return (vector unsigned char)__a + __b;
236 static __inline__ vector unsigned char __ATTRS_o_ai
237 vec_add(vector unsigned char __a, vector bool char __b) {
238 return __a + (vector unsigned char)__b;
241 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
246 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
248 return (vector short)__a + __b;
251 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
252 vector bool short __b) {
253 return __a + (vector short)__b;
256 static __inline__ vector unsigned short __ATTRS_o_ai
257 vec_add(vector unsigned short __a, vector unsigned short __b) {
261 static __inline__ vector unsigned short __ATTRS_o_ai
262 vec_add(vector bool short __a, vector unsigned short __b) {
263 return (vector unsigned short)__a + __b;
266 static __inline__ vector unsigned short __ATTRS_o_ai
267 vec_add(vector unsigned short __a, vector bool short __b) {
268 return __a + (vector unsigned short)__b;
271 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
276 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
278 return (vector int)__a + __b;
281 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
282 vector bool int __b) {
283 return __a + (vector int)__b;
286 static __inline__ vector unsigned int __ATTRS_o_ai
287 vec_add(vector unsigned int __a, vector unsigned int __b) {
291 static __inline__ vector unsigned int __ATTRS_o_ai
292 vec_add(vector bool int __a, vector unsigned int __b) {
293 return (vector unsigned int)__a + __b;
296 static __inline__ vector unsigned int __ATTRS_o_ai
297 vec_add(vector unsigned int __a, vector bool int __b) {
298 return __a + (vector unsigned int)__b;
301 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
302 static __inline__ vector signed long long __ATTRS_o_ai
303 vec_add(vector signed long long __a, vector signed long long __b) {
307 static __inline__ vector unsigned long long __ATTRS_o_ai
308 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
312 static __inline__ vector signed __int128 __ATTRS_o_ai
313 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
317 static __inline__ vector unsigned __int128 __ATTRS_o_ai
318 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
321 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
323 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
329 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
337 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
338 static __inline__ vector signed __int128 __ATTRS_o_ai
339 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
340 vector signed __int128 __c) {
341 return __builtin_altivec_vaddeuqm(__a, __b, __c);
344 static __inline__ vector unsigned __int128 __ATTRS_o_ai
345 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
346 vector unsigned __int128 __c) {
347 return __builtin_altivec_vaddeuqm(__a, __b, __c);
351 static __inline__ vector signed int __ATTRS_o_ai
352 vec_adde(vector signed int __a, vector signed int __b,
353 vector signed int __c) {
354 vector signed int __mask = {1, 1, 1, 1};
355 vector signed int __carry = __c & __mask;
356 return vec_add(vec_add(__a, __b), __carry);
359 static __inline__ vector unsigned int __ATTRS_o_ai
360 vec_adde(vector unsigned int __a, vector unsigned int __b,
361 vector unsigned int __c) {
362 vector unsigned int __mask = {1, 1, 1, 1};
363 vector unsigned int __carry = __c & __mask;
364 return vec_add(vec_add(__a, __b), __carry);
369 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
370 static __inline__ vector signed __int128 __ATTRS_o_ai
371 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
372 vector signed __int128 __c) {
373 return __builtin_altivec_vaddecuq(__a, __b, __c);
376 static __inline__ vector unsigned __int128 __ATTRS_o_ai
377 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
378 vector unsigned __int128 __c) {
379 return __builtin_altivec_vaddecuq(__a, __b, __c);
382 static __inline__ vector signed int __ATTRS_o_ai
383 vec_addec(vector signed int __a, vector signed int __b,
384 vector signed int __c) {
386 signed int __result[4];
387 for (int i = 0; i < 4; i++) {
388 unsigned int __tempa = (unsigned int) __a[i];
389 unsigned int __tempb = (unsigned int) __b[i];
390 unsigned int __tempc = (unsigned int) __c[i];
391 __tempc = __tempc & 0x00000001;
392 unsigned long long __longa = (unsigned long long) __tempa;
393 unsigned long long __longb = (unsigned long long) __tempb;
394 unsigned long long __longc = (unsigned long long) __tempc;
395 unsigned long long __sum = __longa + __longb + __longc;
396 unsigned long long __res = (__sum >> 32) & 0x01;
397 unsigned long long __tempres = (unsigned int) __res;
398 __result[i] = (signed int) __tempres;
401 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
405 static __inline__ vector unsigned int __ATTRS_o_ai
406 vec_addec(vector unsigned int __a, vector unsigned int __b,
407 vector unsigned int __c) {
409 unsigned int __result[4];
410 for (int i = 0; i < 4; i++) {
411 unsigned int __tempc = __c[i] & 1;
412 unsigned long long __longa = (unsigned long long) __a[i];
413 unsigned long long __longb = (unsigned long long) __b[i];
414 unsigned long long __longc = (unsigned long long) __tempc;
415 unsigned long long __sum = __longa + __longb + __longc;
416 unsigned long long __res = (__sum >> 32) & 0x01;
417 unsigned long long __tempres = (unsigned int) __res;
418 __result[i] = (signed int) __tempres;
421 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
429 #define __builtin_altivec_vaddubm vec_vaddubm
431 static __inline__ vector signed char __ATTRS_o_ai
432 vec_vaddubm(vector signed char __a, vector signed char __b) {
436 static __inline__ vector signed char __ATTRS_o_ai
437 vec_vaddubm(vector bool char __a, vector signed char __b) {
438 return (vector signed char)__a + __b;
441 static __inline__ vector signed char __ATTRS_o_ai
442 vec_vaddubm(vector signed char __a, vector bool char __b) {
443 return __a + (vector signed char)__b;
446 static __inline__ vector unsigned char __ATTRS_o_ai
447 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
451 static __inline__ vector unsigned char __ATTRS_o_ai
452 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
453 return (vector unsigned char)__a + __b;
456 static __inline__ vector unsigned char __ATTRS_o_ai
457 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
458 return __a + (vector unsigned char)__b;
463 #define __builtin_altivec_vadduhm vec_vadduhm
465 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
470 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
472 return (vector short)__a + __b;
475 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
476 vector bool short __b) {
477 return __a + (vector short)__b;
480 static __inline__ vector unsigned short __ATTRS_o_ai
481 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
485 static __inline__ vector unsigned short __ATTRS_o_ai
486 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
487 return (vector unsigned short)__a + __b;
490 static __inline__ vector unsigned short __ATTRS_o_ai
491 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
492 return __a + (vector unsigned short)__b;
497 #define __builtin_altivec_vadduwm vec_vadduwm
499 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
504 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
506 return (vector int)__a + __b;
509 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
510 vector bool int __b) {
511 return __a + (vector int)__b;
514 static __inline__ vector unsigned int __ATTRS_o_ai
515 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
519 static __inline__ vector unsigned int __ATTRS_o_ai
520 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
521 return (vector unsigned int)__a + __b;
524 static __inline__ vector unsigned int __ATTRS_o_ai
525 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
526 return __a + (vector unsigned int)__b;
531 #define __builtin_altivec_vaddfp vec_vaddfp
533 static __inline__ vector float __attribute__((__always_inline__))
534 vec_vaddfp(vector float __a, vector float __b) {
540 static __inline__ vector signed int __ATTRS_o_ai
541 vec_addc(vector signed int __a, vector signed int __b) {
542 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
543 (vector unsigned int)__b);
546 static __inline__ vector unsigned int __ATTRS_o_ai
547 vec_addc(vector unsigned int __a, vector unsigned int __b) {
548 return __builtin_altivec_vaddcuw(__a, __b);
551 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
552 static __inline__ vector signed __int128 __ATTRS_o_ai
553 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
554 return (vector signed __int128)__builtin_altivec_vaddcuq(
555 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
558 static __inline__ vector unsigned __int128 __ATTRS_o_ai
559 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
560 return __builtin_altivec_vaddcuq(__a, __b);
562 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
566 static __inline__ vector unsigned int __attribute__((__always_inline__))
567 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
568 return __builtin_altivec_vaddcuw(__a, __b);
573 static __inline__ vector signed char __ATTRS_o_ai
574 vec_adds(vector signed char __a, vector signed char __b) {
575 return __builtin_altivec_vaddsbs(__a, __b);
578 static __inline__ vector signed char __ATTRS_o_ai
579 vec_adds(vector bool char __a, vector signed char __b) {
580 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
583 static __inline__ vector signed char __ATTRS_o_ai
584 vec_adds(vector signed char __a, vector bool char __b) {
585 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
588 static __inline__ vector unsigned char __ATTRS_o_ai
589 vec_adds(vector unsigned char __a, vector unsigned char __b) {
590 return __builtin_altivec_vaddubs(__a, __b);
593 static __inline__ vector unsigned char __ATTRS_o_ai
594 vec_adds(vector bool char __a, vector unsigned char __b) {
595 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
598 static __inline__ vector unsigned char __ATTRS_o_ai
599 vec_adds(vector unsigned char __a, vector bool char __b) {
600 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
603 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
605 return __builtin_altivec_vaddshs(__a, __b);
608 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
610 return __builtin_altivec_vaddshs((vector short)__a, __b);
613 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
614 vector bool short __b) {
615 return __builtin_altivec_vaddshs(__a, (vector short)__b);
618 static __inline__ vector unsigned short __ATTRS_o_ai
619 vec_adds(vector unsigned short __a, vector unsigned short __b) {
620 return __builtin_altivec_vadduhs(__a, __b);
623 static __inline__ vector unsigned short __ATTRS_o_ai
624 vec_adds(vector bool short __a, vector unsigned short __b) {
625 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
628 static __inline__ vector unsigned short __ATTRS_o_ai
629 vec_adds(vector unsigned short __a, vector bool short __b) {
630 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
633 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
635 return __builtin_altivec_vaddsws(__a, __b);
638 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
640 return __builtin_altivec_vaddsws((vector int)__a, __b);
643 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
644 vector bool int __b) {
645 return __builtin_altivec_vaddsws(__a, (vector int)__b);
648 static __inline__ vector unsigned int __ATTRS_o_ai
649 vec_adds(vector unsigned int __a, vector unsigned int __b) {
650 return __builtin_altivec_vadduws(__a, __b);
653 static __inline__ vector unsigned int __ATTRS_o_ai
654 vec_adds(vector bool int __a, vector unsigned int __b) {
655 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
658 static __inline__ vector unsigned int __ATTRS_o_ai
659 vec_adds(vector unsigned int __a, vector bool int __b) {
660 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
665 static __inline__ vector signed char __ATTRS_o_ai
666 vec_vaddsbs(vector signed char __a, vector signed char __b) {
667 return __builtin_altivec_vaddsbs(__a, __b);
670 static __inline__ vector signed char __ATTRS_o_ai
671 vec_vaddsbs(vector bool char __a, vector signed char __b) {
672 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
675 static __inline__ vector signed char __ATTRS_o_ai
676 vec_vaddsbs(vector signed char __a, vector bool char __b) {
677 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
682 static __inline__ vector unsigned char __ATTRS_o_ai
683 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
684 return __builtin_altivec_vaddubs(__a, __b);
687 static __inline__ vector unsigned char __ATTRS_o_ai
688 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
689 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
692 static __inline__ vector unsigned char __ATTRS_o_ai
693 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
694 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
699 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
701 return __builtin_altivec_vaddshs(__a, __b);
704 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
706 return __builtin_altivec_vaddshs((vector short)__a, __b);
709 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
710 vector bool short __b) {
711 return __builtin_altivec_vaddshs(__a, (vector short)__b);
716 static __inline__ vector unsigned short __ATTRS_o_ai
717 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
718 return __builtin_altivec_vadduhs(__a, __b);
721 static __inline__ vector unsigned short __ATTRS_o_ai
722 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
723 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
726 static __inline__ vector unsigned short __ATTRS_o_ai
727 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
728 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
733 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
735 return __builtin_altivec_vaddsws(__a, __b);
738 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
740 return __builtin_altivec_vaddsws((vector int)__a, __b);
743 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
744 vector bool int __b) {
745 return __builtin_altivec_vaddsws(__a, (vector int)__b);
750 static __inline__ vector unsigned int __ATTRS_o_ai
751 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
752 return __builtin_altivec_vadduws(__a, __b);
755 static __inline__ vector unsigned int __ATTRS_o_ai
756 vec_vadduws(vector bool int __a, vector unsigned int __b) {
757 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
760 static __inline__ vector unsigned int __ATTRS_o_ai
761 vec_vadduws(vector unsigned int __a, vector bool int __b) {
762 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
765 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
768 static __inline__ vector signed __int128 __ATTRS_o_ai
769 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
773 static __inline__ vector unsigned __int128 __ATTRS_o_ai
774 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
780 static __inline__ vector signed __int128 __ATTRS_o_ai
781 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
782 vector signed __int128 __c) {
783 return __builtin_altivec_vaddeuqm(__a, __b, __c);
786 static __inline__ vector unsigned __int128 __ATTRS_o_ai
787 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
788 vector unsigned __int128 __c) {
789 return __builtin_altivec_vaddeuqm(__a, __b, __c);
794 static __inline__ vector signed __int128 __ATTRS_o_ai
795 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
796 return __builtin_altivec_vaddcuq(__a, __b);
799 static __inline__ vector unsigned __int128 __ATTRS_o_ai
800 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
801 return __builtin_altivec_vaddcuq(__a, __b);
806 static __inline__ vector signed __int128 __ATTRS_o_ai
807 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
808 vector signed __int128 __c) {
809 return __builtin_altivec_vaddecuq(__a, __b, __c);
812 static __inline__ vector unsigned __int128 __ATTRS_o_ai
813 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
814 vector unsigned __int128 __c) {
815 return __builtin_altivec_vaddecuq(__a, __b, __c);
817 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
821 #define __builtin_altivec_vand vec_and
823 static __inline__ vector signed char __ATTRS_o_ai
824 vec_and(vector signed char __a, vector signed char __b) {
828 static __inline__ vector signed char __ATTRS_o_ai
829 vec_and(vector bool char __a, vector signed char __b) {
830 return (vector signed char)__a & __b;
833 static __inline__ vector signed char __ATTRS_o_ai
834 vec_and(vector signed char __a, vector bool char __b) {
835 return __a & (vector signed char)__b;
838 static __inline__ vector unsigned char __ATTRS_o_ai
839 vec_and(vector unsigned char __a, vector unsigned char __b) {
843 static __inline__ vector unsigned char __ATTRS_o_ai
844 vec_and(vector bool char __a, vector unsigned char __b) {
845 return (vector unsigned char)__a & __b;
848 static __inline__ vector unsigned char __ATTRS_o_ai
849 vec_and(vector unsigned char __a, vector bool char __b) {
850 return __a & (vector unsigned char)__b;
853 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
854 vector bool char __b) {
858 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
863 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
865 return (vector short)__a & __b;
868 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
869 vector bool short __b) {
870 return __a & (vector short)__b;
873 static __inline__ vector unsigned short __ATTRS_o_ai
874 vec_and(vector unsigned short __a, vector unsigned short __b) {
878 static __inline__ vector unsigned short __ATTRS_o_ai
879 vec_and(vector bool short __a, vector unsigned short __b) {
880 return (vector unsigned short)__a & __b;
883 static __inline__ vector unsigned short __ATTRS_o_ai
884 vec_and(vector unsigned short __a, vector bool short __b) {
885 return __a & (vector unsigned short)__b;
888 static __inline__ vector bool short __ATTRS_o_ai
889 vec_and(vector bool short __a, vector bool short __b) {
893 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
898 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
900 return (vector int)__a & __b;
903 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
904 vector bool int __b) {
905 return __a & (vector int)__b;
908 static __inline__ vector unsigned int __ATTRS_o_ai
909 vec_and(vector unsigned int __a, vector unsigned int __b) {
913 static __inline__ vector unsigned int __ATTRS_o_ai
914 vec_and(vector bool int __a, vector unsigned int __b) {
915 return (vector unsigned int)__a & __b;
918 static __inline__ vector unsigned int __ATTRS_o_ai
919 vec_and(vector unsigned int __a, vector bool int __b) {
920 return __a & (vector unsigned int)__b;
923 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
924 vector bool int __b) {
928 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
930 vector unsigned int __res =
931 (vector unsigned int)__a & (vector unsigned int)__b;
932 return (vector float)__res;
935 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
937 vector unsigned int __res =
938 (vector unsigned int)__a & (vector unsigned int)__b;
939 return (vector float)__res;
942 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
943 vector bool int __b) {
944 vector unsigned int __res =
945 (vector unsigned int)__a & (vector unsigned int)__b;
946 return (vector float)__res;
950 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
952 vector unsigned long long __res =
953 (vector unsigned long long)__a & (vector unsigned long long)__b;
954 return (vector double)__res;
957 static __inline__ vector double __ATTRS_o_ai
958 vec_and(vector double __a, vector bool long long __b) {
959 vector unsigned long long __res =
960 (vector unsigned long long)__a & (vector unsigned long long)__b;
961 return (vector double)__res;
964 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
966 vector unsigned long long __res =
967 (vector unsigned long long)__a & (vector unsigned long long)__b;
968 return (vector double)__res;
971 static __inline__ vector signed long long __ATTRS_o_ai
972 vec_and(vector signed long long __a, vector signed long long __b) {
976 static __inline__ vector signed long long __ATTRS_o_ai
977 vec_and(vector bool long long __a, vector signed long long __b) {
978 return (vector signed long long)__a & __b;
981 static __inline__ vector signed long long __ATTRS_o_ai
982 vec_and(vector signed long long __a, vector bool long long __b) {
983 return __a & (vector signed long long)__b;
986 static __inline__ vector unsigned long long __ATTRS_o_ai
987 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
991 static __inline__ vector unsigned long long __ATTRS_o_ai
992 vec_and(vector bool long long __a, vector unsigned long long __b) {
993 return (vector unsigned long long)__a & __b;
996 static __inline__ vector unsigned long long __ATTRS_o_ai
997 vec_and(vector unsigned long long __a, vector bool long long __b) {
998 return __a & (vector unsigned long long)__b;
1001 static __inline__ vector bool long long __ATTRS_o_ai
1002 vec_and(vector bool long long __a, vector bool long long __b) {
1009 static __inline__ vector signed char __ATTRS_o_ai
1010 vec_vand(vector signed char __a, vector signed char __b) {
1014 static __inline__ vector signed char __ATTRS_o_ai
1015 vec_vand(vector bool char __a, vector signed char __b) {
1016 return (vector signed char)__a & __b;
1019 static __inline__ vector signed char __ATTRS_o_ai
1020 vec_vand(vector signed char __a, vector bool char __b) {
1021 return __a & (vector signed char)__b;
1024 static __inline__ vector unsigned char __ATTRS_o_ai
1025 vec_vand(vector unsigned char __a, vector unsigned char __b) {
1029 static __inline__ vector unsigned char __ATTRS_o_ai
1030 vec_vand(vector bool char __a, vector unsigned char __b) {
1031 return (vector unsigned char)__a & __b;
1034 static __inline__ vector unsigned char __ATTRS_o_ai
1035 vec_vand(vector unsigned char __a, vector bool char __b) {
1036 return __a & (vector unsigned char)__b;
1039 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1040 vector bool char __b) {
1044 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1049 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1051 return (vector short)__a & __b;
1054 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1055 vector bool short __b) {
1056 return __a & (vector short)__b;
1059 static __inline__ vector unsigned short __ATTRS_o_ai
1060 vec_vand(vector unsigned short __a, vector unsigned short __b) {
1064 static __inline__ vector unsigned short __ATTRS_o_ai
1065 vec_vand(vector bool short __a, vector unsigned short __b) {
1066 return (vector unsigned short)__a & __b;
1069 static __inline__ vector unsigned short __ATTRS_o_ai
1070 vec_vand(vector unsigned short __a, vector bool short __b) {
1071 return __a & (vector unsigned short)__b;
1074 static __inline__ vector bool short __ATTRS_o_ai
1075 vec_vand(vector bool short __a, vector bool short __b) {
1079 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1084 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1086 return (vector int)__a & __b;
1089 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1090 vector bool int __b) {
1091 return __a & (vector int)__b;
1094 static __inline__ vector unsigned int __ATTRS_o_ai
1095 vec_vand(vector unsigned int __a, vector unsigned int __b) {
1099 static __inline__ vector unsigned int __ATTRS_o_ai
1100 vec_vand(vector bool int __a, vector unsigned int __b) {
1101 return (vector unsigned int)__a & __b;
1104 static __inline__ vector unsigned int __ATTRS_o_ai
1105 vec_vand(vector unsigned int __a, vector bool int __b) {
1106 return __a & (vector unsigned int)__b;
1109 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1110 vector bool int __b) {
1114 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1116 vector unsigned int __res =
1117 (vector unsigned int)__a & (vector unsigned int)__b;
1118 return (vector float)__res;
1121 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1123 vector unsigned int __res =
1124 (vector unsigned int)__a & (vector unsigned int)__b;
1125 return (vector float)__res;
1128 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1129 vector bool int __b) {
1130 vector unsigned int __res =
1131 (vector unsigned int)__a & (vector unsigned int)__b;
1132 return (vector float)__res;
1136 static __inline__ vector signed long long __ATTRS_o_ai
1137 vec_vand(vector signed long long __a, vector signed long long __b) {
1141 static __inline__ vector signed long long __ATTRS_o_ai
1142 vec_vand(vector bool long long __a, vector signed long long __b) {
1143 return (vector signed long long)__a & __b;
1146 static __inline__ vector signed long long __ATTRS_o_ai
1147 vec_vand(vector signed long long __a, vector bool long long __b) {
1148 return __a & (vector signed long long)__b;
1151 static __inline__ vector unsigned long long __ATTRS_o_ai
1152 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1156 static __inline__ vector unsigned long long __ATTRS_o_ai
1157 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1158 return (vector unsigned long long)__a & __b;
1161 static __inline__ vector unsigned long long __ATTRS_o_ai
1162 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1163 return __a & (vector unsigned long long)__b;
1166 static __inline__ vector bool long long __ATTRS_o_ai
1167 vec_vand(vector bool long long __a, vector bool long long __b) {
1174 #define __builtin_altivec_vandc vec_andc
1176 static __inline__ vector signed char __ATTRS_o_ai
1177 vec_andc(vector signed char __a, vector signed char __b) {
1181 static __inline__ vector signed char __ATTRS_o_ai
1182 vec_andc(vector bool char __a, vector signed char __b) {
1183 return (vector signed char)__a & ~__b;
1186 static __inline__ vector signed char __ATTRS_o_ai
1187 vec_andc(vector signed char __a, vector bool char __b) {
1188 return __a & ~(vector signed char)__b;
1191 static __inline__ vector unsigned char __ATTRS_o_ai
1192 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1196 static __inline__ vector unsigned char __ATTRS_o_ai
1197 vec_andc(vector bool char __a, vector unsigned char __b) {
1198 return (vector unsigned char)__a & ~__b;
1201 static __inline__ vector unsigned char __ATTRS_o_ai
1202 vec_andc(vector unsigned char __a, vector bool char __b) {
1203 return __a & ~(vector unsigned char)__b;
1206 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1207 vector bool char __b) {
1211 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1216 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1218 return (vector short)__a & ~__b;
1221 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1222 vector bool short __b) {
1223 return __a & ~(vector short)__b;
1226 static __inline__ vector unsigned short __ATTRS_o_ai
1227 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1231 static __inline__ vector unsigned short __ATTRS_o_ai
1232 vec_andc(vector bool short __a, vector unsigned short __b) {
1233 return (vector unsigned short)__a & ~__b;
1236 static __inline__ vector unsigned short __ATTRS_o_ai
1237 vec_andc(vector unsigned short __a, vector bool short __b) {
1238 return __a & ~(vector unsigned short)__b;
1241 static __inline__ vector bool short __ATTRS_o_ai
1242 vec_andc(vector bool short __a, vector bool short __b) {
1246 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1251 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1253 return (vector int)__a & ~__b;
1256 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1257 vector bool int __b) {
1258 return __a & ~(vector int)__b;
1261 static __inline__ vector unsigned int __ATTRS_o_ai
1262 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1266 static __inline__ vector unsigned int __ATTRS_o_ai
1267 vec_andc(vector bool int __a, vector unsigned int __b) {
1268 return (vector unsigned int)__a & ~__b;
1271 static __inline__ vector unsigned int __ATTRS_o_ai
1272 vec_andc(vector unsigned int __a, vector bool int __b) {
1273 return __a & ~(vector unsigned int)__b;
1276 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1277 vector bool int __b) {
1281 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1283 vector unsigned int __res =
1284 (vector unsigned int)__a & ~(vector unsigned int)__b;
1285 return (vector float)__res;
1288 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1290 vector unsigned int __res =
1291 (vector unsigned int)__a & ~(vector unsigned int)__b;
1292 return (vector float)__res;
1295 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1296 vector bool int __b) {
1297 vector unsigned int __res =
1298 (vector unsigned int)__a & ~(vector unsigned int)__b;
1299 return (vector float)__res;
1303 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1304 vector double __b) {
1305 vector unsigned long long __res =
1306 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1307 return (vector double)__res;
1310 static __inline__ vector double __ATTRS_o_ai
1311 vec_andc(vector double __a, vector bool long long __b) {
1312 vector unsigned long long __res =
1313 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1314 return (vector double)__res;
1317 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1318 vector double __b) {
1319 vector unsigned long long __res =
1320 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1321 return (vector double)__res;
1324 static __inline__ vector signed long long __ATTRS_o_ai
1325 vec_andc(vector signed long long __a, vector signed long long __b) {
1329 static __inline__ vector signed long long __ATTRS_o_ai
1330 vec_andc(vector bool long long __a, vector signed long long __b) {
1331 return (vector signed long long)__a & ~__b;
1334 static __inline__ vector signed long long __ATTRS_o_ai
1335 vec_andc(vector signed long long __a, vector bool long long __b) {
1336 return __a & ~(vector signed long long)__b;
1339 static __inline__ vector unsigned long long __ATTRS_o_ai
1340 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1344 static __inline__ vector unsigned long long __ATTRS_o_ai
1345 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1346 return (vector unsigned long long)__a & ~__b;
1349 static __inline__ vector unsigned long long __ATTRS_o_ai
1350 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1351 return __a & ~(vector unsigned long long)__b;
1354 static __inline__ vector bool long long __ATTRS_o_ai
1355 vec_andc(vector bool long long __a, vector bool long long __b) {
1362 static __inline__ vector signed char __ATTRS_o_ai
1363 vec_vandc(vector signed char __a, vector signed char __b) {
1367 static __inline__ vector signed char __ATTRS_o_ai
1368 vec_vandc(vector bool char __a, vector signed char __b) {
1369 return (vector signed char)__a & ~__b;
1372 static __inline__ vector signed char __ATTRS_o_ai
1373 vec_vandc(vector signed char __a, vector bool char __b) {
1374 return __a & ~(vector signed char)__b;
1377 static __inline__ vector unsigned char __ATTRS_o_ai
1378 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1382 static __inline__ vector unsigned char __ATTRS_o_ai
1383 vec_vandc(vector bool char __a, vector unsigned char __b) {
1384 return (vector unsigned char)__a & ~__b;
1387 static __inline__ vector unsigned char __ATTRS_o_ai
1388 vec_vandc(vector unsigned char __a, vector bool char __b) {
1389 return __a & ~(vector unsigned char)__b;
1392 static __inline__ vector bool char __ATTRS_o_ai
1393 vec_vandc(vector bool char __a, vector bool char __b) {
1397 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1402 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1404 return (vector short)__a & ~__b;
1407 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1408 vector bool short __b) {
1409 return __a & ~(vector short)__b;
1412 static __inline__ vector unsigned short __ATTRS_o_ai
1413 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1417 static __inline__ vector unsigned short __ATTRS_o_ai
1418 vec_vandc(vector bool short __a, vector unsigned short __b) {
1419 return (vector unsigned short)__a & ~__b;
1422 static __inline__ vector unsigned short __ATTRS_o_ai
1423 vec_vandc(vector unsigned short __a, vector bool short __b) {
1424 return __a & ~(vector unsigned short)__b;
1427 static __inline__ vector bool short __ATTRS_o_ai
1428 vec_vandc(vector bool short __a, vector bool short __b) {
1432 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1437 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1439 return (vector int)__a & ~__b;
1442 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1443 vector bool int __b) {
1444 return __a & ~(vector int)__b;
1447 static __inline__ vector unsigned int __ATTRS_o_ai
1448 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1452 static __inline__ vector unsigned int __ATTRS_o_ai
1453 vec_vandc(vector bool int __a, vector unsigned int __b) {
1454 return (vector unsigned int)__a & ~__b;
1457 static __inline__ vector unsigned int __ATTRS_o_ai
1458 vec_vandc(vector unsigned int __a, vector bool int __b) {
1459 return __a & ~(vector unsigned int)__b;
1462 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1463 vector bool int __b) {
1467 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1469 vector unsigned int __res =
1470 (vector unsigned int)__a & ~(vector unsigned int)__b;
1471 return (vector float)__res;
1474 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1476 vector unsigned int __res =
1477 (vector unsigned int)__a & ~(vector unsigned int)__b;
1478 return (vector float)__res;
1481 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1482 vector bool int __b) {
1483 vector unsigned int __res =
1484 (vector unsigned int)__a & ~(vector unsigned int)__b;
1485 return (vector float)__res;
1489 static __inline__ vector signed long long __ATTRS_o_ai
1490 vec_vandc(vector signed long long __a, vector signed long long __b) {
1494 static __inline__ vector signed long long __ATTRS_o_ai
1495 vec_vandc(vector bool long long __a, vector signed long long __b) {
1496 return (vector signed long long)__a & ~__b;
1499 static __inline__ vector signed long long __ATTRS_o_ai
1500 vec_vandc(vector signed long long __a, vector bool long long __b) {
1501 return __a & ~(vector signed long long)__b;
1504 static __inline__ vector unsigned long long __ATTRS_o_ai
1505 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1509 static __inline__ vector unsigned long long __ATTRS_o_ai
1510 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1511 return (vector unsigned long long)__a & ~__b;
1514 static __inline__ vector unsigned long long __ATTRS_o_ai
1515 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1516 return __a & ~(vector unsigned long long)__b;
1519 static __inline__ vector bool long long __ATTRS_o_ai
1520 vec_vandc(vector bool long long __a, vector bool long long __b) {
1527 static __inline__ vector signed char __ATTRS_o_ai
1528 vec_avg(vector signed char __a, vector signed char __b) {
1529 return __builtin_altivec_vavgsb(__a, __b);
1532 static __inline__ vector unsigned char __ATTRS_o_ai
1533 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1534 return __builtin_altivec_vavgub(__a, __b);
1537 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1539 return __builtin_altivec_vavgsh(__a, __b);
1542 static __inline__ vector unsigned short __ATTRS_o_ai
1543 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1544 return __builtin_altivec_vavguh(__a, __b);
1547 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1549 return __builtin_altivec_vavgsw(__a, __b);
1552 static __inline__ vector unsigned int __ATTRS_o_ai
1553 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1554 return __builtin_altivec_vavguw(__a, __b);
1559 static __inline__ vector signed char __attribute__((__always_inline__))
1560 vec_vavgsb(vector signed char __a, vector signed char __b) {
1561 return __builtin_altivec_vavgsb(__a, __b);
1566 static __inline__ vector unsigned char __attribute__((__always_inline__))
1567 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1568 return __builtin_altivec_vavgub(__a, __b);
1573 static __inline__ vector short __attribute__((__always_inline__))
1574 vec_vavgsh(vector short __a, vector short __b) {
1575 return __builtin_altivec_vavgsh(__a, __b);
1580 static __inline__ vector unsigned short __attribute__((__always_inline__))
1581 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1582 return __builtin_altivec_vavguh(__a, __b);
1587 static __inline__ vector int __attribute__((__always_inline__))
1588 vec_vavgsw(vector int __a, vector int __b) {
1589 return __builtin_altivec_vavgsw(__a, __b);
1594 static __inline__ vector unsigned int __attribute__((__always_inline__))
1595 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1596 return __builtin_altivec_vavguw(__a, __b);
1601 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1603 return __builtin_vsx_xvrspip(__a);
1605 return __builtin_altivec_vrfip(__a);
1610 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1611 return __builtin_vsx_xvrdpip(__a);
1617 static __inline__ vector float __attribute__((__always_inline__))
1618 vec_vrfip(vector float __a) {
1619 return __builtin_altivec_vrfip(__a);
1624 static __inline__ vector int __attribute__((__always_inline__))
1625 vec_cmpb(vector float __a, vector float __b) {
1626 return __builtin_altivec_vcmpbfp(__a, __b);
1631 static __inline__ vector int __attribute__((__always_inline__))
1632 vec_vcmpbfp(vector float __a, vector float __b) {
1633 return __builtin_altivec_vcmpbfp(__a, __b);
1638 static __inline__ vector bool char __ATTRS_o_ai
1639 vec_cmpeq(vector signed char __a, vector signed char __b) {
1640 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1644 static __inline__ vector bool char __ATTRS_o_ai
1645 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1646 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1650 static __inline__ vector bool char __ATTRS_o_ai
1651 vec_cmpeq(vector bool char __a, vector bool char __b) {
1652 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1656 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1658 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1661 static __inline__ vector bool short __ATTRS_o_ai
1662 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1663 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1667 static __inline__ vector bool short __ATTRS_o_ai
1668 vec_cmpeq(vector bool short __a, vector bool short __b) {
1669 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1673 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1675 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1678 static __inline__ vector bool int __ATTRS_o_ai
1679 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1680 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1684 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1685 vector bool int __b) {
1686 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1690 #ifdef __POWER8_VECTOR__
1691 static __inline__ vector bool long long __ATTRS_o_ai
1692 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1693 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1696 static __inline__ vector bool long long __ATTRS_o_ai
1697 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1698 return (vector bool long long)__builtin_altivec_vcmpequd(
1699 (vector long long)__a, (vector long long)__b);
1702 static __inline__ vector bool long long __ATTRS_o_ai
1703 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1704 return (vector bool long long)__builtin_altivec_vcmpequd(
1705 (vector long long)__a, (vector long long)__b);
1710 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1713 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1715 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1720 static __inline__ vector bool long long __ATTRS_o_ai
1721 vec_cmpeq(vector double __a, vector double __b) {
1722 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1726 #ifdef __POWER9_VECTOR__
1729 static __inline__ vector bool char __ATTRS_o_ai
1730 vec_cmpne(vector bool char __a, vector bool char __b) {
1731 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1735 static __inline__ vector bool char __ATTRS_o_ai
1736 vec_cmpne(vector signed char __a, vector signed char __b) {
1737 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1741 static __inline__ vector bool char __ATTRS_o_ai
1742 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1743 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1747 static __inline__ vector bool short __ATTRS_o_ai
1748 vec_cmpne(vector bool short __a, vector bool short __b) {
1749 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1753 static __inline__ vector bool short __ATTRS_o_ai
1754 vec_cmpne(vector signed short __a, vector signed short __b) {
1755 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1759 static __inline__ vector bool short __ATTRS_o_ai
1760 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1761 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1765 static __inline__ vector bool int __ATTRS_o_ai
1766 vec_cmpne(vector bool int __a, vector bool int __b) {
1767 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1771 static __inline__ vector bool int __ATTRS_o_ai
1772 vec_cmpne(vector signed int __a, vector signed int __b) {
1773 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1777 static __inline__ vector bool int __ATTRS_o_ai
1778 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1779 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1783 static __inline__ vector bool long long __ATTRS_o_ai
1784 vec_cmpne(vector bool long long __a, vector bool long long __b) {
1785 return (vector bool long long)
1786 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1789 static __inline__ vector bool long long __ATTRS_o_ai
1790 vec_cmpne(vector signed long long __a, vector signed long long __b) {
1791 return (vector bool long long)
1792 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1795 static __inline__ vector bool long long __ATTRS_o_ai
1796 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1797 return (vector bool long long)
1798 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1801 static __inline__ vector bool int __ATTRS_o_ai
1802 vec_cmpne(vector float __a, vector float __b) {
1803 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1807 static __inline__ vector bool long long __ATTRS_o_ai
1808 vec_cmpne(vector double __a, vector double __b) {
1809 return (vector bool long long)
1810 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1815 static __inline__ vector bool char __ATTRS_o_ai
1816 vec_cmpnez(vector signed char __a, vector signed char __b) {
1817 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1821 static __inline__ vector bool char __ATTRS_o_ai
1822 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1823 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1827 static __inline__ vector bool short __ATTRS_o_ai
1828 vec_cmpnez(vector signed short __a, vector signed short __b) {
1829 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1833 static __inline__ vector bool short __ATTRS_o_ai
1834 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1835 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1839 static __inline__ vector bool int __ATTRS_o_ai
1840 vec_cmpnez(vector signed int __a, vector signed int __b) {
1841 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1845 static __inline__ vector bool int __ATTRS_o_ai
1846 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1847 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1851 static __inline__ signed int __ATTRS_o_ai
1852 vec_cntlz_lsbb(vector signed char __a) {
1853 #ifdef __LITTLE_ENDIAN__
1854 return __builtin_altivec_vctzlsbb(__a);
1856 return __builtin_altivec_vclzlsbb(__a);
1860 static __inline__ signed int __ATTRS_o_ai
1861 vec_cntlz_lsbb(vector unsigned char __a) {
1862 #ifdef __LITTLE_ENDIAN__
1863 return __builtin_altivec_vctzlsbb(__a);
1865 return __builtin_altivec_vclzlsbb(__a);
1869 static __inline__ signed int __ATTRS_o_ai
1870 vec_cnttz_lsbb(vector signed char __a) {
1871 #ifdef __LITTLE_ENDIAN__
1872 return __builtin_altivec_vclzlsbb(__a);
1874 return __builtin_altivec_vctzlsbb(__a);
1878 static __inline__ signed int __ATTRS_o_ai
1879 vec_cnttz_lsbb(vector unsigned char __a) {
1880 #ifdef __LITTLE_ENDIAN__
1881 return __builtin_altivec_vclzlsbb(__a);
1883 return __builtin_altivec_vctzlsbb(__a);
1887 static __inline__ vector unsigned int __ATTRS_o_ai
1888 vec_parity_lsbb(vector unsigned int __a) {
1889 return __builtin_altivec_vprtybw(__a);
1892 static __inline__ vector unsigned int __ATTRS_o_ai
1893 vec_parity_lsbb(vector signed int __a) {
1894 return __builtin_altivec_vprtybw(__a);
1897 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1898 vec_parity_lsbb(vector unsigned __int128 __a) {
1899 return __builtin_altivec_vprtybq(__a);
1902 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1903 vec_parity_lsbb(vector signed __int128 __a) {
1904 return __builtin_altivec_vprtybq(__a);
1907 static __inline__ vector unsigned long long __ATTRS_o_ai
1908 vec_parity_lsbb(vector unsigned long long __a) {
1909 return __builtin_altivec_vprtybd(__a);
1912 static __inline__ vector unsigned long long __ATTRS_o_ai
1913 vec_parity_lsbb(vector signed long long __a) {
1914 return __builtin_altivec_vprtybd(__a);
1921 static __inline__ vector bool char __ATTRS_o_ai
1922 vec_cmpgt(vector signed char __a, vector signed char __b) {
1923 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1926 static __inline__ vector bool char __ATTRS_o_ai
1927 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1928 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1931 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1933 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1936 static __inline__ vector bool short __ATTRS_o_ai
1937 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1938 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1941 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1943 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1946 static __inline__ vector bool int __ATTRS_o_ai
1947 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1948 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1951 #ifdef __POWER8_VECTOR__
1952 static __inline__ vector bool long long __ATTRS_o_ai
1953 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1954 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1957 static __inline__ vector bool long long __ATTRS_o_ai
1958 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1959 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1963 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1966 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1968 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1973 static __inline__ vector bool long long __ATTRS_o_ai
1974 vec_cmpgt(vector double __a, vector double __b) {
1975 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1981 static __inline__ vector bool char __ATTRS_o_ai
1982 vec_cmpge(vector signed char __a, vector signed char __b) {
1983 return ~(vec_cmpgt(__b, __a));
1986 static __inline__ vector bool char __ATTRS_o_ai
1987 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1988 return ~(vec_cmpgt(__b, __a));
1991 static __inline__ vector bool short __ATTRS_o_ai
1992 vec_cmpge(vector signed short __a, vector signed short __b) {
1993 return ~(vec_cmpgt(__b, __a));
1996 static __inline__ vector bool short __ATTRS_o_ai
1997 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1998 return ~(vec_cmpgt(__b, __a));
2001 static __inline__ vector bool int __ATTRS_o_ai
2002 vec_cmpge(vector signed int __a, vector signed int __b) {
2003 return ~(vec_cmpgt(__b, __a));
2006 static __inline__ vector bool int __ATTRS_o_ai
2007 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2008 return ~(vec_cmpgt(__b, __a));
2011 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2014 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2016 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2021 static __inline__ vector bool long long __ATTRS_o_ai
2022 vec_cmpge(vector double __a, vector double __b) {
2023 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2027 #ifdef __POWER8_VECTOR__
2028 static __inline__ vector bool long long __ATTRS_o_ai
2029 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2030 return ~(vec_cmpgt(__b, __a));
2033 static __inline__ vector bool long long __ATTRS_o_ai
2034 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2035 return ~(vec_cmpgt(__b, __a));
2041 static __inline__ vector bool int __attribute__((__always_inline__))
2042 vec_vcmpgefp(vector float __a, vector float __b) {
2043 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2048 static __inline__ vector bool char __attribute__((__always_inline__))
2049 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2050 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2055 static __inline__ vector bool char __attribute__((__always_inline__))
2056 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2057 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2062 static __inline__ vector bool short __attribute__((__always_inline__))
2063 vec_vcmpgtsh(vector short __a, vector short __b) {
2064 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2069 static __inline__ vector bool short __attribute__((__always_inline__))
2070 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2071 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2076 static __inline__ vector bool int __attribute__((__always_inline__))
2077 vec_vcmpgtsw(vector int __a, vector int __b) {
2078 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2083 static __inline__ vector bool int __attribute__((__always_inline__))
2084 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2085 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2090 static __inline__ vector bool int __attribute__((__always_inline__))
2091 vec_vcmpgtfp(vector float __a, vector float __b) {
2092 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2097 static __inline__ vector bool char __ATTRS_o_ai
2098 vec_cmple(vector signed char __a, vector signed char __b) {
2099 return vec_cmpge(__b, __a);
2102 static __inline__ vector bool char __ATTRS_o_ai
2103 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2104 return vec_cmpge(__b, __a);
2107 static __inline__ vector bool short __ATTRS_o_ai
2108 vec_cmple(vector signed short __a, vector signed short __b) {
2109 return vec_cmpge(__b, __a);
2112 static __inline__ vector bool short __ATTRS_o_ai
2113 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2114 return vec_cmpge(__b, __a);
2117 static __inline__ vector bool int __ATTRS_o_ai
2118 vec_cmple(vector signed int __a, vector signed int __b) {
2119 return vec_cmpge(__b, __a);
2122 static __inline__ vector bool int __ATTRS_o_ai
2123 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2124 return vec_cmpge(__b, __a);
2127 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2129 return vec_cmpge(__b, __a);
2133 static __inline__ vector bool long long __ATTRS_o_ai
2134 vec_cmple(vector double __a, vector double __b) {
2135 return vec_cmpge(__b, __a);
2139 #ifdef __POWER8_VECTOR__
2140 static __inline__ vector bool long long __ATTRS_o_ai
2141 vec_cmple(vector signed long long __a, vector signed long long __b) {
2142 return vec_cmpge(__b, __a);
2145 static __inline__ vector bool long long __ATTRS_o_ai
2146 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2147 return vec_cmpge(__b, __a);
2153 static __inline__ vector bool char __ATTRS_o_ai
2154 vec_cmplt(vector signed char __a, vector signed char __b) {
2155 return vec_cmpgt(__b, __a);
2158 static __inline__ vector bool char __ATTRS_o_ai
2159 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2160 return vec_cmpgt(__b, __a);
2163 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2165 return vec_cmpgt(__b, __a);
2168 static __inline__ vector bool short __ATTRS_o_ai
2169 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2170 return vec_cmpgt(__b, __a);
2173 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2175 return vec_cmpgt(__b, __a);
2178 static __inline__ vector bool int __ATTRS_o_ai
2179 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2180 return vec_cmpgt(__b, __a);
2183 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2185 return vec_cmpgt(__b, __a);
2189 static __inline__ vector bool long long __ATTRS_o_ai
2190 vec_cmplt(vector double __a, vector double __b) {
2191 return vec_cmpgt(__b, __a);
2195 #ifdef __POWER8_VECTOR__
2196 static __inline__ vector bool long long __ATTRS_o_ai
2197 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2198 return vec_cmpgt(__b, __a);
2201 static __inline__ vector bool long long __ATTRS_o_ai
2202 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2203 return vec_cmpgt(__b, __a);
2208 static __inline__ vector signed char __ATTRS_o_ai
2209 vec_popcnt(vector signed char __a) {
2210 return __builtin_altivec_vpopcntb(__a);
2212 static __inline__ vector unsigned char __ATTRS_o_ai
2213 vec_popcnt(vector unsigned char __a) {
2214 return __builtin_altivec_vpopcntb(__a);
2216 static __inline__ vector signed short __ATTRS_o_ai
2217 vec_popcnt(vector signed short __a) {
2218 return __builtin_altivec_vpopcnth(__a);
2220 static __inline__ vector unsigned short __ATTRS_o_ai
2221 vec_popcnt(vector unsigned short __a) {
2222 return __builtin_altivec_vpopcnth(__a);
2224 static __inline__ vector signed int __ATTRS_o_ai
2225 vec_popcnt(vector signed int __a) {
2226 return __builtin_altivec_vpopcntw(__a);
2228 static __inline__ vector unsigned int __ATTRS_o_ai
2229 vec_popcnt(vector unsigned int __a) {
2230 return __builtin_altivec_vpopcntw(__a);
2232 static __inline__ vector signed long long __ATTRS_o_ai
2233 vec_popcnt(vector signed long long __a) {
2234 return __builtin_altivec_vpopcntd(__a);
2236 static __inline__ vector unsigned long long __ATTRS_o_ai
2237 vec_popcnt(vector unsigned long long __a) {
2238 return __builtin_altivec_vpopcntd(__a);
2243 static __inline__ vector signed char __ATTRS_o_ai
2244 vec_cntlz(vector signed char __a) {
2245 return __builtin_altivec_vclzb(__a);
2247 static __inline__ vector unsigned char __ATTRS_o_ai
2248 vec_cntlz(vector unsigned char __a) {
2249 return __builtin_altivec_vclzb(__a);
2251 static __inline__ vector signed short __ATTRS_o_ai
2252 vec_cntlz(vector signed short __a) {
2253 return __builtin_altivec_vclzh(__a);
2255 static __inline__ vector unsigned short __ATTRS_o_ai
2256 vec_cntlz(vector unsigned short __a) {
2257 return __builtin_altivec_vclzh(__a);
2259 static __inline__ vector signed int __ATTRS_o_ai
2260 vec_cntlz(vector signed int __a) {
2261 return __builtin_altivec_vclzw(__a);
2263 static __inline__ vector unsigned int __ATTRS_o_ai
2264 vec_cntlz(vector unsigned int __a) {
2265 return __builtin_altivec_vclzw(__a);
2267 static __inline__ vector signed long long __ATTRS_o_ai
2268 vec_cntlz(vector signed long long __a) {
2269 return __builtin_altivec_vclzd(__a);
2271 static __inline__ vector unsigned long long __ATTRS_o_ai
2272 vec_cntlz(vector unsigned long long __a) {
2273 return __builtin_altivec_vclzd(__a);
2277 #ifdef __POWER9_VECTOR__
2281 static __inline__ vector signed char __ATTRS_o_ai
2282 vec_cnttz(vector signed char __a) {
2283 return __builtin_altivec_vctzb(__a);
2285 static __inline__ vector unsigned char __ATTRS_o_ai
2286 vec_cnttz(vector unsigned char __a) {
2287 return __builtin_altivec_vctzb(__a);
2289 static __inline__ vector signed short __ATTRS_o_ai
2290 vec_cnttz(vector signed short __a) {
2291 return __builtin_altivec_vctzh(__a);
2293 static __inline__ vector unsigned short __ATTRS_o_ai
2294 vec_cnttz(vector unsigned short __a) {
2295 return __builtin_altivec_vctzh(__a);
2297 static __inline__ vector signed int __ATTRS_o_ai
2298 vec_cnttz(vector signed int __a) {
2299 return __builtin_altivec_vctzw(__a);
2301 static __inline__ vector unsigned int __ATTRS_o_ai
2302 vec_cnttz(vector unsigned int __a) {
2303 return __builtin_altivec_vctzw(__a);
2305 static __inline__ vector signed long long __ATTRS_o_ai
2306 vec_cnttz(vector signed long long __a) {
2307 return __builtin_altivec_vctzd(__a);
2309 static __inline__ vector unsigned long long __ATTRS_o_ai
2310 vec_cnttz(vector unsigned long long __a) {
2311 return __builtin_altivec_vctzd(__a);
2314 /* vec_first_match_index */
2316 static __inline__ unsigned __ATTRS_o_ai
2317 vec_first_match_index(vector signed char __a, vector signed char __b) {
2318 vector unsigned long long __res =
2319 #ifdef __LITTLE_ENDIAN__
2320 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2322 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2324 if (__res[0] == 64) {
2325 return (__res[1] + 64) >> 3;
2327 return __res[0] >> 3;
2330 static __inline__ unsigned __ATTRS_o_ai
2331 vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {
2332 vector unsigned long long __res =
2333 #ifdef __LITTLE_ENDIAN__
2334 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2336 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2338 if (__res[0] == 64) {
2339 return (__res[1] + 64) >> 3;
2341 return __res[0] >> 3;
2344 static __inline__ unsigned __ATTRS_o_ai
2345 vec_first_match_index(vector signed short __a, vector signed short __b) {
2346 vector unsigned long long __res =
2347 #ifdef __LITTLE_ENDIAN__
2348 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2350 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2352 if (__res[0] == 64) {
2353 return (__res[1] + 64) >> 4;
2355 return __res[0] >> 4;
2358 static __inline__ unsigned __ATTRS_o_ai
2359 vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2360 vector unsigned long long __res =
2361 #ifdef __LITTLE_ENDIAN__
2362 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2364 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2366 if (__res[0] == 64) {
2367 return (__res[1] + 64) >> 4;
2369 return __res[0] >> 4;
2372 static __inline__ unsigned __ATTRS_o_ai
2373 vec_first_match_index(vector signed int __a, vector signed int __b) {
2374 vector unsigned long long __res =
2375 #ifdef __LITTLE_ENDIAN__
2376 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2378 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2380 if (__res[0] == 64) {
2381 return (__res[1] + 64) >> 5;
2383 return __res[0] >> 5;
2386 static __inline__ unsigned __ATTRS_o_ai
2387 vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2388 vector unsigned long long __res =
2389 #ifdef __LITTLE_ENDIAN__
2390 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2392 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2394 if (__res[0] == 64) {
2395 return (__res[1] + 64) >> 5;
2397 return __res[0] >> 5;
2400 /* vec_first_match_or_eos_index */
2402 static __inline__ unsigned __ATTRS_o_ai
2403 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2404 /* Compare the result of the comparison of two vectors with either and OR the
2405 result. Either the elements are equal or one will equal the comparison
2406 result if either is zero.
2408 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2409 vector bool char __tmp2 = __tmp1 |
2410 vec_cmpeq((vector signed char)__tmp1, __a) |
2411 vec_cmpeq((vector signed char)__tmp1, __b);
2413 vector unsigned long long __res =
2414 #ifdef __LITTLE_ENDIAN__
2415 vec_cnttz((vector unsigned long long)__tmp2);
2417 vec_cntlz((vector unsigned long long)__tmp2);
2419 if (__res[0] == 64) {
2420 return (__res[1] + 64) >> 3;
2422 return __res[0] >> 3;
2425 static __inline__ unsigned __ATTRS_o_ai
2426 vec_first_match_or_eos_index(vector unsigned char __a,
2427 vector unsigned char __b) {
2428 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2429 vector bool char __tmp2 = __tmp1 |
2430 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2431 vec_cmpeq((vector unsigned char)__tmp1, __b);
2433 vector unsigned long long __res =
2434 #ifdef __LITTLE_ENDIAN__
2435 vec_cnttz((vector unsigned long long)__tmp2);
2437 vec_cntlz((vector unsigned long long)__tmp2);
2439 if (__res[0] == 64) {
2440 return (__res[1] + 64) >> 3;
2442 return __res[0] >> 3;
2445 static __inline__ unsigned __ATTRS_o_ai
2446 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2447 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2448 vector bool short __tmp2 = __tmp1 |
2449 vec_cmpeq((vector signed short)__tmp1, __a) |
2450 vec_cmpeq((vector signed short)__tmp1, __b);
2452 vector unsigned long long __res =
2453 #ifdef __LITTLE_ENDIAN__
2454 vec_cnttz((vector unsigned long long)__tmp2);
2456 vec_cntlz((vector unsigned long long)__tmp2);
2458 if (__res[0] == 64) {
2459 return (__res[1] + 64) >> 4;
2461 return __res[0] >> 4;
2464 static __inline__ unsigned __ATTRS_o_ai
2465 vec_first_match_or_eos_index(vector unsigned short __a,
2466 vector unsigned short __b) {
2467 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2468 vector bool short __tmp2 = __tmp1 |
2469 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2470 vec_cmpeq((vector unsigned short)__tmp1, __b);
2472 vector unsigned long long __res =
2473 #ifdef __LITTLE_ENDIAN__
2474 vec_cnttz((vector unsigned long long)__tmp2);
2476 vec_cntlz((vector unsigned long long)__tmp2);
2478 if (__res[0] == 64) {
2479 return (__res[1] + 64) >> 4;
2481 return __res[0] >> 4;
2484 static __inline__ unsigned __ATTRS_o_ai
2485 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2486 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2487 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2488 vec_cmpeq((vector signed int)__tmp1, __b);
2490 vector unsigned long long __res =
2491 #ifdef __LITTLE_ENDIAN__
2492 vec_cnttz((vector unsigned long long)__tmp2);
2494 vec_cntlz((vector unsigned long long)__tmp2);
2496 if (__res[0] == 64) {
2497 return (__res[1] + 64) >> 5;
2499 return __res[0] >> 5;
2502 static __inline__ unsigned __ATTRS_o_ai
2503 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2504 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2505 vector bool int __tmp2 = __tmp1 |
2506 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2507 vec_cmpeq((vector unsigned int)__tmp1, __b);
2509 vector unsigned long long __res =
2510 #ifdef __LITTLE_ENDIAN__
2511 vec_cnttz((vector unsigned long long)__tmp2);
2513 vec_cntlz((vector unsigned long long)__tmp2);
2515 if (__res[0] == 64) {
2516 return (__res[1] + 64) >> 5;
2518 return __res[0] >> 5;
2521 /* vec_first_mismatch_index */
2523 static __inline__ unsigned __ATTRS_o_ai
2524 vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2525 vector unsigned long long __res =
2526 #ifdef __LITTLE_ENDIAN__
2527 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2529 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2531 if (__res[0] == 64) {
2532 return (__res[1] + 64) >> 3;
2534 return __res[0] >> 3;
2537 static __inline__ unsigned __ATTRS_o_ai
2538 vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {
2539 vector unsigned long long __res =
2540 #ifdef __LITTLE_ENDIAN__
2541 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2543 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2545 if (__res[0] == 64) {
2546 return (__res[1] + 64) >> 3;
2548 return __res[0] >> 3;
2551 static __inline__ unsigned __ATTRS_o_ai
2552 vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2553 vector unsigned long long __res =
2554 #ifdef __LITTLE_ENDIAN__
2555 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2557 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2559 if (__res[0] == 64) {
2560 return (__res[1] + 64) >> 4;
2562 return __res[0] >> 4;
2565 static __inline__ unsigned __ATTRS_o_ai
2566 vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2567 vector unsigned long long __res =
2568 #ifdef __LITTLE_ENDIAN__
2569 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2571 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2573 if (__res[0] == 64) {
2574 return (__res[1] + 64) >> 4;
2576 return __res[0] >> 4;
2579 static __inline__ unsigned __ATTRS_o_ai
2580 vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2581 vector unsigned long long __res =
2582 #ifdef __LITTLE_ENDIAN__
2583 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2585 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2587 if (__res[0] == 64) {
2588 return (__res[1] + 64) >> 5;
2590 return __res[0] >> 5;
2593 static __inline__ unsigned __ATTRS_o_ai
2594 vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2595 vector unsigned long long __res =
2596 #ifdef __LITTLE_ENDIAN__
2597 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2599 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2601 if (__res[0] == 64) {
2602 return (__res[1] + 64) >> 5;
2604 return __res[0] >> 5;
2607 /* vec_first_mismatch_or_eos_index */
2609 static __inline__ unsigned __ATTRS_o_ai
2610 vec_first_mismatch_or_eos_index(vector signed char __a,
2611 vector signed char __b) {
2612 vector unsigned long long __res =
2613 #ifdef __LITTLE_ENDIAN__
2614 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2616 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2618 if (__res[0] == 64) {
2619 return (__res[1] + 64) >> 3;
2621 return __res[0] >> 3;
2624 static __inline__ unsigned __ATTRS_o_ai
2625 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2626 vector unsigned char __b) {
2627 vector unsigned long long __res =
2628 #ifdef __LITTLE_ENDIAN__
2629 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2631 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2633 if (__res[0] == 64) {
2634 return (__res[1] + 64) >> 3;
2636 return __res[0] >> 3;
2639 static __inline__ unsigned __ATTRS_o_ai
2640 vec_first_mismatch_or_eos_index(vector signed short __a,
2641 vector signed short __b) {
2642 vector unsigned long long __res =
2643 #ifdef __LITTLE_ENDIAN__
2644 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2646 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2648 if (__res[0] == 64) {
2649 return (__res[1] + 64) >> 4;
2651 return __res[0] >> 4;
2654 static __inline__ unsigned __ATTRS_o_ai
2655 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2656 vector unsigned short __b) {
2657 vector unsigned long long __res =
2658 #ifdef __LITTLE_ENDIAN__
2659 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2661 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2663 if (__res[0] == 64) {
2664 return (__res[1] + 64) >> 4;
2666 return __res[0] >> 4;
2669 static __inline__ unsigned __ATTRS_o_ai
2670 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2671 vector unsigned long long __res =
2672 #ifdef __LITTLE_ENDIAN__
2673 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2675 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2677 if (__res[0] == 64) {
2678 return (__res[1] + 64) >> 5;
2680 return __res[0] >> 5;
2683 static __inline__ unsigned __ATTRS_o_ai
2684 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2685 vector unsigned int __b) {
2686 vector unsigned long long __res =
2687 #ifdef __LITTLE_ENDIAN__
2688 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2690 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2692 if (__res[0] == 64) {
2693 return (__res[1] + 64) >> 5;
2695 return __res[0] >> 5;
2698 static __inline__ vector double __ATTRS_o_ai
2699 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2700 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2703 static __inline__ vector double __ATTRS_o_ai
2704 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2705 return __builtin_vsx_xviexpdp(__a,__b);
2708 static __inline__ vector float __ATTRS_o_ai
2709 vec_insert_exp(vector float __a, vector unsigned int __b) {
2710 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2713 static __inline__ vector float __ATTRS_o_ai
2714 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2715 return __builtin_vsx_xviexpsp(__a,__b);
2718 #if defined(__powerpc64__)
2719 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(signed char *__a,
2721 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2724 static __inline__ vector unsigned char __ATTRS_o_ai
2725 vec_xl_len(unsigned char *__a, size_t __b) {
2726 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2729 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(signed short *__a,
2731 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2734 static __inline__ vector unsigned short __ATTRS_o_ai
2735 vec_xl_len(unsigned short *__a, size_t __b) {
2736 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2739 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(signed int *__a,
2741 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2744 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(unsigned int *__a,
2746 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2749 static __inline__ vector float __ATTRS_o_ai vec_xl_len(float *__a, size_t __b) {
2750 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2753 static __inline__ vector signed __int128 __ATTRS_o_ai
2754 vec_xl_len(signed __int128 *__a, size_t __b) {
2755 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2758 static __inline__ vector unsigned __int128 __ATTRS_o_ai
2759 vec_xl_len(unsigned __int128 *__a, size_t __b) {
2760 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2763 static __inline__ vector signed long long __ATTRS_o_ai
2764 vec_xl_len(signed long long *__a, size_t __b) {
2765 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2768 static __inline__ vector unsigned long long __ATTRS_o_ai
2769 vec_xl_len(unsigned long long *__a, size_t __b) {
2770 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2773 static __inline__ vector double __ATTRS_o_ai vec_xl_len(double *__a,
2775 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2778 static __inline__ vector double __ATTRS_o_ai vec_xl_len_r(unsigned char *__a,
2780 vector unsigned char __res =
2781 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2782 #ifdef __LITTLE_ENDIAN__
2783 vector unsigned char __mask =
2784 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2785 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2786 (vector int)__res, (vector int)__res, __mask);
2792 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2795 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2798 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2799 signed char *__b, size_t __c) {
2800 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2803 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2804 signed short *__b, size_t __c) {
2805 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2808 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2809 unsigned short *__b,
2811 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2814 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2815 signed int *__b, size_t __c) {
2816 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2819 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2820 unsigned int *__b, size_t __c) {
2821 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2824 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2826 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2829 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2830 signed __int128 *__b,
2832 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2835 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2836 unsigned __int128 *__b,
2838 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2841 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2842 signed long long *__b,
2844 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2847 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2848 unsigned long long *__b,
2850 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2853 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2855 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2858 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2861 #ifdef __LITTLE_ENDIAN__
2862 vector unsigned char __mask =
2863 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2864 vector unsigned char __res =
2865 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2866 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2868 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2877 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2879 return __builtin_vsx_xvcpsgnsp(__a, __b);
2882 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2883 vector double __b) {
2884 return __builtin_vsx_xvcpsgndp(__a, __b);
2890 static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {
2891 return __builtin_altivec_vcfsx(__a, __b);
2894 static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a,
2896 return __builtin_altivec_vcfux((vector int)__a, __b);
2900 static __inline__ vector double __ATTRS_o_ai
2901 vec_ctf(vector unsigned long long __a, int __b) {
2902 vector double __ret = __builtin_convertvector(__a, vector double);
2903 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
2907 static __inline__ vector double __ATTRS_o_ai
2908 vec_ctf(vector signed long long __a, int __b) {
2909 vector double __ret = __builtin_convertvector(__a, vector double);
2910 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
2917 static __inline__ vector float __attribute__((__always_inline__))
2918 vec_vcfsx(vector int __a, int __b) {
2919 return __builtin_altivec_vcfsx(__a, __b);
2924 static __inline__ vector float __attribute__((__always_inline__))
2925 vec_vcfux(vector unsigned int __a, int __b) {
2926 return __builtin_altivec_vcfux((vector int)__a, __b);
2931 static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) {
2932 return __builtin_altivec_vctsxs(__a, __b);
2936 static __inline__ vector signed long long __ATTRS_o_ai
2937 vec_cts(vector double __a, int __b) {
2938 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2939 return __builtin_convertvector(__a, vector signed long long);
2945 static __inline__ vector int __attribute__((__always_inline__))
2946 vec_vctsxs(vector float __a, int __b) {
2947 return __builtin_altivec_vctsxs(__a, __b);
2952 static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a,
2954 return __builtin_altivec_vctuxs(__a, __b);
2958 static __inline__ vector unsigned long long __ATTRS_o_ai
2959 vec_ctu(vector double __a, int __b) {
2960 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2961 return __builtin_convertvector(__a, vector unsigned long long);
2967 static __inline__ vector unsigned int __attribute__((__always_inline__))
2968 vec_vctuxs(vector float __a, int __b) {
2969 return __builtin_altivec_vctuxs(__a, __b);
2974 static __inline__ vector signed int __ATTRS_o_ai
2975 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2977 static __inline__ vector signed int __ATTRS_o_ai
2978 vec_signed(vector float __a) {
2979 return __builtin_convertvector(__a, vector signed int);
2983 static __inline__ vector signed long long __ATTRS_o_ai
2984 vec_signed(vector double __a) {
2985 return __builtin_convertvector(__a, vector signed long long);
2988 static __inline__ vector signed int __attribute__((__always_inline__))
2989 vec_signed2(vector double __a, vector double __b) {
2990 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2993 static __inline__ vector signed int __ATTRS_o_ai
2994 vec_signede(vector double __a) {
2995 #ifdef __LITTLE_ENDIAN__
2996 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2997 return vec_sld(__ret, __ret, 12);
2999 return __builtin_vsx_xvcvdpsxws(__a);
3003 static __inline__ vector signed int __ATTRS_o_ai
3004 vec_signedo(vector double __a) {
3005 #ifdef __LITTLE_ENDIAN__
3006 return __builtin_vsx_xvcvdpsxws(__a);
3008 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3009 return vec_sld(__ret, __ret, 12);
3016 static __inline__ vector unsigned int __ATTRS_o_ai
3017 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3019 static __inline__ vector unsigned int __ATTRS_o_ai
3020 vec_unsigned(vector float __a) {
3021 return __builtin_convertvector(__a, vector unsigned int);
3025 static __inline__ vector unsigned long long __ATTRS_o_ai
3026 vec_unsigned(vector double __a) {
3027 return __builtin_convertvector(__a, vector unsigned long long);
3030 static __inline__ vector unsigned int __attribute__((__always_inline__))
3031 vec_unsigned2(vector double __a, vector double __b) {
3032 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3035 static __inline__ vector unsigned int __ATTRS_o_ai
3036 vec_unsignede(vector double __a) {
3037 #ifdef __LITTLE_ENDIAN__
3038 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3039 return vec_sld(__ret, __ret, 12);
3041 return __builtin_vsx_xvcvdpuxws(__a);
3045 static __inline__ vector unsigned int __ATTRS_o_ai
3046 vec_unsignedo(vector double __a) {
3047 #ifdef __LITTLE_ENDIAN__
3048 return __builtin_vsx_xvcvdpuxws(__a);
3050 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3051 return vec_sld(__ret, __ret, 12);
3058 static __inline__ vector float __ATTRS_o_ai
3059 vec_sld(vector float, vector float, unsigned const int __c);
3061 static __inline__ vector float __ATTRS_o_ai
3062 vec_float(vector signed int __a) {
3063 return __builtin_convertvector(__a, vector float);
3066 static __inline__ vector float __ATTRS_o_ai
3067 vec_float(vector unsigned int __a) {
3068 return __builtin_convertvector(__a, vector float);
3072 static __inline__ vector float __ATTRS_o_ai
3073 vec_float2(vector signed long long __a, vector signed long long __b) {
3074 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3077 static __inline__ vector float __ATTRS_o_ai
3078 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3079 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3082 static __inline__ vector float __ATTRS_o_ai
3083 vec_float2(vector double __a, vector double __b) {
3084 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3087 static __inline__ vector float __ATTRS_o_ai
3088 vec_floate(vector signed long long __a) {
3089 #ifdef __LITTLE_ENDIAN__
3090 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3091 return vec_sld(__ret, __ret, 12);
3093 return __builtin_vsx_xvcvsxdsp(__a);
3097 static __inline__ vector float __ATTRS_o_ai
3098 vec_floate(vector unsigned long long __a) {
3099 #ifdef __LITTLE_ENDIAN__
3100 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3101 return vec_sld(__ret, __ret, 12);
3103 return __builtin_vsx_xvcvuxdsp(__a);
3107 static __inline__ vector float __ATTRS_o_ai
3108 vec_floate(vector double __a) {
3109 #ifdef __LITTLE_ENDIAN__
3110 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3111 return vec_sld(__ret, __ret, 12);
3113 return __builtin_vsx_xvcvdpsp(__a);
3117 static __inline__ vector float __ATTRS_o_ai
3118 vec_floato(vector signed long long __a) {
3119 #ifdef __LITTLE_ENDIAN__
3120 return __builtin_vsx_xvcvsxdsp(__a);
3122 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3123 return vec_sld(__ret, __ret, 12);
3127 static __inline__ vector float __ATTRS_o_ai
3128 vec_floato(vector unsigned long long __a) {
3129 #ifdef __LITTLE_ENDIAN__
3130 return __builtin_vsx_xvcvuxdsp(__a);
3132 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3133 return vec_sld(__ret, __ret, 12);
3137 static __inline__ vector float __ATTRS_o_ai
3138 vec_floato(vector double __a) {
3139 #ifdef __LITTLE_ENDIAN__
3140 return __builtin_vsx_xvcvdpsp(__a);
3142 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3143 return vec_sld(__ret, __ret, 12);
3151 static __inline__ vector double __ATTRS_o_ai
3152 vec_double(vector signed long long __a) {
3153 return __builtin_convertvector(__a, vector double);
3156 static __inline__ vector double __ATTRS_o_ai
3157 vec_double(vector unsigned long long __a) {
3158 return __builtin_convertvector(__a, vector double);
3161 static __inline__ vector double __ATTRS_o_ai
3162 vec_doublee(vector signed int __a) {
3163 #ifdef __LITTLE_ENDIAN__
3164 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3166 return __builtin_vsx_xvcvsxwdp(__a);
3170 static __inline__ vector double __ATTRS_o_ai
3171 vec_doublee(vector unsigned int __a) {
3172 #ifdef __LITTLE_ENDIAN__
3173 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3175 return __builtin_vsx_xvcvuxwdp(__a);
3179 static __inline__ vector double __ATTRS_o_ai
3180 vec_doublee(vector float __a) {
3181 #ifdef __LITTLE_ENDIAN__
3182 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3184 return __builtin_vsx_xvcvspdp(__a);
3188 static __inline__ vector double __ATTRS_o_ai
3189 vec_doubleh(vector signed int __a) {
3190 vector double __ret = {__a[0], __a[1]};
3194 static __inline__ vector double __ATTRS_o_ai
3195 vec_doubleh(vector unsigned int __a) {
3196 vector double __ret = {__a[0], __a[1]};
3200 static __inline__ vector double __ATTRS_o_ai
3201 vec_doubleh(vector float __a) {
3202 vector double __ret = {__a[0], __a[1]};
3206 static __inline__ vector double __ATTRS_o_ai
3207 vec_doublel(vector signed int __a) {
3208 vector double __ret = {__a[2], __a[3]};
3212 static __inline__ vector double __ATTRS_o_ai
3213 vec_doublel(vector unsigned int __a) {
3214 vector double __ret = {__a[2], __a[3]};
3218 static __inline__ vector double __ATTRS_o_ai
3219 vec_doublel(vector float __a) {
3220 vector double __ret = {__a[2], __a[3]};
3224 static __inline__ vector double __ATTRS_o_ai
3225 vec_doubleo(vector signed int __a) {
3226 #ifdef __LITTLE_ENDIAN__
3227 return __builtin_vsx_xvcvsxwdp(__a);
3229 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3233 static __inline__ vector double __ATTRS_o_ai
3234 vec_doubleo(vector unsigned int __a) {
3235 #ifdef __LITTLE_ENDIAN__
3236 return __builtin_vsx_xvcvuxwdp(__a);
3238 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3242 static __inline__ vector double __ATTRS_o_ai
3243 vec_doubleo(vector float __a) {
3244 #ifdef __LITTLE_ENDIAN__
3245 return __builtin_vsx_xvcvspdp(__a);
3247 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3254 /* Integer vector divides (vectors are scalarized, elements divided
3255 and the vectors reassembled).
3257 static __inline__ vector signed char __ATTRS_o_ai
3258 vec_div(vector signed char __a, vector signed char __b) {
3262 static __inline__ vector unsigned char __ATTRS_o_ai
3263 vec_div(vector unsigned char __a, vector unsigned char __b) {
3267 static __inline__ vector signed short __ATTRS_o_ai
3268 vec_div(vector signed short __a, vector signed short __b) {
3272 static __inline__ vector unsigned short __ATTRS_o_ai
3273 vec_div(vector unsigned short __a, vector unsigned short __b) {
3277 static __inline__ vector signed int __ATTRS_o_ai
3278 vec_div(vector signed int __a, vector signed int __b) {
3282 static __inline__ vector unsigned int __ATTRS_o_ai
3283 vec_div(vector unsigned int __a, vector unsigned int __b) {
3288 static __inline__ vector signed long long __ATTRS_o_ai
3289 vec_div(vector signed long long __a, vector signed long long __b) {
3293 static __inline__ vector unsigned long long __ATTRS_o_ai
3294 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3298 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3303 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3304 vector double __b) {
3311 static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
3312 __builtin_altivec_dss(__a);
3317 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3318 __builtin_altivec_dssall();
3322 #define vec_dst(__PTR, __CW, __STR) \
3324 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3327 #define vec_dstst(__PTR, __CW, __STR) \
3329 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3332 #define vec_dststt(__PTR, __CW, __STR) \
3334 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3337 #define vec_dstt(__PTR, __CW, __STR) \
3339 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3343 #ifdef __POWER8_VECTOR__
3344 static __inline__ vector signed char __ATTRS_o_ai
3345 vec_eqv(vector signed char __a, vector signed char __b) {
3346 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3347 (vector unsigned int)__b);
3350 static __inline__ vector unsigned char __ATTRS_o_ai
3351 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3352 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3353 (vector unsigned int)__b);
3356 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3357 vector bool char __b) {
3358 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3359 (vector unsigned int)__b);
3362 static __inline__ vector signed short __ATTRS_o_ai
3363 vec_eqv(vector signed short __a, vector signed short __b) {
3364 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3365 (vector unsigned int)__b);
3368 static __inline__ vector unsigned short __ATTRS_o_ai
3369 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3370 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3371 (vector unsigned int)__b);
3374 static __inline__ vector bool short __ATTRS_o_ai
3375 vec_eqv(vector bool short __a, vector bool short __b) {
3376 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3377 (vector unsigned int)__b);
3380 static __inline__ vector signed int __ATTRS_o_ai
3381 vec_eqv(vector signed int __a, vector signed int __b) {
3382 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3383 (vector unsigned int)__b);
3386 static __inline__ vector unsigned int __ATTRS_o_ai
3387 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3388 return __builtin_vsx_xxleqv(__a, __b);
3391 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3392 vector bool int __b) {
3393 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3394 (vector unsigned int)__b);
3397 static __inline__ vector signed long long __ATTRS_o_ai
3398 vec_eqv(vector signed long long __a, vector signed long long __b) {
3399 return (vector signed long long)__builtin_vsx_xxleqv(
3400 (vector unsigned int)__a, (vector unsigned int)__b);
3403 static __inline__ vector unsigned long long __ATTRS_o_ai
3404 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3405 return (vector unsigned long long)__builtin_vsx_xxleqv(
3406 (vector unsigned int)__a, (vector unsigned int)__b);
3409 static __inline__ vector bool long long __ATTRS_o_ai
3410 vec_eqv(vector bool long long __a, vector bool long long __b) {
3411 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3412 (vector unsigned int)__b);
3415 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3417 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3418 (vector unsigned int)__b);
3421 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3422 vector double __b) {
3423 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3424 (vector unsigned int)__b);
3430 static __inline__ vector float __attribute__((__always_inline__))
3431 vec_expte(vector float __a) {
3432 return __builtin_altivec_vexptefp(__a);
3437 static __inline__ vector float __attribute__((__always_inline__))
3438 vec_vexptefp(vector float __a) {
3439 return __builtin_altivec_vexptefp(__a);
3444 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3446 return __builtin_vsx_xvrspim(__a);
3448 return __builtin_altivec_vrfim(__a);
3453 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3454 return __builtin_vsx_xvrdpim(__a);
3460 static __inline__ vector float __attribute__((__always_inline__))
3461 vec_vrfim(vector float __a) {
3462 return __builtin_altivec_vrfim(__a);
3467 static __inline__ vector signed char __ATTRS_o_ai
3468 vec_ld(int __a, const vector signed char *__b) {
3469 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3472 static __inline__ vector signed char __ATTRS_o_ai
3473 vec_ld(int __a, const signed char *__b) {
3474 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3477 static __inline__ vector unsigned char __ATTRS_o_ai
3478 vec_ld(int __a, const vector unsigned char *__b) {
3479 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3482 static __inline__ vector unsigned char __ATTRS_o_ai
3483 vec_ld(int __a, const unsigned char *__b) {
3484 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3487 static __inline__ vector bool char __ATTRS_o_ai
3488 vec_ld(int __a, const vector bool char *__b) {
3489 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3492 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3493 const vector short *__b) {
3494 return (vector short)__builtin_altivec_lvx(__a, __b);
3497 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3498 return (vector short)__builtin_altivec_lvx(__a, __b);
3501 static __inline__ vector unsigned short __ATTRS_o_ai
3502 vec_ld(int __a, const vector unsigned short *__b) {
3503 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3506 static __inline__ vector unsigned short __ATTRS_o_ai
3507 vec_ld(int __a, const unsigned short *__b) {
3508 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3511 static __inline__ vector bool short __ATTRS_o_ai
3512 vec_ld(int __a, const vector bool short *__b) {
3513 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3516 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3517 const vector pixel *__b) {
3518 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3521 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3522 const vector int *__b) {
3523 return (vector int)__builtin_altivec_lvx(__a, __b);
3526 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3527 return (vector int)__builtin_altivec_lvx(__a, __b);
3530 static __inline__ vector unsigned int __ATTRS_o_ai
3531 vec_ld(int __a, const vector unsigned int *__b) {
3532 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3535 static __inline__ vector unsigned int __ATTRS_o_ai
3536 vec_ld(int __a, const unsigned int *__b) {
3537 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3540 static __inline__ vector bool int __ATTRS_o_ai
3541 vec_ld(int __a, const vector bool int *__b) {
3542 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3545 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3546 const vector float *__b) {
3547 return (vector float)__builtin_altivec_lvx(__a, __b);
3550 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3551 return (vector float)__builtin_altivec_lvx(__a, __b);
3556 static __inline__ vector signed char __ATTRS_o_ai
3557 vec_lvx(int __a, const vector signed char *__b) {
3558 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3561 static __inline__ vector signed char __ATTRS_o_ai
3562 vec_lvx(int __a, const signed char *__b) {
3563 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3566 static __inline__ vector unsigned char __ATTRS_o_ai
3567 vec_lvx(int __a, const vector unsigned char *__b) {
3568 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3571 static __inline__ vector unsigned char __ATTRS_o_ai
3572 vec_lvx(int __a, const unsigned char *__b) {
3573 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3576 static __inline__ vector bool char __ATTRS_o_ai
3577 vec_lvx(int __a, const vector bool char *__b) {
3578 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3581 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3582 const vector short *__b) {
3583 return (vector short)__builtin_altivec_lvx(__a, __b);
3586 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3587 return (vector short)__builtin_altivec_lvx(__a, __b);
3590 static __inline__ vector unsigned short __ATTRS_o_ai
3591 vec_lvx(int __a, const vector unsigned short *__b) {
3592 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3595 static __inline__ vector unsigned short __ATTRS_o_ai
3596 vec_lvx(int __a, const unsigned short *__b) {
3597 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3600 static __inline__ vector bool short __ATTRS_o_ai
3601 vec_lvx(int __a, const vector bool short *__b) {
3602 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3605 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3606 const vector pixel *__b) {
3607 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3610 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3611 const vector int *__b) {
3612 return (vector int)__builtin_altivec_lvx(__a, __b);
3615 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3616 return (vector int)__builtin_altivec_lvx(__a, __b);
3619 static __inline__ vector unsigned int __ATTRS_o_ai
3620 vec_lvx(int __a, const vector unsigned int *__b) {
3621 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3624 static __inline__ vector unsigned int __ATTRS_o_ai
3625 vec_lvx(int __a, const unsigned int *__b) {
3626 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3629 static __inline__ vector bool int __ATTRS_o_ai
3630 vec_lvx(int __a, const vector bool int *__b) {
3631 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3634 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3635 const vector float *__b) {
3636 return (vector float)__builtin_altivec_lvx(__a, __b);
3639 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3640 return (vector float)__builtin_altivec_lvx(__a, __b);
3645 static __inline__ vector signed char __ATTRS_o_ai
3646 vec_lde(int __a, const signed char *__b) {
3647 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3650 static __inline__ vector unsigned char __ATTRS_o_ai
3651 vec_lde(int __a, const unsigned char *__b) {
3652 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3655 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3656 return (vector short)__builtin_altivec_lvehx(__a, __b);
3659 static __inline__ vector unsigned short __ATTRS_o_ai
3660 vec_lde(int __a, const unsigned short *__b) {
3661 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3664 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3665 return (vector int)__builtin_altivec_lvewx(__a, __b);
3668 static __inline__ vector unsigned int __ATTRS_o_ai
3669 vec_lde(int __a, const unsigned int *__b) {
3670 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3673 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3674 return (vector float)__builtin_altivec_lvewx(__a, __b);
3679 static __inline__ vector signed char __ATTRS_o_ai
3680 vec_lvebx(int __a, const signed char *__b) {
3681 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3684 static __inline__ vector unsigned char __ATTRS_o_ai
3685 vec_lvebx(int __a, const unsigned char *__b) {
3686 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3691 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3693 return (vector short)__builtin_altivec_lvehx(__a, __b);
3696 static __inline__ vector unsigned short __ATTRS_o_ai
3697 vec_lvehx(int __a, const unsigned short *__b) {
3698 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3703 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3704 return (vector int)__builtin_altivec_lvewx(__a, __b);
3707 static __inline__ vector unsigned int __ATTRS_o_ai
3708 vec_lvewx(int __a, const unsigned int *__b) {
3709 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3712 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3714 return (vector float)__builtin_altivec_lvewx(__a, __b);
3719 static __inline__ vector signed char __ATTRS_o_ai
3720 vec_ldl(int __a, const vector signed char *__b) {
3721 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3724 static __inline__ vector signed char __ATTRS_o_ai
3725 vec_ldl(int __a, const signed char *__b) {
3726 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3729 static __inline__ vector unsigned char __ATTRS_o_ai
3730 vec_ldl(int __a, const vector unsigned char *__b) {
3731 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3734 static __inline__ vector unsigned char __ATTRS_o_ai
3735 vec_ldl(int __a, const unsigned char *__b) {
3736 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3739 static __inline__ vector bool char __ATTRS_o_ai
3740 vec_ldl(int __a, const vector bool char *__b) {
3741 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3744 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3745 const vector short *__b) {
3746 return (vector short)__builtin_altivec_lvxl(__a, __b);
3749 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3750 return (vector short)__builtin_altivec_lvxl(__a, __b);
3753 static __inline__ vector unsigned short __ATTRS_o_ai
3754 vec_ldl(int __a, const vector unsigned short *__b) {
3755 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3758 static __inline__ vector unsigned short __ATTRS_o_ai
3759 vec_ldl(int __a, const unsigned short *__b) {
3760 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3763 static __inline__ vector bool short __ATTRS_o_ai
3764 vec_ldl(int __a, const vector bool short *__b) {
3765 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3768 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3769 const vector pixel *__b) {
3770 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3773 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3774 const vector int *__b) {
3775 return (vector int)__builtin_altivec_lvxl(__a, __b);
3778 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3779 return (vector int)__builtin_altivec_lvxl(__a, __b);
3782 static __inline__ vector unsigned int __ATTRS_o_ai
3783 vec_ldl(int __a, const vector unsigned int *__b) {
3784 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3787 static __inline__ vector unsigned int __ATTRS_o_ai
3788 vec_ldl(int __a, const unsigned int *__b) {
3789 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3792 static __inline__ vector bool int __ATTRS_o_ai
3793 vec_ldl(int __a, const vector bool int *__b) {
3794 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3797 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3798 const vector float *__b) {
3799 return (vector float)__builtin_altivec_lvxl(__a, __b);
3802 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3803 return (vector float)__builtin_altivec_lvxl(__a, __b);
3808 static __inline__ vector signed char __ATTRS_o_ai
3809 vec_lvxl(int __a, const vector signed char *__b) {
3810 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3813 static __inline__ vector signed char __ATTRS_o_ai
3814 vec_lvxl(int __a, const signed char *__b) {
3815 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3818 static __inline__ vector unsigned char __ATTRS_o_ai
3819 vec_lvxl(int __a, const vector unsigned char *__b) {
3820 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3823 static __inline__ vector unsigned char __ATTRS_o_ai
3824 vec_lvxl(int __a, const unsigned char *__b) {
3825 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3828 static __inline__ vector bool char __ATTRS_o_ai
3829 vec_lvxl(int __a, const vector bool char *__b) {
3830 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3833 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3834 const vector short *__b) {
3835 return (vector short)__builtin_altivec_lvxl(__a, __b);
3838 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3840 return (vector short)__builtin_altivec_lvxl(__a, __b);
3843 static __inline__ vector unsigned short __ATTRS_o_ai
3844 vec_lvxl(int __a, const vector unsigned short *__b) {
3845 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3848 static __inline__ vector unsigned short __ATTRS_o_ai
3849 vec_lvxl(int __a, const unsigned short *__b) {
3850 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3853 static __inline__ vector bool short __ATTRS_o_ai
3854 vec_lvxl(int __a, const vector bool short *__b) {
3855 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3858 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3859 const vector pixel *__b) {
3860 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3863 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3864 const vector int *__b) {
3865 return (vector int)__builtin_altivec_lvxl(__a, __b);
3868 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3869 return (vector int)__builtin_altivec_lvxl(__a, __b);
3872 static __inline__ vector unsigned int __ATTRS_o_ai
3873 vec_lvxl(int __a, const vector unsigned int *__b) {
3874 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3877 static __inline__ vector unsigned int __ATTRS_o_ai
3878 vec_lvxl(int __a, const unsigned int *__b) {
3879 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3882 static __inline__ vector bool int __ATTRS_o_ai
3883 vec_lvxl(int __a, const vector bool int *__b) {
3884 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3887 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3888 const vector float *__b) {
3889 return (vector float)__builtin_altivec_lvxl(__a, __b);
3892 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3894 return (vector float)__builtin_altivec_lvxl(__a, __b);
3899 static __inline__ vector float __attribute__((__always_inline__))
3900 vec_loge(vector float __a) {
3901 return __builtin_altivec_vlogefp(__a);
3906 static __inline__ vector float __attribute__((__always_inline__))
3907 vec_vlogefp(vector float __a) {
3908 return __builtin_altivec_vlogefp(__a);
3913 #ifdef __LITTLE_ENDIAN__
3914 static __inline__ vector unsigned char __ATTRS_o_ai
3915 __attribute__((__deprecated__("use assignment for unaligned little endian \
3916 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3917 vector unsigned char mask =
3918 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3919 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3920 7, 6, 5, 4, 3, 2, 1, 0};
3921 return vec_perm(mask, mask, reverse);
3924 static __inline__ vector unsigned char __ATTRS_o_ai
3925 vec_lvsl(int __a, const signed char *__b) {
3926 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3930 #ifdef __LITTLE_ENDIAN__
3931 static __inline__ vector unsigned char __ATTRS_o_ai
3932 __attribute__((__deprecated__("use assignment for unaligned little endian \
3933 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3934 vector unsigned char mask =
3935 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3936 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3937 7, 6, 5, 4, 3, 2, 1, 0};
3938 return vec_perm(mask, mask, reverse);
3941 static __inline__ vector unsigned char __ATTRS_o_ai
3942 vec_lvsl(int __a, const unsigned char *__b) {
3943 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3947 #ifdef __LITTLE_ENDIAN__
3948 static __inline__ vector unsigned char __ATTRS_o_ai
3949 __attribute__((__deprecated__("use assignment for unaligned little endian \
3950 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3951 vector unsigned char mask =
3952 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3953 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3954 7, 6, 5, 4, 3, 2, 1, 0};
3955 return vec_perm(mask, mask, reverse);
3958 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3960 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3964 #ifdef __LITTLE_ENDIAN__
3965 static __inline__ vector unsigned char __ATTRS_o_ai
3966 __attribute__((__deprecated__("use assignment for unaligned little endian \
3967 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3968 vector unsigned char mask =
3969 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3970 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3971 7, 6, 5, 4, 3, 2, 1, 0};
3972 return vec_perm(mask, mask, reverse);
3975 static __inline__ vector unsigned char __ATTRS_o_ai
3976 vec_lvsl(int __a, const unsigned short *__b) {
3977 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3981 #ifdef __LITTLE_ENDIAN__
3982 static __inline__ vector unsigned char __ATTRS_o_ai
3983 __attribute__((__deprecated__("use assignment for unaligned little endian \
3984 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3985 vector unsigned char mask =
3986 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3987 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3988 7, 6, 5, 4, 3, 2, 1, 0};
3989 return vec_perm(mask, mask, reverse);
3992 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3994 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3998 #ifdef __LITTLE_ENDIAN__
3999 static __inline__ vector unsigned char __ATTRS_o_ai
4000 __attribute__((__deprecated__("use assignment for unaligned little endian \
4001 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
4002 vector unsigned char mask =
4003 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4004 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4005 7, 6, 5, 4, 3, 2, 1, 0};
4006 return vec_perm(mask, mask, reverse);
4009 static __inline__ vector unsigned char __ATTRS_o_ai
4010 vec_lvsl(int __a, const unsigned int *__b) {
4011 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4015 #ifdef __LITTLE_ENDIAN__
4016 static __inline__ vector unsigned char __ATTRS_o_ai
4017 __attribute__((__deprecated__("use assignment for unaligned little endian \
4018 loads/stores"))) vec_lvsl(int __a, const float *__b) {
4019 vector unsigned char mask =
4020 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4021 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4022 7, 6, 5, 4, 3, 2, 1, 0};
4023 return vec_perm(mask, mask, reverse);
4026 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4028 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_lvsr(int __a, const signed char *__b) {
4038 vector unsigned char mask =
4039 (vector unsigned char)__builtin_altivec_lvsr(__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_lvsr(int __a, const signed char *__b) {
4047 return (vector unsigned char)__builtin_altivec_lvsr(__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_lvsr(int __a, const unsigned char *__b) {
4055 vector unsigned char mask =
4056 (vector unsigned char)__builtin_altivec_lvsr(__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
4063 vec_lvsr(int __a, const unsigned char *__b) {
4064 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4068 #ifdef __LITTLE_ENDIAN__
4069 static __inline__ vector unsigned char __ATTRS_o_ai
4070 __attribute__((__deprecated__("use assignment for unaligned little endian \
4071 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4072 vector unsigned char mask =
4073 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4074 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4075 7, 6, 5, 4, 3, 2, 1, 0};
4076 return vec_perm(mask, mask, reverse);
4079 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4081 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4085 #ifdef __LITTLE_ENDIAN__
4086 static __inline__ vector unsigned char __ATTRS_o_ai
4087 __attribute__((__deprecated__("use assignment for unaligned little endian \
4088 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4089 vector unsigned char mask =
4090 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4091 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4092 7, 6, 5, 4, 3, 2, 1, 0};
4093 return vec_perm(mask, mask, reverse);
4096 static __inline__ vector unsigned char __ATTRS_o_ai
4097 vec_lvsr(int __a, const unsigned short *__b) {
4098 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4102 #ifdef __LITTLE_ENDIAN__
4103 static __inline__ vector unsigned char __ATTRS_o_ai
4104 __attribute__((__deprecated__("use assignment for unaligned little endian \
4105 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4106 vector unsigned char mask =
4107 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4108 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4109 7, 6, 5, 4, 3, 2, 1, 0};
4110 return vec_perm(mask, mask, reverse);
4113 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4115 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4119 #ifdef __LITTLE_ENDIAN__
4120 static __inline__ vector unsigned char __ATTRS_o_ai
4121 __attribute__((__deprecated__("use assignment for unaligned little endian \
4122 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4123 vector unsigned char mask =
4124 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4125 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4126 7, 6, 5, 4, 3, 2, 1, 0};
4127 return vec_perm(mask, mask, reverse);
4130 static __inline__ vector unsigned char __ATTRS_o_ai
4131 vec_lvsr(int __a, const unsigned int *__b) {
4132 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4136 #ifdef __LITTLE_ENDIAN__
4137 static __inline__ vector unsigned char __ATTRS_o_ai
4138 __attribute__((__deprecated__("use assignment for unaligned little endian \
4139 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4140 vector unsigned char mask =
4141 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4142 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4143 7, 6, 5, 4, 3, 2, 1, 0};
4144 return vec_perm(mask, mask, reverse);
4147 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4149 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4154 static __inline__ vector signed short __ATTRS_o_ai
4155 vec_mladd(vector signed short, vector signed short, vector signed short);
4156 static __inline__ vector signed short __ATTRS_o_ai
4157 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4158 static __inline__ vector signed short __ATTRS_o_ai
4159 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4160 static __inline__ vector unsigned short __ATTRS_o_ai
4161 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4163 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4164 vector signed short __a, vector signed short __b, vector signed short __c) {
4165 return vec_mladd(__a, __b, __c);
4168 static __inline__ vector signed short __ATTRS_o_ai
4169 vec_madd(vector signed short __a, vector unsigned short __b,
4170 vector unsigned short __c) {
4171 return vec_mladd(__a, __b, __c);
4174 static __inline__ vector signed short __ATTRS_o_ai
4175 vec_madd(vector unsigned short __a, vector signed short __b,
4176 vector signed short __c) {
4177 return vec_mladd(__a, __b, __c);
4180 static __inline__ vector unsigned short __ATTRS_o_ai
4181 vec_madd(vector unsigned short __a, vector unsigned short __b,
4182 vector unsigned short __c) {
4183 return vec_mladd(__a, __b, __c);
4186 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4190 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4192 return __builtin_altivec_vmaddfp(__a, __b, __c);
4197 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4199 vector double __c) {
4200 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4206 static __inline__ vector float __attribute__((__always_inline__))
4207 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4208 return __builtin_altivec_vmaddfp(__a, __b, __c);
4213 static __inline__ vector signed short __attribute__((__always_inline__))
4214 vec_madds(vector signed short __a, vector signed short __b,
4215 vector signed short __c) {
4216 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4220 static __inline__ vector signed short __attribute__((__always_inline__))
4221 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4222 vector signed short __c) {
4223 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4229 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4232 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4235 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4237 vector double __c) {
4238 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4244 static __inline__ vector signed char __ATTRS_o_ai
4245 vec_max(vector signed char __a, vector signed char __b) {
4246 return __builtin_altivec_vmaxsb(__a, __b);
4249 static __inline__ vector signed char __ATTRS_o_ai
4250 vec_max(vector bool char __a, vector signed char __b) {
4251 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4254 static __inline__ vector signed char __ATTRS_o_ai
4255 vec_max(vector signed char __a, vector bool char __b) {
4256 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4259 static __inline__ vector unsigned char __ATTRS_o_ai
4260 vec_max(vector unsigned char __a, vector unsigned char __b) {
4261 return __builtin_altivec_vmaxub(__a, __b);
4264 static __inline__ vector unsigned char __ATTRS_o_ai
4265 vec_max(vector bool char __a, vector unsigned char __b) {
4266 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4269 static __inline__ vector unsigned char __ATTRS_o_ai
4270 vec_max(vector unsigned char __a, vector bool char __b) {
4271 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4274 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4276 return __builtin_altivec_vmaxsh(__a, __b);
4279 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4281 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4284 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4285 vector bool short __b) {
4286 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4289 static __inline__ vector unsigned short __ATTRS_o_ai
4290 vec_max(vector unsigned short __a, vector unsigned short __b) {
4291 return __builtin_altivec_vmaxuh(__a, __b);
4294 static __inline__ vector unsigned short __ATTRS_o_ai
4295 vec_max(vector bool short __a, vector unsigned short __b) {
4296 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4299 static __inline__ vector unsigned short __ATTRS_o_ai
4300 vec_max(vector unsigned short __a, vector bool short __b) {
4301 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4304 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4306 return __builtin_altivec_vmaxsw(__a, __b);
4309 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4311 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4314 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4315 vector bool int __b) {
4316 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4319 static __inline__ vector unsigned int __ATTRS_o_ai
4320 vec_max(vector unsigned int __a, vector unsigned int __b) {
4321 return __builtin_altivec_vmaxuw(__a, __b);
4324 static __inline__ vector unsigned int __ATTRS_o_ai
4325 vec_max(vector bool int __a, vector unsigned int __b) {
4326 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4329 static __inline__ vector unsigned int __ATTRS_o_ai
4330 vec_max(vector unsigned int __a, vector bool int __b) {
4331 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4334 #ifdef __POWER8_VECTOR__
4335 static __inline__ vector signed long long __ATTRS_o_ai
4336 vec_max(vector signed long long __a, vector signed long long __b) {
4337 return __builtin_altivec_vmaxsd(__a, __b);
4340 static __inline__ vector signed long long __ATTRS_o_ai
4341 vec_max(vector bool long long __a, vector signed long long __b) {
4342 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4345 static __inline__ vector signed long long __ATTRS_o_ai
4346 vec_max(vector signed long long __a, vector bool long long __b) {
4347 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4350 static __inline__ vector unsigned long long __ATTRS_o_ai
4351 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4352 return __builtin_altivec_vmaxud(__a, __b);
4355 static __inline__ vector unsigned long long __ATTRS_o_ai
4356 vec_max(vector bool long long __a, vector unsigned long long __b) {
4357 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4360 static __inline__ vector unsigned long long __ATTRS_o_ai
4361 vec_max(vector unsigned long long __a, vector bool long long __b) {
4362 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4366 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4369 return __builtin_vsx_xvmaxsp(__a, __b);
4371 return __builtin_altivec_vmaxfp(__a, __b);
4376 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4377 vector double __b) {
4378 return __builtin_vsx_xvmaxdp(__a, __b);
4384 static __inline__ vector signed char __ATTRS_o_ai
4385 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4386 return __builtin_altivec_vmaxsb(__a, __b);
4389 static __inline__ vector signed char __ATTRS_o_ai
4390 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4391 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4394 static __inline__ vector signed char __ATTRS_o_ai
4395 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4396 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4401 static __inline__ vector unsigned char __ATTRS_o_ai
4402 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4403 return __builtin_altivec_vmaxub(__a, __b);
4406 static __inline__ vector unsigned char __ATTRS_o_ai
4407 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4408 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4411 static __inline__ vector unsigned char __ATTRS_o_ai
4412 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4413 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4418 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4420 return __builtin_altivec_vmaxsh(__a, __b);
4423 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4425 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4428 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4429 vector bool short __b) {
4430 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4435 static __inline__ vector unsigned short __ATTRS_o_ai
4436 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4437 return __builtin_altivec_vmaxuh(__a, __b);
4440 static __inline__ vector unsigned short __ATTRS_o_ai
4441 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4442 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4445 static __inline__ vector unsigned short __ATTRS_o_ai
4446 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4447 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4452 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4454 return __builtin_altivec_vmaxsw(__a, __b);
4457 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4459 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4462 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4463 vector bool int __b) {
4464 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4469 static __inline__ vector unsigned int __ATTRS_o_ai
4470 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4471 return __builtin_altivec_vmaxuw(__a, __b);
4474 static __inline__ vector unsigned int __ATTRS_o_ai
4475 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4476 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4479 static __inline__ vector unsigned int __ATTRS_o_ai
4480 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4481 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4486 static __inline__ vector float __attribute__((__always_inline__))
4487 vec_vmaxfp(vector float __a, vector float __b) {
4489 return __builtin_vsx_xvmaxsp(__a, __b);
4491 return __builtin_altivec_vmaxfp(__a, __b);
4497 static __inline__ vector signed char __ATTRS_o_ai
4498 vec_mergeh(vector signed char __a, vector signed char __b) {
4499 return vec_perm(__a, __b,
4500 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4501 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4502 0x06, 0x16, 0x07, 0x17));
4505 static __inline__ vector unsigned char __ATTRS_o_ai
4506 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4507 return vec_perm(__a, __b,
4508 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4509 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4510 0x06, 0x16, 0x07, 0x17));
4513 static __inline__ vector bool char __ATTRS_o_ai
4514 vec_mergeh(vector bool char __a, vector bool char __b) {
4515 return vec_perm(__a, __b,
4516 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4517 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4518 0x06, 0x16, 0x07, 0x17));
4521 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4523 return vec_perm(__a, __b,
4524 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4525 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4526 0x06, 0x07, 0x16, 0x17));
4529 static __inline__ vector unsigned short __ATTRS_o_ai
4530 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4531 return vec_perm(__a, __b,
4532 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4533 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4534 0x06, 0x07, 0x16, 0x17));
4537 static __inline__ vector bool short __ATTRS_o_ai
4538 vec_mergeh(vector bool short __a, vector bool short __b) {
4539 return vec_perm(__a, __b,
4540 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4541 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4542 0x06, 0x07, 0x16, 0x17));
4545 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4547 return vec_perm(__a, __b,
4548 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4549 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4550 0x06, 0x07, 0x16, 0x17));
4553 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4555 return vec_perm(__a, __b,
4556 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4557 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4558 0x14, 0x15, 0x16, 0x17));
4561 static __inline__ vector unsigned int __ATTRS_o_ai
4562 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4563 return vec_perm(__a, __b,
4564 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4565 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4566 0x14, 0x15, 0x16, 0x17));
4569 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4570 vector bool int __b) {
4571 return vec_perm(__a, __b,
4572 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4573 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4574 0x14, 0x15, 0x16, 0x17));
4577 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4579 return vec_perm(__a, __b,
4580 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4581 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4582 0x14, 0x15, 0x16, 0x17));
4586 static __inline__ vector signed long long __ATTRS_o_ai
4587 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4588 return vec_perm(__a, __b,
4589 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4590 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4591 0x14, 0x15, 0x16, 0x17));
4594 static __inline__ vector signed long long __ATTRS_o_ai
4595 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4596 return vec_perm(__a, (vector signed long long)__b,
4597 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4598 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4599 0x14, 0x15, 0x16, 0x17));
4602 static __inline__ vector signed long long __ATTRS_o_ai
4603 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4604 return vec_perm((vector signed long long)__a, __b,
4605 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4606 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4607 0x14, 0x15, 0x16, 0x17));
4610 static __inline__ vector unsigned long long __ATTRS_o_ai
4611 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4612 return vec_perm(__a, __b,
4613 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4614 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4615 0x14, 0x15, 0x16, 0x17));
4618 static __inline__ vector unsigned long long __ATTRS_o_ai
4619 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4620 return vec_perm(__a, (vector unsigned long long)__b,
4621 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4622 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4623 0x14, 0x15, 0x16, 0x17));
4626 static __inline__ vector unsigned long long __ATTRS_o_ai
4627 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4628 return vec_perm((vector unsigned long long)__a, __b,
4629 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4630 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4631 0x14, 0x15, 0x16, 0x17));
4634 static __inline__ vector bool long long __ATTRS_o_ai
4635 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4636 return vec_perm(__a, __b,
4637 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4638 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4639 0x14, 0x15, 0x16, 0x17));
4642 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4643 vector double __b) {
4644 return vec_perm(__a, __b,
4645 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4646 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4647 0x14, 0x15, 0x16, 0x17));
4649 static __inline__ vector double __ATTRS_o_ai
4650 vec_mergeh(vector double __a, vector bool long long __b) {
4651 return vec_perm(__a, (vector double)__b,
4652 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4653 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4654 0x14, 0x15, 0x16, 0x17));
4656 static __inline__ vector double __ATTRS_o_ai
4657 vec_mergeh(vector bool long long __a, vector double __b) {
4658 return vec_perm((vector double)__a, __b,
4659 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4660 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4661 0x14, 0x15, 0x16, 0x17));
4667 #define __builtin_altivec_vmrghb vec_vmrghb
4669 static __inline__ vector signed char __ATTRS_o_ai
4670 vec_vmrghb(vector signed char __a, vector signed char __b) {
4671 return vec_perm(__a, __b,
4672 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4673 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4674 0x06, 0x16, 0x07, 0x17));
4677 static __inline__ vector unsigned char __ATTRS_o_ai
4678 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4679 return vec_perm(__a, __b,
4680 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4681 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4682 0x06, 0x16, 0x07, 0x17));
4685 static __inline__ vector bool char __ATTRS_o_ai
4686 vec_vmrghb(vector bool char __a, vector bool char __b) {
4687 return vec_perm(__a, __b,
4688 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4689 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4690 0x06, 0x16, 0x07, 0x17));
4695 #define __builtin_altivec_vmrghh vec_vmrghh
4697 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4699 return vec_perm(__a, __b,
4700 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4701 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4702 0x06, 0x07, 0x16, 0x17));
4705 static __inline__ vector unsigned short __ATTRS_o_ai
4706 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4707 return vec_perm(__a, __b,
4708 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4709 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4710 0x06, 0x07, 0x16, 0x17));
4713 static __inline__ vector bool short __ATTRS_o_ai
4714 vec_vmrghh(vector bool short __a, vector bool short __b) {
4715 return vec_perm(__a, __b,
4716 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4717 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4718 0x06, 0x07, 0x16, 0x17));
4721 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4723 return vec_perm(__a, __b,
4724 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4725 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4726 0x06, 0x07, 0x16, 0x17));
4731 #define __builtin_altivec_vmrghw vec_vmrghw
4733 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4735 return vec_perm(__a, __b,
4736 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4737 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4738 0x14, 0x15, 0x16, 0x17));
4741 static __inline__ vector unsigned int __ATTRS_o_ai
4742 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4743 return vec_perm(__a, __b,
4744 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4745 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4746 0x14, 0x15, 0x16, 0x17));
4749 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4750 vector bool int __b) {
4751 return vec_perm(__a, __b,
4752 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4753 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4754 0x14, 0x15, 0x16, 0x17));
4757 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4759 return vec_perm(__a, __b,
4760 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4761 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4762 0x14, 0x15, 0x16, 0x17));
4767 static __inline__ vector signed char __ATTRS_o_ai
4768 vec_mergel(vector signed char __a, vector signed char __b) {
4769 return vec_perm(__a, __b,
4770 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4771 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4772 0x0E, 0x1E, 0x0F, 0x1F));
4775 static __inline__ vector unsigned char __ATTRS_o_ai
4776 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4777 return vec_perm(__a, __b,
4778 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4779 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4780 0x0E, 0x1E, 0x0F, 0x1F));
4783 static __inline__ vector bool char __ATTRS_o_ai
4784 vec_mergel(vector bool char __a, vector bool char __b) {
4785 return vec_perm(__a, __b,
4786 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4787 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4788 0x0E, 0x1E, 0x0F, 0x1F));
4791 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4793 return vec_perm(__a, __b,
4794 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4795 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4796 0x0E, 0x0F, 0x1E, 0x1F));
4799 static __inline__ vector unsigned short __ATTRS_o_ai
4800 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4801 return vec_perm(__a, __b,
4802 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4803 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4804 0x0E, 0x0F, 0x1E, 0x1F));
4807 static __inline__ vector bool short __ATTRS_o_ai
4808 vec_mergel(vector bool short __a, vector bool short __b) {
4809 return vec_perm(__a, __b,
4810 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4811 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4812 0x0E, 0x0F, 0x1E, 0x1F));
4815 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4817 return vec_perm(__a, __b,
4818 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4819 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4820 0x0E, 0x0F, 0x1E, 0x1F));
4823 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4825 return vec_perm(__a, __b,
4826 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4827 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4828 0x1C, 0x1D, 0x1E, 0x1F));
4831 static __inline__ vector unsigned int __ATTRS_o_ai
4832 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4833 return vec_perm(__a, __b,
4834 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4835 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4836 0x1C, 0x1D, 0x1E, 0x1F));
4839 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4840 vector bool int __b) {
4841 return vec_perm(__a, __b,
4842 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4843 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4844 0x1C, 0x1D, 0x1E, 0x1F));
4847 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4849 return vec_perm(__a, __b,
4850 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4851 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4852 0x1C, 0x1D, 0x1E, 0x1F));
4856 static __inline__ vector signed long long __ATTRS_o_ai
4857 vec_mergel(vector signed long long __a, vector signed long long __b) {
4858 return vec_perm(__a, __b,
4859 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4860 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4861 0x1C, 0x1D, 0x1E, 0x1F));
4863 static __inline__ vector signed long long __ATTRS_o_ai
4864 vec_mergel(vector signed long long __a, vector bool long long __b) {
4865 return vec_perm(__a, (vector signed long long)__b,
4866 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4867 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4868 0x1C, 0x1D, 0x1E, 0x1F));
4870 static __inline__ vector signed long long __ATTRS_o_ai
4871 vec_mergel(vector bool long long __a, vector signed long long __b) {
4872 return vec_perm((vector signed long long)__a, __b,
4873 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4874 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4875 0x1C, 0x1D, 0x1E, 0x1F));
4877 static __inline__ vector unsigned long long __ATTRS_o_ai
4878 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4879 return vec_perm(__a, __b,
4880 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4881 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4882 0x1C, 0x1D, 0x1E, 0x1F));
4884 static __inline__ vector unsigned long long __ATTRS_o_ai
4885 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4886 return vec_perm(__a, (vector unsigned long long)__b,
4887 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4888 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4889 0x1C, 0x1D, 0x1E, 0x1F));
4891 static __inline__ vector unsigned long long __ATTRS_o_ai
4892 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4893 return vec_perm((vector unsigned long long)__a, __b,
4894 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4895 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4896 0x1C, 0x1D, 0x1E, 0x1F));
4898 static __inline__ vector bool long long __ATTRS_o_ai
4899 vec_mergel(vector bool long long __a, vector bool long long __b) {
4900 return vec_perm(__a, __b,
4901 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4902 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4903 0x1C, 0x1D, 0x1E, 0x1F));
4905 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4906 vector double __b) {
4907 return vec_perm(__a, __b,
4908 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4909 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4910 0x1C, 0x1D, 0x1E, 0x1F));
4912 static __inline__ vector double __ATTRS_o_ai
4913 vec_mergel(vector double __a, vector bool long long __b) {
4914 return vec_perm(__a, (vector double)__b,
4915 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4916 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4917 0x1C, 0x1D, 0x1E, 0x1F));
4919 static __inline__ vector double __ATTRS_o_ai
4920 vec_mergel(vector bool long long __a, vector double __b) {
4921 return vec_perm((vector double)__a, __b,
4922 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4923 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4924 0x1C, 0x1D, 0x1E, 0x1F));
4930 #define __builtin_altivec_vmrglb vec_vmrglb
4932 static __inline__ vector signed char __ATTRS_o_ai
4933 vec_vmrglb(vector signed char __a, vector signed char __b) {
4934 return vec_perm(__a, __b,
4935 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4936 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4937 0x0E, 0x1E, 0x0F, 0x1F));
4940 static __inline__ vector unsigned char __ATTRS_o_ai
4941 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4942 return vec_perm(__a, __b,
4943 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4944 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4945 0x0E, 0x1E, 0x0F, 0x1F));
4948 static __inline__ vector bool char __ATTRS_o_ai
4949 vec_vmrglb(vector bool char __a, vector bool char __b) {
4950 return vec_perm(__a, __b,
4951 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4952 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4953 0x0E, 0x1E, 0x0F, 0x1F));
4958 #define __builtin_altivec_vmrglh vec_vmrglh
4960 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4962 return vec_perm(__a, __b,
4963 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4964 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4965 0x0E, 0x0F, 0x1E, 0x1F));
4968 static __inline__ vector unsigned short __ATTRS_o_ai
4969 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4970 return vec_perm(__a, __b,
4971 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4972 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4973 0x0E, 0x0F, 0x1E, 0x1F));
4976 static __inline__ vector bool short __ATTRS_o_ai
4977 vec_vmrglh(vector bool short __a, vector bool short __b) {
4978 return vec_perm(__a, __b,
4979 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4980 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4981 0x0E, 0x0F, 0x1E, 0x1F));
4984 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4986 return vec_perm(__a, __b,
4987 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4988 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4989 0x0E, 0x0F, 0x1E, 0x1F));
4994 #define __builtin_altivec_vmrglw vec_vmrglw
4996 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4998 return vec_perm(__a, __b,
4999 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5000 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5001 0x1C, 0x1D, 0x1E, 0x1F));
5004 static __inline__ vector unsigned int __ATTRS_o_ai
5005 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
5006 return vec_perm(__a, __b,
5007 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5008 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5009 0x1C, 0x1D, 0x1E, 0x1F));
5012 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5013 vector bool int __b) {
5014 return vec_perm(__a, __b,
5015 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5016 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5017 0x1C, 0x1D, 0x1E, 0x1F));
5020 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5022 return vec_perm(__a, __b,
5023 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5024 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5025 0x1C, 0x1D, 0x1E, 0x1F));
5028 #ifdef __POWER8_VECTOR__
5031 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5032 vector bool int __b) {
5033 return vec_perm(__a, __b,
5034 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5035 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5036 0x18, 0x19, 0x1A, 0x1B));
5039 static __inline__ vector signed int __ATTRS_o_ai
5040 vec_mergee(vector signed int __a, vector signed int __b) {
5041 return vec_perm(__a, __b,
5042 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5043 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5044 0x18, 0x19, 0x1A, 0x1B));
5047 static __inline__ vector unsigned int __ATTRS_o_ai
5048 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5049 return vec_perm(__a, __b,
5050 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5051 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5052 0x18, 0x19, 0x1A, 0x1B));
5055 static __inline__ vector bool long long __ATTRS_o_ai
5056 vec_mergee(vector bool long long __a, vector bool long long __b) {
5057 return vec_mergeh(__a, __b);
5060 static __inline__ vector signed long long __ATTRS_o_ai
5061 vec_mergee(vector signed long long __a, vector signed long long __b) {
5062 return vec_mergeh(__a, __b);
5065 static __inline__ vector unsigned long long __ATTRS_o_ai
5066 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5067 return vec_mergeh(__a, __b);
5070 static __inline__ vector float __ATTRS_o_ai
5071 vec_mergee(vector float __a, vector float __b) {
5072 return vec_perm(__a, __b,
5073 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5074 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5075 0x18, 0x19, 0x1A, 0x1B));
5078 static __inline__ vector double __ATTRS_o_ai
5079 vec_mergee(vector double __a, vector double __b) {
5080 return vec_mergeh(__a, __b);
5085 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5086 vector bool int __b) {
5087 return vec_perm(__a, __b,
5088 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5089 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5090 0x1C, 0x1D, 0x1E, 0x1F));
5093 static __inline__ vector signed int __ATTRS_o_ai
5094 vec_mergeo(vector signed int __a, vector signed int __b) {
5095 return vec_perm(__a, __b,
5096 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5097 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5098 0x1C, 0x1D, 0x1E, 0x1F));
5101 static __inline__ vector unsigned int __ATTRS_o_ai
5102 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5103 return vec_perm(__a, __b,
5104 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5105 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5106 0x1C, 0x1D, 0x1E, 0x1F));
5109 static __inline__ vector bool long long __ATTRS_o_ai
5110 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5111 return vec_mergel(__a, __b);
5114 static __inline__ vector signed long long __ATTRS_o_ai
5115 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5116 return vec_mergel(__a, __b);
5119 static __inline__ vector unsigned long long __ATTRS_o_ai
5120 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5121 return vec_mergel(__a, __b);
5124 static __inline__ vector float __ATTRS_o_ai
5125 vec_mergeo(vector float __a, vector float __b) {
5126 return vec_perm(__a, __b,
5127 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5128 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5129 0x1C, 0x1D, 0x1E, 0x1F));
5132 static __inline__ vector double __ATTRS_o_ai
5133 vec_mergeo(vector double __a, vector double __b) {
5134 return vec_mergel(__a, __b);
5141 static __inline__ vector unsigned short __attribute__((__always_inline__))
5143 return __builtin_altivec_mfvscr();
5148 static __inline__ vector signed char __ATTRS_o_ai
5149 vec_min(vector signed char __a, vector signed char __b) {
5150 return __builtin_altivec_vminsb(__a, __b);
5153 static __inline__ vector signed char __ATTRS_o_ai
5154 vec_min(vector bool char __a, vector signed char __b) {
5155 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5158 static __inline__ vector signed char __ATTRS_o_ai
5159 vec_min(vector signed char __a, vector bool char __b) {
5160 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5163 static __inline__ vector unsigned char __ATTRS_o_ai
5164 vec_min(vector unsigned char __a, vector unsigned char __b) {
5165 return __builtin_altivec_vminub(__a, __b);
5168 static __inline__ vector unsigned char __ATTRS_o_ai
5169 vec_min(vector bool char __a, vector unsigned char __b) {
5170 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5173 static __inline__ vector unsigned char __ATTRS_o_ai
5174 vec_min(vector unsigned char __a, vector bool char __b) {
5175 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5178 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5180 return __builtin_altivec_vminsh(__a, __b);
5183 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5185 return __builtin_altivec_vminsh((vector short)__a, __b);
5188 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5189 vector bool short __b) {
5190 return __builtin_altivec_vminsh(__a, (vector short)__b);
5193 static __inline__ vector unsigned short __ATTRS_o_ai
5194 vec_min(vector unsigned short __a, vector unsigned short __b) {
5195 return __builtin_altivec_vminuh(__a, __b);
5198 static __inline__ vector unsigned short __ATTRS_o_ai
5199 vec_min(vector bool short __a, vector unsigned short __b) {
5200 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5203 static __inline__ vector unsigned short __ATTRS_o_ai
5204 vec_min(vector unsigned short __a, vector bool short __b) {
5205 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5208 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5210 return __builtin_altivec_vminsw(__a, __b);
5213 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5215 return __builtin_altivec_vminsw((vector int)__a, __b);
5218 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5219 vector bool int __b) {
5220 return __builtin_altivec_vminsw(__a, (vector int)__b);
5223 static __inline__ vector unsigned int __ATTRS_o_ai
5224 vec_min(vector unsigned int __a, vector unsigned int __b) {
5225 return __builtin_altivec_vminuw(__a, __b);
5228 static __inline__ vector unsigned int __ATTRS_o_ai
5229 vec_min(vector bool int __a, vector unsigned int __b) {
5230 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5233 static __inline__ vector unsigned int __ATTRS_o_ai
5234 vec_min(vector unsigned int __a, vector bool int __b) {
5235 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5238 #ifdef __POWER8_VECTOR__
5239 static __inline__ vector signed long long __ATTRS_o_ai
5240 vec_min(vector signed long long __a, vector signed long long __b) {
5241 return __builtin_altivec_vminsd(__a, __b);
5244 static __inline__ vector signed long long __ATTRS_o_ai
5245 vec_min(vector bool long long __a, vector signed long long __b) {
5246 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5249 static __inline__ vector signed long long __ATTRS_o_ai
5250 vec_min(vector signed long long __a, vector bool long long __b) {
5251 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5254 static __inline__ vector unsigned long long __ATTRS_o_ai
5255 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5256 return __builtin_altivec_vminud(__a, __b);
5259 static __inline__ vector unsigned long long __ATTRS_o_ai
5260 vec_min(vector bool long long __a, vector unsigned long long __b) {
5261 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5264 static __inline__ vector unsigned long long __ATTRS_o_ai
5265 vec_min(vector unsigned long long __a, vector bool long long __b) {
5266 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5270 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5273 return __builtin_vsx_xvminsp(__a, __b);
5275 return __builtin_altivec_vminfp(__a, __b);
5280 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5281 vector double __b) {
5282 return __builtin_vsx_xvmindp(__a, __b);
5288 static __inline__ vector signed char __ATTRS_o_ai
5289 vec_vminsb(vector signed char __a, vector signed char __b) {
5290 return __builtin_altivec_vminsb(__a, __b);
5293 static __inline__ vector signed char __ATTRS_o_ai
5294 vec_vminsb(vector bool char __a, vector signed char __b) {
5295 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5298 static __inline__ vector signed char __ATTRS_o_ai
5299 vec_vminsb(vector signed char __a, vector bool char __b) {
5300 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5305 static __inline__ vector unsigned char __ATTRS_o_ai
5306 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5307 return __builtin_altivec_vminub(__a, __b);
5310 static __inline__ vector unsigned char __ATTRS_o_ai
5311 vec_vminub(vector bool char __a, vector unsigned char __b) {
5312 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5315 static __inline__ vector unsigned char __ATTRS_o_ai
5316 vec_vminub(vector unsigned char __a, vector bool char __b) {
5317 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5322 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5324 return __builtin_altivec_vminsh(__a, __b);
5327 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5329 return __builtin_altivec_vminsh((vector short)__a, __b);
5332 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5333 vector bool short __b) {
5334 return __builtin_altivec_vminsh(__a, (vector short)__b);
5339 static __inline__ vector unsigned short __ATTRS_o_ai
5340 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5341 return __builtin_altivec_vminuh(__a, __b);
5344 static __inline__ vector unsigned short __ATTRS_o_ai
5345 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5346 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5349 static __inline__ vector unsigned short __ATTRS_o_ai
5350 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5351 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5356 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5358 return __builtin_altivec_vminsw(__a, __b);
5361 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5363 return __builtin_altivec_vminsw((vector int)__a, __b);
5366 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5367 vector bool int __b) {
5368 return __builtin_altivec_vminsw(__a, (vector int)__b);
5373 static __inline__ vector unsigned int __ATTRS_o_ai
5374 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5375 return __builtin_altivec_vminuw(__a, __b);
5378 static __inline__ vector unsigned int __ATTRS_o_ai
5379 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5380 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5383 static __inline__ vector unsigned int __ATTRS_o_ai
5384 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5385 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5390 static __inline__ vector float __attribute__((__always_inline__))
5391 vec_vminfp(vector float __a, vector float __b) {
5393 return __builtin_vsx_xvminsp(__a, __b);
5395 return __builtin_altivec_vminfp(__a, __b);
5401 #define __builtin_altivec_vmladduhm vec_mladd
5403 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5406 return __a * __b + __c;
5409 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5410 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5411 return __a * (vector short)__b + (vector short)__c;
5414 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5417 return (vector short)__a * __b + __c;
5420 static __inline__ vector unsigned short __ATTRS_o_ai
5421 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5422 vector unsigned short __c) {
5423 return __a * __b + __c;
5428 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5431 return __a * __b + __c;
5434 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5435 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5436 return __a * (vector short)__b + (vector short)__c;
5439 static __inline__ vector short __ATTRS_o_ai
5440 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5441 return (vector short)__a * __b + __c;
5444 static __inline__ vector unsigned short __ATTRS_o_ai
5445 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5446 vector unsigned short __c) {
5447 return __a * __b + __c;
5452 static __inline__ vector short __attribute__((__always_inline__))
5453 vec_mradds(vector short __a, vector short __b, vector short __c) {
5454 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5457 /* vec_vmhraddshs */
5459 static __inline__ vector short __attribute__((__always_inline__))
5460 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5461 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5466 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5467 vector unsigned char __b,
5469 return __builtin_altivec_vmsummbm(__a, __b, __c);
5472 static __inline__ vector unsigned int __ATTRS_o_ai
5473 vec_msum(vector unsigned char __a, vector unsigned char __b,
5474 vector unsigned int __c) {
5475 return __builtin_altivec_vmsumubm(__a, __b, __c);
5478 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5481 return __builtin_altivec_vmsumshm(__a, __b, __c);
5484 static __inline__ vector unsigned int __ATTRS_o_ai
5485 vec_msum(vector unsigned short __a, vector unsigned short __b,
5486 vector unsigned int __c) {
5487 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5492 static __inline__ vector int __attribute__((__always_inline__))
5493 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5494 return __builtin_altivec_vmsummbm(__a, __b, __c);
5499 static __inline__ vector unsigned int __attribute__((__always_inline__))
5500 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5501 vector unsigned int __c) {
5502 return __builtin_altivec_vmsumubm(__a, __b, __c);
5507 static __inline__ vector int __attribute__((__always_inline__))
5508 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5509 return __builtin_altivec_vmsumshm(__a, __b, __c);
5514 static __inline__ vector unsigned int __attribute__((__always_inline__))
5515 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5516 vector unsigned int __c) {
5517 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5522 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5525 return __builtin_altivec_vmsumshs(__a, __b, __c);
5528 static __inline__ vector unsigned int __ATTRS_o_ai
5529 vec_msums(vector unsigned short __a, vector unsigned short __b,
5530 vector unsigned int __c) {
5531 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5536 static __inline__ vector int __attribute__((__always_inline__))
5537 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5538 return __builtin_altivec_vmsumshs(__a, __b, __c);
5543 static __inline__ vector unsigned int __attribute__((__always_inline__))
5544 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5545 vector unsigned int __c) {
5546 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5551 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5552 __builtin_altivec_mtvscr((vector int)__a);
5555 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5556 __builtin_altivec_mtvscr((vector int)__a);
5559 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5560 __builtin_altivec_mtvscr((vector int)__a);
5563 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5564 __builtin_altivec_mtvscr((vector int)__a);
5567 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5568 __builtin_altivec_mtvscr((vector int)__a);
5571 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5572 __builtin_altivec_mtvscr((vector int)__a);
5575 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5576 __builtin_altivec_mtvscr((vector int)__a);
5579 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5580 __builtin_altivec_mtvscr((vector int)__a);
5583 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5584 __builtin_altivec_mtvscr((vector int)__a);
5587 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5588 __builtin_altivec_mtvscr((vector int)__a);
5591 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5592 __builtin_altivec_mtvscr((vector int)__a);
5597 /* Integer vector multiplication will involve multiplication of the odd/even
5598 elements separately, then truncating the results and moving to the
5601 static __inline__ vector signed char __ATTRS_o_ai
5602 vec_mul(vector signed char __a, vector signed char __b) {
5606 static __inline__ vector unsigned char __ATTRS_o_ai
5607 vec_mul(vector unsigned char __a, vector unsigned char __b) {
5611 static __inline__ vector signed short __ATTRS_o_ai
5612 vec_mul(vector signed short __a, vector signed short __b) {
5616 static __inline__ vector unsigned short __ATTRS_o_ai
5617 vec_mul(vector unsigned short __a, vector unsigned short __b) {
5621 static __inline__ vector signed int __ATTRS_o_ai
5622 vec_mul(vector signed int __a, vector signed int __b) {
5626 static __inline__ vector unsigned int __ATTRS_o_ai
5627 vec_mul(vector unsigned int __a, vector unsigned int __b) {
5632 static __inline__ vector signed long long __ATTRS_o_ai
5633 vec_mul(vector signed long long __a, vector signed long long __b) {
5637 static __inline__ vector unsigned long long __ATTRS_o_ai
5638 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5643 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5649 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5650 vector double __b) {
5655 /* The vmulos* and vmules* instructions have a big endian bias, so
5656 we must reverse the meaning of "even" and "odd" for little endian. */
5660 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5661 vector signed char __b) {
5662 #ifdef __LITTLE_ENDIAN__
5663 return __builtin_altivec_vmulosb(__a, __b);
5665 return __builtin_altivec_vmulesb(__a, __b);
5669 static __inline__ vector unsigned short __ATTRS_o_ai
5670 vec_mule(vector unsigned char __a, vector unsigned char __b) {
5671 #ifdef __LITTLE_ENDIAN__
5672 return __builtin_altivec_vmuloub(__a, __b);
5674 return __builtin_altivec_vmuleub(__a, __b);
5678 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5680 #ifdef __LITTLE_ENDIAN__
5681 return __builtin_altivec_vmulosh(__a, __b);
5683 return __builtin_altivec_vmulesh(__a, __b);
5687 static __inline__ vector unsigned int __ATTRS_o_ai
5688 vec_mule(vector unsigned short __a, vector unsigned short __b) {
5689 #ifdef __LITTLE_ENDIAN__
5690 return __builtin_altivec_vmulouh(__a, __b);
5692 return __builtin_altivec_vmuleuh(__a, __b);
5696 #ifdef __POWER8_VECTOR__
5697 static __inline__ vector signed long long __ATTRS_o_ai
5698 vec_mule(vector signed int __a, vector signed int __b) {
5699 #ifdef __LITTLE_ENDIAN__
5700 return __builtin_altivec_vmulosw(__a, __b);
5702 return __builtin_altivec_vmulesw(__a, __b);
5706 static __inline__ vector unsigned long long __ATTRS_o_ai
5707 vec_mule(vector unsigned int __a, vector unsigned int __b) {
5708 #ifdef __LITTLE_ENDIAN__
5709 return __builtin_altivec_vmulouw(__a, __b);
5711 return __builtin_altivec_vmuleuw(__a, __b);
5718 static __inline__ vector short __attribute__((__always_inline__))
5719 vec_vmulesb(vector signed char __a, vector signed char __b) {
5720 #ifdef __LITTLE_ENDIAN__
5721 return __builtin_altivec_vmulosb(__a, __b);
5723 return __builtin_altivec_vmulesb(__a, __b);
5729 static __inline__ vector unsigned short __attribute__((__always_inline__))
5730 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5731 #ifdef __LITTLE_ENDIAN__
5732 return __builtin_altivec_vmuloub(__a, __b);
5734 return __builtin_altivec_vmuleub(__a, __b);
5740 static __inline__ vector int __attribute__((__always_inline__))
5741 vec_vmulesh(vector short __a, vector short __b) {
5742 #ifdef __LITTLE_ENDIAN__
5743 return __builtin_altivec_vmulosh(__a, __b);
5745 return __builtin_altivec_vmulesh(__a, __b);
5751 static __inline__ vector unsigned int __attribute__((__always_inline__))
5752 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5753 #ifdef __LITTLE_ENDIAN__
5754 return __builtin_altivec_vmulouh(__a, __b);
5756 return __builtin_altivec_vmuleuh(__a, __b);
5762 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5763 vector signed char __b) {
5764 #ifdef __LITTLE_ENDIAN__
5765 return __builtin_altivec_vmulesb(__a, __b);
5767 return __builtin_altivec_vmulosb(__a, __b);
5771 static __inline__ vector unsigned short __ATTRS_o_ai
5772 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5773 #ifdef __LITTLE_ENDIAN__
5774 return __builtin_altivec_vmuleub(__a, __b);
5776 return __builtin_altivec_vmuloub(__a, __b);
5780 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5782 #ifdef __LITTLE_ENDIAN__
5783 return __builtin_altivec_vmulesh(__a, __b);
5785 return __builtin_altivec_vmulosh(__a, __b);
5789 static __inline__ vector unsigned int __ATTRS_o_ai
5790 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5791 #ifdef __LITTLE_ENDIAN__
5792 return __builtin_altivec_vmuleuh(__a, __b);
5794 return __builtin_altivec_vmulouh(__a, __b);
5798 #ifdef __POWER8_VECTOR__
5799 static __inline__ vector signed long long __ATTRS_o_ai
5800 vec_mulo(vector signed int __a, vector signed int __b) {
5801 #ifdef __LITTLE_ENDIAN__
5802 return __builtin_altivec_vmulesw(__a, __b);
5804 return __builtin_altivec_vmulosw(__a, __b);
5808 static __inline__ vector unsigned long long __ATTRS_o_ai
5809 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5810 #ifdef __LITTLE_ENDIAN__
5811 return __builtin_altivec_vmuleuw(__a, __b);
5813 return __builtin_altivec_vmulouw(__a, __b);
5820 static __inline__ vector short __attribute__((__always_inline__))
5821 vec_vmulosb(vector signed char __a, vector signed char __b) {
5822 #ifdef __LITTLE_ENDIAN__
5823 return __builtin_altivec_vmulesb(__a, __b);
5825 return __builtin_altivec_vmulosb(__a, __b);
5831 static __inline__ vector unsigned short __attribute__((__always_inline__))
5832 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5833 #ifdef __LITTLE_ENDIAN__
5834 return __builtin_altivec_vmuleub(__a, __b);
5836 return __builtin_altivec_vmuloub(__a, __b);
5842 static __inline__ vector int __attribute__((__always_inline__))
5843 vec_vmulosh(vector short __a, vector short __b) {
5844 #ifdef __LITTLE_ENDIAN__
5845 return __builtin_altivec_vmulesh(__a, __b);
5847 return __builtin_altivec_vmulosh(__a, __b);
5853 static __inline__ vector unsigned int __attribute__((__always_inline__))
5854 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5855 #ifdef __LITTLE_ENDIAN__
5856 return __builtin_altivec_vmuleuh(__a, __b);
5858 return __builtin_altivec_vmulouh(__a, __b);
5864 #ifdef __POWER8_VECTOR__
5865 static __inline__ vector signed char __ATTRS_o_ai
5866 vec_nand(vector signed char __a, vector signed char __b) {
5867 return ~(__a & __b);
5870 static __inline__ vector signed char __ATTRS_o_ai
5871 vec_nand(vector signed char __a, vector bool char __b) {
5872 return ~(__a & __b);
5875 static __inline__ vector signed char __ATTRS_o_ai
5876 vec_nand(vector bool char __a, vector signed char __b) {
5877 return ~(__a & __b);
5880 static __inline__ vector unsigned char __ATTRS_o_ai
5881 vec_nand(vector unsigned char __a, vector unsigned char __b) {
5882 return ~(__a & __b);
5885 static __inline__ vector unsigned char __ATTRS_o_ai
5886 vec_nand(vector unsigned char __a, vector bool char __b) {
5887 return ~(__a & __b);
5890 static __inline__ vector unsigned char __ATTRS_o_ai
5891 vec_nand(vector bool char __a, vector unsigned char __b) {
5892 return ~(__a & __b);
5895 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5896 vector bool char __b) {
5897 return ~(__a & __b);
5900 static __inline__ vector signed short __ATTRS_o_ai
5901 vec_nand(vector signed short __a, vector signed short __b) {
5902 return ~(__a & __b);
5905 static __inline__ vector signed short __ATTRS_o_ai
5906 vec_nand(vector signed short __a, vector bool short __b) {
5907 return ~(__a & __b);
5910 static __inline__ vector signed short __ATTRS_o_ai
5911 vec_nand(vector bool short __a, vector signed short __b) {
5912 return ~(__a & __b);
5915 static __inline__ vector unsigned short __ATTRS_o_ai
5916 vec_nand(vector unsigned short __a, vector unsigned short __b) {
5917 return ~(__a & __b);
5920 static __inline__ vector unsigned short __ATTRS_o_ai
5921 vec_nand(vector unsigned short __a, vector bool short __b) {
5922 return ~(__a & __b);
5925 static __inline__ vector bool short __ATTRS_o_ai
5926 vec_nand(vector bool short __a, vector bool short __b) {
5927 return ~(__a & __b);
5930 static __inline__ vector signed int __ATTRS_o_ai
5931 vec_nand(vector signed int __a, vector signed int __b) {
5932 return ~(__a & __b);
5935 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5936 vector bool int __b) {
5937 return ~(__a & __b);
5940 static __inline__ vector signed int __ATTRS_o_ai
5941 vec_nand(vector bool int __a, vector signed int __b) {
5942 return ~(__a & __b);
5945 static __inline__ vector unsigned int __ATTRS_o_ai
5946 vec_nand(vector unsigned int __a, vector unsigned int __b) {
5947 return ~(__a & __b);
5950 static __inline__ vector unsigned int __ATTRS_o_ai
5951 vec_nand(vector unsigned int __a, vector bool int __b) {
5952 return ~(__a & __b);
5955 static __inline__ vector unsigned int __ATTRS_o_ai
5956 vec_nand(vector bool int __a, vector unsigned int __b) {
5957 return ~(__a & __b);
5960 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5961 vector bool int __b) {
5962 return ~(__a & __b);
5965 static __inline__ vector float __ATTRS_o_ai
5966 vec_nand(vector float __a, vector float __b) {
5967 return (vector float)(~((vector unsigned int)__a &
5968 (vector unsigned int)__b));
5971 static __inline__ vector signed long long __ATTRS_o_ai
5972 vec_nand(vector signed long long __a, vector signed long long __b) {
5973 return ~(__a & __b);
5976 static __inline__ vector signed long long __ATTRS_o_ai
5977 vec_nand(vector signed long long __a, vector bool long long __b) {
5978 return ~(__a & __b);
5981 static __inline__ vector signed long long __ATTRS_o_ai
5982 vec_nand(vector bool long long __a, vector signed long long __b) {
5983 return ~(__a & __b);
5986 static __inline__ vector unsigned long long __ATTRS_o_ai
5987 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
5988 return ~(__a & __b);
5991 static __inline__ vector unsigned long long __ATTRS_o_ai
5992 vec_nand(vector unsigned long long __a, vector bool long long __b) {
5993 return ~(__a & __b);
5996 static __inline__ vector unsigned long long __ATTRS_o_ai
5997 vec_nand(vector bool long long __a, vector unsigned long long __b) {
5998 return ~(__a & __b);
6001 static __inline__ vector bool long long __ATTRS_o_ai
6002 vec_nand(vector bool long long __a, vector bool long long __b) {
6003 return ~(__a & __b);
6006 static __inline__ vector double __ATTRS_o_ai
6007 vec_nand(vector double __a, vector double __b) {
6008 return (vector double)(~((vector unsigned long long)__a &
6009 (vector unsigned long long)__b));
6017 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6020 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6023 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6025 vector double __c) {
6026 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6032 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6036 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6038 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6043 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6045 vector double __c) {
6046 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6052 static __inline__ vector float __attribute__((__always_inline__))
6053 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6054 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6059 #define __builtin_altivec_vnor vec_nor
6061 static __inline__ vector signed char __ATTRS_o_ai
6062 vec_nor(vector signed char __a, vector signed char __b) {
6063 return ~(__a | __b);
6066 static __inline__ vector unsigned char __ATTRS_o_ai
6067 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6068 return ~(__a | __b);
6071 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6072 vector bool char __b) {
6073 return ~(__a | __b);
6076 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6078 return ~(__a | __b);
6081 static __inline__ vector unsigned short __ATTRS_o_ai
6082 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6083 return ~(__a | __b);
6086 static __inline__ vector bool short __ATTRS_o_ai
6087 vec_nor(vector bool short __a, vector bool short __b) {
6088 return ~(__a | __b);
6091 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6093 return ~(__a | __b);
6096 static __inline__ vector unsigned int __ATTRS_o_ai
6097 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6098 return ~(__a | __b);
6101 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6102 vector bool int __b) {
6103 return ~(__a | __b);
6106 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6108 vector unsigned int __res =
6109 ~((vector unsigned int)__a | (vector unsigned int)__b);
6110 return (vector float)__res;
6114 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6115 vector double __b) {
6116 vector unsigned long long __res =
6117 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6118 return (vector double)__res;
6124 static __inline__ vector signed char __ATTRS_o_ai
6125 vec_vnor(vector signed char __a, vector signed char __b) {
6126 return ~(__a | __b);
6129 static __inline__ vector unsigned char __ATTRS_o_ai
6130 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6131 return ~(__a | __b);
6134 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6135 vector bool char __b) {
6136 return ~(__a | __b);
6139 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6141 return ~(__a | __b);
6144 static __inline__ vector unsigned short __ATTRS_o_ai
6145 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6146 return ~(__a | __b);
6149 static __inline__ vector bool short __ATTRS_o_ai
6150 vec_vnor(vector bool short __a, vector bool short __b) {
6151 return ~(__a | __b);
6154 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6156 return ~(__a | __b);
6159 static __inline__ vector unsigned int __ATTRS_o_ai
6160 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6161 return ~(__a | __b);
6164 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6165 vector bool int __b) {
6166 return ~(__a | __b);
6169 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6171 vector unsigned int __res =
6172 ~((vector unsigned int)__a | (vector unsigned int)__b);
6173 return (vector float)__res;
6177 static __inline__ vector signed long long __ATTRS_o_ai
6178 vec_nor(vector signed long long __a, vector signed long long __b) {
6179 return ~(__a | __b);
6182 static __inline__ vector unsigned long long __ATTRS_o_ai
6183 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6184 return ~(__a | __b);
6187 static __inline__ vector bool long long __ATTRS_o_ai
6188 vec_nor(vector bool long long __a, vector bool long long __b) {
6189 return ~(__a | __b);
6195 #define __builtin_altivec_vor vec_or
6197 static __inline__ vector signed char __ATTRS_o_ai
6198 vec_or(vector signed char __a, vector signed char __b) {
6202 static __inline__ vector signed char __ATTRS_o_ai
6203 vec_or(vector bool char __a, vector signed char __b) {
6204 return (vector signed char)__a | __b;
6207 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6208 vector bool char __b) {
6209 return __a | (vector signed char)__b;
6212 static __inline__ vector unsigned char __ATTRS_o_ai
6213 vec_or(vector unsigned char __a, vector unsigned char __b) {
6217 static __inline__ vector unsigned char __ATTRS_o_ai
6218 vec_or(vector bool char __a, vector unsigned char __b) {
6219 return (vector unsigned char)__a | __b;
6222 static __inline__ vector unsigned char __ATTRS_o_ai
6223 vec_or(vector unsigned char __a, vector bool char __b) {
6224 return __a | (vector unsigned char)__b;
6227 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6228 vector bool char __b) {
6232 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6237 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6239 return (vector short)__a | __b;
6242 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6243 vector bool short __b) {
6244 return __a | (vector short)__b;
6247 static __inline__ vector unsigned short __ATTRS_o_ai
6248 vec_or(vector unsigned short __a, vector unsigned short __b) {
6252 static __inline__ vector unsigned short __ATTRS_o_ai
6253 vec_or(vector bool short __a, vector unsigned short __b) {
6254 return (vector unsigned short)__a | __b;
6257 static __inline__ vector unsigned short __ATTRS_o_ai
6258 vec_or(vector unsigned short __a, vector bool short __b) {
6259 return __a | (vector unsigned short)__b;
6262 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6263 vector bool short __b) {
6267 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6272 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6274 return (vector int)__a | __b;
6277 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6278 vector bool int __b) {
6279 return __a | (vector int)__b;
6282 static __inline__ vector unsigned int __ATTRS_o_ai
6283 vec_or(vector unsigned int __a, vector unsigned int __b) {
6287 static __inline__ vector unsigned int __ATTRS_o_ai
6288 vec_or(vector bool int __a, vector unsigned int __b) {
6289 return (vector unsigned int)__a | __b;
6292 static __inline__ vector unsigned int __ATTRS_o_ai
6293 vec_or(vector unsigned int __a, vector bool int __b) {
6294 return __a | (vector unsigned int)__b;
6297 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6298 vector bool int __b) {
6302 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6304 vector unsigned int __res =
6305 (vector unsigned int)__a | (vector unsigned int)__b;
6306 return (vector float)__res;
6309 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6311 vector unsigned int __res =
6312 (vector unsigned int)__a | (vector unsigned int)__b;
6313 return (vector float)__res;
6316 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6317 vector bool int __b) {
6318 vector unsigned int __res =
6319 (vector unsigned int)__a | (vector unsigned int)__b;
6320 return (vector float)__res;
6324 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6325 vector double __b) {
6326 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6329 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6330 vector bool long long __b) {
6331 return (vector unsigned long long)__a | (vector unsigned long long)__b;
6334 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6335 vector double __b) {
6336 vector unsigned long long __res =
6337 (vector unsigned long long)__a | (vector unsigned long long)__b;
6338 return (vector double)__res;
6341 static __inline__ vector signed long long __ATTRS_o_ai
6342 vec_or(vector signed long long __a, vector signed long long __b) {
6346 static __inline__ vector signed long long __ATTRS_o_ai
6347 vec_or(vector bool long long __a, vector signed long long __b) {
6348 return (vector signed long long)__a | __b;
6351 static __inline__ vector signed long long __ATTRS_o_ai
6352 vec_or(vector signed long long __a, vector bool long long __b) {
6353 return __a | (vector signed long long)__b;
6356 static __inline__ vector unsigned long long __ATTRS_o_ai
6357 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6361 static __inline__ vector unsigned long long __ATTRS_o_ai
6362 vec_or(vector bool long long __a, vector unsigned long long __b) {
6363 return (vector unsigned long long)__a | __b;
6366 static __inline__ vector unsigned long long __ATTRS_o_ai
6367 vec_or(vector unsigned long long __a, vector bool long long __b) {
6368 return __a | (vector unsigned long long)__b;
6371 static __inline__ vector bool long long __ATTRS_o_ai
6372 vec_or(vector bool long long __a, vector bool long long __b) {
6377 #ifdef __POWER8_VECTOR__
6378 static __inline__ vector signed char __ATTRS_o_ai
6379 vec_orc(vector signed char __a, vector signed char __b) {
6383 static __inline__ vector signed char __ATTRS_o_ai
6384 vec_orc(vector signed char __a, vector bool char __b) {
6388 static __inline__ vector signed char __ATTRS_o_ai
6389 vec_orc(vector bool char __a, vector signed char __b) {
6393 static __inline__ vector unsigned char __ATTRS_o_ai
6394 vec_orc(vector unsigned char __a, vector unsigned char __b) {
6398 static __inline__ vector unsigned char __ATTRS_o_ai
6399 vec_orc(vector unsigned char __a, vector bool char __b) {
6403 static __inline__ vector unsigned char __ATTRS_o_ai
6404 vec_orc(vector bool char __a, vector unsigned char __b) {
6408 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6409 vector bool char __b) {
6413 static __inline__ vector signed short __ATTRS_o_ai
6414 vec_orc(vector signed short __a, vector signed short __b) {
6418 static __inline__ vector signed short __ATTRS_o_ai
6419 vec_orc(vector signed short __a, vector bool short __b) {
6423 static __inline__ vector signed short __ATTRS_o_ai
6424 vec_orc(vector bool short __a, vector signed short __b) {
6428 static __inline__ vector unsigned short __ATTRS_o_ai
6429 vec_orc(vector unsigned short __a, vector unsigned short __b) {
6433 static __inline__ vector unsigned short __ATTRS_o_ai
6434 vec_orc(vector unsigned short __a, vector bool short __b) {
6438 static __inline__ vector unsigned short __ATTRS_o_ai
6439 vec_orc(vector bool short __a, vector unsigned short __b) {
6443 static __inline__ vector bool short __ATTRS_o_ai
6444 vec_orc(vector bool short __a, vector bool short __b) {
6448 static __inline__ vector signed int __ATTRS_o_ai
6449 vec_orc(vector signed int __a, vector signed int __b) {
6453 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6454 vector bool int __b) {
6458 static __inline__ vector signed int __ATTRS_o_ai
6459 vec_orc(vector bool int __a, vector signed int __b) {
6463 static __inline__ vector unsigned int __ATTRS_o_ai
6464 vec_orc(vector unsigned int __a, vector unsigned int __b) {
6468 static __inline__ vector unsigned int __ATTRS_o_ai
6469 vec_orc(vector unsigned int __a, vector bool int __b) {
6473 static __inline__ vector unsigned int __ATTRS_o_ai
6474 vec_orc(vector bool int __a, vector unsigned int __b) {
6478 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6479 vector bool int __b) {
6483 static __inline__ vector float __ATTRS_o_ai
6484 vec_orc(vector bool int __a, vector float __b) {
6485 return (vector float)(__a | ~(vector unsigned int)__b);
6488 static __inline__ vector float __ATTRS_o_ai
6489 vec_orc(vector float __a, vector bool int __b) {
6490 return (vector float)((vector unsigned int)__a | ~__b);
6493 static __inline__ vector signed long long __ATTRS_o_ai
6494 vec_orc(vector signed long long __a, vector signed long long __b) {
6498 static __inline__ vector signed long long __ATTRS_o_ai
6499 vec_orc(vector signed long long __a, vector bool long long __b) {
6503 static __inline__ vector signed long long __ATTRS_o_ai
6504 vec_orc(vector bool long long __a, vector signed long long __b) {
6508 static __inline__ vector unsigned long long __ATTRS_o_ai
6509 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6513 static __inline__ vector unsigned long long __ATTRS_o_ai
6514 vec_orc(vector unsigned long long __a, vector bool long long __b) {
6518 static __inline__ vector unsigned long long __ATTRS_o_ai
6519 vec_orc(vector bool long long __a, vector unsigned long long __b) {
6523 static __inline__ vector bool long long __ATTRS_o_ai
6524 vec_orc(vector bool long long __a, vector bool long long __b) {
6528 static __inline__ vector double __ATTRS_o_ai
6529 vec_orc(vector double __a, vector bool long long __b) {
6530 return (vector double)((vector unsigned long long)__a | ~__b);
6533 static __inline__ vector double __ATTRS_o_ai
6534 vec_orc(vector bool long long __a, vector double __b) {
6535 return (vector double)(__a | ~(vector unsigned long long)__b);
6541 static __inline__ vector signed char __ATTRS_o_ai
6542 vec_vor(vector signed char __a, vector signed char __b) {
6546 static __inline__ vector signed char __ATTRS_o_ai
6547 vec_vor(vector bool char __a, vector signed char __b) {
6548 return (vector signed char)__a | __b;
6551 static __inline__ vector signed char __ATTRS_o_ai
6552 vec_vor(vector signed char __a, vector bool char __b) {
6553 return __a | (vector signed char)__b;
6556 static __inline__ vector unsigned char __ATTRS_o_ai
6557 vec_vor(vector unsigned char __a, vector unsigned char __b) {
6561 static __inline__ vector unsigned char __ATTRS_o_ai
6562 vec_vor(vector bool char __a, vector unsigned char __b) {
6563 return (vector unsigned char)__a | __b;
6566 static __inline__ vector unsigned char __ATTRS_o_ai
6567 vec_vor(vector unsigned char __a, vector bool char __b) {
6568 return __a | (vector unsigned char)__b;
6571 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6572 vector bool char __b) {
6576 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6581 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6583 return (vector short)__a | __b;
6586 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6587 vector bool short __b) {
6588 return __a | (vector short)__b;
6591 static __inline__ vector unsigned short __ATTRS_o_ai
6592 vec_vor(vector unsigned short __a, vector unsigned short __b) {
6596 static __inline__ vector unsigned short __ATTRS_o_ai
6597 vec_vor(vector bool short __a, vector unsigned short __b) {
6598 return (vector unsigned short)__a | __b;
6601 static __inline__ vector unsigned short __ATTRS_o_ai
6602 vec_vor(vector unsigned short __a, vector bool short __b) {
6603 return __a | (vector unsigned short)__b;
6606 static __inline__ vector bool short __ATTRS_o_ai
6607 vec_vor(vector bool short __a, vector bool short __b) {
6611 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6616 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6618 return (vector int)__a | __b;
6621 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6622 vector bool int __b) {
6623 return __a | (vector int)__b;
6626 static __inline__ vector unsigned int __ATTRS_o_ai
6627 vec_vor(vector unsigned int __a, vector unsigned int __b) {
6631 static __inline__ vector unsigned int __ATTRS_o_ai
6632 vec_vor(vector bool int __a, vector unsigned int __b) {
6633 return (vector unsigned int)__a | __b;
6636 static __inline__ vector unsigned int __ATTRS_o_ai
6637 vec_vor(vector unsigned int __a, vector bool int __b) {
6638 return __a | (vector unsigned int)__b;
6641 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6642 vector bool int __b) {
6646 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6648 vector unsigned int __res =
6649 (vector unsigned int)__a | (vector unsigned int)__b;
6650 return (vector float)__res;
6653 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6655 vector unsigned int __res =
6656 (vector unsigned int)__a | (vector unsigned int)__b;
6657 return (vector float)__res;
6660 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6661 vector bool int __b) {
6662 vector unsigned int __res =
6663 (vector unsigned int)__a | (vector unsigned int)__b;
6664 return (vector float)__res;
6668 static __inline__ vector signed long long __ATTRS_o_ai
6669 vec_vor(vector signed long long __a, vector signed long long __b) {
6673 static __inline__ vector signed long long __ATTRS_o_ai
6674 vec_vor(vector bool long long __a, vector signed long long __b) {
6675 return (vector signed long long)__a | __b;
6678 static __inline__ vector signed long long __ATTRS_o_ai
6679 vec_vor(vector signed long long __a, vector bool long long __b) {
6680 return __a | (vector signed long long)__b;
6683 static __inline__ vector unsigned long long __ATTRS_o_ai
6684 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6688 static __inline__ vector unsigned long long __ATTRS_o_ai
6689 vec_vor(vector bool long long __a, vector unsigned long long __b) {
6690 return (vector unsigned long long)__a | __b;
6693 static __inline__ vector unsigned long long __ATTRS_o_ai
6694 vec_vor(vector unsigned long long __a, vector bool long long __b) {
6695 return __a | (vector unsigned long long)__b;
6698 static __inline__ vector bool long long __ATTRS_o_ai
6699 vec_vor(vector bool long long __a, vector bool long long __b) {
6706 /* The various vector pack instructions have a big-endian bias, so for
6707 little endian we must handle reversed element numbering. */
6709 static __inline__ vector signed char __ATTRS_o_ai
6710 vec_pack(vector signed short __a, vector signed short __b) {
6711 #ifdef __LITTLE_ENDIAN__
6712 return (vector signed char)vec_perm(
6714 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6715 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6717 return (vector signed char)vec_perm(
6719 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6720 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6724 static __inline__ vector unsigned char __ATTRS_o_ai
6725 vec_pack(vector unsigned short __a, vector unsigned short __b) {
6726 #ifdef __LITTLE_ENDIAN__
6727 return (vector unsigned char)vec_perm(
6729 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6730 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6732 return (vector unsigned char)vec_perm(
6734 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6735 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6739 static __inline__ vector bool char __ATTRS_o_ai
6740 vec_pack(vector bool short __a, vector bool short __b) {
6741 #ifdef __LITTLE_ENDIAN__
6742 return (vector bool char)vec_perm(
6744 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6745 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6747 return (vector bool char)vec_perm(
6749 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6750 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6754 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6756 #ifdef __LITTLE_ENDIAN__
6757 return (vector short)vec_perm(
6759 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6760 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6762 return (vector short)vec_perm(
6764 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6765 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6769 static __inline__ vector unsigned short __ATTRS_o_ai
6770 vec_pack(vector unsigned int __a, vector unsigned int __b) {
6771 #ifdef __LITTLE_ENDIAN__
6772 return (vector unsigned short)vec_perm(
6774 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6775 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6777 return (vector unsigned short)vec_perm(
6779 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6780 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6784 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6785 vector bool int __b) {
6786 #ifdef __LITTLE_ENDIAN__
6787 return (vector bool short)vec_perm(
6789 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6790 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6792 return (vector bool short)vec_perm(
6794 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6795 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6800 static __inline__ vector signed int __ATTRS_o_ai
6801 vec_pack(vector signed long long __a, vector signed long long __b) {
6802 #ifdef __LITTLE_ENDIAN__
6803 return (vector signed int)vec_perm(
6805 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6806 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6808 return (vector signed int)vec_perm(
6810 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6811 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6814 static __inline__ vector unsigned int __ATTRS_o_ai
6815 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6816 #ifdef __LITTLE_ENDIAN__
6817 return (vector unsigned int)vec_perm(
6819 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6820 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6822 return (vector unsigned int)vec_perm(
6824 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6825 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6829 static __inline__ vector bool int __ATTRS_o_ai
6830 vec_pack(vector bool long long __a, vector bool long long __b) {
6831 #ifdef __LITTLE_ENDIAN__
6832 return (vector bool int)vec_perm(
6834 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6835 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6837 return (vector bool int)vec_perm(
6839 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6840 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6844 static __inline__ vector float __ATTRS_o_ai
6845 vec_pack(vector double __a, vector double __b) {
6846 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6850 #ifdef __POWER9_VECTOR__
6851 static __inline__ vector unsigned short __ATTRS_o_ai
6852 vec_pack_to_short_fp32(vector float __a, vector float __b) {
6853 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6854 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6855 #ifdef __LITTLE_ENDIAN__
6856 return (vector unsigned short)vec_mergee(__resa, __resb);
6858 return (vector unsigned short)vec_mergeo(__resa, __resb);
6865 #define __builtin_altivec_vpkuhum vec_vpkuhum
6867 static __inline__ vector signed char __ATTRS_o_ai
6868 vec_vpkuhum(vector signed short __a, vector signed short __b) {
6869 #ifdef __LITTLE_ENDIAN__
6870 return (vector signed char)vec_perm(
6872 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6873 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6875 return (vector signed char)vec_perm(
6877 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6878 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6882 static __inline__ vector unsigned char __ATTRS_o_ai
6883 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6884 #ifdef __LITTLE_ENDIAN__
6885 return (vector unsigned char)vec_perm(
6887 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6888 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6890 return (vector unsigned char)vec_perm(
6892 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6893 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6897 static __inline__ vector bool char __ATTRS_o_ai
6898 vec_vpkuhum(vector bool short __a, vector bool short __b) {
6899 #ifdef __LITTLE_ENDIAN__
6900 return (vector bool char)vec_perm(
6902 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6903 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6905 return (vector bool char)vec_perm(
6907 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6908 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6914 #define __builtin_altivec_vpkuwum vec_vpkuwum
6916 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6918 #ifdef __LITTLE_ENDIAN__
6919 return (vector short)vec_perm(
6921 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6922 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6924 return (vector short)vec_perm(
6926 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6927 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6931 static __inline__ vector unsigned short __ATTRS_o_ai
6932 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6933 #ifdef __LITTLE_ENDIAN__
6934 return (vector unsigned short)vec_perm(
6936 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6937 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6939 return (vector unsigned short)vec_perm(
6941 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6942 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6946 static __inline__ vector bool short __ATTRS_o_ai
6947 vec_vpkuwum(vector bool int __a, vector bool int __b) {
6948 #ifdef __LITTLE_ENDIAN__
6949 return (vector bool short)vec_perm(
6951 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6952 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6954 return (vector bool short)vec_perm(
6956 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6957 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6963 #ifdef __POWER8_VECTOR__
6964 #define __builtin_altivec_vpkudum vec_vpkudum
6966 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
6967 vector long long __b) {
6968 #ifdef __LITTLE_ENDIAN__
6969 return (vector int)vec_perm(
6971 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6972 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6974 return (vector int)vec_perm(
6976 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6977 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6981 static __inline__ vector unsigned int __ATTRS_o_ai
6982 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
6983 #ifdef __LITTLE_ENDIAN__
6984 return (vector unsigned int)vec_perm(
6986 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6987 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6989 return (vector unsigned int)vec_perm(
6991 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6992 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6996 static __inline__ vector bool int __ATTRS_o_ai
6997 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
6998 #ifdef __LITTLE_ENDIAN__
6999 return (vector bool int)vec_perm(
7000 (vector long long)__a, (vector long long)__b,
7001 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7002 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7004 return (vector bool int)vec_perm(
7005 (vector long long)__a, (vector long long)__b,
7006 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7007 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7014 static __inline__ vector pixel __attribute__((__always_inline__))
7015 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7016 #ifdef __LITTLE_ENDIAN__
7017 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7019 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7025 static __inline__ vector pixel __attribute__((__always_inline__))
7026 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7027 #ifdef __LITTLE_ENDIAN__
7028 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7030 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7036 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7038 #ifdef __LITTLE_ENDIAN__
7039 return __builtin_altivec_vpkshss(__b, __a);
7041 return __builtin_altivec_vpkshss(__a, __b);
7045 static __inline__ vector unsigned char __ATTRS_o_ai
7046 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7047 #ifdef __LITTLE_ENDIAN__
7048 return __builtin_altivec_vpkuhus(__b, __a);
7050 return __builtin_altivec_vpkuhus(__a, __b);
7054 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7056 #ifdef __LITTLE_ENDIAN__
7057 return __builtin_altivec_vpkswss(__b, __a);
7059 return __builtin_altivec_vpkswss(__a, __b);
7063 static __inline__ vector unsigned short __ATTRS_o_ai
7064 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7065 #ifdef __LITTLE_ENDIAN__
7066 return __builtin_altivec_vpkuwus(__b, __a);
7068 return __builtin_altivec_vpkuwus(__a, __b);
7072 #ifdef __POWER8_VECTOR__
7073 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7074 vector long long __b) {
7075 #ifdef __LITTLE_ENDIAN__
7076 return __builtin_altivec_vpksdss(__b, __a);
7078 return __builtin_altivec_vpksdss(__a, __b);
7082 static __inline__ vector unsigned int __ATTRS_o_ai
7083 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7084 #ifdef __LITTLE_ENDIAN__
7085 return __builtin_altivec_vpkudus(__b, __a);
7087 return __builtin_altivec_vpkudus(__a, __b);
7094 static __inline__ vector signed char __attribute__((__always_inline__))
7095 vec_vpkshss(vector short __a, vector short __b) {
7096 #ifdef __LITTLE_ENDIAN__
7097 return __builtin_altivec_vpkshss(__b, __a);
7099 return __builtin_altivec_vpkshss(__a, __b);
7105 #ifdef __POWER8_VECTOR__
7106 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7107 vector long long __b) {
7108 #ifdef __LITTLE_ENDIAN__
7109 return __builtin_altivec_vpksdss(__b, __a);
7111 return __builtin_altivec_vpksdss(__a, __b);
7118 static __inline__ vector unsigned char __attribute__((__always_inline__))
7119 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7120 #ifdef __LITTLE_ENDIAN__
7121 return __builtin_altivec_vpkuhus(__b, __a);
7123 return __builtin_altivec_vpkuhus(__a, __b);
7129 #ifdef __POWER8_VECTOR__
7130 static __inline__ vector unsigned int __attribute__((__always_inline__))
7131 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7132 #ifdef __LITTLE_ENDIAN__
7133 return __builtin_altivec_vpkudus(__b, __a);
7135 return __builtin_altivec_vpkudus(__a, __b);
7142 static __inline__ vector signed short __attribute__((__always_inline__))
7143 vec_vpkswss(vector int __a, vector int __b) {
7144 #ifdef __LITTLE_ENDIAN__
7145 return __builtin_altivec_vpkswss(__b, __a);
7147 return __builtin_altivec_vpkswss(__a, __b);
7153 static __inline__ vector unsigned short __attribute__((__always_inline__))
7154 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7155 #ifdef __LITTLE_ENDIAN__
7156 return __builtin_altivec_vpkuwus(__b, __a);
7158 return __builtin_altivec_vpkuwus(__a, __b);
7164 static __inline__ vector unsigned char __ATTRS_o_ai
7165 vec_packsu(vector short __a, vector short __b) {
7166 #ifdef __LITTLE_ENDIAN__
7167 return __builtin_altivec_vpkshus(__b, __a);
7169 return __builtin_altivec_vpkshus(__a, __b);
7173 static __inline__ vector unsigned char __ATTRS_o_ai
7174 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7175 #ifdef __LITTLE_ENDIAN__
7176 return __builtin_altivec_vpkuhus(__b, __a);
7178 return __builtin_altivec_vpkuhus(__a, __b);
7182 static __inline__ vector unsigned short __ATTRS_o_ai
7183 vec_packsu(vector int __a, vector int __b) {
7184 #ifdef __LITTLE_ENDIAN__
7185 return __builtin_altivec_vpkswus(__b, __a);
7187 return __builtin_altivec_vpkswus(__a, __b);
7191 static __inline__ vector unsigned short __ATTRS_o_ai
7192 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7193 #ifdef __LITTLE_ENDIAN__
7194 return __builtin_altivec_vpkuwus(__b, __a);
7196 return __builtin_altivec_vpkuwus(__a, __b);
7200 #ifdef __POWER8_VECTOR__
7201 static __inline__ vector unsigned int __ATTRS_o_ai
7202 vec_packsu(vector long long __a, vector long long __b) {
7203 #ifdef __LITTLE_ENDIAN__
7204 return __builtin_altivec_vpksdus(__b, __a);
7206 return __builtin_altivec_vpksdus(__a, __b);
7210 static __inline__ vector unsigned int __ATTRS_o_ai
7211 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7212 #ifdef __LITTLE_ENDIAN__
7213 return __builtin_altivec_vpkudus(__b, __a);
7215 return __builtin_altivec_vpkudus(__a, __b);
7222 static __inline__ vector unsigned char __ATTRS_o_ai
7223 vec_vpkshus(vector short __a, vector short __b) {
7224 #ifdef __LITTLE_ENDIAN__
7225 return __builtin_altivec_vpkshus(__b, __a);
7227 return __builtin_altivec_vpkshus(__a, __b);
7231 static __inline__ vector unsigned char __ATTRS_o_ai
7232 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7233 #ifdef __LITTLE_ENDIAN__
7234 return __builtin_altivec_vpkuhus(__b, __a);
7236 return __builtin_altivec_vpkuhus(__a, __b);
7242 static __inline__ vector unsigned short __ATTRS_o_ai
7243 vec_vpkswus(vector int __a, vector int __b) {
7244 #ifdef __LITTLE_ENDIAN__
7245 return __builtin_altivec_vpkswus(__b, __a);
7247 return __builtin_altivec_vpkswus(__a, __b);
7251 static __inline__ vector unsigned short __ATTRS_o_ai
7252 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7253 #ifdef __LITTLE_ENDIAN__
7254 return __builtin_altivec_vpkuwus(__b, __a);
7256 return __builtin_altivec_vpkuwus(__a, __b);
7262 #ifdef __POWER8_VECTOR__
7263 static __inline__ vector unsigned int __ATTRS_o_ai
7264 vec_vpksdus(vector long long __a, vector long long __b) {
7265 #ifdef __LITTLE_ENDIAN__
7266 return __builtin_altivec_vpksdus(__b, __a);
7268 return __builtin_altivec_vpksdus(__a, __b);
7275 // The vperm instruction is defined architecturally with a big-endian bias.
7276 // For little endian, we swap the input operands and invert the permute
7277 // control vector. Only the rightmost 5 bits matter, so we could use
7278 // a vector of all 31s instead of all 255s to perform the inversion.
7279 // However, when the PCV is not a constant, using 255 has an advantage
7280 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7281 // later, possibly a vec_nand).
7283 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7284 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7285 #ifdef __LITTLE_ENDIAN__
7286 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7287 255, 255, 255, 255, 255, 255, 255, 255};
7288 __d = vec_xor(__c, __d);
7289 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7290 (vector int)__a, __d);
7292 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7293 (vector int)__b, __c);
7297 static __inline__ vector unsigned char __ATTRS_o_ai
7298 vec_perm(vector unsigned char __a, vector unsigned char __b,
7299 vector unsigned char __c) {
7300 #ifdef __LITTLE_ENDIAN__
7301 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7302 255, 255, 255, 255, 255, 255, 255, 255};
7303 __d = vec_xor(__c, __d);
7304 return (vector unsigned char)__builtin_altivec_vperm_4si(
7305 (vector int)__b, (vector int)__a, __d);
7307 return (vector unsigned char)__builtin_altivec_vperm_4si(
7308 (vector int)__a, (vector int)__b, __c);
7312 static __inline__ vector bool char __ATTRS_o_ai
7313 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7314 #ifdef __LITTLE_ENDIAN__
7315 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7316 255, 255, 255, 255, 255, 255, 255, 255};
7317 __d = vec_xor(__c, __d);
7318 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7319 (vector int)__a, __d);
7321 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7322 (vector int)__b, __c);
7326 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7327 vector signed short __b,
7328 vector unsigned char __c) {
7329 #ifdef __LITTLE_ENDIAN__
7330 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7331 255, 255, 255, 255, 255, 255, 255, 255};
7332 __d = vec_xor(__c, __d);
7333 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7334 (vector int)__a, __d);
7336 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7337 (vector int)__b, __c);
7341 static __inline__ vector unsigned short __ATTRS_o_ai
7342 vec_perm(vector unsigned short __a, vector unsigned short __b,
7343 vector unsigned char __c) {
7344 #ifdef __LITTLE_ENDIAN__
7345 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7346 255, 255, 255, 255, 255, 255, 255, 255};
7347 __d = vec_xor(__c, __d);
7348 return (vector unsigned short)__builtin_altivec_vperm_4si(
7349 (vector int)__b, (vector int)__a, __d);
7351 return (vector unsigned short)__builtin_altivec_vperm_4si(
7352 (vector int)__a, (vector int)__b, __c);
7356 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7357 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7358 #ifdef __LITTLE_ENDIAN__
7359 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7360 255, 255, 255, 255, 255, 255, 255, 255};
7361 __d = vec_xor(__c, __d);
7362 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7363 (vector int)__a, __d);
7365 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7366 (vector int)__b, __c);
7370 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7372 vector unsigned char __c) {
7373 #ifdef __LITTLE_ENDIAN__
7374 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7375 255, 255, 255, 255, 255, 255, 255, 255};
7376 __d = vec_xor(__c, __d);
7377 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7378 (vector int)__a, __d);
7380 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7381 (vector int)__b, __c);
7385 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7386 vector signed int __b,
7387 vector unsigned char __c) {
7388 #ifdef __LITTLE_ENDIAN__
7389 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7390 255, 255, 255, 255, 255, 255, 255, 255};
7391 __d = vec_xor(__c, __d);
7392 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7394 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7398 static __inline__ vector unsigned int __ATTRS_o_ai
7399 vec_perm(vector unsigned int __a, vector unsigned int __b,
7400 vector unsigned char __c) {
7401 #ifdef __LITTLE_ENDIAN__
7402 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7403 255, 255, 255, 255, 255, 255, 255, 255};
7404 __d = vec_xor(__c, __d);
7405 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7406 (vector int)__a, __d);
7408 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7409 (vector int)__b, __c);
7413 static __inline__ vector bool int __ATTRS_o_ai
7414 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7415 #ifdef __LITTLE_ENDIAN__
7416 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7417 255, 255, 255, 255, 255, 255, 255, 255};
7418 __d = vec_xor(__c, __d);
7419 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
7420 (vector int)__a, __d);
7422 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7423 (vector int)__b, __c);
7427 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7429 vector unsigned char __c) {
7430 #ifdef __LITTLE_ENDIAN__
7431 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7432 255, 255, 255, 255, 255, 255, 255, 255};
7433 __d = vec_xor(__c, __d);
7434 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7435 (vector int)__a, __d);
7437 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7438 (vector int)__b, __c);
7443 static __inline__ vector long long __ATTRS_o_ai
7444 vec_perm(vector signed long long __a, vector signed long long __b,
7445 vector unsigned char __c) {
7446 #ifdef __LITTLE_ENDIAN__
7447 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7448 255, 255, 255, 255, 255, 255, 255, 255};
7449 __d = vec_xor(__c, __d);
7450 return (vector signed long long)__builtin_altivec_vperm_4si(
7451 (vector int)__b, (vector int)__a, __d);
7453 return (vector signed long long)__builtin_altivec_vperm_4si(
7454 (vector int)__a, (vector int)__b, __c);
7458 static __inline__ vector unsigned long long __ATTRS_o_ai
7459 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7460 vector unsigned char __c) {
7461 #ifdef __LITTLE_ENDIAN__
7462 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7463 255, 255, 255, 255, 255, 255, 255, 255};
7464 __d = vec_xor(__c, __d);
7465 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7466 (vector int)__b, (vector int)__a, __d);
7468 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7469 (vector int)__a, (vector int)__b, __c);
7473 static __inline__ vector bool long long __ATTRS_o_ai
7474 vec_perm(vector bool long long __a, vector bool long long __b,
7475 vector unsigned char __c) {
7476 #ifdef __LITTLE_ENDIAN__
7477 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7478 255, 255, 255, 255, 255, 255, 255, 255};
7479 __d = vec_xor(__c, __d);
7480 return (vector bool long long)__builtin_altivec_vperm_4si(
7481 (vector int)__b, (vector int)__a, __d);
7483 return (vector bool long long)__builtin_altivec_vperm_4si(
7484 (vector int)__a, (vector int)__b, __c);
7488 static __inline__ vector double __ATTRS_o_ai
7489 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
7490 #ifdef __LITTLE_ENDIAN__
7491 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7492 255, 255, 255, 255, 255, 255, 255, 255};
7493 __d = vec_xor(__c, __d);
7494 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
7495 (vector int)__a, __d);
7497 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7498 (vector int)__b, __c);
7505 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7506 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7507 return vec_perm(__a, __b, __c);
7510 static __inline__ vector unsigned char __ATTRS_o_ai
7511 vec_vperm(vector unsigned char __a, vector unsigned char __b,
7512 vector unsigned char __c) {
7513 return vec_perm(__a, __b, __c);
7516 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7517 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7518 return vec_perm(__a, __b, __c);
7521 static __inline__ vector short __ATTRS_o_ai
7522 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7523 return vec_perm(__a, __b, __c);
7526 static __inline__ vector unsigned short __ATTRS_o_ai
7527 vec_vperm(vector unsigned short __a, vector unsigned short __b,
7528 vector unsigned char __c) {
7529 return vec_perm(__a, __b, __c);
7532 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7533 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7534 return vec_perm(__a, __b, __c);
7537 static __inline__ vector pixel __ATTRS_o_ai
7538 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7539 return vec_perm(__a, __b, __c);
7542 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7544 vector unsigned char __c) {
7545 return vec_perm(__a, __b, __c);
7548 static __inline__ vector unsigned int __ATTRS_o_ai
7549 vec_vperm(vector unsigned int __a, vector unsigned int __b,
7550 vector unsigned char __c) {
7551 return vec_perm(__a, __b, __c);
7554 static __inline__ vector bool int __ATTRS_o_ai
7555 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7556 return vec_perm(__a, __b, __c);
7559 static __inline__ vector float __ATTRS_o_ai
7560 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7561 return vec_perm(__a, __b, __c);
7565 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7566 vector long long __a, vector long long __b, vector unsigned char __c) {
7567 return vec_perm(__a, __b, __c);
7570 static __inline__ vector unsigned long long __ATTRS_o_ai
7571 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7572 vector unsigned char __c) {
7573 return vec_perm(__a, __b, __c);
7576 static __inline__ vector double __ATTRS_o_ai
7577 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7578 return vec_perm(__a, __b, __c);
7584 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7586 return __builtin_vsx_xvresp(__a);
7588 return __builtin_altivec_vrefp(__a);
7593 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7594 return __builtin_vsx_xvredp(__a);
7600 static __inline__ vector float __attribute__((__always_inline__))
7601 vec_vrefp(vector float __a) {
7602 return __builtin_altivec_vrefp(__a);
7607 static __inline__ vector signed char __ATTRS_o_ai
7608 vec_rl(vector signed char __a, vector unsigned char __b) {
7609 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7612 static __inline__ vector unsigned char __ATTRS_o_ai
7613 vec_rl(vector unsigned char __a, vector unsigned char __b) {
7614 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7617 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7618 vector unsigned short __b) {
7619 return __builtin_altivec_vrlh(__a, __b);
7622 static __inline__ vector unsigned short __ATTRS_o_ai
7623 vec_rl(vector unsigned short __a, vector unsigned short __b) {
7624 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7627 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7628 vector unsigned int __b) {
7629 return __builtin_altivec_vrlw(__a, __b);
7632 static __inline__ vector unsigned int __ATTRS_o_ai
7633 vec_rl(vector unsigned int __a, vector unsigned int __b) {
7634 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7637 #ifdef __POWER8_VECTOR__
7638 static __inline__ vector signed long long __ATTRS_o_ai
7639 vec_rl(vector signed long long __a, vector unsigned long long __b) {
7640 return __builtin_altivec_vrld(__a, __b);
7643 static __inline__ vector unsigned long long __ATTRS_o_ai
7644 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7645 return __builtin_altivec_vrld(__a, __b);
7650 #ifdef __POWER9_VECTOR__
7651 static __inline__ vector unsigned int __ATTRS_o_ai
7652 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7653 vector unsigned int __c) {
7654 return __builtin_altivec_vrlwmi(__a, __c, __b);
7657 static __inline__ vector unsigned long long __ATTRS_o_ai
7658 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7659 vector unsigned long long __c) {
7660 return __builtin_altivec_vrldmi(__a, __c, __b);
7664 static __inline__ vector unsigned int __ATTRS_o_ai
7665 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7666 vector unsigned int __c) {
7667 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7668 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7671 static __inline__ vector unsigned long long __ATTRS_o_ai
7672 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7673 vector unsigned long long __c) {
7674 vector unsigned long long OneByte = { 0x8, 0x8 };
7675 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7681 static __inline__ vector signed char __ATTRS_o_ai
7682 vec_vrlb(vector signed char __a, vector unsigned char __b) {
7683 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7686 static __inline__ vector unsigned char __ATTRS_o_ai
7687 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7688 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7693 static __inline__ vector short __ATTRS_o_ai
7694 vec_vrlh(vector short __a, vector unsigned short __b) {
7695 return __builtin_altivec_vrlh(__a, __b);
7698 static __inline__ vector unsigned short __ATTRS_o_ai
7699 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7700 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7705 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7706 vector unsigned int __b) {
7707 return __builtin_altivec_vrlw(__a, __b);
7710 static __inline__ vector unsigned int __ATTRS_o_ai
7711 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7712 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7717 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7719 return __builtin_vsx_xvrspi(__a);
7721 return __builtin_altivec_vrfin(__a);
7726 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7727 return __builtin_vsx_xvrdpi(__a);
7732 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7733 return __builtin_vsx_xvrspic(__a);
7736 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7737 return __builtin_vsx_xvrdpic(__a);
7742 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7743 return __builtin_vsx_xvrspi(__a);
7746 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7747 return __builtin_vsx_xvrdpi(__a);
7753 static __inline__ vector float __attribute__((__always_inline__))
7754 vec_vrfin(vector float __a) {
7755 return __builtin_altivec_vrfin(__a);
7761 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7762 return __builtin_vsx_xvsqrtsp(__a);
7765 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7766 return __builtin_vsx_xvsqrtdp(__a);
7772 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7774 return __builtin_vsx_xvrsqrtesp(__a);
7776 return __builtin_altivec_vrsqrtefp(__a);
7781 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7782 return __builtin_vsx_xvrsqrtedp(__a);
7788 static __inline__ __vector float __attribute__((__always_inline__))
7789 vec_vrsqrtefp(vector float __a) {
7790 return __builtin_altivec_vrsqrtefp(__a);
7795 #define __builtin_altivec_vsel_4si vec_sel
7797 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7798 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7799 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7802 static __inline__ vector signed char __ATTRS_o_ai
7803 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7804 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7807 static __inline__ vector unsigned char __ATTRS_o_ai
7808 vec_sel(vector unsigned char __a, vector unsigned char __b,
7809 vector unsigned char __c) {
7810 return (__a & ~__c) | (__b & __c);
7813 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7814 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7815 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7818 static __inline__ vector bool char __ATTRS_o_ai
7819 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7820 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7823 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7824 vector bool char __b,
7825 vector bool char __c) {
7826 return (__a & ~__c) | (__b & __c);
7829 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7831 vector unsigned short __c) {
7832 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7835 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7837 vector bool short __c) {
7838 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7841 static __inline__ vector unsigned short __ATTRS_o_ai
7842 vec_sel(vector unsigned short __a, vector unsigned short __b,
7843 vector unsigned short __c) {
7844 return (__a & ~__c) | (__b & __c);
7847 static __inline__ vector unsigned short __ATTRS_o_ai
7848 vec_sel(vector unsigned short __a, vector unsigned short __b,
7849 vector bool short __c) {
7850 return (__a & ~(vector unsigned short)__c) |
7851 (__b & (vector unsigned short)__c);
7854 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7855 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7856 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7859 static __inline__ vector bool short __ATTRS_o_ai
7860 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7861 return (__a & ~__c) | (__b & __c);
7864 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7866 vector unsigned int __c) {
7867 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7870 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7872 vector bool int __c) {
7873 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7876 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7877 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7878 return (__a & ~__c) | (__b & __c);
7881 static __inline__ vector unsigned int __ATTRS_o_ai
7882 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7883 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7886 static __inline__ vector bool int __ATTRS_o_ai
7887 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7888 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7891 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7892 vector bool int __b,
7893 vector bool int __c) {
7894 return (__a & ~__c) | (__b & __c);
7897 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7899 vector unsigned int __c) {
7900 vector int __res = ((vector int)__a & ~(vector int)__c) |
7901 ((vector int)__b & (vector int)__c);
7902 return (vector float)__res;
7905 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7907 vector bool int __c) {
7908 vector int __res = ((vector int)__a & ~(vector int)__c) |
7909 ((vector int)__b & (vector int)__c);
7910 return (vector float)__res;
7914 static __inline__ vector double __ATTRS_o_ai
7915 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7916 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7917 ((vector long long)__b & (vector long long)__c);
7918 return (vector double)__res;
7921 static __inline__ vector double __ATTRS_o_ai
7922 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7923 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7924 ((vector long long)__b & (vector long long)__c);
7925 return (vector double)__res;
7931 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7932 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7933 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7936 static __inline__ vector signed char __ATTRS_o_ai
7937 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7938 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7941 static __inline__ vector unsigned char __ATTRS_o_ai
7942 vec_vsel(vector unsigned char __a, vector unsigned char __b,
7943 vector unsigned char __c) {
7944 return (__a & ~__c) | (__b & __c);
7947 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7948 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7949 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7952 static __inline__ vector bool char __ATTRS_o_ai
7953 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7954 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7957 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7958 vector bool char __b,
7959 vector bool char __c) {
7960 return (__a & ~__c) | (__b & __c);
7963 static __inline__ vector short __ATTRS_o_ai
7964 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
7965 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7968 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
7970 vector bool short __c) {
7971 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7974 static __inline__ vector unsigned short __ATTRS_o_ai
7975 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7976 vector unsigned short __c) {
7977 return (__a & ~__c) | (__b & __c);
7980 static __inline__ vector unsigned short __ATTRS_o_ai
7981 vec_vsel(vector unsigned short __a, vector unsigned short __b,
7982 vector bool short __c) {
7983 return (__a & ~(vector unsigned short)__c) |
7984 (__b & (vector unsigned short)__c);
7987 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
7988 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7989 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7992 static __inline__ vector bool short __ATTRS_o_ai
7993 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
7994 return (__a & ~__c) | (__b & __c);
7997 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
7999 vector unsigned int __c) {
8000 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8003 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8005 vector bool int __c) {
8006 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8009 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8010 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8011 return (__a & ~__c) | (__b & __c);
8014 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8015 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8016 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8019 static __inline__ vector bool int __ATTRS_o_ai
8020 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8021 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8024 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8025 vector bool int __b,
8026 vector bool int __c) {
8027 return (__a & ~__c) | (__b & __c);
8030 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8032 vector unsigned int __c) {
8033 vector int __res = ((vector int)__a & ~(vector int)__c) |
8034 ((vector int)__b & (vector int)__c);
8035 return (vector float)__res;
8038 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8040 vector bool int __c) {
8041 vector int __res = ((vector int)__a & ~(vector int)__c) |
8042 ((vector int)__b & (vector int)__c);
8043 return (vector float)__res;
8048 static __inline__ vector signed char __ATTRS_o_ai
8049 vec_sl(vector signed char __a, vector unsigned char __b) {
8050 return __a << (vector signed char)__b;
8053 static __inline__ vector unsigned char __ATTRS_o_ai
8054 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8058 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8059 vector unsigned short __b) {
8060 return __a << (vector short)__b;
8063 static __inline__ vector unsigned short __ATTRS_o_ai
8064 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8068 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8069 vector unsigned int __b) {
8070 return __a << (vector int)__b;
8073 static __inline__ vector unsigned int __ATTRS_o_ai
8074 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8078 #ifdef __POWER8_VECTOR__
8079 static __inline__ vector signed long long __ATTRS_o_ai
8080 vec_sl(vector signed long long __a, vector unsigned long long __b) {
8081 return __a << (vector long long)__b;
8084 static __inline__ vector unsigned long long __ATTRS_o_ai
8085 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8092 #define __builtin_altivec_vslb vec_vslb
8094 static __inline__ vector signed char __ATTRS_o_ai
8095 vec_vslb(vector signed char __a, vector unsigned char __b) {
8096 return vec_sl(__a, __b);
8099 static __inline__ vector unsigned char __ATTRS_o_ai
8100 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8101 return vec_sl(__a, __b);
8106 #define __builtin_altivec_vslh vec_vslh
8108 static __inline__ vector short __ATTRS_o_ai
8109 vec_vslh(vector short __a, vector unsigned short __b) {
8110 return vec_sl(__a, __b);
8113 static __inline__ vector unsigned short __ATTRS_o_ai
8114 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8115 return vec_sl(__a, __b);
8120 #define __builtin_altivec_vslw vec_vslw
8122 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8123 vector unsigned int __b) {
8124 return vec_sl(__a, __b);
8127 static __inline__ vector unsigned int __ATTRS_o_ai
8128 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8129 return vec_sl(__a, __b);
8134 #define __builtin_altivec_vsldoi_4si vec_sld
8136 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8137 vector signed char __a, vector signed char __b, unsigned const int __c) {
8138 unsigned char __d = __c & 0x0F;
8139 #ifdef __LITTLE_ENDIAN__
8141 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8142 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8143 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8144 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8148 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8149 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8150 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8154 static __inline__ vector unsigned char __ATTRS_o_ai
8155 vec_sld(vector unsigned char __a, vector unsigned char __b,
8156 unsigned const int __c) {
8157 unsigned char __d = __c & 0x0F;
8158 #ifdef __LITTLE_ENDIAN__
8160 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8161 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8162 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8163 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8167 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8168 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8169 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8173 static __inline__ vector bool char __ATTRS_o_ai
8174 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8175 unsigned char __d = __c & 0x0F;
8176 #ifdef __LITTLE_ENDIAN__
8178 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8179 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8180 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8181 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8185 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8186 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8187 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8191 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8192 vector signed short __a, vector signed short __b, unsigned const int __c) {
8193 unsigned char __d = __c & 0x0F;
8194 #ifdef __LITTLE_ENDIAN__
8196 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8197 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8198 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8199 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8203 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8204 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8205 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8209 static __inline__ vector unsigned short __ATTRS_o_ai
8210 vec_sld(vector unsigned short __a, vector unsigned short __b,
8211 unsigned const int __c) {
8212 unsigned char __d = __c & 0x0F;
8213 #ifdef __LITTLE_ENDIAN__
8215 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8216 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8217 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8218 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8222 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8223 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8224 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8228 static __inline__ vector bool short __ATTRS_o_ai
8229 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8230 unsigned char __d = __c & 0x0F;
8231 #ifdef __LITTLE_ENDIAN__
8233 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8234 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8235 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8236 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8240 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8241 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8242 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8246 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8248 unsigned const int __c) {
8249 unsigned char __d = __c & 0x0F;
8250 #ifdef __LITTLE_ENDIAN__
8252 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8253 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8254 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8255 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8259 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8260 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8261 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8265 static __inline__ vector signed int __ATTRS_o_ai
8266 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
8267 unsigned char __d = __c & 0x0F;
8268 #ifdef __LITTLE_ENDIAN__
8270 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8271 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8272 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8273 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8277 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8278 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8279 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8283 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8284 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8285 unsigned char __d = __c & 0x0F;
8286 #ifdef __LITTLE_ENDIAN__
8288 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8289 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8290 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8291 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8295 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8296 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8297 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8301 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8302 vector bool int __b,
8303 unsigned const int __c) {
8304 unsigned char __d = __c & 0x0F;
8305 #ifdef __LITTLE_ENDIAN__
8307 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8308 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8309 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8310 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8314 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8315 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8316 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8320 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8322 unsigned const int __c) {
8323 unsigned char __d = __c & 0x0F;
8324 #ifdef __LITTLE_ENDIAN__
8326 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8327 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8328 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8329 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8333 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8334 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8335 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8340 static __inline__ vector bool long long __ATTRS_o_ai
8341 vec_sld(vector bool long long __a, vector bool long long __b,
8342 unsigned const int __c) {
8343 unsigned char __d = __c & 0x0F;
8344 #ifdef __LITTLE_ENDIAN__
8346 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8347 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8348 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8349 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8353 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8354 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8355 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8359 static __inline__ vector signed long long __ATTRS_o_ai
8360 vec_sld(vector signed long long __a, vector signed long long __b,
8361 unsigned const int __c) {
8362 unsigned char __d = __c & 0x0F;
8363 #ifdef __LITTLE_ENDIAN__
8365 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8366 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8367 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8368 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8372 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8373 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8374 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8378 static __inline__ vector unsigned long long __ATTRS_o_ai
8379 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8380 unsigned const int __c) {
8381 unsigned char __d = __c & 0x0F;
8382 #ifdef __LITTLE_ENDIAN__
8384 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8385 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8386 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8387 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8391 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8392 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8393 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8397 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8399 unsigned const int __c) {
8400 unsigned char __d = __c & 0x0F;
8401 #ifdef __LITTLE_ENDIAN__
8403 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8404 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8405 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8406 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8410 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8411 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8412 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8418 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8419 vector signed char __a, vector signed char __b, unsigned const int __c) {
8420 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8423 static __inline__ vector unsigned char __ATTRS_o_ai
8424 vec_sldw(vector unsigned char __a, vector unsigned char __b,
8425 unsigned const int __c) {
8426 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8429 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8430 vector signed short __a, vector signed short __b, unsigned const int __c) {
8431 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8434 static __inline__ vector unsigned short __ATTRS_o_ai
8435 vec_sldw(vector unsigned short __a, vector unsigned short __b,
8436 unsigned const int __c) {
8437 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8440 static __inline__ vector signed int __ATTRS_o_ai
8441 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8442 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8445 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8446 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8447 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8451 static __inline__ vector signed long long __ATTRS_o_ai
8452 vec_sldw(vector signed long long __a, vector signed long long __b,
8453 unsigned const int __c) {
8454 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8457 static __inline__ vector unsigned long long __ATTRS_o_ai
8458 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8459 unsigned const int __c) {
8460 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8464 #ifdef __POWER9_VECTOR__
8466 static __inline__ vector unsigned char __ATTRS_o_ai
8467 vec_slv(vector unsigned char __a, vector unsigned char __b) {
8468 return __builtin_altivec_vslv(__a, __b);
8472 static __inline__ vector unsigned char __ATTRS_o_ai
8473 vec_srv(vector unsigned char __a, vector unsigned char __b) {
8474 return __builtin_altivec_vsrv(__a, __b);
8480 static __inline__ vector signed char __ATTRS_o_ai
8481 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8482 unsigned char __d = __c & 0x0F;
8483 #ifdef __LITTLE_ENDIAN__
8485 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8486 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8487 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8488 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8492 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8493 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8494 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8498 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8499 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
8500 unsigned char __d = __c & 0x0F;
8501 #ifdef __LITTLE_ENDIAN__
8503 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8504 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8505 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8506 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8510 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8511 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8512 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8516 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
8518 unsigned char __c) {
8519 unsigned char __d = __c & 0x0F;
8520 #ifdef __LITTLE_ENDIAN__
8522 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8523 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8524 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8525 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8529 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8530 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8531 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8535 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
8536 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
8537 unsigned char __d = __c & 0x0F;
8538 #ifdef __LITTLE_ENDIAN__
8540 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8541 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8542 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8543 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8547 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8548 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8549 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8553 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
8555 unsigned char __c) {
8556 unsigned char __d = __c & 0x0F;
8557 #ifdef __LITTLE_ENDIAN__
8559 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8560 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8561 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8562 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8566 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8567 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8568 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8572 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8574 unsigned char __c) {
8575 unsigned char __d = __c & 0x0F;
8576 #ifdef __LITTLE_ENDIAN__
8578 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8579 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8580 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8581 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8585 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8586 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8587 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8591 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8592 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8593 unsigned char __d = __c & 0x0F;
8594 #ifdef __LITTLE_ENDIAN__
8596 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8597 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8598 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8599 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8603 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8604 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8605 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8609 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8611 unsigned char __c) {
8612 unsigned char __d = __c & 0x0F;
8613 #ifdef __LITTLE_ENDIAN__
8615 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8616 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8617 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8618 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8622 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8623 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8624 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8630 static __inline__ vector signed char __ATTRS_o_ai
8631 vec_sll(vector signed char __a, vector unsigned char __b) {
8632 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8636 static __inline__ vector signed char __ATTRS_o_ai
8637 vec_sll(vector signed char __a, vector unsigned short __b) {
8638 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8642 static __inline__ vector signed char __ATTRS_o_ai
8643 vec_sll(vector signed char __a, vector unsigned int __b) {
8644 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8648 static __inline__ vector unsigned char __ATTRS_o_ai
8649 vec_sll(vector unsigned char __a, vector unsigned char __b) {
8650 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8654 static __inline__ vector unsigned char __ATTRS_o_ai
8655 vec_sll(vector unsigned char __a, vector unsigned short __b) {
8656 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8660 static __inline__ vector unsigned char __ATTRS_o_ai
8661 vec_sll(vector unsigned char __a, vector unsigned int __b) {
8662 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8666 static __inline__ vector bool char __ATTRS_o_ai
8667 vec_sll(vector bool char __a, vector unsigned char __b) {
8668 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8672 static __inline__ vector bool char __ATTRS_o_ai
8673 vec_sll(vector bool char __a, vector unsigned short __b) {
8674 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8678 static __inline__ vector bool char __ATTRS_o_ai
8679 vec_sll(vector bool char __a, vector unsigned int __b) {
8680 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8684 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8685 vector unsigned char __b) {
8686 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8689 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8690 vector unsigned short __b) {
8691 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8694 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8695 vector unsigned int __b) {
8696 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8699 static __inline__ vector unsigned short __ATTRS_o_ai
8700 vec_sll(vector unsigned short __a, vector unsigned char __b) {
8701 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8705 static __inline__ vector unsigned short __ATTRS_o_ai
8706 vec_sll(vector unsigned short __a, vector unsigned short __b) {
8707 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8711 static __inline__ vector unsigned short __ATTRS_o_ai
8712 vec_sll(vector unsigned short __a, vector unsigned int __b) {
8713 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8717 static __inline__ vector bool short __ATTRS_o_ai
8718 vec_sll(vector bool short __a, vector unsigned char __b) {
8719 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8723 static __inline__ vector bool short __ATTRS_o_ai
8724 vec_sll(vector bool short __a, vector unsigned short __b) {
8725 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8729 static __inline__ vector bool short __ATTRS_o_ai
8730 vec_sll(vector bool short __a, vector unsigned int __b) {
8731 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8735 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8736 vector unsigned char __b) {
8737 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8740 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8741 vector unsigned short __b) {
8742 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8745 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8746 vector unsigned int __b) {
8747 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8750 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8751 vector unsigned char __b) {
8752 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8755 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8756 vector unsigned short __b) {
8757 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8760 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8761 vector unsigned int __b) {
8762 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8765 static __inline__ vector unsigned int __ATTRS_o_ai
8766 vec_sll(vector unsigned int __a, vector unsigned char __b) {
8767 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8771 static __inline__ vector unsigned int __ATTRS_o_ai
8772 vec_sll(vector unsigned int __a, vector unsigned short __b) {
8773 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8777 static __inline__ vector unsigned int __ATTRS_o_ai
8778 vec_sll(vector unsigned int __a, vector unsigned int __b) {
8779 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8783 static __inline__ vector bool int __ATTRS_o_ai
8784 vec_sll(vector bool int __a, vector unsigned char __b) {
8785 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8789 static __inline__ vector bool int __ATTRS_o_ai
8790 vec_sll(vector bool int __a, vector unsigned short __b) {
8791 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8795 static __inline__ vector bool int __ATTRS_o_ai
8796 vec_sll(vector bool int __a, vector unsigned int __b) {
8797 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8802 static __inline__ vector signed long long __ATTRS_o_ai
8803 vec_sll(vector signed long long __a, vector unsigned char __b) {
8804 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8808 static __inline__ vector unsigned long long __ATTRS_o_ai
8809 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8810 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8817 static __inline__ vector signed char __ATTRS_o_ai
8818 vec_vsl(vector signed char __a, vector unsigned char __b) {
8819 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8823 static __inline__ vector signed char __ATTRS_o_ai
8824 vec_vsl(vector signed char __a, vector unsigned short __b) {
8825 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8829 static __inline__ vector signed char __ATTRS_o_ai
8830 vec_vsl(vector signed char __a, vector unsigned int __b) {
8831 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8835 static __inline__ vector unsigned char __ATTRS_o_ai
8836 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8837 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8841 static __inline__ vector unsigned char __ATTRS_o_ai
8842 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8843 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8847 static __inline__ vector unsigned char __ATTRS_o_ai
8848 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8849 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8853 static __inline__ vector bool char __ATTRS_o_ai
8854 vec_vsl(vector bool char __a, vector unsigned char __b) {
8855 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8859 static __inline__ vector bool char __ATTRS_o_ai
8860 vec_vsl(vector bool char __a, vector unsigned short __b) {
8861 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8865 static __inline__ vector bool char __ATTRS_o_ai
8866 vec_vsl(vector bool char __a, vector unsigned int __b) {
8867 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8871 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8872 vector unsigned char __b) {
8873 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8876 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8877 vector unsigned short __b) {
8878 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8881 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8882 vector unsigned int __b) {
8883 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8886 static __inline__ vector unsigned short __ATTRS_o_ai
8887 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8888 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8892 static __inline__ vector unsigned short __ATTRS_o_ai
8893 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8894 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8898 static __inline__ vector unsigned short __ATTRS_o_ai
8899 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8900 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8904 static __inline__ vector bool short __ATTRS_o_ai
8905 vec_vsl(vector bool short __a, vector unsigned char __b) {
8906 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8910 static __inline__ vector bool short __ATTRS_o_ai
8911 vec_vsl(vector bool short __a, vector unsigned short __b) {
8912 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8916 static __inline__ vector bool short __ATTRS_o_ai
8917 vec_vsl(vector bool short __a, vector unsigned int __b) {
8918 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8922 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8923 vector unsigned char __b) {
8924 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8927 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8928 vector unsigned short __b) {
8929 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8932 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8933 vector unsigned int __b) {
8934 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8937 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8938 vector unsigned char __b) {
8939 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8942 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8943 vector unsigned short __b) {
8944 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8947 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8948 vector unsigned int __b) {
8949 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8952 static __inline__ vector unsigned int __ATTRS_o_ai
8953 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8954 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8958 static __inline__ vector unsigned int __ATTRS_o_ai
8959 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
8960 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8964 static __inline__ vector unsigned int __ATTRS_o_ai
8965 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
8966 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8970 static __inline__ vector bool int __ATTRS_o_ai
8971 vec_vsl(vector bool int __a, vector unsigned char __b) {
8972 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8976 static __inline__ vector bool int __ATTRS_o_ai
8977 vec_vsl(vector bool int __a, vector unsigned short __b) {
8978 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8982 static __inline__ vector bool int __ATTRS_o_ai
8983 vec_vsl(vector bool int __a, vector unsigned int __b) {
8984 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8990 static __inline__ vector signed char __ATTRS_o_ai
8991 vec_slo(vector signed char __a, vector signed char __b) {
8992 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
8996 static __inline__ vector signed char __ATTRS_o_ai
8997 vec_slo(vector signed char __a, vector unsigned char __b) {
8998 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9002 static __inline__ vector unsigned char __ATTRS_o_ai
9003 vec_slo(vector unsigned char __a, vector signed char __b) {
9004 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9008 static __inline__ vector unsigned char __ATTRS_o_ai
9009 vec_slo(vector unsigned char __a, vector unsigned char __b) {
9010 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9014 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9015 vector signed char __b) {
9016 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9019 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9020 vector unsigned char __b) {
9021 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9024 static __inline__ vector unsigned short __ATTRS_o_ai
9025 vec_slo(vector unsigned short __a, vector signed char __b) {
9026 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9030 static __inline__ vector unsigned short __ATTRS_o_ai
9031 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9032 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9036 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9037 vector signed char __b) {
9038 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9041 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9042 vector unsigned char __b) {
9043 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9046 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9047 vector signed char __b) {
9048 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9051 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9052 vector unsigned char __b) {
9053 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9056 static __inline__ vector unsigned int __ATTRS_o_ai
9057 vec_slo(vector unsigned int __a, vector signed char __b) {
9058 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9062 static __inline__ vector unsigned int __ATTRS_o_ai
9063 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9064 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9068 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9069 vector signed char __b) {
9070 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9073 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9074 vector unsigned char __b) {
9075 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9079 static __inline__ vector signed long long __ATTRS_o_ai
9080 vec_slo(vector signed long long __a, vector signed char __b) {
9081 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9085 static __inline__ vector signed long long __ATTRS_o_ai
9086 vec_slo(vector signed long long __a, vector unsigned char __b) {
9087 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9091 static __inline__ vector unsigned long long __ATTRS_o_ai
9092 vec_slo(vector unsigned long long __a, vector signed char __b) {
9093 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9097 static __inline__ vector unsigned long long __ATTRS_o_ai
9098 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9099 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9106 static __inline__ vector signed char __ATTRS_o_ai
9107 vec_vslo(vector signed char __a, vector signed char __b) {
9108 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9112 static __inline__ vector signed char __ATTRS_o_ai
9113 vec_vslo(vector signed char __a, vector unsigned char __b) {
9114 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9118 static __inline__ vector unsigned char __ATTRS_o_ai
9119 vec_vslo(vector unsigned char __a, vector signed char __b) {
9120 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9124 static __inline__ vector unsigned char __ATTRS_o_ai
9125 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9126 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9130 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9131 vector signed char __b) {
9132 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9135 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9136 vector unsigned char __b) {
9137 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9140 static __inline__ vector unsigned short __ATTRS_o_ai
9141 vec_vslo(vector unsigned short __a, vector signed char __b) {
9142 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9146 static __inline__ vector unsigned short __ATTRS_o_ai
9147 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9148 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9152 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9153 vector signed char __b) {
9154 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9157 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9158 vector unsigned char __b) {
9159 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9162 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9163 vector signed char __b) {
9164 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9167 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9168 vector unsigned char __b) {
9169 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9172 static __inline__ vector unsigned int __ATTRS_o_ai
9173 vec_vslo(vector unsigned int __a, vector signed char __b) {
9174 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9178 static __inline__ vector unsigned int __ATTRS_o_ai
9179 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9180 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9184 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9185 vector signed char __b) {
9186 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9189 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9190 vector unsigned char __b) {
9191 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9196 static __inline__ vector signed char __ATTRS_o_ai
9197 vec_splat(vector signed char __a, unsigned const int __b) {
9198 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9201 static __inline__ vector unsigned char __ATTRS_o_ai
9202 vec_splat(vector unsigned char __a, unsigned const int __b) {
9203 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9206 static __inline__ vector bool char __ATTRS_o_ai
9207 vec_splat(vector bool char __a, unsigned const int __b) {
9208 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9211 static __inline__ vector signed short __ATTRS_o_ai
9212 vec_splat(vector signed short __a, unsigned const int __b) {
9213 unsigned char b0 = (__b & 0x07) * 2;
9214 unsigned char b1 = b0 + 1;
9215 return vec_perm(__a, __a,
9216 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9217 b0, b1, b0, b1, b0, b1));
9220 static __inline__ vector unsigned short __ATTRS_o_ai
9221 vec_splat(vector unsigned short __a, unsigned const int __b) {
9222 unsigned char b0 = (__b & 0x07) * 2;
9223 unsigned char b1 = b0 + 1;
9224 return vec_perm(__a, __a,
9225 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9226 b0, b1, b0, b1, b0, b1));
9229 static __inline__ vector bool short __ATTRS_o_ai
9230 vec_splat(vector bool short __a, unsigned const int __b) {
9231 unsigned char b0 = (__b & 0x07) * 2;
9232 unsigned char b1 = b0 + 1;
9233 return vec_perm(__a, __a,
9234 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9235 b0, b1, b0, b1, b0, b1));
9238 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9239 unsigned const int __b) {
9240 unsigned char b0 = (__b & 0x07) * 2;
9241 unsigned char b1 = b0 + 1;
9242 return vec_perm(__a, __a,
9243 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9244 b0, b1, b0, b1, b0, b1));
9247 static __inline__ vector signed int __ATTRS_o_ai
9248 vec_splat(vector signed int __a, unsigned const int __b) {
9249 unsigned char b0 = (__b & 0x03) * 4;
9250 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9251 return vec_perm(__a, __a,
9252 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9253 b2, b3, b0, b1, b2, b3));
9256 static __inline__ vector unsigned int __ATTRS_o_ai
9257 vec_splat(vector unsigned int __a, unsigned const int __b) {
9258 unsigned char b0 = (__b & 0x03) * 4;
9259 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9260 return vec_perm(__a, __a,
9261 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9262 b2, b3, b0, b1, b2, b3));
9265 static __inline__ vector bool int __ATTRS_o_ai
9266 vec_splat(vector bool int __a, unsigned const int __b) {
9267 unsigned char b0 = (__b & 0x03) * 4;
9268 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9269 return vec_perm(__a, __a,
9270 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9271 b2, b3, b0, b1, b2, b3));
9274 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9275 unsigned const int __b) {
9276 unsigned char b0 = (__b & 0x03) * 4;
9277 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9278 return vec_perm(__a, __a,
9279 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9280 b2, b3, b0, b1, b2, b3));
9284 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9285 unsigned const int __b) {
9286 unsigned char b0 = (__b & 0x01) * 8;
9287 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9288 b6 = b0 + 6, b7 = b0 + 7;
9289 return vec_perm(__a, __a,
9290 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9291 b2, b3, b4, b5, b6, b7));
9293 static __inline__ vector bool long long __ATTRS_o_ai
9294 vec_splat(vector bool long long __a, unsigned const int __b) {
9295 unsigned char b0 = (__b & 0x01) * 8;
9296 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9297 b6 = b0 + 6, b7 = b0 + 7;
9298 return vec_perm(__a, __a,
9299 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9300 b2, b3, b4, b5, b6, b7));
9302 static __inline__ vector signed long long __ATTRS_o_ai
9303 vec_splat(vector signed long long __a, unsigned const int __b) {
9304 unsigned char b0 = (__b & 0x01) * 8;
9305 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9306 b6 = b0 + 6, b7 = b0 + 7;
9307 return vec_perm(__a, __a,
9308 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9309 b2, b3, b4, b5, b6, b7));
9311 static __inline__ vector unsigned long long __ATTRS_o_ai
9312 vec_splat(vector unsigned long long __a, unsigned const int __b) {
9313 unsigned char b0 = (__b & 0x01) * 8;
9314 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9315 b6 = b0 + 6, b7 = b0 + 7;
9316 return vec_perm(__a, __a,
9317 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9318 b2, b3, b4, b5, b6, b7));
9324 #define __builtin_altivec_vspltb vec_vspltb
9326 static __inline__ vector signed char __ATTRS_o_ai
9327 vec_vspltb(vector signed char __a, unsigned char __b) {
9328 return vec_perm(__a, __a, (vector unsigned char)(__b));
9331 static __inline__ vector unsigned char __ATTRS_o_ai
9332 vec_vspltb(vector unsigned char __a, unsigned char __b) {
9333 return vec_perm(__a, __a, (vector unsigned char)(__b));
9336 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9337 unsigned char __b) {
9338 return vec_perm(__a, __a, (vector unsigned char)(__b));
9343 #define __builtin_altivec_vsplth vec_vsplth
9345 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9346 unsigned char __b) {
9348 unsigned char b1 = __b + 1;
9349 return vec_perm(__a, __a,
9350 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9351 __b, b1, __b, b1, __b, b1, __b, b1));
9354 static __inline__ vector unsigned short __ATTRS_o_ai
9355 vec_vsplth(vector unsigned short __a, unsigned char __b) {
9357 unsigned char b1 = __b + 1;
9358 return vec_perm(__a, __a,
9359 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9360 __b, b1, __b, b1, __b, b1, __b, b1));
9363 static __inline__ vector bool short __ATTRS_o_ai
9364 vec_vsplth(vector bool short __a, unsigned char __b) {
9366 unsigned char b1 = __b + 1;
9367 return vec_perm(__a, __a,
9368 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9369 __b, b1, __b, b1, __b, b1, __b, b1));
9372 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9373 unsigned char __b) {
9375 unsigned char b1 = __b + 1;
9376 return vec_perm(__a, __a,
9377 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9378 __b, b1, __b, b1, __b, b1, __b, b1));
9383 #define __builtin_altivec_vspltw vec_vspltw
9385 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9386 unsigned char __b) {
9388 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9389 return vec_perm(__a, __a,
9390 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9391 b1, b2, b3, __b, b1, b2, b3));
9394 static __inline__ vector unsigned int __ATTRS_o_ai
9395 vec_vspltw(vector unsigned int __a, unsigned char __b) {
9397 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9398 return vec_perm(__a, __a,
9399 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9400 b1, b2, b3, __b, b1, b2, b3));
9403 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9404 unsigned char __b) {
9406 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9407 return vec_perm(__a, __a,
9408 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9409 b1, b2, b3, __b, b1, b2, b3));
9412 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9413 unsigned char __b) {
9415 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9416 return vec_perm(__a, __a,
9417 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9418 b1, b2, b3, __b, b1, b2, b3));
9423 #define __builtin_altivec_vspltisb vec_splat_s8
9425 // FIXME: parameter should be treated as 5-bit signed literal
9426 static __inline__ vector signed char __ATTRS_o_ai
9427 vec_splat_s8(signed char __a) {
9428 return (vector signed char)(__a);
9433 // FIXME: parameter should be treated as 5-bit signed literal
9434 static __inline__ vector signed char __ATTRS_o_ai
9435 vec_vspltisb(signed char __a) {
9436 return (vector signed char)(__a);
9441 #define __builtin_altivec_vspltish vec_splat_s16
9443 // FIXME: parameter should be treated as 5-bit signed literal
9444 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9445 return (vector short)(__a);
9450 // FIXME: parameter should be treated as 5-bit signed literal
9451 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9452 return (vector short)(__a);
9457 #define __builtin_altivec_vspltisw vec_splat_s32
9459 // FIXME: parameter should be treated as 5-bit signed literal
9460 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9461 return (vector int)(__a);
9466 // FIXME: parameter should be treated as 5-bit signed literal
9467 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9468 return (vector int)(__a);
9473 // FIXME: parameter should be treated as 5-bit signed literal
9474 static __inline__ vector unsigned char __ATTRS_o_ai
9475 vec_splat_u8(unsigned char __a) {
9476 return (vector unsigned char)(__a);
9481 // FIXME: parameter should be treated as 5-bit signed literal
9482 static __inline__ vector unsigned short __ATTRS_o_ai
9483 vec_splat_u16(signed char __a) {
9484 return (vector unsigned short)(__a);
9489 // FIXME: parameter should be treated as 5-bit signed literal
9490 static __inline__ vector unsigned int __ATTRS_o_ai
9491 vec_splat_u32(signed char __a) {
9492 return (vector unsigned int)(__a);
9497 static __inline__ vector signed char __ATTRS_o_ai
9498 vec_sr(vector signed char __a, vector unsigned char __b) {
9499 vector unsigned char __res = (vector unsigned char)__a >> __b;
9500 return (vector signed char)__res;
9503 static __inline__ vector unsigned char __ATTRS_o_ai
9504 vec_sr(vector unsigned char __a, vector unsigned char __b) {
9508 static __inline__ vector signed short __ATTRS_o_ai
9509 vec_sr(vector signed short __a, vector unsigned short __b) {
9510 vector unsigned short __res = (vector unsigned short)__a >> __b;
9511 return (vector signed short)__res;
9514 static __inline__ vector unsigned short __ATTRS_o_ai
9515 vec_sr(vector unsigned short __a, vector unsigned short __b) {
9519 static __inline__ vector signed int __ATTRS_o_ai
9520 vec_sr(vector signed int __a, vector unsigned int __b) {
9521 vector unsigned int __res = (vector unsigned int)__a >> __b;
9522 return (vector signed int)__res;
9525 static __inline__ vector unsigned int __ATTRS_o_ai
9526 vec_sr(vector unsigned int __a, vector unsigned int __b) {
9530 #ifdef __POWER8_VECTOR__
9531 static __inline__ vector signed long long __ATTRS_o_ai
9532 vec_sr(vector signed long long __a, vector unsigned long long __b) {
9533 vector unsigned long long __res = (vector unsigned long long)__a >> __b;
9534 return (vector signed long long)__res;
9537 static __inline__ vector unsigned long long __ATTRS_o_ai
9538 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9545 #define __builtin_altivec_vsrb vec_vsrb
9547 static __inline__ vector signed char __ATTRS_o_ai
9548 vec_vsrb(vector signed char __a, vector unsigned char __b) {
9549 return __a >> (vector signed char)__b;
9552 static __inline__ vector unsigned char __ATTRS_o_ai
9553 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9559 #define __builtin_altivec_vsrh vec_vsrh
9561 static __inline__ vector short __ATTRS_o_ai
9562 vec_vsrh(vector short __a, vector unsigned short __b) {
9563 return __a >> (vector short)__b;
9566 static __inline__ vector unsigned short __ATTRS_o_ai
9567 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9573 #define __builtin_altivec_vsrw vec_vsrw
9575 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9576 vector unsigned int __b) {
9577 return __a >> (vector int)__b;
9580 static __inline__ vector unsigned int __ATTRS_o_ai
9581 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9587 static __inline__ vector signed char __ATTRS_o_ai
9588 vec_sra(vector signed char __a, vector unsigned char __b) {
9589 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9592 static __inline__ vector unsigned char __ATTRS_o_ai
9593 vec_sra(vector unsigned char __a, vector unsigned char __b) {
9594 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9597 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9598 vector unsigned short __b) {
9599 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9602 static __inline__ vector unsigned short __ATTRS_o_ai
9603 vec_sra(vector unsigned short __a, vector unsigned short __b) {
9604 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9607 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9608 vector unsigned int __b) {
9609 return __builtin_altivec_vsraw(__a, __b);
9612 static __inline__ vector unsigned int __ATTRS_o_ai
9613 vec_sra(vector unsigned int __a, vector unsigned int __b) {
9614 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9617 #ifdef __POWER8_VECTOR__
9618 static __inline__ vector signed long long __ATTRS_o_ai
9619 vec_sra(vector signed long long __a, vector unsigned long long __b) {
9623 static __inline__ vector unsigned long long __ATTRS_o_ai
9624 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9625 return (vector unsigned long long)((vector signed long long)__a >> __b);
9631 static __inline__ vector signed char __ATTRS_o_ai
9632 vec_vsrab(vector signed char __a, vector unsigned char __b) {
9633 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9636 static __inline__ vector unsigned char __ATTRS_o_ai
9637 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9638 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9643 static __inline__ vector short __ATTRS_o_ai
9644 vec_vsrah(vector short __a, vector unsigned short __b) {
9645 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9648 static __inline__ vector unsigned short __ATTRS_o_ai
9649 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9650 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9655 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9656 vector unsigned int __b) {
9657 return __builtin_altivec_vsraw(__a, __b);
9660 static __inline__ vector unsigned int __ATTRS_o_ai
9661 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9662 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9667 static __inline__ vector signed char __ATTRS_o_ai
9668 vec_srl(vector signed char __a, vector unsigned char __b) {
9669 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9673 static __inline__ vector signed char __ATTRS_o_ai
9674 vec_srl(vector signed char __a, vector unsigned short __b) {
9675 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9679 static __inline__ vector signed char __ATTRS_o_ai
9680 vec_srl(vector signed char __a, vector unsigned int __b) {
9681 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9685 static __inline__ vector unsigned char __ATTRS_o_ai
9686 vec_srl(vector unsigned char __a, vector unsigned char __b) {
9687 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9691 static __inline__ vector unsigned char __ATTRS_o_ai
9692 vec_srl(vector unsigned char __a, vector unsigned short __b) {
9693 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9697 static __inline__ vector unsigned char __ATTRS_o_ai
9698 vec_srl(vector unsigned char __a, vector unsigned int __b) {
9699 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9703 static __inline__ vector bool char __ATTRS_o_ai
9704 vec_srl(vector bool char __a, vector unsigned char __b) {
9705 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9709 static __inline__ vector bool char __ATTRS_o_ai
9710 vec_srl(vector bool char __a, vector unsigned short __b) {
9711 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9715 static __inline__ vector bool char __ATTRS_o_ai
9716 vec_srl(vector bool char __a, vector unsigned int __b) {
9717 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9721 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9722 vector unsigned char __b) {
9723 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9726 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9727 vector unsigned short __b) {
9728 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9731 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9732 vector unsigned int __b) {
9733 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9736 static __inline__ vector unsigned short __ATTRS_o_ai
9737 vec_srl(vector unsigned short __a, vector unsigned char __b) {
9738 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9742 static __inline__ vector unsigned short __ATTRS_o_ai
9743 vec_srl(vector unsigned short __a, vector unsigned short __b) {
9744 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9748 static __inline__ vector unsigned short __ATTRS_o_ai
9749 vec_srl(vector unsigned short __a, vector unsigned int __b) {
9750 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9754 static __inline__ vector bool short __ATTRS_o_ai
9755 vec_srl(vector bool short __a, vector unsigned char __b) {
9756 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9760 static __inline__ vector bool short __ATTRS_o_ai
9761 vec_srl(vector bool short __a, vector unsigned short __b) {
9762 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9766 static __inline__ vector bool short __ATTRS_o_ai
9767 vec_srl(vector bool short __a, vector unsigned int __b) {
9768 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9772 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9773 vector unsigned char __b) {
9774 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9777 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9778 vector unsigned short __b) {
9779 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9782 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9783 vector unsigned int __b) {
9784 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9787 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9788 vector unsigned char __b) {
9789 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9792 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9793 vector unsigned short __b) {
9794 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9797 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9798 vector unsigned int __b) {
9799 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9802 static __inline__ vector unsigned int __ATTRS_o_ai
9803 vec_srl(vector unsigned int __a, vector unsigned char __b) {
9804 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9808 static __inline__ vector unsigned int __ATTRS_o_ai
9809 vec_srl(vector unsigned int __a, vector unsigned short __b) {
9810 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9814 static __inline__ vector unsigned int __ATTRS_o_ai
9815 vec_srl(vector unsigned int __a, vector unsigned int __b) {
9816 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9820 static __inline__ vector bool int __ATTRS_o_ai
9821 vec_srl(vector bool int __a, vector unsigned char __b) {
9822 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9826 static __inline__ vector bool int __ATTRS_o_ai
9827 vec_srl(vector bool int __a, vector unsigned short __b) {
9828 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9832 static __inline__ vector bool int __ATTRS_o_ai
9833 vec_srl(vector bool int __a, vector unsigned int __b) {
9834 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9839 static __inline__ vector signed long long __ATTRS_o_ai
9840 vec_srl(vector signed long long __a, vector unsigned char __b) {
9841 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9845 static __inline__ vector unsigned long long __ATTRS_o_ai
9846 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9847 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9854 static __inline__ vector signed char __ATTRS_o_ai
9855 vec_vsr(vector signed char __a, vector unsigned char __b) {
9856 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9860 static __inline__ vector signed char __ATTRS_o_ai
9861 vec_vsr(vector signed char __a, vector unsigned short __b) {
9862 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9866 static __inline__ vector signed char __ATTRS_o_ai
9867 vec_vsr(vector signed char __a, vector unsigned int __b) {
9868 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9872 static __inline__ vector unsigned char __ATTRS_o_ai
9873 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9874 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9878 static __inline__ vector unsigned char __ATTRS_o_ai
9879 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9880 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9884 static __inline__ vector unsigned char __ATTRS_o_ai
9885 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9886 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9890 static __inline__ vector bool char __ATTRS_o_ai
9891 vec_vsr(vector bool char __a, vector unsigned char __b) {
9892 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9896 static __inline__ vector bool char __ATTRS_o_ai
9897 vec_vsr(vector bool char __a, vector unsigned short __b) {
9898 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9902 static __inline__ vector bool char __ATTRS_o_ai
9903 vec_vsr(vector bool char __a, vector unsigned int __b) {
9904 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9908 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9909 vector unsigned char __b) {
9910 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9913 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9914 vector unsigned short __b) {
9915 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9918 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9919 vector unsigned int __b) {
9920 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9923 static __inline__ vector unsigned short __ATTRS_o_ai
9924 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9925 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9929 static __inline__ vector unsigned short __ATTRS_o_ai
9930 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9931 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9935 static __inline__ vector unsigned short __ATTRS_o_ai
9936 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9937 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9941 static __inline__ vector bool short __ATTRS_o_ai
9942 vec_vsr(vector bool short __a, vector unsigned char __b) {
9943 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9947 static __inline__ vector bool short __ATTRS_o_ai
9948 vec_vsr(vector bool short __a, vector unsigned short __b) {
9949 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9953 static __inline__ vector bool short __ATTRS_o_ai
9954 vec_vsr(vector bool short __a, vector unsigned int __b) {
9955 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9959 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9960 vector unsigned char __b) {
9961 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9964 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9965 vector unsigned short __b) {
9966 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9969 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
9970 vector unsigned int __b) {
9971 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9974 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9975 vector unsigned char __b) {
9976 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9979 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9980 vector unsigned short __b) {
9981 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9984 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
9985 vector unsigned int __b) {
9986 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9989 static __inline__ vector unsigned int __ATTRS_o_ai
9990 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
9991 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9995 static __inline__ vector unsigned int __ATTRS_o_ai
9996 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
9997 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10001 static __inline__ vector unsigned int __ATTRS_o_ai
10002 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10003 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10007 static __inline__ vector bool int __ATTRS_o_ai
10008 vec_vsr(vector bool int __a, vector unsigned char __b) {
10009 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10013 static __inline__ vector bool int __ATTRS_o_ai
10014 vec_vsr(vector bool int __a, vector unsigned short __b) {
10015 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10019 static __inline__ vector bool int __ATTRS_o_ai
10020 vec_vsr(vector bool int __a, vector unsigned int __b) {
10021 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10027 static __inline__ vector signed char __ATTRS_o_ai
10028 vec_sro(vector signed char __a, vector signed char __b) {
10029 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10033 static __inline__ vector signed char __ATTRS_o_ai
10034 vec_sro(vector signed char __a, vector unsigned char __b) {
10035 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10039 static __inline__ vector unsigned char __ATTRS_o_ai
10040 vec_sro(vector unsigned char __a, vector signed char __b) {
10041 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10045 static __inline__ vector unsigned char __ATTRS_o_ai
10046 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10047 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10051 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10052 vector signed char __b) {
10053 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10056 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10057 vector unsigned char __b) {
10058 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10061 static __inline__ vector unsigned short __ATTRS_o_ai
10062 vec_sro(vector unsigned short __a, vector signed char __b) {
10063 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10067 static __inline__ vector unsigned short __ATTRS_o_ai
10068 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10069 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10073 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10074 vector signed char __b) {
10075 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10078 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10079 vector unsigned char __b) {
10080 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10083 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10084 vector signed char __b) {
10085 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10088 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10089 vector unsigned char __b) {
10090 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10093 static __inline__ vector unsigned int __ATTRS_o_ai
10094 vec_sro(vector unsigned int __a, vector signed char __b) {
10095 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10099 static __inline__ vector unsigned int __ATTRS_o_ai
10100 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10101 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10105 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10106 vector signed char __b) {
10107 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10110 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10111 vector unsigned char __b) {
10112 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10116 static __inline__ vector signed long long __ATTRS_o_ai
10117 vec_sro(vector signed long long __a, vector signed char __b) {
10118 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10122 static __inline__ vector signed long long __ATTRS_o_ai
10123 vec_sro(vector signed long long __a, vector unsigned char __b) {
10124 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10128 static __inline__ vector unsigned long long __ATTRS_o_ai
10129 vec_sro(vector unsigned long long __a, vector signed char __b) {
10130 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10134 static __inline__ vector unsigned long long __ATTRS_o_ai
10135 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10136 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10143 static __inline__ vector signed char __ATTRS_o_ai
10144 vec_vsro(vector signed char __a, vector signed char __b) {
10145 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10149 static __inline__ vector signed char __ATTRS_o_ai
10150 vec_vsro(vector signed char __a, vector unsigned char __b) {
10151 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10155 static __inline__ vector unsigned char __ATTRS_o_ai
10156 vec_vsro(vector unsigned char __a, vector signed char __b) {
10157 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10161 static __inline__ vector unsigned char __ATTRS_o_ai
10162 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10163 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10167 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10168 vector signed char __b) {
10169 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10172 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10173 vector unsigned char __b) {
10174 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10177 static __inline__ vector unsigned short __ATTRS_o_ai
10178 vec_vsro(vector unsigned short __a, vector signed char __b) {
10179 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10183 static __inline__ vector unsigned short __ATTRS_o_ai
10184 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10185 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10189 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10190 vector signed char __b) {
10191 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10194 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10195 vector unsigned char __b) {
10196 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10199 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10200 vector signed char __b) {
10201 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10204 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10205 vector unsigned char __b) {
10206 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10209 static __inline__ vector unsigned int __ATTRS_o_ai
10210 vec_vsro(vector unsigned int __a, vector signed char __b) {
10211 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10215 static __inline__ vector unsigned int __ATTRS_o_ai
10216 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10217 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10221 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10222 vector signed char __b) {
10223 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10226 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10227 vector unsigned char __b) {
10228 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10233 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10234 vector signed char *__c) {
10235 __builtin_altivec_stvx((vector int)__a, __b, __c);
10238 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10239 signed char *__c) {
10240 __builtin_altivec_stvx((vector int)__a, __b, __c);
10243 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10244 vector unsigned char *__c) {
10245 __builtin_altivec_stvx((vector int)__a, __b, __c);
10248 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10249 unsigned char *__c) {
10250 __builtin_altivec_stvx((vector int)__a, __b, __c);
10253 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10254 signed char *__c) {
10255 __builtin_altivec_stvx((vector int)__a, __b, __c);
10258 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10259 unsigned char *__c) {
10260 __builtin_altivec_stvx((vector int)__a, __b, __c);
10263 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10264 vector bool char *__c) {
10265 __builtin_altivec_stvx((vector int)__a, __b, __c);
10268 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10269 vector short *__c) {
10270 __builtin_altivec_stvx((vector int)__a, __b, __c);
10273 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10275 __builtin_altivec_stvx((vector int)__a, __b, __c);
10278 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10279 vector unsigned short *__c) {
10280 __builtin_altivec_stvx((vector int)__a, __b, __c);
10283 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10284 unsigned short *__c) {
10285 __builtin_altivec_stvx((vector int)__a, __b, __c);
10288 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10290 __builtin_altivec_stvx((vector int)__a, __b, __c);
10293 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10294 unsigned short *__c) {
10295 __builtin_altivec_stvx((vector int)__a, __b, __c);
10298 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10299 vector bool short *__c) {
10300 __builtin_altivec_stvx((vector int)__a, __b, __c);
10303 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10305 __builtin_altivec_stvx((vector int)__a, __b, __c);
10308 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10309 unsigned short *__c) {
10310 __builtin_altivec_stvx((vector int)__a, __b, __c);
10313 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10314 vector pixel *__c) {
10315 __builtin_altivec_stvx((vector int)__a, __b, __c);
10318 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10320 __builtin_altivec_stvx(__a, __b, __c);
10323 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10324 __builtin_altivec_stvx(__a, __b, __c);
10327 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10328 vector unsigned int *__c) {
10329 __builtin_altivec_stvx((vector int)__a, __b, __c);
10332 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10333 unsigned int *__c) {
10334 __builtin_altivec_stvx((vector int)__a, __b, __c);
10337 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10339 __builtin_altivec_stvx((vector int)__a, __b, __c);
10342 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10343 unsigned int *__c) {
10344 __builtin_altivec_stvx((vector int)__a, __b, __c);
10347 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10348 vector bool int *__c) {
10349 __builtin_altivec_stvx((vector int)__a, __b, __c);
10352 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10353 vector float *__c) {
10354 __builtin_altivec_stvx((vector int)__a, __b, __c);
10357 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10359 __builtin_altivec_stvx((vector int)__a, __b, __c);
10364 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10365 vector signed char *__c) {
10366 __builtin_altivec_stvx((vector int)__a, __b, __c);
10369 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10370 signed char *__c) {
10371 __builtin_altivec_stvx((vector int)__a, __b, __c);
10374 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10375 vector unsigned char *__c) {
10376 __builtin_altivec_stvx((vector int)__a, __b, __c);
10379 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10380 unsigned char *__c) {
10381 __builtin_altivec_stvx((vector int)__a, __b, __c);
10384 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10385 signed char *__c) {
10386 __builtin_altivec_stvx((vector int)__a, __b, __c);
10389 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10390 unsigned char *__c) {
10391 __builtin_altivec_stvx((vector int)__a, __b, __c);
10394 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10395 vector bool char *__c) {
10396 __builtin_altivec_stvx((vector int)__a, __b, __c);
10399 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10400 vector short *__c) {
10401 __builtin_altivec_stvx((vector int)__a, __b, __c);
10404 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10406 __builtin_altivec_stvx((vector int)__a, __b, __c);
10409 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10410 vector unsigned short *__c) {
10411 __builtin_altivec_stvx((vector int)__a, __b, __c);
10414 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10415 unsigned short *__c) {
10416 __builtin_altivec_stvx((vector int)__a, __b, __c);
10419 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10421 __builtin_altivec_stvx((vector int)__a, __b, __c);
10424 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10425 unsigned short *__c) {
10426 __builtin_altivec_stvx((vector int)__a, __b, __c);
10429 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10430 vector bool short *__c) {
10431 __builtin_altivec_stvx((vector int)__a, __b, __c);
10434 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10436 __builtin_altivec_stvx((vector int)__a, __b, __c);
10439 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10440 unsigned short *__c) {
10441 __builtin_altivec_stvx((vector int)__a, __b, __c);
10444 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10445 vector pixel *__c) {
10446 __builtin_altivec_stvx((vector int)__a, __b, __c);
10449 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10451 __builtin_altivec_stvx(__a, __b, __c);
10454 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10456 __builtin_altivec_stvx(__a, __b, __c);
10459 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10460 vector unsigned int *__c) {
10461 __builtin_altivec_stvx((vector int)__a, __b, __c);
10464 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10465 unsigned int *__c) {
10466 __builtin_altivec_stvx((vector int)__a, __b, __c);
10469 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10471 __builtin_altivec_stvx((vector int)__a, __b, __c);
10474 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10475 unsigned int *__c) {
10476 __builtin_altivec_stvx((vector int)__a, __b, __c);
10479 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10480 vector bool int *__c) {
10481 __builtin_altivec_stvx((vector int)__a, __b, __c);
10484 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10485 vector float *__c) {
10486 __builtin_altivec_stvx((vector int)__a, __b, __c);
10489 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10491 __builtin_altivec_stvx((vector int)__a, __b, __c);
10496 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10497 signed char *__c) {
10498 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10501 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10502 unsigned char *__c) {
10503 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10506 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10507 signed char *__c) {
10508 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10511 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10512 unsigned char *__c) {
10513 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10516 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10518 __builtin_altivec_stvehx(__a, __b, __c);
10521 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10522 unsigned short *__c) {
10523 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10526 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10528 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10531 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10532 unsigned short *__c) {
10533 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10536 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10538 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10541 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10542 unsigned short *__c) {
10543 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10546 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10547 __builtin_altivec_stvewx(__a, __b, __c);
10550 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10551 unsigned int *__c) {
10552 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10555 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10557 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10560 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10561 unsigned int *__c) {
10562 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10565 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10567 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10572 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10573 signed char *__c) {
10574 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10577 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10578 int __b, unsigned char *__c) {
10579 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10582 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10583 signed char *__c) {
10584 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10587 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10588 unsigned char *__c) {
10589 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10594 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10596 __builtin_altivec_stvehx(__a, __b, __c);
10599 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10600 int __b, unsigned short *__c) {
10601 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10604 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10606 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10609 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10610 unsigned short *__c) {
10611 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10614 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10616 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10619 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10620 unsigned short *__c) {
10621 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10626 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10628 __builtin_altivec_stvewx(__a, __b, __c);
10631 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10632 unsigned int *__c) {
10633 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10636 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10638 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10641 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10642 unsigned int *__c) {
10643 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10646 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10648 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10653 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10654 vector signed char *__c) {
10655 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10658 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10659 signed char *__c) {
10660 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10663 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10664 vector unsigned char *__c) {
10665 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10668 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10669 unsigned char *__c) {
10670 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10673 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10674 signed char *__c) {
10675 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10678 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10679 unsigned char *__c) {
10680 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10683 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10684 vector bool char *__c) {
10685 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10688 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10689 vector short *__c) {
10690 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10693 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10695 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10698 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10699 vector unsigned short *__c) {
10700 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10703 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10704 unsigned short *__c) {
10705 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10708 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10710 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10713 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10714 unsigned short *__c) {
10715 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10718 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10719 vector bool short *__c) {
10720 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10723 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10725 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10728 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10729 unsigned short *__c) {
10730 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10733 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10734 vector pixel *__c) {
10735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10738 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10740 __builtin_altivec_stvxl(__a, __b, __c);
10743 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10744 __builtin_altivec_stvxl(__a, __b, __c);
10747 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10748 vector unsigned int *__c) {
10749 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10752 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10753 unsigned int *__c) {
10754 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10757 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10759 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10762 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10763 unsigned int *__c) {
10764 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10767 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10768 vector bool int *__c) {
10769 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10772 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10773 vector float *__c) {
10774 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10777 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10779 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10784 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10785 vector signed char *__c) {
10786 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10789 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10790 signed char *__c) {
10791 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10794 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10795 vector unsigned char *__c) {
10796 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10799 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10800 unsigned char *__c) {
10801 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10804 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10805 signed char *__c) {
10806 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10809 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10810 unsigned char *__c) {
10811 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10814 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10815 vector bool char *__c) {
10816 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10819 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10820 vector short *__c) {
10821 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10824 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10826 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10829 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10831 vector unsigned short *__c) {
10832 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10835 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10836 int __b, unsigned short *__c) {
10837 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10840 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10842 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10845 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10846 unsigned short *__c) {
10847 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10850 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10851 vector bool short *__c) {
10852 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10855 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10857 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10860 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10861 unsigned short *__c) {
10862 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10865 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10866 vector pixel *__c) {
10867 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10870 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10872 __builtin_altivec_stvxl(__a, __b, __c);
10875 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10877 __builtin_altivec_stvxl(__a, __b, __c);
10880 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10881 vector unsigned int *__c) {
10882 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10885 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10886 unsigned int *__c) {
10887 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10890 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10892 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10895 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10896 unsigned int *__c) {
10897 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10900 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10901 vector bool int *__c) {
10902 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10905 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10906 vector float *__c) {
10907 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10910 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10912 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10917 static __inline__ vector signed char __ATTRS_o_ai
10918 vec_sub(vector signed char __a, vector signed char __b) {
10922 static __inline__ vector signed char __ATTRS_o_ai
10923 vec_sub(vector bool char __a, vector signed char __b) {
10924 return (vector signed char)__a - __b;
10927 static __inline__ vector signed char __ATTRS_o_ai
10928 vec_sub(vector signed char __a, vector bool char __b) {
10929 return __a - (vector signed char)__b;
10932 static __inline__ vector unsigned char __ATTRS_o_ai
10933 vec_sub(vector unsigned char __a, vector unsigned char __b) {
10937 static __inline__ vector unsigned char __ATTRS_o_ai
10938 vec_sub(vector bool char __a, vector unsigned char __b) {
10939 return (vector unsigned char)__a - __b;
10942 static __inline__ vector unsigned char __ATTRS_o_ai
10943 vec_sub(vector unsigned char __a, vector bool char __b) {
10944 return __a - (vector unsigned char)__b;
10947 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10948 vector short __b) {
10952 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10953 vector short __b) {
10954 return (vector short)__a - __b;
10957 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10958 vector bool short __b) {
10959 return __a - (vector short)__b;
10962 static __inline__ vector unsigned short __ATTRS_o_ai
10963 vec_sub(vector unsigned short __a, vector unsigned short __b) {
10967 static __inline__ vector unsigned short __ATTRS_o_ai
10968 vec_sub(vector bool short __a, vector unsigned short __b) {
10969 return (vector unsigned short)__a - __b;
10972 static __inline__ vector unsigned short __ATTRS_o_ai
10973 vec_sub(vector unsigned short __a, vector bool short __b) {
10974 return __a - (vector unsigned short)__b;
10977 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10982 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
10984 return (vector int)__a - __b;
10987 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
10988 vector bool int __b) {
10989 return __a - (vector int)__b;
10992 static __inline__ vector unsigned int __ATTRS_o_ai
10993 vec_sub(vector unsigned int __a, vector unsigned int __b) {
10997 static __inline__ vector unsigned int __ATTRS_o_ai
10998 vec_sub(vector bool int __a, vector unsigned int __b) {
10999 return (vector unsigned int)__a - __b;
11002 static __inline__ vector unsigned int __ATTRS_o_ai
11003 vec_sub(vector unsigned int __a, vector bool int __b) {
11004 return __a - (vector unsigned int)__b;
11007 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11008 static __inline__ vector signed __int128 __ATTRS_o_ai
11009 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11013 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11014 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11017 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11020 static __inline__ vector signed long long __ATTRS_o_ai
11021 vec_sub(vector signed long long __a, vector signed long long __b) {
11025 static __inline__ vector unsigned long long __ATTRS_o_ai
11026 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11030 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11031 vector double __b) {
11036 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11037 vector float __b) {
11043 #define __builtin_altivec_vsububm vec_vsububm
11045 static __inline__ vector signed char __ATTRS_o_ai
11046 vec_vsububm(vector signed char __a, vector signed char __b) {
11050 static __inline__ vector signed char __ATTRS_o_ai
11051 vec_vsububm(vector bool char __a, vector signed char __b) {
11052 return (vector signed char)__a - __b;
11055 static __inline__ vector signed char __ATTRS_o_ai
11056 vec_vsububm(vector signed char __a, vector bool char __b) {
11057 return __a - (vector signed char)__b;
11060 static __inline__ vector unsigned char __ATTRS_o_ai
11061 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11065 static __inline__ vector unsigned char __ATTRS_o_ai
11066 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11067 return (vector unsigned char)__a - __b;
11070 static __inline__ vector unsigned char __ATTRS_o_ai
11071 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11072 return __a - (vector unsigned char)__b;
11077 #define __builtin_altivec_vsubuhm vec_vsubuhm
11079 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11080 vector short __b) {
11084 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11085 vector short __b) {
11086 return (vector short)__a - __b;
11089 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11090 vector bool short __b) {
11091 return __a - (vector short)__b;
11094 static __inline__ vector unsigned short __ATTRS_o_ai
11095 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11099 static __inline__ vector unsigned short __ATTRS_o_ai
11100 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11101 return (vector unsigned short)__a - __b;
11104 static __inline__ vector unsigned short __ATTRS_o_ai
11105 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11106 return __a - (vector unsigned short)__b;
11111 #define __builtin_altivec_vsubuwm vec_vsubuwm
11113 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11118 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11120 return (vector int)__a - __b;
11123 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11124 vector bool int __b) {
11125 return __a - (vector int)__b;
11128 static __inline__ vector unsigned int __ATTRS_o_ai
11129 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11133 static __inline__ vector unsigned int __ATTRS_o_ai
11134 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11135 return (vector unsigned int)__a - __b;
11138 static __inline__ vector unsigned int __ATTRS_o_ai
11139 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11140 return __a - (vector unsigned int)__b;
11145 #define __builtin_altivec_vsubfp vec_vsubfp
11147 static __inline__ vector float __attribute__((__always_inline__))
11148 vec_vsubfp(vector float __a, vector float __b) {
11154 static __inline__ vector signed int __ATTRS_o_ai
11155 vec_subc(vector signed int __a, vector signed int __b) {
11156 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11157 (vector unsigned int) __b);
11160 static __inline__ vector unsigned int __ATTRS_o_ai
11161 vec_subc(vector unsigned int __a, vector unsigned int __b) {
11162 return __builtin_altivec_vsubcuw(__a, __b);
11165 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11166 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11167 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11168 return __builtin_altivec_vsubcuq(__a, __b);
11171 static __inline__ vector signed __int128 __ATTRS_o_ai
11172 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11173 return __builtin_altivec_vsubcuq(__a, __b);
11175 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11179 static __inline__ vector unsigned int __attribute__((__always_inline__))
11180 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11181 return __builtin_altivec_vsubcuw(__a, __b);
11186 static __inline__ vector signed char __ATTRS_o_ai
11187 vec_subs(vector signed char __a, vector signed char __b) {
11188 return __builtin_altivec_vsubsbs(__a, __b);
11191 static __inline__ vector signed char __ATTRS_o_ai
11192 vec_subs(vector bool char __a, vector signed char __b) {
11193 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11196 static __inline__ vector signed char __ATTRS_o_ai
11197 vec_subs(vector signed char __a, vector bool char __b) {
11198 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11201 static __inline__ vector unsigned char __ATTRS_o_ai
11202 vec_subs(vector unsigned char __a, vector unsigned char __b) {
11203 return __builtin_altivec_vsububs(__a, __b);
11206 static __inline__ vector unsigned char __ATTRS_o_ai
11207 vec_subs(vector bool char __a, vector unsigned char __b) {
11208 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11211 static __inline__ vector unsigned char __ATTRS_o_ai
11212 vec_subs(vector unsigned char __a, vector bool char __b) {
11213 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11216 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11217 vector short __b) {
11218 return __builtin_altivec_vsubshs(__a, __b);
11221 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11222 vector short __b) {
11223 return __builtin_altivec_vsubshs((vector short)__a, __b);
11226 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11227 vector bool short __b) {
11228 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11231 static __inline__ vector unsigned short __ATTRS_o_ai
11232 vec_subs(vector unsigned short __a, vector unsigned short __b) {
11233 return __builtin_altivec_vsubuhs(__a, __b);
11236 static __inline__ vector unsigned short __ATTRS_o_ai
11237 vec_subs(vector bool short __a, vector unsigned short __b) {
11238 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11241 static __inline__ vector unsigned short __ATTRS_o_ai
11242 vec_subs(vector unsigned short __a, vector bool short __b) {
11243 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11246 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11248 return __builtin_altivec_vsubsws(__a, __b);
11251 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11253 return __builtin_altivec_vsubsws((vector int)__a, __b);
11256 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11257 vector bool int __b) {
11258 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11261 static __inline__ vector unsigned int __ATTRS_o_ai
11262 vec_subs(vector unsigned int __a, vector unsigned int __b) {
11263 return __builtin_altivec_vsubuws(__a, __b);
11266 static __inline__ vector unsigned int __ATTRS_o_ai
11267 vec_subs(vector bool int __a, vector unsigned int __b) {
11268 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11271 static __inline__ vector unsigned int __ATTRS_o_ai
11272 vec_subs(vector unsigned int __a, vector bool int __b) {
11273 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11278 static __inline__ vector signed char __ATTRS_o_ai
11279 vec_vsubsbs(vector signed char __a, vector signed char __b) {
11280 return __builtin_altivec_vsubsbs(__a, __b);
11283 static __inline__ vector signed char __ATTRS_o_ai
11284 vec_vsubsbs(vector bool char __a, vector signed char __b) {
11285 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11288 static __inline__ vector signed char __ATTRS_o_ai
11289 vec_vsubsbs(vector signed char __a, vector bool char __b) {
11290 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11295 static __inline__ vector unsigned char __ATTRS_o_ai
11296 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11297 return __builtin_altivec_vsububs(__a, __b);
11300 static __inline__ vector unsigned char __ATTRS_o_ai
11301 vec_vsububs(vector bool char __a, vector unsigned char __b) {
11302 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11305 static __inline__ vector unsigned char __ATTRS_o_ai
11306 vec_vsububs(vector unsigned char __a, vector bool char __b) {
11307 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11312 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11313 vector short __b) {
11314 return __builtin_altivec_vsubshs(__a, __b);
11317 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11318 vector short __b) {
11319 return __builtin_altivec_vsubshs((vector short)__a, __b);
11322 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11323 vector bool short __b) {
11324 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11329 static __inline__ vector unsigned short __ATTRS_o_ai
11330 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11331 return __builtin_altivec_vsubuhs(__a, __b);
11334 static __inline__ vector unsigned short __ATTRS_o_ai
11335 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11336 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11339 static __inline__ vector unsigned short __ATTRS_o_ai
11340 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11341 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11346 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11348 return __builtin_altivec_vsubsws(__a, __b);
11351 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11353 return __builtin_altivec_vsubsws((vector int)__a, __b);
11356 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11357 vector bool int __b) {
11358 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11363 static __inline__ vector unsigned int __ATTRS_o_ai
11364 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11365 return __builtin_altivec_vsubuws(__a, __b);
11368 static __inline__ vector unsigned int __ATTRS_o_ai
11369 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11370 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11373 static __inline__ vector unsigned int __ATTRS_o_ai
11374 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11375 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11378 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11381 static __inline__ vector signed __int128 __ATTRS_o_ai
11382 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11386 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11387 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11394 static __inline__ vector signed __int128 __ATTRS_o_ai
11395 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11396 vector signed __int128 __c) {
11397 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11400 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11401 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11402 vector unsigned __int128 __c) {
11403 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11406 static __inline__ vector signed __int128 __ATTRS_o_ai
11407 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11408 vector signed __int128 __c) {
11409 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11412 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11413 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11414 vector unsigned __int128 __c) {
11415 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11420 static __inline__ vector signed __int128 __ATTRS_o_ai
11421 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11422 return __builtin_altivec_vsubcuq(__a, __b);
11425 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11426 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11427 return __builtin_altivec_vsubcuq(__a, __b);
11432 static __inline__ vector signed __int128 __ATTRS_o_ai
11433 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11434 vector signed __int128 __c) {
11435 return __builtin_altivec_vsubecuq(__a, __b, __c);
11438 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11439 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11440 vector unsigned __int128 __c) {
11441 return __builtin_altivec_vsubecuq(__a, __b, __c);
11444 static __inline__ vector signed int __ATTRS_o_ai
11445 vec_subec(vector signed int __a, vector signed int __b,
11446 vector signed int __c) {
11447 return vec_addec(__a, ~__b, __c);
11450 static __inline__ vector unsigned int __ATTRS_o_ai
11451 vec_subec(vector unsigned int __a, vector unsigned int __b,
11452 vector unsigned int __c) {
11453 return vec_addec(__a, ~__b, __c);
11456 static __inline__ vector signed __int128 __ATTRS_o_ai
11457 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11458 vector signed __int128 __c) {
11459 return __builtin_altivec_vsubecuq(__a, __b, __c);
11462 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11463 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11464 vector unsigned __int128 __c) {
11465 return __builtin_altivec_vsubecuq(__a, __b, __c);
11467 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11469 static __inline__ vector signed int __ATTRS_o_ai
11470 vec_sube(vector signed int __a, vector signed int __b,
11471 vector signed int __c) {
11472 vector signed int __mask = {1, 1, 1, 1};
11473 vector signed int __carry = __c & __mask;
11474 return vec_adde(__a, ~__b, __carry);
11477 static __inline__ vector unsigned int __ATTRS_o_ai
11478 vec_sube(vector unsigned int __a, vector unsigned int __b,
11479 vector unsigned int __c) {
11480 vector unsigned int __mask = {1, 1, 1, 1};
11481 vector unsigned int __carry = __c & __mask;
11482 return vec_adde(__a, ~__b, __carry);
11486 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11488 return __builtin_altivec_vsum4sbs(__a, __b);
11491 static __inline__ vector unsigned int __ATTRS_o_ai
11492 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11493 return __builtin_altivec_vsum4ubs(__a, __b);
11496 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11498 return __builtin_altivec_vsum4shs(__a, __b);
11503 static __inline__ vector int __attribute__((__always_inline__))
11504 vec_vsum4sbs(vector signed char __a, vector int __b) {
11505 return __builtin_altivec_vsum4sbs(__a, __b);
11510 static __inline__ vector unsigned int __attribute__((__always_inline__))
11511 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11512 return __builtin_altivec_vsum4ubs(__a, __b);
11517 static __inline__ vector int __attribute__((__always_inline__))
11518 vec_vsum4shs(vector signed short __a, vector int __b) {
11519 return __builtin_altivec_vsum4shs(__a, __b);
11524 /* The vsum2sws instruction has a big-endian bias, so that the second
11525 input vector and the result always reference big-endian elements
11526 1 and 3 (little-endian element 0 and 2). For ease of porting the
11527 programmer wants elements 1 and 3 in both cases, so for little
11528 endian we must perform some permutes. */
11530 static __inline__ vector signed int __attribute__((__always_inline__))
11531 vec_sum2s(vector int __a, vector int __b) {
11532 #ifdef __LITTLE_ENDIAN__
11533 vector int __c = (vector signed int)vec_perm(
11534 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11536 __c = __builtin_altivec_vsum2sws(__a, __c);
11537 return (vector signed int)vec_perm(
11538 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11541 return __builtin_altivec_vsum2sws(__a, __b);
11547 static __inline__ vector signed int __attribute__((__always_inline__))
11548 vec_vsum2sws(vector int __a, vector int __b) {
11549 #ifdef __LITTLE_ENDIAN__
11550 vector int __c = (vector signed int)vec_perm(
11551 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11553 __c = __builtin_altivec_vsum2sws(__a, __c);
11554 return (vector signed int)vec_perm(
11555 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11558 return __builtin_altivec_vsum2sws(__a, __b);
11564 /* The vsumsws instruction has a big-endian bias, so that the second
11565 input vector and the result always reference big-endian element 3
11566 (little-endian element 0). For ease of porting the programmer
11567 wants element 3 in both cases, so for little endian we must perform
11570 static __inline__ vector signed int __attribute__((__always_inline__))
11571 vec_sums(vector signed int __a, vector signed int __b) {
11572 #ifdef __LITTLE_ENDIAN__
11573 __b = (vector signed int)vec_splat(__b, 3);
11574 __b = __builtin_altivec_vsumsws(__a, __b);
11575 return (vector signed int)(0, 0, 0, __b[0]);
11577 return __builtin_altivec_vsumsws(__a, __b);
11583 static __inline__ vector signed int __attribute__((__always_inline__))
11584 vec_vsumsws(vector signed int __a, vector signed int __b) {
11585 #ifdef __LITTLE_ENDIAN__
11586 __b = (vector signed int)vec_splat(__b, 3);
11587 __b = __builtin_altivec_vsumsws(__a, __b);
11588 return (vector signed int)(0, 0, 0, __b[0]);
11590 return __builtin_altivec_vsumsws(__a, __b);
11596 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11598 return __builtin_vsx_xvrspiz(__a);
11600 return __builtin_altivec_vrfiz(__a);
11605 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11606 return __builtin_vsx_xvrdpiz(__a);
11612 static __inline__ vector float __attribute__((__always_inline__))
11613 vec_vrfiz(vector float __a) {
11614 return __builtin_altivec_vrfiz(__a);
11619 /* The vector unpack instructions all have a big-endian bias, so for
11620 little endian we must reverse the meanings of "high" and "low." */
11622 static __inline__ vector short __ATTRS_o_ai
11623 vec_unpackh(vector signed char __a) {
11624 #ifdef __LITTLE_ENDIAN__
11625 return __builtin_altivec_vupklsb((vector char)__a);
11627 return __builtin_altivec_vupkhsb((vector char)__a);
11631 static __inline__ vector bool short __ATTRS_o_ai
11632 vec_unpackh(vector bool char __a) {
11633 #ifdef __LITTLE_ENDIAN__
11634 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11636 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11640 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11641 #ifdef __LITTLE_ENDIAN__
11642 return __builtin_altivec_vupklsh(__a);
11644 return __builtin_altivec_vupkhsh(__a);
11648 static __inline__ vector bool int __ATTRS_o_ai
11649 vec_unpackh(vector bool short __a) {
11650 #ifdef __LITTLE_ENDIAN__
11651 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11653 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11657 static __inline__ vector unsigned int __ATTRS_o_ai
11658 vec_unpackh(vector pixel __a) {
11659 #ifdef __LITTLE_ENDIAN__
11660 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11662 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11666 #ifdef __POWER8_VECTOR__
11667 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11668 #ifdef __LITTLE_ENDIAN__
11669 return __builtin_altivec_vupklsw(__a);
11671 return __builtin_altivec_vupkhsw(__a);
11675 static __inline__ vector bool long long __ATTRS_o_ai
11676 vec_unpackh(vector bool int __a) {
11677 #ifdef __LITTLE_ENDIAN__
11678 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11680 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11684 static __inline__ vector double __ATTRS_o_ai
11685 vec_unpackh(vector float __a) {
11686 return (vector double)(__a[0], __a[1]);
11692 static __inline__ vector short __ATTRS_o_ai
11693 vec_vupkhsb(vector signed char __a) {
11694 #ifdef __LITTLE_ENDIAN__
11695 return __builtin_altivec_vupklsb((vector char)__a);
11697 return __builtin_altivec_vupkhsb((vector char)__a);
11701 static __inline__ vector bool short __ATTRS_o_ai
11702 vec_vupkhsb(vector bool char __a) {
11703 #ifdef __LITTLE_ENDIAN__
11704 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11706 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11712 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11713 #ifdef __LITTLE_ENDIAN__
11714 return __builtin_altivec_vupklsh(__a);
11716 return __builtin_altivec_vupkhsh(__a);
11720 static __inline__ vector bool int __ATTRS_o_ai
11721 vec_vupkhsh(vector bool short __a) {
11722 #ifdef __LITTLE_ENDIAN__
11723 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11725 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11729 static __inline__ vector unsigned int __ATTRS_o_ai
11730 vec_vupkhsh(vector pixel __a) {
11731 #ifdef __LITTLE_ENDIAN__
11732 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11734 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11740 #ifdef __POWER8_VECTOR__
11741 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11742 #ifdef __LITTLE_ENDIAN__
11743 return __builtin_altivec_vupklsw(__a);
11745 return __builtin_altivec_vupkhsw(__a);
11749 static __inline__ vector bool long long __ATTRS_o_ai
11750 vec_vupkhsw(vector bool int __a) {
11751 #ifdef __LITTLE_ENDIAN__
11752 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11754 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11761 static __inline__ vector short __ATTRS_o_ai
11762 vec_unpackl(vector signed char __a) {
11763 #ifdef __LITTLE_ENDIAN__
11764 return __builtin_altivec_vupkhsb((vector char)__a);
11766 return __builtin_altivec_vupklsb((vector char)__a);
11770 static __inline__ vector bool short __ATTRS_o_ai
11771 vec_unpackl(vector bool char __a) {
11772 #ifdef __LITTLE_ENDIAN__
11773 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11775 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11779 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11780 #ifdef __LITTLE_ENDIAN__
11781 return __builtin_altivec_vupkhsh(__a);
11783 return __builtin_altivec_vupklsh(__a);
11787 static __inline__ vector bool int __ATTRS_o_ai
11788 vec_unpackl(vector bool short __a) {
11789 #ifdef __LITTLE_ENDIAN__
11790 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11792 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11796 static __inline__ vector unsigned int __ATTRS_o_ai
11797 vec_unpackl(vector pixel __a) {
11798 #ifdef __LITTLE_ENDIAN__
11799 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11801 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11805 #ifdef __POWER8_VECTOR__
11806 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11807 #ifdef __LITTLE_ENDIAN__
11808 return __builtin_altivec_vupkhsw(__a);
11810 return __builtin_altivec_vupklsw(__a);
11814 static __inline__ vector bool long long __ATTRS_o_ai
11815 vec_unpackl(vector bool int __a) {
11816 #ifdef __LITTLE_ENDIAN__
11817 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11819 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11823 static __inline__ vector double __ATTRS_o_ai
11824 vec_unpackl(vector float __a) {
11825 return (vector double)(__a[2], __a[3]);
11831 static __inline__ vector short __ATTRS_o_ai
11832 vec_vupklsb(vector signed char __a) {
11833 #ifdef __LITTLE_ENDIAN__
11834 return __builtin_altivec_vupkhsb((vector char)__a);
11836 return __builtin_altivec_vupklsb((vector char)__a);
11840 static __inline__ vector bool short __ATTRS_o_ai
11841 vec_vupklsb(vector bool char __a) {
11842 #ifdef __LITTLE_ENDIAN__
11843 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11845 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11851 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11852 #ifdef __LITTLE_ENDIAN__
11853 return __builtin_altivec_vupkhsh(__a);
11855 return __builtin_altivec_vupklsh(__a);
11859 static __inline__ vector bool int __ATTRS_o_ai
11860 vec_vupklsh(vector bool short __a) {
11861 #ifdef __LITTLE_ENDIAN__
11862 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11864 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11868 static __inline__ vector unsigned int __ATTRS_o_ai
11869 vec_vupklsh(vector pixel __a) {
11870 #ifdef __LITTLE_ENDIAN__
11871 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11873 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11879 #ifdef __POWER8_VECTOR__
11880 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11881 #ifdef __LITTLE_ENDIAN__
11882 return __builtin_altivec_vupkhsw(__a);
11884 return __builtin_altivec_vupklsw(__a);
11888 static __inline__ vector bool long long __ATTRS_o_ai
11889 vec_vupklsw(vector bool int __a) {
11890 #ifdef __LITTLE_ENDIAN__
11891 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11893 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11902 static __inline__ vector bool int __ATTRS_o_ai
11903 vec_vsx_ld(int __a, const vector bool int *__b) {
11904 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11907 static __inline__ vector signed int __ATTRS_o_ai
11908 vec_vsx_ld(int __a, const vector signed int *__b) {
11909 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11912 static __inline__ vector signed int __ATTRS_o_ai
11913 vec_vsx_ld(int __a, const signed int *__b) {
11914 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11917 static __inline__ vector unsigned int __ATTRS_o_ai
11918 vec_vsx_ld(int __a, const vector unsigned int *__b) {
11919 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11922 static __inline__ vector unsigned int __ATTRS_o_ai
11923 vec_vsx_ld(int __a, const unsigned int *__b) {
11924 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11927 static __inline__ vector float __ATTRS_o_ai
11928 vec_vsx_ld(int __a, const vector float *__b) {
11929 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11932 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11933 const float *__b) {
11934 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11937 static __inline__ vector signed long long __ATTRS_o_ai
11938 vec_vsx_ld(int __a, const vector signed long long *__b) {
11939 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11942 static __inline__ vector unsigned long long __ATTRS_o_ai
11943 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11944 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11947 static __inline__ vector double __ATTRS_o_ai
11948 vec_vsx_ld(int __a, const vector double *__b) {
11949 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11952 static __inline__ vector double __ATTRS_o_ai
11953 vec_vsx_ld(int __a, const double *__b) {
11954 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11957 static __inline__ vector bool short __ATTRS_o_ai
11958 vec_vsx_ld(int __a, const vector bool short *__b) {
11959 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
11962 static __inline__ vector signed short __ATTRS_o_ai
11963 vec_vsx_ld(int __a, const vector signed short *__b) {
11964 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11967 static __inline__ vector signed short __ATTRS_o_ai
11968 vec_vsx_ld(int __a, const signed short *__b) {
11969 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
11972 static __inline__ vector unsigned short __ATTRS_o_ai
11973 vec_vsx_ld(int __a, const vector unsigned short *__b) {
11974 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11977 static __inline__ vector unsigned short __ATTRS_o_ai
11978 vec_vsx_ld(int __a, const unsigned short *__b) {
11979 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
11982 static __inline__ vector bool char __ATTRS_o_ai
11983 vec_vsx_ld(int __a, const vector bool char *__b) {
11984 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
11987 static __inline__ vector signed char __ATTRS_o_ai
11988 vec_vsx_ld(int __a, const vector signed char *__b) {
11989 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11992 static __inline__ vector signed char __ATTRS_o_ai
11993 vec_vsx_ld(int __a, const signed char *__b) {
11994 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
11997 static __inline__ vector unsigned char __ATTRS_o_ai
11998 vec_vsx_ld(int __a, const vector unsigned char *__b) {
11999 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12002 static __inline__ vector unsigned char __ATTRS_o_ai
12003 vec_vsx_ld(int __a, const unsigned char *__b) {
12004 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12013 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12014 vector bool int *__c) {
12015 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12018 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12020 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12023 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12024 unsigned int *__c) {
12025 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12028 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12029 vector signed int *__c) {
12030 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12033 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12035 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12038 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12039 vector unsigned int *__c) {
12040 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12043 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12044 unsigned int *__c) {
12045 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12048 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12049 vector float *__c) {
12050 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12053 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12055 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12058 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12060 vector signed long long *__c) {
12061 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12064 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12066 vector unsigned long long *__c) {
12067 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12070 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12071 vector double *__c) {
12072 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12075 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12077 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12080 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12081 vector bool short *__c) {
12082 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12085 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12086 signed short *__c) {
12087 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12090 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12091 unsigned short *__c) {
12092 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12094 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12095 vector signed short *__c) {
12096 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12099 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12100 signed short *__c) {
12101 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12104 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12106 vector unsigned short *__c) {
12107 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12110 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12111 int __b, unsigned short *__c) {
12112 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12115 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12116 vector bool char *__c) {
12117 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12120 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12121 signed char *__c) {
12122 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12125 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12126 unsigned char *__c) {
12127 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12130 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12131 vector signed char *__c) {
12132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12135 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12136 signed char *__c) {
12137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12140 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12142 vector unsigned char *__c) {
12143 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12146 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12147 int __b, unsigned char *__c) {
12148 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12155 #define __builtin_altivec_vxor vec_xor
12157 static __inline__ vector signed char __ATTRS_o_ai
12158 vec_xor(vector signed char __a, vector signed char __b) {
12162 static __inline__ vector signed char __ATTRS_o_ai
12163 vec_xor(vector bool char __a, vector signed char __b) {
12164 return (vector signed char)__a ^ __b;
12167 static __inline__ vector signed char __ATTRS_o_ai
12168 vec_xor(vector signed char __a, vector bool char __b) {
12169 return __a ^ (vector signed char)__b;
12172 static __inline__ vector unsigned char __ATTRS_o_ai
12173 vec_xor(vector unsigned char __a, vector unsigned char __b) {
12177 static __inline__ vector unsigned char __ATTRS_o_ai
12178 vec_xor(vector bool char __a, vector unsigned char __b) {
12179 return (vector unsigned char)__a ^ __b;
12182 static __inline__ vector unsigned char __ATTRS_o_ai
12183 vec_xor(vector unsigned char __a, vector bool char __b) {
12184 return __a ^ (vector unsigned char)__b;
12187 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12188 vector bool char __b) {
12192 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12193 vector short __b) {
12197 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12198 vector short __b) {
12199 return (vector short)__a ^ __b;
12202 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12203 vector bool short __b) {
12204 return __a ^ (vector short)__b;
12207 static __inline__ vector unsigned short __ATTRS_o_ai
12208 vec_xor(vector unsigned short __a, vector unsigned short __b) {
12212 static __inline__ vector unsigned short __ATTRS_o_ai
12213 vec_xor(vector bool short __a, vector unsigned short __b) {
12214 return (vector unsigned short)__a ^ __b;
12217 static __inline__ vector unsigned short __ATTRS_o_ai
12218 vec_xor(vector unsigned short __a, vector bool short __b) {
12219 return __a ^ (vector unsigned short)__b;
12222 static __inline__ vector bool short __ATTRS_o_ai
12223 vec_xor(vector bool short __a, vector bool short __b) {
12227 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12232 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12234 return (vector int)__a ^ __b;
12237 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12238 vector bool int __b) {
12239 return __a ^ (vector int)__b;
12242 static __inline__ vector unsigned int __ATTRS_o_ai
12243 vec_xor(vector unsigned int __a, vector unsigned int __b) {
12247 static __inline__ vector unsigned int __ATTRS_o_ai
12248 vec_xor(vector bool int __a, vector unsigned int __b) {
12249 return (vector unsigned int)__a ^ __b;
12252 static __inline__ vector unsigned int __ATTRS_o_ai
12253 vec_xor(vector unsigned int __a, vector bool int __b) {
12254 return __a ^ (vector unsigned int)__b;
12257 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12258 vector bool int __b) {
12262 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12263 vector float __b) {
12264 vector unsigned int __res =
12265 (vector unsigned int)__a ^ (vector unsigned int)__b;
12266 return (vector float)__res;
12269 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12270 vector float __b) {
12271 vector unsigned int __res =
12272 (vector unsigned int)__a ^ (vector unsigned int)__b;
12273 return (vector float)__res;
12276 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12277 vector bool int __b) {
12278 vector unsigned int __res =
12279 (vector unsigned int)__a ^ (vector unsigned int)__b;
12280 return (vector float)__res;
12284 static __inline__ vector signed long long __ATTRS_o_ai
12285 vec_xor(vector signed long long __a, vector signed long long __b) {
12289 static __inline__ vector signed long long __ATTRS_o_ai
12290 vec_xor(vector bool long long __a, vector signed long long __b) {
12291 return (vector signed long long)__a ^ __b;
12294 static __inline__ vector signed long long __ATTRS_o_ai
12295 vec_xor(vector signed long long __a, vector bool long long __b) {
12296 return __a ^ (vector signed long long)__b;
12299 static __inline__ vector unsigned long long __ATTRS_o_ai
12300 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12304 static __inline__ vector unsigned long long __ATTRS_o_ai
12305 vec_xor(vector bool long long __a, vector unsigned long long __b) {
12306 return (vector unsigned long long)__a ^ __b;
12309 static __inline__ vector unsigned long long __ATTRS_o_ai
12310 vec_xor(vector unsigned long long __a, vector bool long long __b) {
12311 return __a ^ (vector unsigned long long)__b;
12314 static __inline__ vector bool long long __ATTRS_o_ai
12315 vec_xor(vector bool long long __a, vector bool long long __b) {
12319 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12320 vector double __b) {
12321 return (vector double)((vector unsigned long long)__a ^
12322 (vector unsigned long long)__b);
12325 static __inline__ vector double __ATTRS_o_ai
12326 vec_xor(vector double __a, vector bool long long __b) {
12327 return (vector double)((vector unsigned long long)__a ^
12328 (vector unsigned long long)__b);
12331 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12332 vector double __b) {
12333 return (vector double)((vector unsigned long long)__a ^
12334 (vector unsigned long long)__b);
12340 static __inline__ vector signed char __ATTRS_o_ai
12341 vec_vxor(vector signed char __a, vector signed char __b) {
12345 static __inline__ vector signed char __ATTRS_o_ai
12346 vec_vxor(vector bool char __a, vector signed char __b) {
12347 return (vector signed char)__a ^ __b;
12350 static __inline__ vector signed char __ATTRS_o_ai
12351 vec_vxor(vector signed char __a, vector bool char __b) {
12352 return __a ^ (vector signed char)__b;
12355 static __inline__ vector unsigned char __ATTRS_o_ai
12356 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12360 static __inline__ vector unsigned char __ATTRS_o_ai
12361 vec_vxor(vector bool char __a, vector unsigned char __b) {
12362 return (vector unsigned char)__a ^ __b;
12365 static __inline__ vector unsigned char __ATTRS_o_ai
12366 vec_vxor(vector unsigned char __a, vector bool char __b) {
12367 return __a ^ (vector unsigned char)__b;
12370 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12371 vector bool char __b) {
12375 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12376 vector short __b) {
12380 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12381 vector short __b) {
12382 return (vector short)__a ^ __b;
12385 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12386 vector bool short __b) {
12387 return __a ^ (vector short)__b;
12390 static __inline__ vector unsigned short __ATTRS_o_ai
12391 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12395 static __inline__ vector unsigned short __ATTRS_o_ai
12396 vec_vxor(vector bool short __a, vector unsigned short __b) {
12397 return (vector unsigned short)__a ^ __b;
12400 static __inline__ vector unsigned short __ATTRS_o_ai
12401 vec_vxor(vector unsigned short __a, vector bool short __b) {
12402 return __a ^ (vector unsigned short)__b;
12405 static __inline__ vector bool short __ATTRS_o_ai
12406 vec_vxor(vector bool short __a, vector bool short __b) {
12410 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12415 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12417 return (vector int)__a ^ __b;
12420 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12421 vector bool int __b) {
12422 return __a ^ (vector int)__b;
12425 static __inline__ vector unsigned int __ATTRS_o_ai
12426 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12430 static __inline__ vector unsigned int __ATTRS_o_ai
12431 vec_vxor(vector bool int __a, vector unsigned int __b) {
12432 return (vector unsigned int)__a ^ __b;
12435 static __inline__ vector unsigned int __ATTRS_o_ai
12436 vec_vxor(vector unsigned int __a, vector bool int __b) {
12437 return __a ^ (vector unsigned int)__b;
12440 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12441 vector bool int __b) {
12445 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12446 vector float __b) {
12447 vector unsigned int __res =
12448 (vector unsigned int)__a ^ (vector unsigned int)__b;
12449 return (vector float)__res;
12452 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12453 vector float __b) {
12454 vector unsigned int __res =
12455 (vector unsigned int)__a ^ (vector unsigned int)__b;
12456 return (vector float)__res;
12459 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12460 vector bool int __b) {
12461 vector unsigned int __res =
12462 (vector unsigned int)__a ^ (vector unsigned int)__b;
12463 return (vector float)__res;
12467 static __inline__ vector signed long long __ATTRS_o_ai
12468 vec_vxor(vector signed long long __a, vector signed long long __b) {
12472 static __inline__ vector signed long long __ATTRS_o_ai
12473 vec_vxor(vector bool long long __a, vector signed long long __b) {
12474 return (vector signed long long)__a ^ __b;
12477 static __inline__ vector signed long long __ATTRS_o_ai
12478 vec_vxor(vector signed long long __a, vector bool long long __b) {
12479 return __a ^ (vector signed long long)__b;
12482 static __inline__ vector unsigned long long __ATTRS_o_ai
12483 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12487 static __inline__ vector unsigned long long __ATTRS_o_ai
12488 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12489 return (vector unsigned long long)__a ^ __b;
12492 static __inline__ vector unsigned long long __ATTRS_o_ai
12493 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12494 return __a ^ (vector unsigned long long)__b;
12497 static __inline__ vector bool long long __ATTRS_o_ai
12498 vec_vxor(vector bool long long __a, vector bool long long __b) {
12503 /* ------------------------ extensions for CBEA ----------------------------- */
12507 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12512 static __inline__ unsigned char __ATTRS_o_ai
12513 vec_extract(vector unsigned char __a, int __b) {
12517 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12522 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12527 static __inline__ unsigned short __ATTRS_o_ai
12528 vec_extract(vector unsigned short __a, int __b) {
12532 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12537 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12542 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12547 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12553 static __inline__ signed long long __ATTRS_o_ai
12554 vec_extract(vector signed long long __a, int __b) {
12558 static __inline__ unsigned long long __ATTRS_o_ai
12559 vec_extract(vector unsigned long long __a, int __b) {
12563 static __inline__ unsigned long long __ATTRS_o_ai
12564 vec_extract(vector bool long long __a, int __b) {
12568 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12573 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12577 #ifdef __POWER9_VECTOR__
12579 #define vec_insert4b __builtin_vsx_insertword
12580 #define vec_extract4b __builtin_vsx_extractuword
12582 /* vec_extract_exp */
12584 static __inline__ vector unsigned int __ATTRS_o_ai
12585 vec_extract_exp(vector float __a) {
12586 return __builtin_vsx_xvxexpsp(__a);
12589 static __inline__ vector unsigned long long __ATTRS_o_ai
12590 vec_extract_exp(vector double __a) {
12591 return __builtin_vsx_xvxexpdp(__a);
12594 /* vec_extract_sig */
12596 static __inline__ vector unsigned int __ATTRS_o_ai
12597 vec_extract_sig(vector float __a) {
12598 return __builtin_vsx_xvxsigsp(__a);
12601 static __inline__ vector unsigned long long __ATTRS_o_ai
12602 vec_extract_sig (vector double __a) {
12603 return __builtin_vsx_xvxsigdp(__a);
12606 static __inline__ vector float __ATTRS_o_ai
12607 vec_extract_fp32_from_shorth(vector unsigned short __a) {
12608 vector unsigned short __b =
12609 #ifdef __LITTLE_ENDIAN__
12610 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12612 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12614 return __builtin_vsx_xvcvhpsp(__b);
12617 static __inline__ vector float __ATTRS_o_ai
12618 vec_extract_fp32_from_shortl(vector unsigned short __a) {
12619 vector unsigned short __b =
12620 #ifdef __LITTLE_ENDIAN__
12621 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12623 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12625 return __builtin_vsx_xvcvhpsp(__b);
12627 #endif /* __POWER9_VECTOR__ */
12631 static __inline__ vector signed char __ATTRS_o_ai
12632 vec_insert(signed char __a, vector signed char __b, int __c) {
12637 static __inline__ vector unsigned char __ATTRS_o_ai
12638 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12643 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12644 vector bool char __b,
12650 static __inline__ vector signed short __ATTRS_o_ai
12651 vec_insert(signed short __a, vector signed short __b, int __c) {
12656 static __inline__ vector unsigned short __ATTRS_o_ai
12657 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12662 static __inline__ vector bool short __ATTRS_o_ai
12663 vec_insert(unsigned short __a, vector bool short __b, int __c) {
12668 static __inline__ vector signed int __ATTRS_o_ai
12669 vec_insert(signed int __a, vector signed int __b, int __c) {
12674 static __inline__ vector unsigned int __ATTRS_o_ai
12675 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12680 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12681 vector bool int __b,
12688 static __inline__ vector signed long long __ATTRS_o_ai
12689 vec_insert(signed long long __a, vector signed long long __b, int __c) {
12694 static __inline__ vector unsigned long long __ATTRS_o_ai
12695 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12700 static __inline__ vector bool long long __ATTRS_o_ai
12701 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12705 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12713 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12722 static __inline__ vector signed char __ATTRS_o_ai
12723 vec_lvlx(int __a, const signed char *__b) {
12724 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12725 vec_lvsl(__a, __b));
12728 static __inline__ vector signed char __ATTRS_o_ai
12729 vec_lvlx(int __a, const vector signed char *__b) {
12730 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12731 vec_lvsl(__a, (unsigned char *)__b));
12734 static __inline__ vector unsigned char __ATTRS_o_ai
12735 vec_lvlx(int __a, const unsigned char *__b) {
12736 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12737 vec_lvsl(__a, __b));
12740 static __inline__ vector unsigned char __ATTRS_o_ai
12741 vec_lvlx(int __a, const vector unsigned char *__b) {
12742 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12743 vec_lvsl(__a, (unsigned char *)__b));
12746 static __inline__ vector bool char __ATTRS_o_ai
12747 vec_lvlx(int __a, const vector bool char *__b) {
12748 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12749 vec_lvsl(__a, (unsigned char *)__b));
12752 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12753 const short *__b) {
12754 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12757 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12758 const vector short *__b) {
12759 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12760 vec_lvsl(__a, (unsigned char *)__b));
12763 static __inline__ vector unsigned short __ATTRS_o_ai
12764 vec_lvlx(int __a, const unsigned short *__b) {
12765 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12766 vec_lvsl(__a, __b));
12769 static __inline__ vector unsigned short __ATTRS_o_ai
12770 vec_lvlx(int __a, const vector unsigned short *__b) {
12771 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12772 vec_lvsl(__a, (unsigned char *)__b));
12775 static __inline__ vector bool short __ATTRS_o_ai
12776 vec_lvlx(int __a, const vector bool short *__b) {
12777 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12778 vec_lvsl(__a, (unsigned char *)__b));
12781 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12782 const vector pixel *__b) {
12783 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12784 vec_lvsl(__a, (unsigned char *)__b));
12787 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12788 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12791 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12792 const vector int *__b) {
12793 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12794 vec_lvsl(__a, (unsigned char *)__b));
12797 static __inline__ vector unsigned int __ATTRS_o_ai
12798 vec_lvlx(int __a, const unsigned int *__b) {
12799 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12800 vec_lvsl(__a, __b));
12803 static __inline__ vector unsigned int __ATTRS_o_ai
12804 vec_lvlx(int __a, const vector unsigned int *__b) {
12805 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12806 vec_lvsl(__a, (unsigned char *)__b));
12809 static __inline__ vector bool int __ATTRS_o_ai
12810 vec_lvlx(int __a, const vector bool int *__b) {
12811 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12812 vec_lvsl(__a, (unsigned char *)__b));
12815 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12816 const float *__b) {
12817 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12820 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12821 const vector float *__b) {
12822 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12823 vec_lvsl(__a, (unsigned char *)__b));
12828 static __inline__ vector signed char __ATTRS_o_ai
12829 vec_lvlxl(int __a, const signed char *__b) {
12830 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12831 vec_lvsl(__a, __b));
12834 static __inline__ vector signed char __ATTRS_o_ai
12835 vec_lvlxl(int __a, const vector signed char *__b) {
12836 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12837 vec_lvsl(__a, (unsigned char *)__b));
12840 static __inline__ vector unsigned char __ATTRS_o_ai
12841 vec_lvlxl(int __a, const unsigned char *__b) {
12842 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12843 vec_lvsl(__a, __b));
12846 static __inline__ vector unsigned char __ATTRS_o_ai
12847 vec_lvlxl(int __a, const vector unsigned char *__b) {
12848 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12849 vec_lvsl(__a, (unsigned char *)__b));
12852 static __inline__ vector bool char __ATTRS_o_ai
12853 vec_lvlxl(int __a, const vector bool char *__b) {
12854 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12855 vec_lvsl(__a, (unsigned char *)__b));
12858 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12859 const short *__b) {
12860 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12863 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12864 const vector short *__b) {
12865 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12866 vec_lvsl(__a, (unsigned char *)__b));
12869 static __inline__ vector unsigned short __ATTRS_o_ai
12870 vec_lvlxl(int __a, const unsigned short *__b) {
12871 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12872 vec_lvsl(__a, __b));
12875 static __inline__ vector unsigned short __ATTRS_o_ai
12876 vec_lvlxl(int __a, const vector unsigned short *__b) {
12877 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12878 vec_lvsl(__a, (unsigned char *)__b));
12881 static __inline__ vector bool short __ATTRS_o_ai
12882 vec_lvlxl(int __a, const vector bool short *__b) {
12883 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12884 vec_lvsl(__a, (unsigned char *)__b));
12887 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12888 const vector pixel *__b) {
12889 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12890 vec_lvsl(__a, (unsigned char *)__b));
12893 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12894 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12897 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12898 const vector int *__b) {
12899 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12900 vec_lvsl(__a, (unsigned char *)__b));
12903 static __inline__ vector unsigned int __ATTRS_o_ai
12904 vec_lvlxl(int __a, const unsigned int *__b) {
12905 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12906 vec_lvsl(__a, __b));
12909 static __inline__ vector unsigned int __ATTRS_o_ai
12910 vec_lvlxl(int __a, const vector unsigned int *__b) {
12911 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12912 vec_lvsl(__a, (unsigned char *)__b));
12915 static __inline__ vector bool int __ATTRS_o_ai
12916 vec_lvlxl(int __a, const vector bool int *__b) {
12917 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12918 vec_lvsl(__a, (unsigned char *)__b));
12921 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12922 const float *__b) {
12923 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12926 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12927 vector float *__b) {
12928 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12929 vec_lvsl(__a, (unsigned char *)__b));
12934 static __inline__ vector signed char __ATTRS_o_ai
12935 vec_lvrx(int __a, const signed char *__b) {
12936 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12937 vec_lvsl(__a, __b));
12940 static __inline__ vector signed char __ATTRS_o_ai
12941 vec_lvrx(int __a, const vector signed char *__b) {
12942 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12943 vec_lvsl(__a, (unsigned char *)__b));
12946 static __inline__ vector unsigned char __ATTRS_o_ai
12947 vec_lvrx(int __a, const unsigned char *__b) {
12948 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12949 vec_lvsl(__a, __b));
12952 static __inline__ vector unsigned char __ATTRS_o_ai
12953 vec_lvrx(int __a, const vector unsigned char *__b) {
12954 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12955 vec_lvsl(__a, (unsigned char *)__b));
12958 static __inline__ vector bool char __ATTRS_o_ai
12959 vec_lvrx(int __a, const vector bool char *__b) {
12960 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
12961 vec_lvsl(__a, (unsigned char *)__b));
12964 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12965 const short *__b) {
12966 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
12969 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
12970 const vector short *__b) {
12971 return vec_perm((vector short)(0), vec_ld(__a, __b),
12972 vec_lvsl(__a, (unsigned char *)__b));
12975 static __inline__ vector unsigned short __ATTRS_o_ai
12976 vec_lvrx(int __a, const unsigned short *__b) {
12977 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12978 vec_lvsl(__a, __b));
12981 static __inline__ vector unsigned short __ATTRS_o_ai
12982 vec_lvrx(int __a, const vector unsigned short *__b) {
12983 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
12984 vec_lvsl(__a, (unsigned char *)__b));
12987 static __inline__ vector bool short __ATTRS_o_ai
12988 vec_lvrx(int __a, const vector bool short *__b) {
12989 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
12990 vec_lvsl(__a, (unsigned char *)__b));
12993 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
12994 const vector pixel *__b) {
12995 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
12996 vec_lvsl(__a, (unsigned char *)__b));
12999 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
13000 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13003 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
13004 const vector int *__b) {
13005 return vec_perm((vector int)(0), vec_ld(__a, __b),
13006 vec_lvsl(__a, (unsigned char *)__b));
13009 static __inline__ vector unsigned int __ATTRS_o_ai
13010 vec_lvrx(int __a, const unsigned int *__b) {
13011 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13012 vec_lvsl(__a, __b));
13015 static __inline__ vector unsigned int __ATTRS_o_ai
13016 vec_lvrx(int __a, const vector unsigned int *__b) {
13017 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13018 vec_lvsl(__a, (unsigned char *)__b));
13021 static __inline__ vector bool int __ATTRS_o_ai
13022 vec_lvrx(int __a, const vector bool int *__b) {
13023 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13024 vec_lvsl(__a, (unsigned char *)__b));
13027 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13028 const float *__b) {
13029 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13032 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13033 const vector float *__b) {
13034 return vec_perm((vector float)(0), vec_ld(__a, __b),
13035 vec_lvsl(__a, (unsigned char *)__b));
13040 static __inline__ vector signed char __ATTRS_o_ai
13041 vec_lvrxl(int __a, const signed char *__b) {
13042 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13043 vec_lvsl(__a, __b));
13046 static __inline__ vector signed char __ATTRS_o_ai
13047 vec_lvrxl(int __a, const vector signed char *__b) {
13048 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13049 vec_lvsl(__a, (unsigned char *)__b));
13052 static __inline__ vector unsigned char __ATTRS_o_ai
13053 vec_lvrxl(int __a, const unsigned char *__b) {
13054 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13055 vec_lvsl(__a, __b));
13058 static __inline__ vector unsigned char __ATTRS_o_ai
13059 vec_lvrxl(int __a, const vector unsigned char *__b) {
13060 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13061 vec_lvsl(__a, (unsigned char *)__b));
13064 static __inline__ vector bool char __ATTRS_o_ai
13065 vec_lvrxl(int __a, const vector bool char *__b) {
13066 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13067 vec_lvsl(__a, (unsigned char *)__b));
13070 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13071 const short *__b) {
13072 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13075 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13076 const vector short *__b) {
13077 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13078 vec_lvsl(__a, (unsigned char *)__b));
13081 static __inline__ vector unsigned short __ATTRS_o_ai
13082 vec_lvrxl(int __a, const unsigned short *__b) {
13083 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13084 vec_lvsl(__a, __b));
13087 static __inline__ vector unsigned short __ATTRS_o_ai
13088 vec_lvrxl(int __a, const vector unsigned short *__b) {
13089 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13090 vec_lvsl(__a, (unsigned char *)__b));
13093 static __inline__ vector bool short __ATTRS_o_ai
13094 vec_lvrxl(int __a, const vector bool short *__b) {
13095 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13096 vec_lvsl(__a, (unsigned char *)__b));
13099 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13100 const vector pixel *__b) {
13101 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13102 vec_lvsl(__a, (unsigned char *)__b));
13105 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13106 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13109 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13110 const vector int *__b) {
13111 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13112 vec_lvsl(__a, (unsigned char *)__b));
13115 static __inline__ vector unsigned int __ATTRS_o_ai
13116 vec_lvrxl(int __a, const unsigned int *__b) {
13117 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13118 vec_lvsl(__a, __b));
13121 static __inline__ vector unsigned int __ATTRS_o_ai
13122 vec_lvrxl(int __a, const vector unsigned int *__b) {
13123 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13124 vec_lvsl(__a, (unsigned char *)__b));
13127 static __inline__ vector bool int __ATTRS_o_ai
13128 vec_lvrxl(int __a, const vector bool int *__b) {
13129 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13130 vec_lvsl(__a, (unsigned char *)__b));
13133 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13134 const float *__b) {
13135 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13138 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13139 const vector float *__b) {
13140 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13141 vec_lvsl(__a, (unsigned char *)__b));
13146 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13147 signed char *__c) {
13148 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13152 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13153 vector signed char *__c) {
13155 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13159 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13160 unsigned char *__c) {
13161 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13165 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13166 vector unsigned char *__c) {
13168 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13172 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13173 vector bool char *__c) {
13175 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13179 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13181 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13185 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13186 vector short *__c) {
13188 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13192 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13193 int __b, unsigned short *__c) {
13194 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13198 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13200 vector unsigned short *__c) {
13202 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13206 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
13207 vector bool short *__c) {
13209 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13213 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13214 vector pixel *__c) {
13216 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13220 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13222 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13226 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13229 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13233 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13234 unsigned int *__c) {
13235 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13239 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13240 vector unsigned int *__c) {
13242 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13246 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13247 vector bool int *__c) {
13249 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13253 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13254 vector float *__c) {
13256 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13262 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13263 signed char *__c) {
13264 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13268 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13269 vector signed char *__c) {
13271 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13275 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13276 int __b, unsigned char *__c) {
13277 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13281 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13283 vector unsigned char *__c) {
13285 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13289 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
13290 vector bool char *__c) {
13292 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13296 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13298 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13302 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13303 vector short *__c) {
13305 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13309 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13310 int __b, unsigned short *__c) {
13311 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13315 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13317 vector unsigned short *__c) {
13319 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13323 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
13324 vector bool short *__c) {
13326 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13330 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13331 vector pixel *__c) {
13333 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13337 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13339 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13343 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13346 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13350 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13351 unsigned int *__c) {
13352 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
13356 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13357 vector unsigned int *__c) {
13359 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13363 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13364 vector bool int *__c) {
13366 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13370 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13371 vector float *__c) {
13373 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13379 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13380 signed char *__c) {
13381 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13385 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13386 vector signed char *__c) {
13388 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13392 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13393 unsigned char *__c) {
13394 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13398 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13399 vector unsigned char *__c) {
13401 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13405 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13406 vector bool char *__c) {
13408 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13412 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13414 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13418 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13419 vector short *__c) {
13421 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13425 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13426 int __b, unsigned short *__c) {
13427 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13431 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13433 vector unsigned short *__c) {
13435 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13439 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
13440 vector bool short *__c) {
13442 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13446 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13447 vector pixel *__c) {
13449 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13453 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13455 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13459 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13462 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13466 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13467 unsigned int *__c) {
13468 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13472 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13473 vector unsigned int *__c) {
13475 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13479 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13480 vector bool int *__c) {
13482 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13486 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13487 vector float *__c) {
13489 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13495 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13496 signed char *__c) {
13497 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13501 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13502 vector signed char *__c) {
13504 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13508 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13509 int __b, unsigned char *__c) {
13510 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13514 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13516 vector unsigned char *__c) {
13518 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13522 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
13523 vector bool char *__c) {
13525 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13529 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13531 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13535 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13536 vector short *__c) {
13538 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13542 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13543 int __b, unsigned short *__c) {
13544 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13548 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13550 vector unsigned short *__c) {
13552 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13556 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
13557 vector bool short *__c) {
13559 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13563 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13564 vector pixel *__c) {
13566 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13570 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13572 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13576 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13579 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13583 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13584 unsigned int *__c) {
13585 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
13589 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13590 vector unsigned int *__c) {
13592 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13596 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13597 vector bool int *__c) {
13599 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13603 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13604 vector float *__c) {
13606 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13612 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13614 vector signed char __res = (vector signed char)(0);
13619 static __inline__ vector unsigned char __ATTRS_o_ai
13620 vec_promote(unsigned char __a, int __b) {
13621 vector unsigned char __res = (vector unsigned char)(0);
13626 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13627 vector short __res = (vector short)(0);
13632 static __inline__ vector unsigned short __ATTRS_o_ai
13633 vec_promote(unsigned short __a, int __b) {
13634 vector unsigned short __res = (vector unsigned short)(0);
13639 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13640 vector int __res = (vector int)(0);
13645 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13647 vector unsigned int __res = (vector unsigned int)(0);
13652 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13653 vector float __res = (vector float)(0);
13660 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13661 return (vector signed char)(__a);
13664 static __inline__ vector unsigned char __ATTRS_o_ai
13665 vec_splats(unsigned char __a) {
13666 return (vector unsigned char)(__a);
13669 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13670 return (vector short)(__a);
13673 static __inline__ vector unsigned short __ATTRS_o_ai
13674 vec_splats(unsigned short __a) {
13675 return (vector unsigned short)(__a);
13678 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13679 return (vector int)(__a);
13682 static __inline__ vector unsigned int __ATTRS_o_ai
13683 vec_splats(unsigned int __a) {
13684 return (vector unsigned int)(__a);
13688 static __inline__ vector signed long long __ATTRS_o_ai
13689 vec_splats(signed long long __a) {
13690 return (vector signed long long)(__a);
13693 static __inline__ vector unsigned long long __ATTRS_o_ai
13694 vec_splats(unsigned long long __a) {
13695 return (vector unsigned long long)(__a);
13698 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13699 static __inline__ vector signed __int128 __ATTRS_o_ai
13700 vec_splats(signed __int128 __a) {
13701 return (vector signed __int128)(__a);
13704 static __inline__ vector unsigned __int128 __ATTRS_o_ai
13705 vec_splats(unsigned __int128 __a) {
13706 return (vector unsigned __int128)(__a);
13711 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13712 return (vector double)(__a);
13716 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13717 return (vector float)(__a);
13720 /* ----------------------------- predicates --------------------------------- */
13724 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13725 vector signed char __b) {
13726 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13730 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13731 vector bool char __b) {
13732 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13736 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13737 vector unsigned char __b) {
13738 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13742 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13743 vector bool char __b) {
13744 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13748 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13749 vector signed char __b) {
13750 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13754 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13755 vector unsigned char __b) {
13756 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13760 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13761 vector bool char __b) {
13762 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13766 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13767 vector short __b) {
13768 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13771 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13772 vector bool short __b) {
13773 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13776 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13777 vector unsigned short __b) {
13778 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13779 (vector short)__b);
13782 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13783 vector bool short __b) {
13784 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13785 (vector short)__b);
13788 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13789 vector short __b) {
13790 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13791 (vector short)__b);
13794 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13795 vector unsigned short __b) {
13796 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13797 (vector short)__b);
13800 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13801 vector bool short __b) {
13802 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13803 (vector short)__b);
13806 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13807 vector pixel __b) {
13808 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13809 (vector short)__b);
13812 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13813 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13816 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13817 vector bool int __b) {
13818 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13821 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13822 vector unsigned int __b) {
13823 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13827 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13828 vector bool int __b) {
13829 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13833 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13835 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13839 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13840 vector unsigned int __b) {
13841 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13845 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13846 vector bool int __b) {
13847 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13851 #ifdef __POWER8_VECTOR__
13852 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13853 vector signed long long __b) {
13854 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13857 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13858 vector bool long long __b) {
13859 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13862 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13863 vector unsigned long long __b) {
13864 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13865 (vector long long)__b);
13868 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13869 vector bool long long __b) {
13870 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13871 (vector long long)__b);
13874 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13875 vector long long __b) {
13876 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13877 (vector long long)__b);
13880 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13881 vector unsigned long long __b) {
13882 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13883 (vector long long)__b);
13886 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13887 vector bool long long __b) {
13888 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13889 (vector long long)__b);
13893 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13894 vector float __b) {
13896 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13898 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13903 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13904 vector double __b) {
13905 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13911 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13912 vector signed char __b) {
13913 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13916 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13917 vector bool char __b) {
13918 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13921 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13922 vector unsigned char __b) {
13923 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13926 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13927 vector bool char __b) {
13928 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13931 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13932 vector signed char __b) {
13933 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13934 (vector unsigned char)__a);
13937 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13938 vector unsigned char __b) {
13939 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13942 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13943 vector bool char __b) {
13944 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13945 (vector unsigned char)__a);
13948 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13949 vector short __b) {
13950 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
13953 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13954 vector bool short __b) {
13955 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
13958 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13959 vector unsigned short __b) {
13960 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
13963 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
13964 vector bool short __b) {
13965 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13969 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13970 vector short __b) {
13971 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13972 (vector unsigned short)__a);
13975 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13976 vector unsigned short __b) {
13977 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
13978 (vector unsigned short)__a);
13981 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
13982 vector bool short __b) {
13983 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
13984 (vector unsigned short)__a);
13987 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
13988 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
13991 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
13992 vector bool int __b) {
13993 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
13996 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
13997 vector unsigned int __b) {
13998 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
14001 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14002 vector bool int __b) {
14003 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14006 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14008 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14009 (vector unsigned int)__a);
14012 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14013 vector unsigned int __b) {
14014 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14017 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14018 vector bool int __b) {
14019 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14020 (vector unsigned int)__a);
14023 #ifdef __POWER8_VECTOR__
14024 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14025 vector signed long long __b) {
14026 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14028 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14029 vector bool long long __b) {
14030 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14034 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14035 vector unsigned long long __b) {
14036 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14039 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14040 vector bool long long __b) {
14041 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14045 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14046 vector signed long long __b) {
14047 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14048 (vector unsigned long long)__a);
14051 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14052 vector unsigned long long __b) {
14053 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14054 (vector unsigned long long)__a);
14057 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14058 vector bool long long __b) {
14059 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14060 (vector unsigned long long)__a);
14064 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14065 vector float __b) {
14067 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14069 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14074 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14075 vector double __b) {
14076 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14082 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14083 vector signed char __b) {
14084 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14087 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14088 vector bool char __b) {
14089 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14092 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14093 vector unsigned char __b) {
14094 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14097 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14098 vector bool char __b) {
14099 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14102 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14103 vector signed char __b) {
14104 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14105 (vector unsigned char)__b);
14108 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14109 vector unsigned char __b) {
14110 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14113 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14114 vector bool char __b) {
14115 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14116 (vector unsigned char)__b);
14119 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14120 vector short __b) {
14121 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14124 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14125 vector bool short __b) {
14126 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14129 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14130 vector unsigned short __b) {
14131 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14134 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14135 vector bool short __b) {
14136 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14137 (vector unsigned short)__b);
14140 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14141 vector short __b) {
14142 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14143 (vector unsigned short)__b);
14146 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14147 vector unsigned short __b) {
14148 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14152 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14153 vector bool short __b) {
14154 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14155 (vector unsigned short)__b);
14158 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14159 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14162 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14163 vector bool int __b) {
14164 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14167 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14168 vector unsigned int __b) {
14169 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14172 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14173 vector bool int __b) {
14174 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14177 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14179 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14180 (vector unsigned int)__b);
14183 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14184 vector unsigned int __b) {
14185 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14188 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14189 vector bool int __b) {
14190 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14191 (vector unsigned int)__b);
14194 #ifdef __POWER8_VECTOR__
14195 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14196 vector signed long long __b) {
14197 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14199 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14200 vector bool long long __b) {
14201 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14202 (vector signed long long)__b);
14205 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14206 vector unsigned long long __b) {
14207 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14210 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14211 vector bool long long __b) {
14212 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14213 (vector unsigned long long)__b);
14216 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14217 vector signed long long __b) {
14218 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14219 (vector unsigned long long)__b);
14222 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14223 vector unsigned long long __b) {
14224 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14228 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14229 vector bool long long __b) {
14230 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14231 (vector unsigned long long)__b);
14235 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14236 vector float __b) {
14238 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14240 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14245 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14246 vector double __b) {
14247 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14253 static __inline__ int __attribute__((__always_inline__))
14254 vec_all_in(vector float __a, vector float __b) {
14255 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14260 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14261 vector signed char __b) {
14262 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14265 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14266 vector bool char __b) {
14267 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14270 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14271 vector unsigned char __b) {
14272 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14275 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14276 vector bool char __b) {
14277 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14280 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14281 vector signed char __b) {
14282 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14283 (vector unsigned char)__b);
14286 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14287 vector unsigned char __b) {
14288 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14291 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14292 vector bool char __b) {
14293 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14294 (vector unsigned char)__b);
14297 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14298 vector short __b) {
14299 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14302 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14303 vector bool short __b) {
14304 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14307 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14308 vector unsigned short __b) {
14309 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14312 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14313 vector bool short __b) {
14314 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14315 (vector unsigned short)__b);
14318 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14319 vector short __b) {
14320 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14321 (vector unsigned short)__b);
14324 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14325 vector unsigned short __b) {
14326 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14330 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14331 vector bool short __b) {
14332 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14333 (vector unsigned short)__b);
14336 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14337 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14340 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14341 vector bool int __b) {
14342 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14345 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14346 vector unsigned int __b) {
14347 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14350 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14351 vector bool int __b) {
14352 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14355 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14357 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14358 (vector unsigned int)__b);
14361 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14362 vector unsigned int __b) {
14363 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14366 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14367 vector bool int __b) {
14368 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14369 (vector unsigned int)__b);
14372 #ifdef __POWER8_VECTOR__
14373 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14374 vector signed long long __b) {
14375 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14378 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14379 vector unsigned long long __b) {
14380 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14383 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14384 vector bool long long __b) {
14385 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14386 (vector signed long long)__b);
14389 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14390 vector bool long long __b) {
14391 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14392 (vector unsigned long long)__b);
14395 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14396 vector signed long long __b) {
14397 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14398 (vector unsigned long long)__b);
14401 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14402 vector unsigned long long __b) {
14403 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14407 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14408 vector bool long long __b) {
14409 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14410 (vector unsigned long long)__b);
14414 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14415 vector float __b) {
14417 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14419 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14424 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14425 vector double __b) {
14426 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14432 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14433 vector signed char __b) {
14434 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14437 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14438 vector bool char __b) {
14439 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14442 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14443 vector unsigned char __b) {
14444 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14447 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14448 vector bool char __b) {
14449 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14452 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14453 vector signed char __b) {
14454 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14455 (vector unsigned char)__a);
14458 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14459 vector unsigned char __b) {
14460 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14463 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14464 vector bool char __b) {
14465 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14466 (vector unsigned char)__a);
14469 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14470 vector short __b) {
14471 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14474 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14475 vector bool short __b) {
14476 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14479 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14480 vector unsigned short __b) {
14481 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14484 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14485 vector bool short __b) {
14486 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14490 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14491 vector short __b) {
14492 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14493 (vector unsigned short)__a);
14496 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14497 vector unsigned short __b) {
14498 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14499 (vector unsigned short)__a);
14502 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14503 vector bool short __b) {
14504 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14505 (vector unsigned short)__a);
14508 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14509 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14512 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14513 vector bool int __b) {
14514 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14517 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14518 vector unsigned int __b) {
14519 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14522 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14523 vector bool int __b) {
14524 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14527 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14529 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14530 (vector unsigned int)__a);
14533 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14534 vector unsigned int __b) {
14535 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14538 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14539 vector bool int __b) {
14540 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14541 (vector unsigned int)__a);
14544 #ifdef __POWER8_VECTOR__
14545 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14546 vector signed long long __b) {
14547 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14550 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14551 vector unsigned long long __b) {
14552 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14555 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14556 vector bool long long __b) {
14557 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14561 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14562 vector bool long long __b) {
14563 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14567 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14568 vector signed long long __b) {
14569 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14570 (vector unsigned long long)__a);
14573 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14574 vector unsigned long long __b) {
14575 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14576 (vector unsigned long long)__a);
14579 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14580 vector bool long long __b) {
14581 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14582 (vector unsigned long long)__a);
14586 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14587 vector float __b) {
14589 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14591 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14596 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14597 vector double __b) {
14598 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14604 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14606 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14608 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14613 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14614 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14620 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14621 vector signed char __b) {
14622 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14626 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14627 vector bool char __b) {
14628 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14632 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14633 vector unsigned char __b) {
14634 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14638 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14639 vector bool char __b) {
14640 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14644 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14645 vector signed char __b) {
14646 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14650 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14651 vector unsigned char __b) {
14652 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14656 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14657 vector bool char __b) {
14658 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14662 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14663 vector short __b) {
14664 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14667 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14668 vector bool short __b) {
14669 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14672 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14673 vector unsigned short __b) {
14674 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14675 (vector short)__b);
14678 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14679 vector bool short __b) {
14680 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14681 (vector short)__b);
14684 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14685 vector short __b) {
14686 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14687 (vector short)__b);
14690 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14691 vector unsigned short __b) {
14692 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14693 (vector short)__b);
14696 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14697 vector bool short __b) {
14698 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14699 (vector short)__b);
14702 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14703 vector pixel __b) {
14704 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14705 (vector short)__b);
14708 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14709 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14712 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14713 vector bool int __b) {
14714 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14717 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14718 vector unsigned int __b) {
14719 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14723 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14724 vector bool int __b) {
14725 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14729 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14731 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14735 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14736 vector unsigned int __b) {
14737 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14741 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14742 vector bool int __b) {
14743 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14747 #ifdef __POWER8_VECTOR__
14748 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14749 vector signed long long __b) {
14750 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14753 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14754 vector unsigned long long __b) {
14755 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14756 (vector long long)__b);
14759 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14760 vector bool long long __b) {
14761 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14762 (vector signed long long)__b);
14765 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14766 vector bool long long __b) {
14767 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14768 (vector signed long long)__b);
14771 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14772 vector signed long long __b) {
14773 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14774 (vector signed long long)__b);
14777 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14778 vector unsigned long long __b) {
14779 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14780 (vector signed long long)__b);
14783 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14784 vector bool long long __b) {
14785 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14786 (vector signed long long)__b);
14790 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14791 vector float __b) {
14793 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14795 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14800 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14801 vector double __b) {
14802 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14808 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14809 vector float __b) {
14811 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14813 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14818 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14819 vector double __b) {
14820 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14826 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14827 vector float __b) {
14829 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14831 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14836 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14837 vector double __b) {
14838 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14844 static __inline__ int __attribute__((__always_inline__))
14845 vec_all_nle(vector float __a, vector float __b) {
14846 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14851 static __inline__ int __attribute__((__always_inline__))
14852 vec_all_nlt(vector float __a, vector float __b) {
14853 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14856 /* vec_all_numeric */
14858 static __inline__ int __attribute__((__always_inline__))
14859 vec_all_numeric(vector float __a) {
14860 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14865 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14866 vector signed char __b) {
14867 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14871 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14872 vector bool char __b) {
14873 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14877 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14878 vector unsigned char __b) {
14879 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14883 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14884 vector bool char __b) {
14885 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14889 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14890 vector signed char __b) {
14891 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14895 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14896 vector unsigned char __b) {
14897 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14901 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14902 vector bool char __b) {
14903 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14907 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14908 vector short __b) {
14909 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14912 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14913 vector bool short __b) {
14914 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14917 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14918 vector unsigned short __b) {
14919 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14920 (vector short)__b);
14923 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14924 vector bool short __b) {
14925 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14926 (vector short)__b);
14929 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14930 vector short __b) {
14931 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14932 (vector short)__b);
14935 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14936 vector unsigned short __b) {
14937 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14938 (vector short)__b);
14941 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14942 vector bool short __b) {
14943 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14944 (vector short)__b);
14947 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14948 vector pixel __b) {
14949 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14950 (vector short)__b);
14953 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
14954 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
14957 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
14958 vector bool int __b) {
14959 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
14962 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14963 vector unsigned int __b) {
14964 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14968 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
14969 vector bool int __b) {
14970 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14974 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14976 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14980 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14981 vector unsigned int __b) {
14982 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14986 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
14987 vector bool int __b) {
14988 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
14992 #ifdef __POWER8_VECTOR__
14993 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
14994 vector signed long long __b) {
14995 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
14998 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
14999 vector unsigned long long __b) {
15000 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
15001 (vector long long)__b);
15004 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15005 vector bool long long __b) {
15006 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
15007 (vector signed long long)__b);
15010 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15011 vector bool long long __b) {
15012 return __builtin_altivec_vcmpequd_p(
15013 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15016 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15017 vector signed long long __b) {
15018 return __builtin_altivec_vcmpequd_p(
15019 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15022 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15023 vector unsigned long long __b) {
15024 return __builtin_altivec_vcmpequd_p(
15025 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15028 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15029 vector bool long long __b) {
15030 return __builtin_altivec_vcmpequd_p(
15031 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15035 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15036 vector float __b) {
15038 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15040 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15045 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15046 vector double __b) {
15047 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15053 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15054 vector signed char __b) {
15055 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15058 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15059 vector bool char __b) {
15060 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15064 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15065 vector unsigned char __b) {
15066 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15069 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15070 vector bool char __b) {
15071 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15075 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15076 vector signed char __b) {
15077 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15078 (vector unsigned char)__a);
15081 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15082 vector unsigned char __b) {
15083 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15084 (vector unsigned char)__a);
15087 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15088 vector bool char __b) {
15089 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15090 (vector unsigned char)__a);
15093 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15094 vector short __b) {
15095 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15098 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15099 vector bool short __b) {
15100 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15103 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15104 vector unsigned short __b) {
15105 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15108 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15109 vector bool short __b) {
15110 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15114 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15115 vector short __b) {
15116 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15117 (vector unsigned short)__a);
15120 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15121 vector unsigned short __b) {
15122 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15123 (vector unsigned short)__a);
15126 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15127 vector bool short __b) {
15128 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15129 (vector unsigned short)__a);
15132 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15133 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15136 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15137 vector bool int __b) {
15138 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15141 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15142 vector unsigned int __b) {
15143 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15146 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15147 vector bool int __b) {
15148 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15152 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15154 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15155 (vector unsigned int)__a);
15158 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15159 vector unsigned int __b) {
15160 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15161 (vector unsigned int)__a);
15164 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15165 vector bool int __b) {
15166 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15167 (vector unsigned int)__a);
15170 #ifdef __POWER8_VECTOR__
15171 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15172 vector signed long long __b) {
15173 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15176 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15177 vector unsigned long long __b) {
15178 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15181 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15182 vector bool long long __b) {
15183 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15184 (vector signed long long)__b, __a);
15187 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15188 vector bool long long __b) {
15189 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15190 (vector unsigned long long)__b, __a);
15193 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15194 vector signed long long __b) {
15195 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15196 (vector unsigned long long)__b,
15197 (vector unsigned long long)__a);
15200 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15201 vector unsigned long long __b) {
15202 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15203 (vector unsigned long long)__a);
15206 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15207 vector bool long long __b) {
15208 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15209 (vector unsigned long long)__b,
15210 (vector unsigned long long)__a);
15214 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15215 vector float __b) {
15217 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15219 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15224 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15225 vector double __b) {
15226 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15232 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15233 vector signed char __b) {
15234 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15237 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15238 vector bool char __b) {
15239 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15240 (vector signed char)__b);
15243 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15244 vector unsigned char __b) {
15245 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15248 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15249 vector bool char __b) {
15250 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15251 (vector unsigned char)__b);
15254 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15255 vector signed char __b) {
15256 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15257 (vector unsigned char)__b);
15260 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15261 vector unsigned char __b) {
15262 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15266 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15267 vector bool char __b) {
15268 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15269 (vector unsigned char)__b);
15272 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15273 vector short __b) {
15274 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15277 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15278 vector bool short __b) {
15279 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15282 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15283 vector unsigned short __b) {
15284 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15287 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15288 vector bool short __b) {
15289 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15290 (vector unsigned short)__b);
15293 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15294 vector short __b) {
15295 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15296 (vector unsigned short)__b);
15299 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15300 vector unsigned short __b) {
15301 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15305 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15306 vector bool short __b) {
15307 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15308 (vector unsigned short)__b);
15311 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15312 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15315 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15316 vector bool int __b) {
15317 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15320 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15321 vector unsigned int __b) {
15322 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15325 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15326 vector bool int __b) {
15327 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15328 (vector unsigned int)__b);
15331 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15333 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15334 (vector unsigned int)__b);
15337 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15338 vector unsigned int __b) {
15339 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15343 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15344 vector bool int __b) {
15345 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15346 (vector unsigned int)__b);
15349 #ifdef __POWER8_VECTOR__
15350 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15351 vector signed long long __b) {
15352 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15355 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15356 vector unsigned long long __b) {
15357 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15360 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15361 vector bool long long __b) {
15362 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15363 (vector signed long long)__b);
15366 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15367 vector bool long long __b) {
15368 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15369 (vector unsigned long long)__b);
15372 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15373 vector signed long long __b) {
15374 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15375 (vector unsigned long long)__a,
15376 (vector unsigned long long)__b);
15379 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15380 vector unsigned long long __b) {
15381 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15382 (vector unsigned long long)__a, __b);
15385 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15386 vector bool long long __b) {
15387 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15388 (vector unsigned long long)__a,
15389 (vector unsigned long long)__b);
15393 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15394 vector float __b) {
15396 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15398 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15403 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15404 vector double __b) {
15405 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15411 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15412 vector signed char __b) {
15413 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15416 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15417 vector bool char __b) {
15418 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15419 (vector signed char)__b);
15422 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15423 vector unsigned char __b) {
15424 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15427 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15428 vector bool char __b) {
15429 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15430 (vector unsigned char)__b);
15433 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15434 vector signed char __b) {
15435 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15436 (vector unsigned char)__b);
15439 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15440 vector unsigned char __b) {
15441 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15445 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15446 vector bool char __b) {
15447 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15448 (vector unsigned char)__b);
15451 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15452 vector short __b) {
15453 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15456 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15457 vector bool short __b) {
15458 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15461 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15462 vector unsigned short __b) {
15463 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15466 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15467 vector bool short __b) {
15468 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15469 (vector unsigned short)__b);
15472 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15473 vector short __b) {
15474 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15475 (vector unsigned short)__b);
15478 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15479 vector unsigned short __b) {
15480 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15484 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15485 vector bool short __b) {
15486 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15487 (vector unsigned short)__b);
15490 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15491 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15494 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15495 vector bool int __b) {
15496 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15499 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15500 vector unsigned int __b) {
15501 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15504 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15505 vector bool int __b) {
15506 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15507 (vector unsigned int)__b);
15510 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15512 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15513 (vector unsigned int)__b);
15516 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15517 vector unsigned int __b) {
15518 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15522 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15523 vector bool int __b) {
15524 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15525 (vector unsigned int)__b);
15528 #ifdef __POWER8_VECTOR__
15529 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15530 vector signed long long __b) {
15531 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15534 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15535 vector unsigned long long __b) {
15536 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15539 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15540 vector bool long long __b) {
15541 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15542 (vector signed long long)__b);
15545 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15546 vector bool long long __b) {
15547 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15548 (vector unsigned long long)__b);
15551 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15552 vector signed long long __b) {
15553 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15554 (vector unsigned long long)__a,
15555 (vector unsigned long long)__b);
15558 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15559 vector unsigned long long __b) {
15560 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15561 (vector unsigned long long)__a, __b);
15564 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15565 vector bool long long __b) {
15566 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15567 (vector unsigned long long)__a,
15568 (vector unsigned long long)__b);
15572 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15573 vector float __b) {
15575 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15577 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15582 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15583 vector double __b) {
15584 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15590 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15591 vector signed char __b) {
15592 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15595 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15596 vector bool char __b) {
15597 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15601 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15602 vector unsigned char __b) {
15603 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15606 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15607 vector bool char __b) {
15608 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15612 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15613 vector signed char __b) {
15614 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15615 (vector unsigned char)__a);
15618 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15619 vector unsigned char __b) {
15620 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15621 (vector unsigned char)__a);
15624 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15625 vector bool char __b) {
15626 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15627 (vector unsigned char)__a);
15630 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15631 vector short __b) {
15632 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15635 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15636 vector bool short __b) {
15637 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15640 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15641 vector unsigned short __b) {
15642 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15645 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15646 vector bool short __b) {
15647 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15651 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15652 vector short __b) {
15653 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15654 (vector unsigned short)__a);
15657 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15658 vector unsigned short __b) {
15659 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15660 (vector unsigned short)__a);
15663 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15664 vector bool short __b) {
15665 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15666 (vector unsigned short)__a);
15669 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15670 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15673 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15674 vector bool int __b) {
15675 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15678 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15679 vector unsigned int __b) {
15680 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15683 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15684 vector bool int __b) {
15685 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15689 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15691 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15692 (vector unsigned int)__a);
15695 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15696 vector unsigned int __b) {
15697 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15698 (vector unsigned int)__a);
15701 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15702 vector bool int __b) {
15703 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15704 (vector unsigned int)__a);
15707 #ifdef __POWER8_VECTOR__
15708 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15709 vector signed long long __b) {
15710 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15713 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15714 vector unsigned long long __b) {
15715 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15718 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15719 vector bool long long __b) {
15720 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15721 (vector signed long long)__b, __a);
15724 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15725 vector bool long long __b) {
15726 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15727 (vector unsigned long long)__b, __a);
15730 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15731 vector signed long long __b) {
15732 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15733 (vector unsigned long long)__b,
15734 (vector unsigned long long)__a);
15737 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15738 vector unsigned long long __b) {
15739 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15740 (vector unsigned long long)__a);
15743 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15744 vector bool long long __b) {
15745 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15746 (vector unsigned long long)__b,
15747 (vector unsigned long long)__a);
15751 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15752 vector float __b) {
15754 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15756 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15761 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15762 vector double __b) {
15763 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15769 static __inline__ int __attribute__((__always_inline__))
15770 vec_any_nan(vector float __a) {
15771 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15776 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15777 vector signed char __b) {
15778 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15782 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15783 vector bool char __b) {
15784 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15788 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15789 vector unsigned char __b) {
15790 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15794 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15795 vector bool char __b) {
15796 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15800 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15801 vector signed char __b) {
15802 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15806 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15807 vector unsigned char __b) {
15808 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15812 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15813 vector bool char __b) {
15814 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15818 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15819 vector short __b) {
15820 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15823 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15824 vector bool short __b) {
15825 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15828 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15829 vector unsigned short __b) {
15830 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15831 (vector short)__b);
15834 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15835 vector bool short __b) {
15836 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15837 (vector short)__b);
15840 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15841 vector short __b) {
15842 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15843 (vector short)__b);
15846 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15847 vector unsigned short __b) {
15848 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15849 (vector short)__b);
15852 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15853 vector bool short __b) {
15854 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15855 (vector short)__b);
15858 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15859 vector pixel __b) {
15860 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15861 (vector short)__b);
15864 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15865 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15868 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15869 vector bool int __b) {
15870 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15873 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15874 vector unsigned int __b) {
15875 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15879 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15880 vector bool int __b) {
15881 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15885 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15887 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15891 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15892 vector unsigned int __b) {
15893 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15897 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15898 vector bool int __b) {
15899 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15903 #ifdef __POWER8_VECTOR__
15904 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15905 vector signed long long __b) {
15906 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15909 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15910 vector unsigned long long __b) {
15911 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15912 (vector long long)__b);
15915 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15916 vector bool long long __b) {
15917 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15918 (vector signed long long)__b);
15921 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15922 vector bool long long __b) {
15923 return __builtin_altivec_vcmpequd_p(
15924 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15927 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15928 vector signed long long __b) {
15929 return __builtin_altivec_vcmpequd_p(
15930 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15933 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15934 vector unsigned long long __b) {
15935 return __builtin_altivec_vcmpequd_p(
15936 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15939 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15940 vector bool long long __b) {
15941 return __builtin_altivec_vcmpequd_p(
15942 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15946 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15947 vector float __b) {
15949 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
15951 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
15956 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
15957 vector double __b) {
15958 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
15964 static __inline__ int __attribute__((__always_inline__))
15965 vec_any_nge(vector float __a, vector float __b) {
15966 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
15971 static __inline__ int __attribute__((__always_inline__))
15972 vec_any_ngt(vector float __a, vector float __b) {
15973 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
15978 static __inline__ int __attribute__((__always_inline__))
15979 vec_any_nle(vector float __a, vector float __b) {
15980 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
15985 static __inline__ int __attribute__((__always_inline__))
15986 vec_any_nlt(vector float __a, vector float __b) {
15987 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
15990 /* vec_any_numeric */
15992 static __inline__ int __attribute__((__always_inline__))
15993 vec_any_numeric(vector float __a) {
15994 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
15999 static __inline__ int __attribute__((__always_inline__))
16000 vec_any_out(vector float __a, vector float __b) {
16001 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
16004 /* Power 8 Crypto functions
16005 Note: We diverge from the current GCC implementation with regard
16006 to cryptography and related functions as follows:
16007 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
16008 - The remaining ones are only available on Power8 and up so
16009 require -mpower8-vector
16010 The justification for this is that export requirements require that
16011 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16012 support). As a result, we need to be able to turn off support for those.
16013 The remaining ones (currently controlled by -mcrypto for GCC) still
16014 need to be provided on compliant hardware even if Vector.Crypto is not
16018 #define vec_sbox_be __builtin_altivec_crypto_vsbox
16019 #define vec_cipher_be __builtin_altivec_crypto_vcipher
16020 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16021 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16022 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16024 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16025 __builtin_crypto_vsbox(vector unsigned long long __a) {
16026 return __builtin_altivec_crypto_vsbox(__a);
16029 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16030 __builtin_crypto_vcipher(vector unsigned long long __a,
16031 vector unsigned long long __b) {
16032 return __builtin_altivec_crypto_vcipher(__a, __b);
16035 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16036 __builtin_crypto_vcipherlast(vector unsigned long long __a,
16037 vector unsigned long long __b) {
16038 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16041 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16042 __builtin_crypto_vncipher(vector unsigned long long __a,
16043 vector unsigned long long __b) {
16044 return __builtin_altivec_crypto_vncipher(__a, __b);
16047 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16048 __builtin_crypto_vncipherlast(vector unsigned long long __a,
16049 vector unsigned long long __b) {
16050 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16053 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16054 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16056 #define vec_shasigma_be(X, Y, Z) \
16057 _Generic((X), vector unsigned int \
16058 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16059 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16062 #ifdef __POWER8_VECTOR__
16063 static __inline__ vector bool char __ATTRS_o_ai
16064 vec_permxor(vector bool char __a, vector bool char __b,
16065 vector bool char __c) {
16066 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16069 static __inline__ vector signed char __ATTRS_o_ai
16070 vec_permxor(vector signed char __a, vector signed char __b,
16071 vector signed char __c) {
16072 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16075 static __inline__ vector unsigned char __ATTRS_o_ai
16076 vec_permxor(vector unsigned char __a, vector unsigned char __b,
16077 vector unsigned char __c) {
16078 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16081 static __inline__ vector unsigned char __ATTRS_o_ai
16082 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16083 vector unsigned char __c) {
16084 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16087 static __inline__ vector unsigned short __ATTRS_o_ai
16088 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16089 vector unsigned short __c) {
16090 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16091 (vector unsigned char)__a, (vector unsigned char)__b,
16092 (vector unsigned char)__c);
16095 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16096 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16097 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16098 (vector unsigned char)__a, (vector unsigned char)__b,
16099 (vector unsigned char)__c);
16102 static __inline__ vector unsigned long long __ATTRS_o_ai
16103 __builtin_crypto_vpermxor(vector unsigned long long __a,
16104 vector unsigned long long __b,
16105 vector unsigned long long __c) {
16106 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16107 (vector unsigned char)__a, (vector unsigned char)__b,
16108 (vector unsigned char)__c);
16111 static __inline__ vector unsigned char __ATTRS_o_ai
16112 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16113 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16116 static __inline__ vector unsigned short __ATTRS_o_ai
16117 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16118 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16121 static __inline__ vector unsigned int __ATTRS_o_ai
16122 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16123 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16126 static __inline__ vector unsigned long long __ATTRS_o_ai
16127 __builtin_crypto_vpmsumb(vector unsigned long long __a,
16128 vector unsigned long long __b) {
16129 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16132 static __inline__ vector signed char __ATTRS_o_ai
16133 vec_vgbbd(vector signed char __a) {
16134 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16137 #define vec_pmsum_be __builtin_crypto_vpmsumb
16138 #define vec_gb __builtin_altivec_vgbbd
16140 static __inline__ vector unsigned char __ATTRS_o_ai
16141 vec_vgbbd(vector unsigned char __a) {
16142 return __builtin_altivec_vgbbd(__a);
16145 static __inline__ vector long long __ATTRS_o_ai
16146 vec_vbpermq(vector signed char __a, vector signed char __b) {
16147 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16148 (vector unsigned char)__b);
16151 static __inline__ vector long long __ATTRS_o_ai
16152 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16153 return __builtin_altivec_vbpermq(__a, __b);
16156 #ifdef __powerpc64__
16157 static __inline__ vector unsigned long long __attribute__((__always_inline__))
16158 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16159 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16160 (vector unsigned char)__b);
16168 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16169 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16173 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16174 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16178 static inline __ATTRS_o_ai vector unsigned char
16179 vec_reve(vector unsigned char __a) {
16180 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16184 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16185 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16188 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16189 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16192 static inline __ATTRS_o_ai vector unsigned int
16193 vec_reve(vector unsigned int __a) {
16194 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16197 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16198 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16201 static inline __ATTRS_o_ai vector signed short
16202 vec_reve(vector signed short __a) {
16203 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16206 static inline __ATTRS_o_ai vector unsigned short
16207 vec_reve(vector unsigned short __a) {
16208 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16211 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16212 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16216 static inline __ATTRS_o_ai vector bool long long
16217 vec_reve(vector bool long long __a) {
16218 return __builtin_shufflevector(__a, __a, 1, 0);
16221 static inline __ATTRS_o_ai vector signed long long
16222 vec_reve(vector signed long long __a) {
16223 return __builtin_shufflevector(__a, __a, 1, 0);
16226 static inline __ATTRS_o_ai vector unsigned long long
16227 vec_reve(vector unsigned long long __a) {
16228 return __builtin_shufflevector(__a, __a, 1, 0);
16231 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16232 return __builtin_shufflevector(__a, __a, 1, 0);
16237 static __inline__ vector bool char __ATTRS_o_ai
16238 vec_revb(vector bool char __a) {
16242 static __inline__ vector signed char __ATTRS_o_ai
16243 vec_revb(vector signed char __a) {
16247 static __inline__ vector unsigned char __ATTRS_o_ai
16248 vec_revb(vector unsigned char __a) {
16252 static __inline__ vector bool short __ATTRS_o_ai
16253 vec_revb(vector bool short __a) {
16254 vector unsigned char __indices =
16255 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16256 return vec_perm(__a, __a, __indices);
16259 static __inline__ vector signed short __ATTRS_o_ai
16260 vec_revb(vector signed short __a) {
16261 vector unsigned char __indices =
16262 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16263 return vec_perm(__a, __a, __indices);
16266 static __inline__ vector unsigned short __ATTRS_o_ai
16267 vec_revb(vector unsigned short __a) {
16268 vector unsigned char __indices =
16269 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16270 return vec_perm(__a, __a, __indices);
16273 static __inline__ vector bool int __ATTRS_o_ai
16274 vec_revb(vector bool int __a) {
16275 vector unsigned char __indices =
16276 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16277 return vec_perm(__a, __a, __indices);
16280 static __inline__ vector signed int __ATTRS_o_ai
16281 vec_revb(vector signed int __a) {
16282 vector unsigned char __indices =
16283 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16284 return vec_perm(__a, __a, __indices);
16287 static __inline__ vector unsigned int __ATTRS_o_ai
16288 vec_revb(vector unsigned int __a) {
16289 vector unsigned char __indices =
16290 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16291 return vec_perm(__a, __a, __indices);
16294 static __inline__ vector float __ATTRS_o_ai
16295 vec_revb(vector float __a) {
16296 vector unsigned char __indices =
16297 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16298 return vec_perm(__a, __a, __indices);
16302 static __inline__ vector bool long long __ATTRS_o_ai
16303 vec_revb(vector bool long long __a) {
16304 vector unsigned char __indices =
16305 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16306 return vec_perm(__a, __a, __indices);
16309 static __inline__ vector signed long long __ATTRS_o_ai
16310 vec_revb(vector signed long long __a) {
16311 vector unsigned char __indices =
16312 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16313 return vec_perm(__a, __a, __indices);
16316 static __inline__ vector unsigned long long __ATTRS_o_ai
16317 vec_revb(vector unsigned long long __a) {
16318 vector unsigned char __indices =
16319 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16320 return vec_perm(__a, __a, __indices);
16323 static __inline__ vector double __ATTRS_o_ai
16324 vec_revb(vector double __a) {
16325 vector unsigned char __indices =
16326 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16327 return vec_perm(__a, __a, __indices);
16329 #endif /* End __VSX__ */
16331 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16332 static __inline__ vector signed __int128 __ATTRS_o_ai
16333 vec_revb(vector signed __int128 __a) {
16334 vector unsigned char __indices =
16335 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16336 return (vector signed __int128)vec_perm((vector signed int)__a,
16337 (vector signed int)__a,
16341 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16342 vec_revb(vector unsigned __int128 __a) {
16343 vector unsigned char __indices =
16344 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16345 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16346 (vector signed int)__a,
16349 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16353 static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16354 signed char *__ptr) {
16355 return *(vector signed char *)(__ptr + __offset);
16358 static inline __ATTRS_o_ai vector unsigned char
16359 vec_xl(signed long long __offset, unsigned char *__ptr) {
16360 return *(vector unsigned char *)(__ptr + __offset);
16363 static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16364 signed short *__ptr) {
16365 return *(vector signed short *)(__ptr + __offset);
16368 static inline __ATTRS_o_ai vector unsigned short
16369 vec_xl(signed long long __offset, unsigned short *__ptr) {
16370 return *(vector unsigned short *)(__ptr + __offset);
16373 static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16374 signed int *__ptr) {
16375 return *(vector signed int *)(__ptr + __offset);
16378 static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16379 unsigned int *__ptr) {
16380 return *(vector unsigned int *)(__ptr + __offset);
16383 static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16385 return *(vector float *)(__ptr + __offset);
16389 static inline __ATTRS_o_ai vector signed long long
16390 vec_xl(signed long long __offset, signed long long *__ptr) {
16391 return *(vector signed long long *)(__ptr + __offset);
16394 static inline __ATTRS_o_ai vector unsigned long long
16395 vec_xl(signed long long __offset, unsigned long long *__ptr) {
16396 return *(vector unsigned long long *)(__ptr + __offset);
16399 static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16401 return *(vector double *)(__ptr + __offset);
16405 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16406 static inline __ATTRS_o_ai vector signed __int128
16407 vec_xl(signed long long __offset, signed __int128 *__ptr) {
16408 return *(vector signed __int128 *)(__ptr + __offset);
16411 static inline __ATTRS_o_ai vector unsigned __int128
16412 vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
16413 return *(vector unsigned __int128 *)(__ptr + __offset);
16419 #ifdef __LITTLE_ENDIAN__
16420 static __inline__ vector signed char __ATTRS_o_ai
16421 vec_xl_be(signed long long __offset, signed char *__ptr) {
16422 vector signed char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16423 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16424 13, 12, 11, 10, 9, 8);
16427 static __inline__ vector unsigned char __ATTRS_o_ai
16428 vec_xl_be(signed long long __offset, unsigned char *__ptr) {
16429 vector unsigned char __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16430 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16431 13, 12, 11, 10, 9, 8);
16434 static __inline__ vector signed short __ATTRS_o_ai
16435 vec_xl_be(signed long long __offset, signed short *__ptr) {
16436 vector signed short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16437 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16440 static __inline__ vector unsigned short __ATTRS_o_ai
16441 vec_xl_be(signed long long __offset, unsigned short *__ptr) {
16442 vector unsigned short __vec = __builtin_vsx_lxvd2x_be(__offset, __ptr);
16443 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16446 static __inline__ vector signed int __ATTRS_o_ai
16447 vec_xl_be(signed long long __offset, signed int *__ptr) {
16448 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16451 static __inline__ vector unsigned int __ATTRS_o_ai
16452 vec_xl_be(signed long long __offset, unsigned int *__ptr) {
16453 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16456 static __inline__ vector float __ATTRS_o_ai
16457 vec_xl_be(signed long long __offset, float *__ptr) {
16458 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16462 static __inline__ vector signed long long __ATTRS_o_ai
16463 vec_xl_be(signed long long __offset, signed long long *__ptr) {
16464 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16467 static __inline__ vector unsigned long long __ATTRS_o_ai
16468 vec_xl_be(signed long long __offset, unsigned long long *__ptr) {
16469 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16472 static __inline__ vector double __ATTRS_o_ai
16473 vec_xl_be(signed long long __offset, double *__ptr) {
16474 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16478 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16479 static __inline__ vector signed __int128 __ATTRS_o_ai
16480 vec_xl_be(signed long long __offset, signed __int128 *__ptr) {
16481 return vec_xl(__offset, __ptr);
16484 static __inline__ vector unsigned __int128 __ATTRS_o_ai
16485 vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
16486 return vec_xl(__offset, __ptr);
16490 #define vec_xl_be vec_xl
16495 static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16496 signed long long __offset,
16497 signed char *__ptr) {
16498 *(vector signed char *)(__ptr + __offset) = __vec;
16501 static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16502 signed long long __offset,
16503 unsigned char *__ptr) {
16504 *(vector unsigned char *)(__ptr + __offset) = __vec;
16507 static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16508 signed long long __offset,
16509 signed short *__ptr) {
16510 *(vector signed short *)(__ptr + __offset) = __vec;
16513 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16514 signed long long __offset,
16515 unsigned short *__ptr) {
16516 *(vector unsigned short *)(__ptr + __offset) = __vec;
16519 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16520 signed long long __offset,
16521 signed int *__ptr) {
16522 *(vector signed int *)(__ptr + __offset) = __vec;
16525 static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16526 signed long long __offset,
16527 unsigned int *__ptr) {
16528 *(vector unsigned int *)(__ptr + __offset) = __vec;
16531 static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16532 signed long long __offset,
16534 *(vector float *)(__ptr + __offset) = __vec;
16538 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16539 signed long long __offset,
16540 signed long long *__ptr) {
16541 *(vector signed long long *)(__ptr + __offset) = __vec;
16544 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16545 signed long long __offset,
16546 unsigned long long *__ptr) {
16547 *(vector unsigned long long *)(__ptr + __offset) = __vec;
16550 static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16551 signed long long __offset,
16553 *(vector double *)(__ptr + __offset) = __vec;
16557 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16558 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16559 signed long long __offset,
16560 signed __int128 *__ptr) {
16561 *(vector signed __int128 *)(__ptr + __offset) = __vec;
16564 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16565 signed long long __offset,
16566 unsigned __int128 *__ptr) {
16567 *(vector unsigned __int128 *)(__ptr + __offset) = __vec;
16573 #ifdef __LITTLE_ENDIAN__
16574 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16575 signed long long __offset,
16576 signed char *__ptr) {
16577 vector signed char __tmp =
16578 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16579 13, 12, 11, 10, 9, 8);
16580 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16583 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16584 signed long long __offset,
16585 unsigned char *__ptr) {
16586 vector unsigned char __tmp =
16587 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16588 13, 12, 11, 10, 9, 8);
16589 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16592 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16593 signed long long __offset,
16594 signed short *__ptr) {
16595 vector signed short __tmp =
16596 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16597 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16600 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16601 signed long long __offset,
16602 unsigned short *__ptr) {
16603 vector unsigned short __tmp =
16604 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16605 __builtin_vsx_stxvd2x_be(__tmp, __offset, __ptr);
16608 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16609 signed long long __offset,
16610 signed int *__ptr) {
16611 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16614 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16615 signed long long __offset,
16616 unsigned int *__ptr) {
16617 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16620 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16621 signed long long __offset,
16623 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16627 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16628 signed long long __offset,
16629 signed long long *__ptr) {
16630 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16633 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16634 signed long long __offset,
16635 unsigned long long *__ptr) {
16636 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16639 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16640 signed long long __offset,
16642 __builtin_vsx_stxvd2x_be(__vec, __offset, __ptr);
16646 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16647 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16648 signed long long __offset,
16649 signed __int128 *__ptr) {
16650 vec_xst(__vec, __offset, __ptr);
16653 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16654 signed long long __offset,
16655 unsigned __int128 *__ptr) {
16656 vec_xst(__vec, __offset, __ptr);
16660 #define vec_xst_be vec_xst
16663 #ifdef __POWER9_VECTOR__
16664 #define vec_test_data_class(__a, __b) \
16667 (vector bool int)__builtin_vsx_xvtstdcsp((__a), (__b)), \
16669 (vector bool long long)__builtin_vsx_xvtstdcdp((__a), (__b)) \
16672 #endif /* #ifdef __POWER9_VECTOR__ */
16674 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16679 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16685 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16686 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16691 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16695 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16699 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16703 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16704 return - vec_abs(__a);
16708 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16709 return - vec_abs(__a);
16714 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16715 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16716 return __builtin_altivec_vminsd(__a, -__a);
16720 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16721 return __builtin_altivec_vminsw(__a, -__a);
16724 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16725 return __builtin_altivec_vminsh(__a, -__a);
16728 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16729 return __builtin_altivec_vminsb(__a, -__a);
16731 #undef __ATTRS_o_ai
16733 #endif /* __ALTIVEC_H */