1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 \*===----------------------------------------------------------------------===*/
13 #error "AltiVec support not enabled"
16 /* Constants for mapping CR6 bits to predicate result. */
19 #define __CR6_EQ_REV 1
21 #define __CR6_LT_REV 3
23 /* Constants for vec_test_data_class */
24 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
25 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
26 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
27 __VEC_CLASS_FP_SUBNORMAL_N)
28 #define __VEC_CLASS_FP_ZERO_N (1<<2)
29 #define __VEC_CLASS_FP_ZERO_P (1<<3)
30 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
31 __VEC_CLASS_FP_ZERO_N)
32 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
33 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
34 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
35 __VEC_CLASS_FP_INFINITY_N)
36 #define __VEC_CLASS_FP_NAN (1<<6)
37 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
38 __VEC_CLASS_FP_SUBNORMAL | \
39 __VEC_CLASS_FP_ZERO | \
40 __VEC_CLASS_FP_INFINITY)
42 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
46 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
47 vector signed char __a, vector signed char __b, vector unsigned char __c);
49 static __inline__ vector unsigned char __ATTRS_o_ai
50 vec_perm(vector unsigned char __a, vector unsigned char __b,
51 vector unsigned char __c);
53 static __inline__ vector bool char __ATTRS_o_ai
54 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
56 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
57 vector signed short __b,
58 vector unsigned char __c);
60 static __inline__ vector unsigned short __ATTRS_o_ai
61 vec_perm(vector unsigned short __a, vector unsigned short __b,
62 vector unsigned char __c);
64 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
65 vector bool short __a, vector bool short __b, vector unsigned char __c);
67 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
69 vector unsigned char __c);
71 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
72 vector signed int __b,
73 vector unsigned char __c);
75 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
76 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
78 static __inline__ vector bool int __ATTRS_o_ai
79 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
81 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
83 vector unsigned char __c);
86 static __inline__ vector long long __ATTRS_o_ai
87 vec_perm(vector signed long long __a, vector signed long long __b,
88 vector unsigned char __c);
90 static __inline__ vector unsigned long long __ATTRS_o_ai
91 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
92 vector unsigned char __c);
94 static __inline__ vector bool long long __ATTRS_o_ai
95 vec_perm(vector bool long long __a, vector bool long long __b,
96 vector unsigned char __c);
98 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
100 vector unsigned char __c);
103 static __inline__ vector unsigned char __ATTRS_o_ai
104 vec_xor(vector unsigned char __a, vector unsigned char __b);
108 #define __builtin_altivec_abs_v16qi vec_abs
109 #define __builtin_altivec_abs_v8hi vec_abs
110 #define __builtin_altivec_abs_v4si vec_abs
112 static __inline__ vector signed char __ATTRS_o_ai
113 vec_abs(vector signed char __a) {
114 return __builtin_altivec_vmaxsb(__a, -__a);
117 static __inline__ vector signed short __ATTRS_o_ai
118 vec_abs(vector signed short __a) {
119 return __builtin_altivec_vmaxsh(__a, -__a);
122 static __inline__ vector signed int __ATTRS_o_ai
123 vec_abs(vector signed int __a) {
124 return __builtin_altivec_vmaxsw(__a, -__a);
127 #ifdef __POWER8_VECTOR__
128 static __inline__ vector signed long long __ATTRS_o_ai
129 vec_abs(vector signed long long __a) {
130 return __builtin_altivec_vmaxsd(__a, -__a);
134 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
136 return __builtin_vsx_xvabssp(__a);
138 vector unsigned int __res =
139 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
140 return (vector float)__res;
145 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
146 return __builtin_vsx_xvabsdp(__a);
151 #define __builtin_altivec_abss_v16qi vec_abss
152 #define __builtin_altivec_abss_v8hi vec_abss
153 #define __builtin_altivec_abss_v4si vec_abss
155 static __inline__ vector signed char __ATTRS_o_ai
156 vec_abss(vector signed char __a) {
157 return __builtin_altivec_vmaxsb(
158 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
161 static __inline__ vector signed short __ATTRS_o_ai
162 vec_abss(vector signed short __a) {
163 return __builtin_altivec_vmaxsh(
164 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
167 static __inline__ vector signed int __ATTRS_o_ai
168 vec_abss(vector signed int __a) {
169 return __builtin_altivec_vmaxsw(
170 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
174 #if defined(__POWER9_VECTOR__)
176 static __inline__ vector unsigned char __ATTRS_o_ai
177 vec_absd(vector unsigned char __a, vector unsigned char __b) {
178 return __builtin_altivec_vabsdub(__a, __b);
181 static __inline__ vector unsigned short __ATTRS_o_ai
182 vec_absd(vector unsigned short __a, vector unsigned short __b) {
183 return __builtin_altivec_vabsduh(__a, __b);
186 static __inline__ vector unsigned int __ATTRS_o_ai
187 vec_absd(vector unsigned int __a, vector unsigned int __b) {
188 return __builtin_altivec_vabsduw(__a, __b);
191 #endif /* End __POWER9_VECTOR__ */
195 static __inline__ vector signed char __ATTRS_o_ai
196 vec_add(vector signed char __a, vector signed char __b) {
200 static __inline__ vector signed char __ATTRS_o_ai
201 vec_add(vector bool char __a, vector signed char __b) {
202 return (vector signed char)__a + __b;
205 static __inline__ vector signed char __ATTRS_o_ai
206 vec_add(vector signed char __a, vector bool char __b) {
207 return __a + (vector signed char)__b;
210 static __inline__ vector unsigned char __ATTRS_o_ai
211 vec_add(vector unsigned char __a, vector unsigned char __b) {
215 static __inline__ vector unsigned char __ATTRS_o_ai
216 vec_add(vector bool char __a, vector unsigned char __b) {
217 return (vector unsigned char)__a + __b;
220 static __inline__ vector unsigned char __ATTRS_o_ai
221 vec_add(vector unsigned char __a, vector bool char __b) {
222 return __a + (vector unsigned char)__b;
225 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
230 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
232 return (vector short)__a + __b;
235 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
236 vector bool short __b) {
237 return __a + (vector short)__b;
240 static __inline__ vector unsigned short __ATTRS_o_ai
241 vec_add(vector unsigned short __a, vector unsigned short __b) {
245 static __inline__ vector unsigned short __ATTRS_o_ai
246 vec_add(vector bool short __a, vector unsigned short __b) {
247 return (vector unsigned short)__a + __b;
250 static __inline__ vector unsigned short __ATTRS_o_ai
251 vec_add(vector unsigned short __a, vector bool short __b) {
252 return __a + (vector unsigned short)__b;
255 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
260 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
262 return (vector int)__a + __b;
265 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
266 vector bool int __b) {
267 return __a + (vector int)__b;
270 static __inline__ vector unsigned int __ATTRS_o_ai
271 vec_add(vector unsigned int __a, vector unsigned int __b) {
275 static __inline__ vector unsigned int __ATTRS_o_ai
276 vec_add(vector bool int __a, vector unsigned int __b) {
277 return (vector unsigned int)__a + __b;
280 static __inline__ vector unsigned int __ATTRS_o_ai
281 vec_add(vector unsigned int __a, vector bool int __b) {
282 return __a + (vector unsigned int)__b;
285 #ifdef __POWER8_VECTOR__
286 static __inline__ vector signed long long __ATTRS_o_ai
287 vec_add(vector signed long long __a, vector signed long long __b) {
291 static __inline__ vector unsigned long long __ATTRS_o_ai
292 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
296 #ifdef __SIZEOF_INT128__
297 static __inline__ vector signed __int128 __ATTRS_o_ai
298 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
302 static __inline__ vector unsigned __int128 __ATTRS_o_ai
303 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
308 static __inline__ vector unsigned char __attribute__((__always_inline__))
309 vec_add_u128(vector unsigned char __a, vector unsigned char __b) {
310 return __builtin_altivec_vadduqm(__a, __b);
312 #elif defined(__VSX__)
313 static __inline__ vector signed long long __ATTRS_o_ai
314 vec_add(vector signed long long __a, vector signed long long __b) {
315 #ifdef __LITTLE_ENDIAN__
316 // Little endian systems on CPU's prior to Power8 don't really exist
317 // so scalarizing is fine.
320 vector unsigned int __res =
321 (vector unsigned int)__a + (vector unsigned int)__b;
322 vector unsigned int __carry = __builtin_altivec_vaddcuw(
323 (vector unsigned int)__a, (vector unsigned int)__b);
324 __carry = __builtin_shufflevector((vector unsigned char)__carry,
325 (vector unsigned char)__carry, 0, 0, 0, 7,
326 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);
327 return (vector signed long long)(__res + __carry);
331 static __inline__ vector unsigned long long __ATTRS_o_ai
332 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
333 return (vector unsigned long long)vec_add((vector signed long long)__a,
334 (vector signed long long)__b);
336 #endif // __POWER8_VECTOR__
338 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
344 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
352 #ifdef __POWER8_VECTOR__
353 #ifdef __SIZEOF_INT128__
354 static __inline__ vector signed __int128 __ATTRS_o_ai
355 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
356 vector signed __int128 __c) {
357 return __builtin_altivec_vaddeuqm(__a, __b, __c);
360 static __inline__ vector unsigned __int128 __ATTRS_o_ai
361 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
362 vector unsigned __int128 __c) {
363 return __builtin_altivec_vaddeuqm(__a, __b, __c);
367 static __inline__ vector unsigned char __attribute__((__always_inline__))
368 vec_adde_u128(vector unsigned char __a, vector unsigned char __b,
369 vector unsigned char __c) {
370 return (vector unsigned char)__builtin_altivec_vaddeuqm(__a, __b, __c);
374 static __inline__ vector signed int __ATTRS_o_ai
375 vec_adde(vector signed int __a, vector signed int __b,
376 vector signed int __c) {
377 vector signed int __mask = {1, 1, 1, 1};
378 vector signed int __carry = __c & __mask;
379 return vec_add(vec_add(__a, __b), __carry);
382 static __inline__ vector unsigned int __ATTRS_o_ai
383 vec_adde(vector unsigned int __a, vector unsigned int __b,
384 vector unsigned int __c) {
385 vector unsigned int __mask = {1, 1, 1, 1};
386 vector unsigned int __carry = __c & __mask;
387 return vec_add(vec_add(__a, __b), __carry);
392 #ifdef __POWER8_VECTOR__
393 #ifdef __SIZEOF_INT128__
394 static __inline__ vector signed __int128 __ATTRS_o_ai
395 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
396 vector signed __int128 __c) {
397 return __builtin_altivec_vaddecuq(__a, __b, __c);
400 static __inline__ vector unsigned __int128 __ATTRS_o_ai
401 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
402 vector unsigned __int128 __c) {
403 return __builtin_altivec_vaddecuq(__a, __b, __c);
407 static __inline__ vector unsigned char __attribute__((__always_inline__))
408 vec_addec_u128(vector unsigned char __a, vector unsigned char __b,
409 vector unsigned char __c) {
410 return (vector unsigned char)__builtin_altivec_vaddecuq(__a, __b, __c);
414 static __inline__ vector signed int __ATTRS_o_ai
415 vec_addec(vector signed int __a, vector signed int __b,
416 vector signed int __c) {
418 signed int __result[4];
419 for (int i = 0; i < 4; i++) {
420 unsigned int __tempa = (unsigned int) __a[i];
421 unsigned int __tempb = (unsigned int) __b[i];
422 unsigned int __tempc = (unsigned int) __c[i];
423 __tempc = __tempc & 0x00000001;
424 unsigned long long __longa = (unsigned long long) __tempa;
425 unsigned long long __longb = (unsigned long long) __tempb;
426 unsigned long long __longc = (unsigned long long) __tempc;
427 unsigned long long __sum = __longa + __longb + __longc;
428 unsigned long long __res = (__sum >> 32) & 0x01;
429 unsigned long long __tempres = (unsigned int) __res;
430 __result[i] = (signed int) __tempres;
433 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
437 static __inline__ vector unsigned int __ATTRS_o_ai
438 vec_addec(vector unsigned int __a, vector unsigned int __b,
439 vector unsigned int __c) {
441 unsigned int __result[4];
442 for (int i = 0; i < 4; i++) {
443 unsigned int __tempc = __c[i] & 1;
444 unsigned long long __longa = (unsigned long long) __a[i];
445 unsigned long long __longb = (unsigned long long) __b[i];
446 unsigned long long __longc = (unsigned long long) __tempc;
447 unsigned long long __sum = __longa + __longb + __longc;
448 unsigned long long __res = (__sum >> 32) & 0x01;
449 unsigned long long __tempres = (unsigned int) __res;
450 __result[i] = (signed int) __tempres;
453 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
456 #endif // __powerpc64__
457 #endif // __POWER8_VECTOR__
461 #define __builtin_altivec_vaddubm vec_vaddubm
463 static __inline__ vector signed char __ATTRS_o_ai
464 vec_vaddubm(vector signed char __a, vector signed char __b) {
468 static __inline__ vector signed char __ATTRS_o_ai
469 vec_vaddubm(vector bool char __a, vector signed char __b) {
470 return (vector signed char)__a + __b;
473 static __inline__ vector signed char __ATTRS_o_ai
474 vec_vaddubm(vector signed char __a, vector bool char __b) {
475 return __a + (vector signed char)__b;
478 static __inline__ vector unsigned char __ATTRS_o_ai
479 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
483 static __inline__ vector unsigned char __ATTRS_o_ai
484 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
485 return (vector unsigned char)__a + __b;
488 static __inline__ vector unsigned char __ATTRS_o_ai
489 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
490 return __a + (vector unsigned char)__b;
495 #define __builtin_altivec_vadduhm vec_vadduhm
497 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
502 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
504 return (vector short)__a + __b;
507 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
508 vector bool short __b) {
509 return __a + (vector short)__b;
512 static __inline__ vector unsigned short __ATTRS_o_ai
513 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
517 static __inline__ vector unsigned short __ATTRS_o_ai
518 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
519 return (vector unsigned short)__a + __b;
522 static __inline__ vector unsigned short __ATTRS_o_ai
523 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
524 return __a + (vector unsigned short)__b;
529 #define __builtin_altivec_vadduwm vec_vadduwm
531 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
536 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
538 return (vector int)__a + __b;
541 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
542 vector bool int __b) {
543 return __a + (vector int)__b;
546 static __inline__ vector unsigned int __ATTRS_o_ai
547 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
551 static __inline__ vector unsigned int __ATTRS_o_ai
552 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
553 return (vector unsigned int)__a + __b;
556 static __inline__ vector unsigned int __ATTRS_o_ai
557 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
558 return __a + (vector unsigned int)__b;
563 #define __builtin_altivec_vaddfp vec_vaddfp
565 static __inline__ vector float __attribute__((__always_inline__))
566 vec_vaddfp(vector float __a, vector float __b) {
572 static __inline__ vector signed int __ATTRS_o_ai
573 vec_addc(vector signed int __a, vector signed int __b) {
574 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
575 (vector unsigned int)__b);
578 static __inline__ vector unsigned int __ATTRS_o_ai
579 vec_addc(vector unsigned int __a, vector unsigned int __b) {
580 return __builtin_altivec_vaddcuw(__a, __b);
583 #ifdef __POWER8_VECTOR__
584 #ifdef __SIZEOF_INT128__
585 static __inline__ vector signed __int128 __ATTRS_o_ai
586 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
587 return (vector signed __int128)__builtin_altivec_vaddcuq(
588 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
591 static __inline__ vector unsigned __int128 __ATTRS_o_ai
592 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
593 return __builtin_altivec_vaddcuq(__a, __b);
597 static __inline__ vector unsigned char __attribute__((__always_inline__))
598 vec_addc_u128(vector unsigned char __a, vector unsigned char __b) {
599 return (vector unsigned char)__builtin_altivec_vaddcuq(__a, __b);
601 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
605 static __inline__ vector unsigned int __attribute__((__always_inline__))
606 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
607 return __builtin_altivec_vaddcuw(__a, __b);
612 static __inline__ vector signed char __ATTRS_o_ai
613 vec_adds(vector signed char __a, vector signed char __b) {
614 return __builtin_altivec_vaddsbs(__a, __b);
617 static __inline__ vector signed char __ATTRS_o_ai
618 vec_adds(vector bool char __a, vector signed char __b) {
619 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
622 static __inline__ vector signed char __ATTRS_o_ai
623 vec_adds(vector signed char __a, vector bool char __b) {
624 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
627 static __inline__ vector unsigned char __ATTRS_o_ai
628 vec_adds(vector unsigned char __a, vector unsigned char __b) {
629 return __builtin_altivec_vaddubs(__a, __b);
632 static __inline__ vector unsigned char __ATTRS_o_ai
633 vec_adds(vector bool char __a, vector unsigned char __b) {
634 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
637 static __inline__ vector unsigned char __ATTRS_o_ai
638 vec_adds(vector unsigned char __a, vector bool char __b) {
639 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
642 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
644 return __builtin_altivec_vaddshs(__a, __b);
647 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
649 return __builtin_altivec_vaddshs((vector short)__a, __b);
652 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
653 vector bool short __b) {
654 return __builtin_altivec_vaddshs(__a, (vector short)__b);
657 static __inline__ vector unsigned short __ATTRS_o_ai
658 vec_adds(vector unsigned short __a, vector unsigned short __b) {
659 return __builtin_altivec_vadduhs(__a, __b);
662 static __inline__ vector unsigned short __ATTRS_o_ai
663 vec_adds(vector bool short __a, vector unsigned short __b) {
664 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
667 static __inline__ vector unsigned short __ATTRS_o_ai
668 vec_adds(vector unsigned short __a, vector bool short __b) {
669 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
672 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
674 return __builtin_altivec_vaddsws(__a, __b);
677 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
679 return __builtin_altivec_vaddsws((vector int)__a, __b);
682 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
683 vector bool int __b) {
684 return __builtin_altivec_vaddsws(__a, (vector int)__b);
687 static __inline__ vector unsigned int __ATTRS_o_ai
688 vec_adds(vector unsigned int __a, vector unsigned int __b) {
689 return __builtin_altivec_vadduws(__a, __b);
692 static __inline__ vector unsigned int __ATTRS_o_ai
693 vec_adds(vector bool int __a, vector unsigned int __b) {
694 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
697 static __inline__ vector unsigned int __ATTRS_o_ai
698 vec_adds(vector unsigned int __a, vector bool int __b) {
699 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
704 static __inline__ vector signed char __ATTRS_o_ai
705 vec_vaddsbs(vector signed char __a, vector signed char __b) {
706 return __builtin_altivec_vaddsbs(__a, __b);
709 static __inline__ vector signed char __ATTRS_o_ai
710 vec_vaddsbs(vector bool char __a, vector signed char __b) {
711 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
714 static __inline__ vector signed char __ATTRS_o_ai
715 vec_vaddsbs(vector signed char __a, vector bool char __b) {
716 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
721 static __inline__ vector unsigned char __ATTRS_o_ai
722 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
723 return __builtin_altivec_vaddubs(__a, __b);
726 static __inline__ vector unsigned char __ATTRS_o_ai
727 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
728 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
731 static __inline__ vector unsigned char __ATTRS_o_ai
732 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
733 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
738 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
740 return __builtin_altivec_vaddshs(__a, __b);
743 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
745 return __builtin_altivec_vaddshs((vector short)__a, __b);
748 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
749 vector bool short __b) {
750 return __builtin_altivec_vaddshs(__a, (vector short)__b);
755 static __inline__ vector unsigned short __ATTRS_o_ai
756 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
757 return __builtin_altivec_vadduhs(__a, __b);
760 static __inline__ vector unsigned short __ATTRS_o_ai
761 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
762 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
765 static __inline__ vector unsigned short __ATTRS_o_ai
766 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
767 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
772 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
774 return __builtin_altivec_vaddsws(__a, __b);
777 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
779 return __builtin_altivec_vaddsws((vector int)__a, __b);
782 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
783 vector bool int __b) {
784 return __builtin_altivec_vaddsws(__a, (vector int)__b);
789 static __inline__ vector unsigned int __ATTRS_o_ai
790 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
791 return __builtin_altivec_vadduws(__a, __b);
794 static __inline__ vector unsigned int __ATTRS_o_ai
795 vec_vadduws(vector bool int __a, vector unsigned int __b) {
796 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
799 static __inline__ vector unsigned int __ATTRS_o_ai
800 vec_vadduws(vector unsigned int __a, vector bool int __b) {
801 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
804 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
805 defined(__SIZEOF_INT128__)
808 static __inline__ vector signed __int128 __ATTRS_o_ai
809 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
813 static __inline__ vector unsigned __int128 __ATTRS_o_ai
814 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
820 static __inline__ vector signed __int128 __ATTRS_o_ai
821 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
822 vector signed __int128 __c) {
823 return __builtin_altivec_vaddeuqm(__a, __b, __c);
826 static __inline__ vector unsigned __int128 __ATTRS_o_ai
827 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
828 vector unsigned __int128 __c) {
829 return __builtin_altivec_vaddeuqm(__a, __b, __c);
834 static __inline__ vector signed __int128 __ATTRS_o_ai
835 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
836 return __builtin_altivec_vaddcuq(__a, __b);
839 static __inline__ vector unsigned __int128 __ATTRS_o_ai
840 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
841 return __builtin_altivec_vaddcuq(__a, __b);
846 static __inline__ vector signed __int128 __ATTRS_o_ai
847 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
848 vector signed __int128 __c) {
849 return __builtin_altivec_vaddecuq(__a, __b, __c);
852 static __inline__ vector unsigned __int128 __ATTRS_o_ai
853 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
854 vector unsigned __int128 __c) {
855 return __builtin_altivec_vaddecuq(__a, __b, __c);
857 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
861 #define __builtin_altivec_vand vec_and
863 static __inline__ vector signed char __ATTRS_o_ai
864 vec_and(vector signed char __a, vector signed char __b) {
868 static __inline__ vector signed char __ATTRS_o_ai
869 vec_and(vector bool char __a, vector signed char __b) {
870 return (vector signed char)__a & __b;
873 static __inline__ vector signed char __ATTRS_o_ai
874 vec_and(vector signed char __a, vector bool char __b) {
875 return __a & (vector signed char)__b;
878 static __inline__ vector unsigned char __ATTRS_o_ai
879 vec_and(vector unsigned char __a, vector unsigned char __b) {
883 static __inline__ vector unsigned char __ATTRS_o_ai
884 vec_and(vector bool char __a, vector unsigned char __b) {
885 return (vector unsigned char)__a & __b;
888 static __inline__ vector unsigned char __ATTRS_o_ai
889 vec_and(vector unsigned char __a, vector bool char __b) {
890 return __a & (vector unsigned char)__b;
893 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
894 vector bool char __b) {
898 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
903 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
905 return (vector short)__a & __b;
908 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
909 vector bool short __b) {
910 return __a & (vector short)__b;
913 static __inline__ vector unsigned short __ATTRS_o_ai
914 vec_and(vector unsigned short __a, vector unsigned short __b) {
918 static __inline__ vector unsigned short __ATTRS_o_ai
919 vec_and(vector bool short __a, vector unsigned short __b) {
920 return (vector unsigned short)__a & __b;
923 static __inline__ vector unsigned short __ATTRS_o_ai
924 vec_and(vector unsigned short __a, vector bool short __b) {
925 return __a & (vector unsigned short)__b;
928 static __inline__ vector bool short __ATTRS_o_ai
929 vec_and(vector bool short __a, vector bool short __b) {
933 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
938 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
940 return (vector int)__a & __b;
943 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
944 vector bool int __b) {
945 return __a & (vector int)__b;
948 static __inline__ vector unsigned int __ATTRS_o_ai
949 vec_and(vector unsigned int __a, vector unsigned int __b) {
953 static __inline__ vector unsigned int __ATTRS_o_ai
954 vec_and(vector bool int __a, vector unsigned int __b) {
955 return (vector unsigned int)__a & __b;
958 static __inline__ vector unsigned int __ATTRS_o_ai
959 vec_and(vector unsigned int __a, vector bool int __b) {
960 return __a & (vector unsigned int)__b;
963 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
964 vector bool int __b) {
968 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
970 vector unsigned int __res =
971 (vector unsigned int)__a & (vector unsigned int)__b;
972 return (vector float)__res;
975 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
977 vector unsigned int __res =
978 (vector unsigned int)__a & (vector unsigned int)__b;
979 return (vector float)__res;
982 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
983 vector bool int __b) {
984 vector unsigned int __res =
985 (vector unsigned int)__a & (vector unsigned int)__b;
986 return (vector float)__res;
990 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
992 vector unsigned long long __res =
993 (vector unsigned long long)__a & (vector unsigned long long)__b;
994 return (vector double)__res;
997 static __inline__ vector double __ATTRS_o_ai
998 vec_and(vector double __a, vector bool long long __b) {
999 vector unsigned long long __res =
1000 (vector unsigned long long)__a & (vector unsigned long long)__b;
1001 return (vector double)__res;
1004 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
1005 vector double __b) {
1006 vector unsigned long long __res =
1007 (vector unsigned long long)__a & (vector unsigned long long)__b;
1008 return (vector double)__res;
1011 static __inline__ vector signed long long __ATTRS_o_ai
1012 vec_and(vector signed long long __a, vector signed long long __b) {
1016 static __inline__ vector signed long long __ATTRS_o_ai
1017 vec_and(vector bool long long __a, vector signed long long __b) {
1018 return (vector signed long long)__a & __b;
1021 static __inline__ vector signed long long __ATTRS_o_ai
1022 vec_and(vector signed long long __a, vector bool long long __b) {
1023 return __a & (vector signed long long)__b;
1026 static __inline__ vector unsigned long long __ATTRS_o_ai
1027 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
1031 static __inline__ vector unsigned long long __ATTRS_o_ai
1032 vec_and(vector bool long long __a, vector unsigned long long __b) {
1033 return (vector unsigned long long)__a & __b;
1036 static __inline__ vector unsigned long long __ATTRS_o_ai
1037 vec_and(vector unsigned long long __a, vector bool long long __b) {
1038 return __a & (vector unsigned long long)__b;
1041 static __inline__ vector bool long long __ATTRS_o_ai
1042 vec_and(vector bool long long __a, vector bool long long __b) {
1049 static __inline__ vector signed char __ATTRS_o_ai
1050 vec_vand(vector signed char __a, vector signed char __b) {
1054 static __inline__ vector signed char __ATTRS_o_ai
1055 vec_vand(vector bool char __a, vector signed char __b) {
1056 return (vector signed char)__a & __b;
1059 static __inline__ vector signed char __ATTRS_o_ai
1060 vec_vand(vector signed char __a, vector bool char __b) {
1061 return __a & (vector signed char)__b;
1064 static __inline__ vector unsigned char __ATTRS_o_ai
1065 vec_vand(vector unsigned char __a, vector unsigned char __b) {
1069 static __inline__ vector unsigned char __ATTRS_o_ai
1070 vec_vand(vector bool char __a, vector unsigned char __b) {
1071 return (vector unsigned char)__a & __b;
1074 static __inline__ vector unsigned char __ATTRS_o_ai
1075 vec_vand(vector unsigned char __a, vector bool char __b) {
1076 return __a & (vector unsigned char)__b;
1079 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1080 vector bool char __b) {
1084 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1089 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1091 return (vector short)__a & __b;
1094 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1095 vector bool short __b) {
1096 return __a & (vector short)__b;
1099 static __inline__ vector unsigned short __ATTRS_o_ai
1100 vec_vand(vector unsigned short __a, vector unsigned short __b) {
1104 static __inline__ vector unsigned short __ATTRS_o_ai
1105 vec_vand(vector bool short __a, vector unsigned short __b) {
1106 return (vector unsigned short)__a & __b;
1109 static __inline__ vector unsigned short __ATTRS_o_ai
1110 vec_vand(vector unsigned short __a, vector bool short __b) {
1111 return __a & (vector unsigned short)__b;
1114 static __inline__ vector bool short __ATTRS_o_ai
1115 vec_vand(vector bool short __a, vector bool short __b) {
1119 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1124 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1126 return (vector int)__a & __b;
1129 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1130 vector bool int __b) {
1131 return __a & (vector int)__b;
1134 static __inline__ vector unsigned int __ATTRS_o_ai
1135 vec_vand(vector unsigned int __a, vector unsigned int __b) {
1139 static __inline__ vector unsigned int __ATTRS_o_ai
1140 vec_vand(vector bool int __a, vector unsigned int __b) {
1141 return (vector unsigned int)__a & __b;
1144 static __inline__ vector unsigned int __ATTRS_o_ai
1145 vec_vand(vector unsigned int __a, vector bool int __b) {
1146 return __a & (vector unsigned int)__b;
1149 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1150 vector bool int __b) {
1154 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1156 vector unsigned int __res =
1157 (vector unsigned int)__a & (vector unsigned int)__b;
1158 return (vector float)__res;
1161 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1163 vector unsigned int __res =
1164 (vector unsigned int)__a & (vector unsigned int)__b;
1165 return (vector float)__res;
1168 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1169 vector bool int __b) {
1170 vector unsigned int __res =
1171 (vector unsigned int)__a & (vector unsigned int)__b;
1172 return (vector float)__res;
1176 static __inline__ vector signed long long __ATTRS_o_ai
1177 vec_vand(vector signed long long __a, vector signed long long __b) {
1181 static __inline__ vector signed long long __ATTRS_o_ai
1182 vec_vand(vector bool long long __a, vector signed long long __b) {
1183 return (vector signed long long)__a & __b;
1186 static __inline__ vector signed long long __ATTRS_o_ai
1187 vec_vand(vector signed long long __a, vector bool long long __b) {
1188 return __a & (vector signed long long)__b;
1191 static __inline__ vector unsigned long long __ATTRS_o_ai
1192 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1196 static __inline__ vector unsigned long long __ATTRS_o_ai
1197 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1198 return (vector unsigned long long)__a & __b;
1201 static __inline__ vector unsigned long long __ATTRS_o_ai
1202 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1203 return __a & (vector unsigned long long)__b;
1206 static __inline__ vector bool long long __ATTRS_o_ai
1207 vec_vand(vector bool long long __a, vector bool long long __b) {
1214 #define __builtin_altivec_vandc vec_andc
1216 static __inline__ vector signed char __ATTRS_o_ai
1217 vec_andc(vector signed char __a, vector signed char __b) {
1221 static __inline__ vector signed char __ATTRS_o_ai
1222 vec_andc(vector bool char __a, vector signed char __b) {
1223 return (vector signed char)__a & ~__b;
1226 static __inline__ vector signed char __ATTRS_o_ai
1227 vec_andc(vector signed char __a, vector bool char __b) {
1228 return __a & ~(vector signed char)__b;
1231 static __inline__ vector unsigned char __ATTRS_o_ai
1232 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1236 static __inline__ vector unsigned char __ATTRS_o_ai
1237 vec_andc(vector bool char __a, vector unsigned char __b) {
1238 return (vector unsigned char)__a & ~__b;
1241 static __inline__ vector unsigned char __ATTRS_o_ai
1242 vec_andc(vector unsigned char __a, vector bool char __b) {
1243 return __a & ~(vector unsigned char)__b;
1246 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1247 vector bool char __b) {
1251 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1256 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1258 return (vector short)__a & ~__b;
1261 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1262 vector bool short __b) {
1263 return __a & ~(vector short)__b;
1266 static __inline__ vector unsigned short __ATTRS_o_ai
1267 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1271 static __inline__ vector unsigned short __ATTRS_o_ai
1272 vec_andc(vector bool short __a, vector unsigned short __b) {
1273 return (vector unsigned short)__a & ~__b;
1276 static __inline__ vector unsigned short __ATTRS_o_ai
1277 vec_andc(vector unsigned short __a, vector bool short __b) {
1278 return __a & ~(vector unsigned short)__b;
1281 static __inline__ vector bool short __ATTRS_o_ai
1282 vec_andc(vector bool short __a, vector bool short __b) {
1286 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1291 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1293 return (vector int)__a & ~__b;
1296 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1297 vector bool int __b) {
1298 return __a & ~(vector int)__b;
1301 static __inline__ vector unsigned int __ATTRS_o_ai
1302 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1306 static __inline__ vector unsigned int __ATTRS_o_ai
1307 vec_andc(vector bool int __a, vector unsigned int __b) {
1308 return (vector unsigned int)__a & ~__b;
1311 static __inline__ vector unsigned int __ATTRS_o_ai
1312 vec_andc(vector unsigned int __a, vector bool int __b) {
1313 return __a & ~(vector unsigned int)__b;
1316 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1317 vector bool int __b) {
1321 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1323 vector unsigned int __res =
1324 (vector unsigned int)__a & ~(vector unsigned int)__b;
1325 return (vector float)__res;
1328 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1330 vector unsigned int __res =
1331 (vector unsigned int)__a & ~(vector unsigned int)__b;
1332 return (vector float)__res;
1335 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1336 vector bool int __b) {
1337 vector unsigned int __res =
1338 (vector unsigned int)__a & ~(vector unsigned int)__b;
1339 return (vector float)__res;
1343 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1344 vector double __b) {
1345 vector unsigned long long __res =
1346 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1347 return (vector double)__res;
1350 static __inline__ vector double __ATTRS_o_ai
1351 vec_andc(vector double __a, vector bool long long __b) {
1352 vector unsigned long long __res =
1353 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1354 return (vector double)__res;
1357 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1358 vector double __b) {
1359 vector unsigned long long __res =
1360 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1361 return (vector double)__res;
1364 static __inline__ vector signed long long __ATTRS_o_ai
1365 vec_andc(vector signed long long __a, vector signed long long __b) {
1369 static __inline__ vector signed long long __ATTRS_o_ai
1370 vec_andc(vector bool long long __a, vector signed long long __b) {
1371 return (vector signed long long)__a & ~__b;
1374 static __inline__ vector signed long long __ATTRS_o_ai
1375 vec_andc(vector signed long long __a, vector bool long long __b) {
1376 return __a & ~(vector signed long long)__b;
1379 static __inline__ vector unsigned long long __ATTRS_o_ai
1380 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1384 static __inline__ vector unsigned long long __ATTRS_o_ai
1385 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1386 return (vector unsigned long long)__a & ~__b;
1389 static __inline__ vector unsigned long long __ATTRS_o_ai
1390 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1391 return __a & ~(vector unsigned long long)__b;
1394 static __inline__ vector bool long long __ATTRS_o_ai
1395 vec_andc(vector bool long long __a, vector bool long long __b) {
1402 static __inline__ vector signed char __ATTRS_o_ai
1403 vec_vandc(vector signed char __a, vector signed char __b) {
1407 static __inline__ vector signed char __ATTRS_o_ai
1408 vec_vandc(vector bool char __a, vector signed char __b) {
1409 return (vector signed char)__a & ~__b;
1412 static __inline__ vector signed char __ATTRS_o_ai
1413 vec_vandc(vector signed char __a, vector bool char __b) {
1414 return __a & ~(vector signed char)__b;
1417 static __inline__ vector unsigned char __ATTRS_o_ai
1418 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1422 static __inline__ vector unsigned char __ATTRS_o_ai
1423 vec_vandc(vector bool char __a, vector unsigned char __b) {
1424 return (vector unsigned char)__a & ~__b;
1427 static __inline__ vector unsigned char __ATTRS_o_ai
1428 vec_vandc(vector unsigned char __a, vector bool char __b) {
1429 return __a & ~(vector unsigned char)__b;
1432 static __inline__ vector bool char __ATTRS_o_ai
1433 vec_vandc(vector bool char __a, vector bool char __b) {
1437 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1442 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1444 return (vector short)__a & ~__b;
1447 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1448 vector bool short __b) {
1449 return __a & ~(vector short)__b;
1452 static __inline__ vector unsigned short __ATTRS_o_ai
1453 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1457 static __inline__ vector unsigned short __ATTRS_o_ai
1458 vec_vandc(vector bool short __a, vector unsigned short __b) {
1459 return (vector unsigned short)__a & ~__b;
1462 static __inline__ vector unsigned short __ATTRS_o_ai
1463 vec_vandc(vector unsigned short __a, vector bool short __b) {
1464 return __a & ~(vector unsigned short)__b;
1467 static __inline__ vector bool short __ATTRS_o_ai
1468 vec_vandc(vector bool short __a, vector bool short __b) {
1472 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1477 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1479 return (vector int)__a & ~__b;
1482 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1483 vector bool int __b) {
1484 return __a & ~(vector int)__b;
1487 static __inline__ vector unsigned int __ATTRS_o_ai
1488 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1492 static __inline__ vector unsigned int __ATTRS_o_ai
1493 vec_vandc(vector bool int __a, vector unsigned int __b) {
1494 return (vector unsigned int)__a & ~__b;
1497 static __inline__ vector unsigned int __ATTRS_o_ai
1498 vec_vandc(vector unsigned int __a, vector bool int __b) {
1499 return __a & ~(vector unsigned int)__b;
1502 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1503 vector bool int __b) {
1507 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1509 vector unsigned int __res =
1510 (vector unsigned int)__a & ~(vector unsigned int)__b;
1511 return (vector float)__res;
1514 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1516 vector unsigned int __res =
1517 (vector unsigned int)__a & ~(vector unsigned int)__b;
1518 return (vector float)__res;
1521 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1522 vector bool int __b) {
1523 vector unsigned int __res =
1524 (vector unsigned int)__a & ~(vector unsigned int)__b;
1525 return (vector float)__res;
1529 static __inline__ vector signed long long __ATTRS_o_ai
1530 vec_vandc(vector signed long long __a, vector signed long long __b) {
1534 static __inline__ vector signed long long __ATTRS_o_ai
1535 vec_vandc(vector bool long long __a, vector signed long long __b) {
1536 return (vector signed long long)__a & ~__b;
1539 static __inline__ vector signed long long __ATTRS_o_ai
1540 vec_vandc(vector signed long long __a, vector bool long long __b) {
1541 return __a & ~(vector signed long long)__b;
1544 static __inline__ vector unsigned long long __ATTRS_o_ai
1545 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1549 static __inline__ vector unsigned long long __ATTRS_o_ai
1550 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1551 return (vector unsigned long long)__a & ~__b;
1554 static __inline__ vector unsigned long long __ATTRS_o_ai
1555 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1556 return __a & ~(vector unsigned long long)__b;
1559 static __inline__ vector bool long long __ATTRS_o_ai
1560 vec_vandc(vector bool long long __a, vector bool long long __b) {
1567 static __inline__ vector signed char __ATTRS_o_ai
1568 vec_avg(vector signed char __a, vector signed char __b) {
1569 return __builtin_altivec_vavgsb(__a, __b);
1572 static __inline__ vector unsigned char __ATTRS_o_ai
1573 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1574 return __builtin_altivec_vavgub(__a, __b);
1577 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1579 return __builtin_altivec_vavgsh(__a, __b);
1582 static __inline__ vector unsigned short __ATTRS_o_ai
1583 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1584 return __builtin_altivec_vavguh(__a, __b);
1587 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1589 return __builtin_altivec_vavgsw(__a, __b);
1592 static __inline__ vector unsigned int __ATTRS_o_ai
1593 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1594 return __builtin_altivec_vavguw(__a, __b);
1599 static __inline__ vector signed char __attribute__((__always_inline__))
1600 vec_vavgsb(vector signed char __a, vector signed char __b) {
1601 return __builtin_altivec_vavgsb(__a, __b);
1606 static __inline__ vector unsigned char __attribute__((__always_inline__))
1607 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1608 return __builtin_altivec_vavgub(__a, __b);
1613 static __inline__ vector short __attribute__((__always_inline__))
1614 vec_vavgsh(vector short __a, vector short __b) {
1615 return __builtin_altivec_vavgsh(__a, __b);
1620 static __inline__ vector unsigned short __attribute__((__always_inline__))
1621 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1622 return __builtin_altivec_vavguh(__a, __b);
1627 static __inline__ vector int __attribute__((__always_inline__))
1628 vec_vavgsw(vector int __a, vector int __b) {
1629 return __builtin_altivec_vavgsw(__a, __b);
1634 static __inline__ vector unsigned int __attribute__((__always_inline__))
1635 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1636 return __builtin_altivec_vavguw(__a, __b);
1641 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1643 return __builtin_vsx_xvrspip(__a);
1645 return __builtin_altivec_vrfip(__a);
1650 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1651 return __builtin_vsx_xvrdpip(__a);
1656 static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a) {
1657 return vec_ceil(__a);
1661 static __inline__ vector double __ATTRS_o_ai vec_roundp(vector double __a) {
1662 return vec_ceil(__a);
1668 static __inline__ vector float __attribute__((__always_inline__))
1669 vec_vrfip(vector float __a) {
1670 return __builtin_altivec_vrfip(__a);
1675 static __inline__ vector int __attribute__((__always_inline__))
1676 vec_cmpb(vector float __a, vector float __b) {
1677 return __builtin_altivec_vcmpbfp(__a, __b);
1682 static __inline__ vector int __attribute__((__always_inline__))
1683 vec_vcmpbfp(vector float __a, vector float __b) {
1684 return __builtin_altivec_vcmpbfp(__a, __b);
1689 static __inline__ vector bool char __ATTRS_o_ai
1690 vec_cmpeq(vector signed char __a, vector signed char __b) {
1691 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1695 static __inline__ vector bool char __ATTRS_o_ai
1696 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1697 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1701 static __inline__ vector bool char __ATTRS_o_ai
1702 vec_cmpeq(vector bool char __a, vector bool char __b) {
1703 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1707 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1709 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1712 static __inline__ vector bool short __ATTRS_o_ai
1713 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1714 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1718 static __inline__ vector bool short __ATTRS_o_ai
1719 vec_cmpeq(vector bool short __a, vector bool short __b) {
1720 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1724 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1726 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1729 static __inline__ vector bool int __ATTRS_o_ai
1730 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1731 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1735 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1736 vector bool int __b) {
1737 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1741 #ifdef __POWER8_VECTOR__
1742 static __inline__ vector bool long long __ATTRS_o_ai
1743 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1744 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1747 static __inline__ vector bool long long __ATTRS_o_ai
1748 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1749 return (vector bool long long)__builtin_altivec_vcmpequd(
1750 (vector long long)__a, (vector long long)__b);
1753 static __inline__ vector bool long long __ATTRS_o_ai
1754 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1755 return (vector bool long long)__builtin_altivec_vcmpequd(
1756 (vector long long)__a, (vector long long)__b);
1758 #elif defined(__VSX__)
1759 static __inline__ vector bool long long __ATTRS_o_ai
1760 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1761 vector bool int __wordcmp =
1762 vec_cmpeq((vector signed int)__a, (vector signed int)__b);
1763 #ifdef __LITTLE_ENDIAN__
1764 __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 3, 0, 1, 2);
1765 return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 1,
1768 __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);
1769 return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,
1774 static __inline__ vector bool long long __ATTRS_o_ai
1775 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1776 return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1779 static __inline__ vector bool long long __ATTRS_o_ai
1780 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1781 return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1785 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1788 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1790 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1795 static __inline__ vector bool long long __ATTRS_o_ai
1796 vec_cmpeq(vector double __a, vector double __b) {
1797 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1801 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1802 static __inline__ vector bool __int128 __ATTRS_o_ai
1803 vec_cmpeq(vector signed __int128 __a, vector signed __int128 __b) {
1804 return (vector bool __int128)__builtin_altivec_vcmpequq(
1805 (vector bool __int128)__a, (vector bool __int128)__b);
1808 static __inline__ vector bool __int128 __ATTRS_o_ai
1809 vec_cmpeq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1810 return (vector bool __int128)__builtin_altivec_vcmpequq(
1811 (vector bool __int128)__a, (vector bool __int128)__b);
1815 #ifdef __POWER9_VECTOR__
1818 static __inline__ vector bool char __ATTRS_o_ai
1819 vec_cmpne(vector bool char __a, vector bool char __b) {
1820 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1824 static __inline__ vector bool char __ATTRS_o_ai
1825 vec_cmpne(vector signed char __a, vector signed char __b) {
1826 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1830 static __inline__ vector bool char __ATTRS_o_ai
1831 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1832 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1836 static __inline__ vector bool short __ATTRS_o_ai
1837 vec_cmpne(vector bool short __a, vector bool short __b) {
1838 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1842 static __inline__ vector bool short __ATTRS_o_ai
1843 vec_cmpne(vector signed short __a, vector signed short __b) {
1844 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1848 static __inline__ vector bool short __ATTRS_o_ai
1849 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1850 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1854 static __inline__ vector bool int __ATTRS_o_ai
1855 vec_cmpne(vector bool int __a, vector bool int __b) {
1856 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1860 static __inline__ vector bool int __ATTRS_o_ai
1861 vec_cmpne(vector signed int __a, vector signed int __b) {
1862 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1866 static __inline__ vector bool int __ATTRS_o_ai
1867 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1868 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1872 static __inline__ vector bool int __ATTRS_o_ai
1873 vec_cmpne(vector float __a, vector float __b) {
1874 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1878 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1879 static __inline__ vector bool __int128 __ATTRS_o_ai
1880 vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1881 return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
1882 (vector bool __int128)__a, (vector bool __int128)__b));
1885 static __inline__ vector bool __int128 __ATTRS_o_ai
1886 vec_cmpne(vector signed __int128 __a, vector signed __int128 __b) {
1887 return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
1888 (vector bool __int128)__a, (vector bool __int128)__b));
1894 static __inline__ vector bool char __ATTRS_o_ai
1895 vec_cmpnez(vector signed char __a, vector signed char __b) {
1896 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1900 static __inline__ vector bool char __ATTRS_o_ai
1901 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1902 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1906 static __inline__ vector bool short __ATTRS_o_ai
1907 vec_cmpnez(vector signed short __a, vector signed short __b) {
1908 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1912 static __inline__ vector bool short __ATTRS_o_ai
1913 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1914 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1918 static __inline__ vector bool int __ATTRS_o_ai
1919 vec_cmpnez(vector signed int __a, vector signed int __b) {
1920 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1924 static __inline__ vector bool int __ATTRS_o_ai
1925 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1926 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1930 static __inline__ signed int __ATTRS_o_ai
1931 vec_cntlz_lsbb(vector signed char __a) {
1932 #ifdef __LITTLE_ENDIAN__
1933 return __builtin_altivec_vctzlsbb(__a);
1935 return __builtin_altivec_vclzlsbb(__a);
1939 static __inline__ signed int __ATTRS_o_ai
1940 vec_cntlz_lsbb(vector unsigned char __a) {
1941 #ifdef __LITTLE_ENDIAN__
1942 return __builtin_altivec_vctzlsbb(__a);
1944 return __builtin_altivec_vclzlsbb(__a);
1948 static __inline__ signed int __ATTRS_o_ai
1949 vec_cnttz_lsbb(vector signed char __a) {
1950 #ifdef __LITTLE_ENDIAN__
1951 return __builtin_altivec_vclzlsbb(__a);
1953 return __builtin_altivec_vctzlsbb(__a);
1957 static __inline__ signed int __ATTRS_o_ai
1958 vec_cnttz_lsbb(vector unsigned char __a) {
1959 #ifdef __LITTLE_ENDIAN__
1960 return __builtin_altivec_vclzlsbb(__a);
1962 return __builtin_altivec_vctzlsbb(__a);
1966 static __inline__ vector unsigned int __ATTRS_o_ai
1967 vec_parity_lsbb(vector unsigned int __a) {
1968 return __builtin_altivec_vprtybw(__a);
1971 static __inline__ vector unsigned int __ATTRS_o_ai
1972 vec_parity_lsbb(vector signed int __a) {
1973 return __builtin_altivec_vprtybw(__a);
1976 #ifdef __SIZEOF_INT128__
1977 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1978 vec_parity_lsbb(vector unsigned __int128 __a) {
1979 return __builtin_altivec_vprtybq(__a);
1982 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1983 vec_parity_lsbb(vector signed __int128 __a) {
1984 return __builtin_altivec_vprtybq(__a);
1988 static __inline__ vector unsigned long long __ATTRS_o_ai
1989 vec_parity_lsbb(vector unsigned long long __a) {
1990 return __builtin_altivec_vprtybd(__a);
1993 static __inline__ vector unsigned long long __ATTRS_o_ai
1994 vec_parity_lsbb(vector signed long long __a) {
1995 return __builtin_altivec_vprtybd(__a);
2001 static __inline__ vector bool char __ATTRS_o_ai
2002 vec_cmpne(vector bool char __a, vector bool char __b) {
2003 return ~(vec_cmpeq(__a, __b));
2006 static __inline__ vector bool char __ATTRS_o_ai
2007 vec_cmpne(vector signed char __a, vector signed char __b) {
2008 return ~(vec_cmpeq(__a, __b));
2011 static __inline__ vector bool char __ATTRS_o_ai
2012 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
2013 return ~(vec_cmpeq(__a, __b));
2016 static __inline__ vector bool short __ATTRS_o_ai
2017 vec_cmpne(vector bool short __a, vector bool short __b) {
2018 return ~(vec_cmpeq(__a, __b));
2021 static __inline__ vector bool short __ATTRS_o_ai
2022 vec_cmpne(vector signed short __a, vector signed short __b) {
2023 return ~(vec_cmpeq(__a, __b));
2026 static __inline__ vector bool short __ATTRS_o_ai
2027 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
2028 return ~(vec_cmpeq(__a, __b));
2031 static __inline__ vector bool int __ATTRS_o_ai
2032 vec_cmpne(vector bool int __a, vector bool int __b) {
2033 return ~(vec_cmpeq(__a, __b));
2036 static __inline__ vector bool int __ATTRS_o_ai
2037 vec_cmpne(vector signed int __a, vector signed int __b) {
2038 return ~(vec_cmpeq(__a, __b));
2041 static __inline__ vector bool int __ATTRS_o_ai
2042 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
2043 return ~(vec_cmpeq(__a, __b));
2046 static __inline__ vector bool int __ATTRS_o_ai
2047 vec_cmpne(vector float __a, vector float __b) {
2048 return ~(vec_cmpeq(__a, __b));
2052 #ifdef __POWER8_VECTOR__
2053 static __inline__ vector bool long long __ATTRS_o_ai
2054 vec_cmpne(vector bool long long __a, vector bool long long __b) {
2055 return (vector bool long long)
2056 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
2059 static __inline__ vector bool long long __ATTRS_o_ai
2060 vec_cmpne(vector signed long long __a, vector signed long long __b) {
2061 return (vector bool long long)
2062 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
2065 static __inline__ vector bool long long __ATTRS_o_ai
2066 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
2067 return (vector bool long long)
2068 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
2070 #elif defined(__VSX__)
2071 static __inline__ vector bool long long __ATTRS_o_ai
2072 vec_cmpne(vector bool long long __a, vector bool long long __b) {
2073 return (vector bool long long)~(
2074 vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2077 static __inline__ vector bool long long __ATTRS_o_ai
2078 vec_cmpne(vector signed long long __a, vector signed long long __b) {
2079 return (vector bool long long)~(
2080 vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2083 static __inline__ vector bool long long __ATTRS_o_ai
2084 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
2085 return (vector bool long long)~(
2086 vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2091 static __inline__ vector bool long long __ATTRS_o_ai
2092 vec_cmpne(vector double __a, vector double __b) {
2093 return (vector bool long long)
2094 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
2100 static __inline__ vector bool char __ATTRS_o_ai
2101 vec_cmpgt(vector signed char __a, vector signed char __b) {
2102 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2105 static __inline__ vector bool char __ATTRS_o_ai
2106 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
2107 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2110 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
2112 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2115 static __inline__ vector bool short __ATTRS_o_ai
2116 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
2117 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2120 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
2122 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2125 static __inline__ vector bool int __ATTRS_o_ai
2126 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
2127 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2130 #ifdef __POWER8_VECTOR__
2131 static __inline__ vector bool long long __ATTRS_o_ai
2132 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
2133 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
2136 static __inline__ vector bool long long __ATTRS_o_ai
2137 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2138 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2140 #elif defined(__VSX__)
2141 static __inline__ vector bool long long __ATTRS_o_ai
2142 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
2143 vector signed int __sgtw = (vector signed int)vec_cmpgt(
2144 (vector signed int)__a, (vector signed int)__b);
2145 vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2146 (vector unsigned int)__a, (vector unsigned int)__b);
2147 vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2148 (vector signed int)__a, (vector signed int)__b);
2149 #ifdef __LITTLE_ENDIAN__
2150 __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2151 __sgtw |= (vector signed int)__ugtw;
2152 return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 1, 1, 3,
2155 __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2156 __sgtw |= (vector signed int)__ugtw;
2157 return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 0, 0, 2,
2162 static __inline__ vector bool long long __ATTRS_o_ai
2163 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2164 vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2165 (vector unsigned int)__a, (vector unsigned int)__b);
2166 vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2167 (vector signed int)__a, (vector signed int)__b);
2168 #ifdef __LITTLE_ENDIAN__
2169 __eqw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2171 return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,
2174 __eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2176 return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,
2182 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
2185 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
2187 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2192 static __inline__ vector bool long long __ATTRS_o_ai
2193 vec_cmpgt(vector double __a, vector double __b) {
2194 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
2198 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2199 static __inline__ vector bool __int128 __ATTRS_o_ai
2200 vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {
2201 return (vector bool __int128)__builtin_altivec_vcmpgtsq(
2202 (vector bool __int128)__a, (vector bool __int128)__b);
2205 static __inline__ vector bool __int128 __ATTRS_o_ai
2206 vec_cmpgt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2207 return (vector bool __int128)__builtin_altivec_vcmpgtuq(
2208 (vector bool __int128)__a, (vector bool __int128)__b);
2214 static __inline__ vector bool char __ATTRS_o_ai
2215 vec_cmpge(vector signed char __a, vector signed char __b) {
2216 return ~(vec_cmpgt(__b, __a));
2219 static __inline__ vector bool char __ATTRS_o_ai
2220 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
2221 return ~(vec_cmpgt(__b, __a));
2224 static __inline__ vector bool short __ATTRS_o_ai
2225 vec_cmpge(vector signed short __a, vector signed short __b) {
2226 return ~(vec_cmpgt(__b, __a));
2229 static __inline__ vector bool short __ATTRS_o_ai
2230 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
2231 return ~(vec_cmpgt(__b, __a));
2234 static __inline__ vector bool int __ATTRS_o_ai
2235 vec_cmpge(vector signed int __a, vector signed int __b) {
2236 return ~(vec_cmpgt(__b, __a));
2239 static __inline__ vector bool int __ATTRS_o_ai
2240 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2241 return ~(vec_cmpgt(__b, __a));
2244 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2247 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2249 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2254 static __inline__ vector bool long long __ATTRS_o_ai
2255 vec_cmpge(vector double __a, vector double __b) {
2256 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2259 static __inline__ vector bool long long __ATTRS_o_ai
2260 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2261 return ~(vec_cmpgt(__b, __a));
2264 static __inline__ vector bool long long __ATTRS_o_ai
2265 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2266 return ~(vec_cmpgt(__b, __a));
2270 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2271 static __inline__ vector bool __int128 __ATTRS_o_ai
2272 vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {
2273 return ~(vec_cmpgt(__b, __a));
2276 static __inline__ vector bool __int128 __ATTRS_o_ai
2277 vec_cmpge(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2278 return ~(vec_cmpgt(__b, __a));
2284 static __inline__ vector bool int __attribute__((__always_inline__))
2285 vec_vcmpgefp(vector float __a, vector float __b) {
2286 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2291 static __inline__ vector bool char __attribute__((__always_inline__))
2292 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2293 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2298 static __inline__ vector bool char __attribute__((__always_inline__))
2299 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2300 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2305 static __inline__ vector bool short __attribute__((__always_inline__))
2306 vec_vcmpgtsh(vector short __a, vector short __b) {
2307 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2312 static __inline__ vector bool short __attribute__((__always_inline__))
2313 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2314 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2319 static __inline__ vector bool int __attribute__((__always_inline__))
2320 vec_vcmpgtsw(vector int __a, vector int __b) {
2321 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2326 static __inline__ vector bool int __attribute__((__always_inline__))
2327 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2328 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2333 static __inline__ vector bool int __attribute__((__always_inline__))
2334 vec_vcmpgtfp(vector float __a, vector float __b) {
2335 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2340 static __inline__ vector bool char __ATTRS_o_ai
2341 vec_cmple(vector signed char __a, vector signed char __b) {
2342 return vec_cmpge(__b, __a);
2345 static __inline__ vector bool char __ATTRS_o_ai
2346 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2347 return vec_cmpge(__b, __a);
2350 static __inline__ vector bool short __ATTRS_o_ai
2351 vec_cmple(vector signed short __a, vector signed short __b) {
2352 return vec_cmpge(__b, __a);
2355 static __inline__ vector bool short __ATTRS_o_ai
2356 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2357 return vec_cmpge(__b, __a);
2360 static __inline__ vector bool int __ATTRS_o_ai
2361 vec_cmple(vector signed int __a, vector signed int __b) {
2362 return vec_cmpge(__b, __a);
2365 static __inline__ vector bool int __ATTRS_o_ai
2366 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2367 return vec_cmpge(__b, __a);
2370 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2372 return vec_cmpge(__b, __a);
2376 static __inline__ vector bool long long __ATTRS_o_ai
2377 vec_cmple(vector double __a, vector double __b) {
2378 return vec_cmpge(__b, __a);
2381 static __inline__ vector bool long long __ATTRS_o_ai
2382 vec_cmple(vector signed long long __a, vector signed long long __b) {
2383 return vec_cmpge(__b, __a);
2386 static __inline__ vector bool long long __ATTRS_o_ai
2387 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2388 return vec_cmpge(__b, __a);
2392 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2393 static __inline__ vector bool __int128 __ATTRS_o_ai
2394 vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {
2395 return vec_cmpge(__b, __a);
2398 static __inline__ vector bool __int128 __ATTRS_o_ai
2399 vec_cmple(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2400 return vec_cmpge(__b, __a);
2406 static __inline__ vector bool char __ATTRS_o_ai
2407 vec_cmplt(vector signed char __a, vector signed char __b) {
2408 return vec_cmpgt(__b, __a);
2411 static __inline__ vector bool char __ATTRS_o_ai
2412 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2413 return vec_cmpgt(__b, __a);
2416 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2418 return vec_cmpgt(__b, __a);
2421 static __inline__ vector bool short __ATTRS_o_ai
2422 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2423 return vec_cmpgt(__b, __a);
2426 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2428 return vec_cmpgt(__b, __a);
2431 static __inline__ vector bool int __ATTRS_o_ai
2432 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2433 return vec_cmpgt(__b, __a);
2436 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2438 return vec_cmpgt(__b, __a);
2442 static __inline__ vector bool long long __ATTRS_o_ai
2443 vec_cmplt(vector double __a, vector double __b) {
2444 return vec_cmpgt(__b, __a);
2448 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2449 static __inline__ vector bool __int128 __ATTRS_o_ai
2450 vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {
2451 return vec_cmpgt(__b, __a);
2454 static __inline__ vector bool __int128 __ATTRS_o_ai
2455 vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2456 return vec_cmpgt(__b, __a);
2461 static __inline__ vector bool long long __ATTRS_o_ai
2462 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2463 return vec_cmpgt(__b, __a);
2466 static __inline__ vector bool long long __ATTRS_o_ai
2467 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2468 return vec_cmpgt(__b, __a);
2472 #ifdef __POWER8_VECTOR__
2475 static __inline__ vector signed char __ATTRS_o_ai
2476 vec_popcnt(vector signed char __a) {
2477 return __builtin_altivec_vpopcntb(__a);
2479 static __inline__ vector unsigned char __ATTRS_o_ai
2480 vec_popcnt(vector unsigned char __a) {
2481 return __builtin_altivec_vpopcntb(__a);
2483 static __inline__ vector signed short __ATTRS_o_ai
2484 vec_popcnt(vector signed short __a) {
2485 return __builtin_altivec_vpopcnth(__a);
2487 static __inline__ vector unsigned short __ATTRS_o_ai
2488 vec_popcnt(vector unsigned short __a) {
2489 return __builtin_altivec_vpopcnth(__a);
2491 static __inline__ vector signed int __ATTRS_o_ai
2492 vec_popcnt(vector signed int __a) {
2493 return __builtin_altivec_vpopcntw(__a);
2495 static __inline__ vector unsigned int __ATTRS_o_ai
2496 vec_popcnt(vector unsigned int __a) {
2497 return __builtin_altivec_vpopcntw(__a);
2499 static __inline__ vector signed long long __ATTRS_o_ai
2500 vec_popcnt(vector signed long long __a) {
2501 return __builtin_altivec_vpopcntd(__a);
2503 static __inline__ vector unsigned long long __ATTRS_o_ai
2504 vec_popcnt(vector unsigned long long __a) {
2505 return __builtin_altivec_vpopcntd(__a);
2508 #define vec_vclz vec_cntlz
2511 static __inline__ vector signed char __ATTRS_o_ai
2512 vec_cntlz(vector signed char __a) {
2513 return __builtin_altivec_vclzb(__a);
2515 static __inline__ vector unsigned char __ATTRS_o_ai
2516 vec_cntlz(vector unsigned char __a) {
2517 return __builtin_altivec_vclzb(__a);
2519 static __inline__ vector signed short __ATTRS_o_ai
2520 vec_cntlz(vector signed short __a) {
2521 return __builtin_altivec_vclzh(__a);
2523 static __inline__ vector unsigned short __ATTRS_o_ai
2524 vec_cntlz(vector unsigned short __a) {
2525 return __builtin_altivec_vclzh(__a);
2527 static __inline__ vector signed int __ATTRS_o_ai
2528 vec_cntlz(vector signed int __a) {
2529 return __builtin_altivec_vclzw(__a);
2531 static __inline__ vector unsigned int __ATTRS_o_ai
2532 vec_cntlz(vector unsigned int __a) {
2533 return __builtin_altivec_vclzw(__a);
2535 static __inline__ vector signed long long __ATTRS_o_ai
2536 vec_cntlz(vector signed long long __a) {
2537 return __builtin_altivec_vclzd(__a);
2539 static __inline__ vector unsigned long long __ATTRS_o_ai
2540 vec_cntlz(vector unsigned long long __a) {
2541 return __builtin_altivec_vclzd(__a);
2545 #ifdef __POWER9_VECTOR__
2549 static __inline__ vector signed char __ATTRS_o_ai
2550 vec_cnttz(vector signed char __a) {
2551 return __builtin_altivec_vctzb(__a);
2553 static __inline__ vector unsigned char __ATTRS_o_ai
2554 vec_cnttz(vector unsigned char __a) {
2555 return __builtin_altivec_vctzb(__a);
2557 static __inline__ vector signed short __ATTRS_o_ai
2558 vec_cnttz(vector signed short __a) {
2559 return __builtin_altivec_vctzh(__a);
2561 static __inline__ vector unsigned short __ATTRS_o_ai
2562 vec_cnttz(vector unsigned short __a) {
2563 return __builtin_altivec_vctzh(__a);
2565 static __inline__ vector signed int __ATTRS_o_ai
2566 vec_cnttz(vector signed int __a) {
2567 return __builtin_altivec_vctzw(__a);
2569 static __inline__ vector unsigned int __ATTRS_o_ai
2570 vec_cnttz(vector unsigned int __a) {
2571 return __builtin_altivec_vctzw(__a);
2573 static __inline__ vector signed long long __ATTRS_o_ai
2574 vec_cnttz(vector signed long long __a) {
2575 return __builtin_altivec_vctzd(__a);
2577 static __inline__ vector unsigned long long __ATTRS_o_ai
2578 vec_cnttz(vector unsigned long long __a) {
2579 return __builtin_altivec_vctzd(__a);
2582 /* vec_first_match_index */
2584 static __inline__ unsigned __ATTRS_o_ai
2585 vec_first_match_index(vector signed char __a, vector signed char __b) {
2586 vector unsigned long long __res =
2587 #ifdef __LITTLE_ENDIAN__
2588 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2590 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2592 if (__res[0] == 64) {
2593 return (__res[1] + 64) >> 3;
2595 return __res[0] >> 3;
2598 static __inline__ unsigned __ATTRS_o_ai
2599 vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {
2600 vector unsigned long long __res =
2601 #ifdef __LITTLE_ENDIAN__
2602 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2604 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2606 if (__res[0] == 64) {
2607 return (__res[1] + 64) >> 3;
2609 return __res[0] >> 3;
2612 static __inline__ unsigned __ATTRS_o_ai
2613 vec_first_match_index(vector signed short __a, vector signed short __b) {
2614 vector unsigned long long __res =
2615 #ifdef __LITTLE_ENDIAN__
2616 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2618 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2620 if (__res[0] == 64) {
2621 return (__res[1] + 64) >> 4;
2623 return __res[0] >> 4;
2626 static __inline__ unsigned __ATTRS_o_ai
2627 vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2628 vector unsigned long long __res =
2629 #ifdef __LITTLE_ENDIAN__
2630 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2632 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2634 if (__res[0] == 64) {
2635 return (__res[1] + 64) >> 4;
2637 return __res[0] >> 4;
2640 static __inline__ unsigned __ATTRS_o_ai
2641 vec_first_match_index(vector signed int __a, vector signed int __b) {
2642 vector unsigned long long __res =
2643 #ifdef __LITTLE_ENDIAN__
2644 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2646 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2648 if (__res[0] == 64) {
2649 return (__res[1] + 64) >> 5;
2651 return __res[0] >> 5;
2654 static __inline__ unsigned __ATTRS_o_ai
2655 vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2656 vector unsigned long long __res =
2657 #ifdef __LITTLE_ENDIAN__
2658 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2660 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2662 if (__res[0] == 64) {
2663 return (__res[1] + 64) >> 5;
2665 return __res[0] >> 5;
2668 /* vec_first_match_or_eos_index */
2670 static __inline__ unsigned __ATTRS_o_ai
2671 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2672 /* Compare the result of the comparison of two vectors with either and OR the
2673 result. Either the elements are equal or one will equal the comparison
2674 result if either is zero.
2676 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2677 vector bool char __tmp2 = __tmp1 |
2678 vec_cmpeq((vector signed char)__tmp1, __a) |
2679 vec_cmpeq((vector signed char)__tmp1, __b);
2681 vector unsigned long long __res =
2682 #ifdef __LITTLE_ENDIAN__
2683 vec_cnttz((vector unsigned long long)__tmp2);
2685 vec_cntlz((vector unsigned long long)__tmp2);
2687 if (__res[0] == 64) {
2688 return (__res[1] + 64) >> 3;
2690 return __res[0] >> 3;
2693 static __inline__ unsigned __ATTRS_o_ai
2694 vec_first_match_or_eos_index(vector unsigned char __a,
2695 vector unsigned char __b) {
2696 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2697 vector bool char __tmp2 = __tmp1 |
2698 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2699 vec_cmpeq((vector unsigned char)__tmp1, __b);
2701 vector unsigned long long __res =
2702 #ifdef __LITTLE_ENDIAN__
2703 vec_cnttz((vector unsigned long long)__tmp2);
2705 vec_cntlz((vector unsigned long long)__tmp2);
2707 if (__res[0] == 64) {
2708 return (__res[1] + 64) >> 3;
2710 return __res[0] >> 3;
2713 static __inline__ unsigned __ATTRS_o_ai
2714 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2715 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2716 vector bool short __tmp2 = __tmp1 |
2717 vec_cmpeq((vector signed short)__tmp1, __a) |
2718 vec_cmpeq((vector signed short)__tmp1, __b);
2720 vector unsigned long long __res =
2721 #ifdef __LITTLE_ENDIAN__
2722 vec_cnttz((vector unsigned long long)__tmp2);
2724 vec_cntlz((vector unsigned long long)__tmp2);
2726 if (__res[0] == 64) {
2727 return (__res[1] + 64) >> 4;
2729 return __res[0] >> 4;
2732 static __inline__ unsigned __ATTRS_o_ai
2733 vec_first_match_or_eos_index(vector unsigned short __a,
2734 vector unsigned short __b) {
2735 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2736 vector bool short __tmp2 = __tmp1 |
2737 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2738 vec_cmpeq((vector unsigned short)__tmp1, __b);
2740 vector unsigned long long __res =
2741 #ifdef __LITTLE_ENDIAN__
2742 vec_cnttz((vector unsigned long long)__tmp2);
2744 vec_cntlz((vector unsigned long long)__tmp2);
2746 if (__res[0] == 64) {
2747 return (__res[1] + 64) >> 4;
2749 return __res[0] >> 4;
2752 static __inline__ unsigned __ATTRS_o_ai
2753 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2754 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2755 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2756 vec_cmpeq((vector signed int)__tmp1, __b);
2758 vector unsigned long long __res =
2759 #ifdef __LITTLE_ENDIAN__
2760 vec_cnttz((vector unsigned long long)__tmp2);
2762 vec_cntlz((vector unsigned long long)__tmp2);
2764 if (__res[0] == 64) {
2765 return (__res[1] + 64) >> 5;
2767 return __res[0] >> 5;
2770 static __inline__ unsigned __ATTRS_o_ai
2771 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2772 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2773 vector bool int __tmp2 = __tmp1 |
2774 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2775 vec_cmpeq((vector unsigned int)__tmp1, __b);
2777 vector unsigned long long __res =
2778 #ifdef __LITTLE_ENDIAN__
2779 vec_cnttz((vector unsigned long long)__tmp2);
2781 vec_cntlz((vector unsigned long long)__tmp2);
2783 if (__res[0] == 64) {
2784 return (__res[1] + 64) >> 5;
2786 return __res[0] >> 5;
2789 /* vec_first_mismatch_index */
2791 static __inline__ unsigned __ATTRS_o_ai
2792 vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2793 vector unsigned long long __res =
2794 #ifdef __LITTLE_ENDIAN__
2795 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2797 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2799 if (__res[0] == 64) {
2800 return (__res[1] + 64) >> 3;
2802 return __res[0] >> 3;
2805 static __inline__ unsigned __ATTRS_o_ai
2806 vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {
2807 vector unsigned long long __res =
2808 #ifdef __LITTLE_ENDIAN__
2809 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2811 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2813 if (__res[0] == 64) {
2814 return (__res[1] + 64) >> 3;
2816 return __res[0] >> 3;
2819 static __inline__ unsigned __ATTRS_o_ai
2820 vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2821 vector unsigned long long __res =
2822 #ifdef __LITTLE_ENDIAN__
2823 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2825 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2827 if (__res[0] == 64) {
2828 return (__res[1] + 64) >> 4;
2830 return __res[0] >> 4;
2833 static __inline__ unsigned __ATTRS_o_ai
2834 vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2835 vector unsigned long long __res =
2836 #ifdef __LITTLE_ENDIAN__
2837 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2839 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2841 if (__res[0] == 64) {
2842 return (__res[1] + 64) >> 4;
2844 return __res[0] >> 4;
2847 static __inline__ unsigned __ATTRS_o_ai
2848 vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2849 vector unsigned long long __res =
2850 #ifdef __LITTLE_ENDIAN__
2851 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2853 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2855 if (__res[0] == 64) {
2856 return (__res[1] + 64) >> 5;
2858 return __res[0] >> 5;
2861 static __inline__ unsigned __ATTRS_o_ai
2862 vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2863 vector unsigned long long __res =
2864 #ifdef __LITTLE_ENDIAN__
2865 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2867 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2869 if (__res[0] == 64) {
2870 return (__res[1] + 64) >> 5;
2872 return __res[0] >> 5;
2875 /* vec_first_mismatch_or_eos_index */
2877 static __inline__ unsigned __ATTRS_o_ai
2878 vec_first_mismatch_or_eos_index(vector signed char __a,
2879 vector signed char __b) {
2880 vector unsigned long long __res =
2881 #ifdef __LITTLE_ENDIAN__
2882 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2884 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2886 if (__res[0] == 64) {
2887 return (__res[1] + 64) >> 3;
2889 return __res[0] >> 3;
2892 static __inline__ unsigned __ATTRS_o_ai
2893 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2894 vector unsigned char __b) {
2895 vector unsigned long long __res =
2896 #ifdef __LITTLE_ENDIAN__
2897 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2899 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2901 if (__res[0] == 64) {
2902 return (__res[1] + 64) >> 3;
2904 return __res[0] >> 3;
2907 static __inline__ unsigned __ATTRS_o_ai
2908 vec_first_mismatch_or_eos_index(vector signed short __a,
2909 vector signed short __b) {
2910 vector unsigned long long __res =
2911 #ifdef __LITTLE_ENDIAN__
2912 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2914 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2916 if (__res[0] == 64) {
2917 return (__res[1] + 64) >> 4;
2919 return __res[0] >> 4;
2922 static __inline__ unsigned __ATTRS_o_ai
2923 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2924 vector unsigned short __b) {
2925 vector unsigned long long __res =
2926 #ifdef __LITTLE_ENDIAN__
2927 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2929 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2931 if (__res[0] == 64) {
2932 return (__res[1] + 64) >> 4;
2934 return __res[0] >> 4;
2937 static __inline__ unsigned __ATTRS_o_ai
2938 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2939 vector unsigned long long __res =
2940 #ifdef __LITTLE_ENDIAN__
2941 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2943 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2945 if (__res[0] == 64) {
2946 return (__res[1] + 64) >> 5;
2948 return __res[0] >> 5;
2951 static __inline__ unsigned __ATTRS_o_ai
2952 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2953 vector unsigned int __b) {
2954 vector unsigned long long __res =
2955 #ifdef __LITTLE_ENDIAN__
2956 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2958 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2960 if (__res[0] == 64) {
2961 return (__res[1] + 64) >> 5;
2963 return __res[0] >> 5;
2966 static __inline__ vector double __ATTRS_o_ai
2967 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2968 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2971 static __inline__ vector double __ATTRS_o_ai
2972 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2973 return __builtin_vsx_xviexpdp(__a,__b);
2976 static __inline__ vector float __ATTRS_o_ai
2977 vec_insert_exp(vector float __a, vector unsigned int __b) {
2978 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2981 static __inline__ vector float __ATTRS_o_ai
2982 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2983 return __builtin_vsx_xviexpsp(__a,__b);
2986 #if defined(__powerpc64__)
2987 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,
2989 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2992 static __inline__ vector unsigned char __ATTRS_o_ai
2993 vec_xl_len(const unsigned char *__a, size_t __b) {
2994 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2997 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,
2999 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
3002 static __inline__ vector unsigned short __ATTRS_o_ai
3003 vec_xl_len(const unsigned short *__a, size_t __b) {
3004 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
3007 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,
3009 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
3012 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,
3014 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
3017 static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t __b) {
3018 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
3021 #ifdef __SIZEOF_INT128__
3022 static __inline__ vector signed __int128 __ATTRS_o_ai
3023 vec_xl_len(const signed __int128 *__a, size_t __b) {
3024 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
3027 static __inline__ vector unsigned __int128 __ATTRS_o_ai
3028 vec_xl_len(const unsigned __int128 *__a, size_t __b) {
3029 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
3033 static __inline__ vector signed long long __ATTRS_o_ai
3034 vec_xl_len(const signed long long *__a, size_t __b) {
3035 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
3038 static __inline__ vector unsigned long long __ATTRS_o_ai
3039 vec_xl_len(const unsigned long long *__a, size_t __b) {
3040 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
3043 static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,
3045 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
3048 static __inline__ vector unsigned char __ATTRS_o_ai
3049 vec_xl_len_r(const unsigned char *__a, size_t __b) {
3050 vector unsigned char __res =
3051 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
3052 #ifdef __LITTLE_ENDIAN__
3053 vector unsigned char __mask =
3054 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
3055 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
3056 (vector int)__res, (vector int)__res, __mask);
3062 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
3065 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3068 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
3069 signed char *__b, size_t __c) {
3070 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3073 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
3074 signed short *__b, size_t __c) {
3075 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3078 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
3079 unsigned short *__b,
3081 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3084 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
3085 signed int *__b, size_t __c) {
3086 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3089 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
3090 unsigned int *__b, size_t __c) {
3091 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3094 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
3096 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3099 #ifdef __SIZEOF_INT128__
3100 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
3101 signed __int128 *__b,
3103 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3106 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
3107 unsigned __int128 *__b,
3109 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3113 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
3114 signed long long *__b,
3116 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3119 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
3120 unsigned long long *__b,
3122 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3125 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
3127 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3130 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
3133 #ifdef __LITTLE_ENDIAN__
3134 vector unsigned char __mask =
3135 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
3136 vector unsigned char __res =
3137 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
3138 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
3140 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
3146 #if defined(__POWER9_VECTOR__) && defined(__powerpc64__)
3147 #define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))
3148 #define __vec_strmb(PTR, CNT, VAL) \
3149 vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))
3151 #define __vec_ldrmb __builtin_vsx_ldrmb
3152 #define __vec_strmb __builtin_vsx_strmb
3158 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
3160 return __builtin_vsx_xvcpsgnsp(__b, __a);
3163 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3164 vector double __b) {
3165 return __builtin_vsx_xvcpsgndp(__b, __a);
3172 // There are some functions that have different signatures with the XL compiler
3173 // from those in Clang/GCC and documented in the PVIPR. This macro ensures that
3174 // the XL-compatible signatures are used for those functions.
3175 #ifdef __XL_COMPAT_ALTIVEC__
3176 #define vec_ctf(__a, __b) \
3177 _Generic((__a), vector int \
3178 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3179 vector unsigned int \
3180 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3182 vector unsigned long long \
3183 : (__builtin_vsx_xvcvuxdsp((vector unsigned long long)(__a)) * \
3184 (vector float)(vector unsigned)((0x7f - (__b)) << 23)), \
3185 vector signed long long \
3186 : (__builtin_vsx_xvcvsxdsp((vector signed long long)(__a)) * \
3187 (vector float)(vector unsigned)((0x7f - (__b)) << 23)))
3188 #else // __XL_COMPAT_ALTIVEC__
3189 #define vec_ctf(__a, __b) \
3190 _Generic((__a), vector int \
3191 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3192 vector unsigned int \
3193 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3195 vector unsigned long long \
3196 : (__builtin_convertvector((vector unsigned long long)(__a), \
3198 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3200 vector signed long long \
3201 : (__builtin_convertvector((vector signed long long)(__a), \
3203 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3205 #endif // __XL_COMPAT_ALTIVEC__
3207 #define vec_ctf(__a, __b) \
3208 _Generic((__a), vector int \
3209 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3210 vector unsigned int \
3211 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3217 #define vec_ctd(__a, __b) \
3218 _Generic((__a), vector signed int \
3219 : (vec_doublee((vector signed int)(__a)) * \
3220 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3222 vector unsigned int \
3223 : (vec_doublee((vector unsigned int)(__a)) * \
3224 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3226 vector unsigned long long \
3227 : (__builtin_convertvector((vector unsigned long long)(__a), \
3229 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3231 vector signed long long \
3232 : (__builtin_convertvector((vector signed long long)(__a), \
3234 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3240 #define vec_vcfux __builtin_altivec_vcfux
3243 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
3248 #ifdef __XL_COMPAT_ALTIVEC__
3249 #define vec_cts(__a, __b) \
3250 _Generic((__a), vector float \
3251 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3254 vector double __ret = \
3255 (vector double)(__a) * \
3256 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3258 __builtin_vsx_xvcvdpsxws(__ret); \
3260 #else // __XL_COMPAT_ALTIVEC__
3261 #define vec_cts(__a, __b) \
3262 _Generic((__a), vector float \
3263 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3266 vector double __ret = \
3267 (vector double)(__a) * \
3268 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3270 __builtin_convertvector(__ret, vector signed long long); \
3272 #endif // __XL_COMPAT_ALTIVEC__
3274 #define vec_cts __builtin_altivec_vctsxs
3279 #define vec_vctsxs __builtin_altivec_vctsxs
3284 #ifdef __XL_COMPAT_ALTIVEC__
3285 #define vec_ctu(__a, __b) \
3286 _Generic((__a), vector float \
3287 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3290 vector double __ret = \
3291 (vector double)(__a) * \
3292 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3294 __builtin_vsx_xvcvdpuxws(__ret); \
3296 #else // __XL_COMPAT_ALTIVEC__
3297 #define vec_ctu(__a, __b) \
3298 _Generic((__a), vector float \
3299 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3302 vector double __ret = \
3303 (vector double)(__a) * \
3304 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3306 __builtin_convertvector(__ret, vector unsigned long long); \
3308 #endif // __XL_COMPAT_ALTIVEC__
3310 #define vec_ctu __builtin_altivec_vctuxs
3313 #ifdef __LITTLE_ENDIAN__
3317 #define vec_ctsl(__a, __b) \
3318 _Generic((__a), vector float \
3320 vector float __ret = \
3321 (vector float)(__a) * \
3322 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3323 __builtin_vsx_xvcvspsxds( \
3324 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3328 vector double __ret = \
3329 (vector double)(__a) * \
3330 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3332 __builtin_convertvector(__ret, vector signed long long); \
3337 #define vec_ctul(__a, __b) \
3338 _Generic((__a), vector float \
3340 vector float __ret = \
3341 (vector float)(__a) * \
3342 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3343 __builtin_vsx_xvcvspuxds( \
3344 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3348 vector double __ret = \
3349 (vector double)(__a) * \
3350 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3352 __builtin_convertvector(__ret, vector unsigned long long); \
3355 #else // __LITTLE_ENDIAN__
3359 #define vec_ctsl(__a, __b) \
3360 _Generic((__a), vector float \
3362 vector float __ret = \
3363 (vector float)(__a) * \
3364 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3365 __builtin_vsx_xvcvspsxds(__ret); \
3369 vector double __ret = \
3370 (vector double)(__a) * \
3371 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3373 __builtin_convertvector(__ret, vector signed long long); \
3378 #define vec_ctul(__a, __b) \
3379 _Generic((__a), vector float \
3381 vector float __ret = \
3382 (vector float)(__a) * \
3383 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3384 __builtin_vsx_xvcvspuxds(__ret); \
3388 vector double __ret = \
3389 (vector double)(__a) * \
3390 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3392 __builtin_convertvector(__ret, vector unsigned long long); \
3395 #endif // __LITTLE_ENDIAN__
3399 #define vec_vctuxs __builtin_altivec_vctuxs
3403 #ifdef __POWER9_VECTOR__
3404 static __inline__ vector signed int __ATTRS_o_ai
3405 vec_signexti(vector signed char __a) {
3406 return __builtin_altivec_vextsb2w(__a);
3409 static __inline__ vector signed int __ATTRS_o_ai
3410 vec_signexti(vector signed short __a) {
3411 return __builtin_altivec_vextsh2w(__a);
3414 static __inline__ vector signed long long __ATTRS_o_ai
3415 vec_signextll(vector signed char __a) {
3416 return __builtin_altivec_vextsb2d(__a);
3419 static __inline__ vector signed long long __ATTRS_o_ai
3420 vec_signextll(vector signed short __a) {
3421 return __builtin_altivec_vextsh2d(__a);
3424 static __inline__ vector signed long long __ATTRS_o_ai
3425 vec_signextll(vector signed int __a) {
3426 return __builtin_altivec_vextsw2d(__a);
3430 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3431 static __inline__ vector signed __int128 __ATTRS_o_ai
3432 vec_signextq(vector signed long long __a) {
3433 return __builtin_altivec_vextsd2q(__a);
3439 static __inline__ vector signed int __ATTRS_o_ai
3440 vec_sld(vector signed int, vector signed int, unsigned const int __c);
3442 static __inline__ vector signed int __ATTRS_o_ai
3443 vec_signed(vector float __a) {
3444 return __builtin_convertvector(__a, vector signed int);
3448 static __inline__ vector signed long long __ATTRS_o_ai
3449 vec_signed(vector double __a) {
3450 return __builtin_convertvector(__a, vector signed long long);
3453 static __inline__ vector signed int __attribute__((__always_inline__))
3454 vec_signed2(vector double __a, vector double __b) {
3455 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
3458 static __inline__ vector signed int __ATTRS_o_ai
3459 vec_signede(vector double __a) {
3460 #ifdef __LITTLE_ENDIAN__
3461 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3462 return vec_sld(__ret, __ret, 12);
3464 return __builtin_vsx_xvcvdpsxws(__a);
3468 static __inline__ vector signed int __ATTRS_o_ai
3469 vec_signedo(vector double __a) {
3470 #ifdef __LITTLE_ENDIAN__
3471 return __builtin_vsx_xvcvdpsxws(__a);
3473 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3474 return vec_sld(__ret, __ret, 12);
3481 static __inline__ vector unsigned int __ATTRS_o_ai
3482 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3484 static __inline__ vector unsigned int __ATTRS_o_ai
3485 vec_unsigned(vector float __a) {
3486 return __builtin_convertvector(__a, vector unsigned int);
3490 static __inline__ vector unsigned long long __ATTRS_o_ai
3491 vec_unsigned(vector double __a) {
3492 return __builtin_convertvector(__a, vector unsigned long long);
3495 static __inline__ vector unsigned int __attribute__((__always_inline__))
3496 vec_unsigned2(vector double __a, vector double __b) {
3497 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3500 static __inline__ vector unsigned int __ATTRS_o_ai
3501 vec_unsignede(vector double __a) {
3502 #ifdef __LITTLE_ENDIAN__
3503 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3504 return vec_sld(__ret, __ret, 12);
3506 return __builtin_vsx_xvcvdpuxws(__a);
3510 static __inline__ vector unsigned int __ATTRS_o_ai
3511 vec_unsignedo(vector double __a) {
3512 #ifdef __LITTLE_ENDIAN__
3513 return __builtin_vsx_xvcvdpuxws(__a);
3515 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3516 return vec_sld(__ret, __ret, 12);
3523 static __inline__ vector float __ATTRS_o_ai
3524 vec_sld(vector float, vector float, unsigned const int __c);
3526 static __inline__ vector float __ATTRS_o_ai
3527 vec_float(vector signed int __a) {
3528 return __builtin_convertvector(__a, vector float);
3531 static __inline__ vector float __ATTRS_o_ai
3532 vec_float(vector unsigned int __a) {
3533 return __builtin_convertvector(__a, vector float);
3537 static __inline__ vector float __ATTRS_o_ai
3538 vec_float2(vector signed long long __a, vector signed long long __b) {
3539 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3542 static __inline__ vector float __ATTRS_o_ai
3543 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3544 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3547 static __inline__ vector float __ATTRS_o_ai
3548 vec_float2(vector double __a, vector double __b) {
3549 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3552 static __inline__ vector float __ATTRS_o_ai
3553 vec_floate(vector signed long long __a) {
3554 #ifdef __LITTLE_ENDIAN__
3555 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3556 return vec_sld(__ret, __ret, 12);
3558 return __builtin_vsx_xvcvsxdsp(__a);
3562 static __inline__ vector float __ATTRS_o_ai
3563 vec_floate(vector unsigned long long __a) {
3564 #ifdef __LITTLE_ENDIAN__
3565 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3566 return vec_sld(__ret, __ret, 12);
3568 return __builtin_vsx_xvcvuxdsp(__a);
3572 static __inline__ vector float __ATTRS_o_ai
3573 vec_floate(vector double __a) {
3574 #ifdef __LITTLE_ENDIAN__
3575 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3576 return vec_sld(__ret, __ret, 12);
3578 return __builtin_vsx_xvcvdpsp(__a);
3582 static __inline__ vector float __ATTRS_o_ai
3583 vec_floato(vector signed long long __a) {
3584 #ifdef __LITTLE_ENDIAN__
3585 return __builtin_vsx_xvcvsxdsp(__a);
3587 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3588 return vec_sld(__ret, __ret, 12);
3592 static __inline__ vector float __ATTRS_o_ai
3593 vec_floato(vector unsigned long long __a) {
3594 #ifdef __LITTLE_ENDIAN__
3595 return __builtin_vsx_xvcvuxdsp(__a);
3597 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3598 return vec_sld(__ret, __ret, 12);
3602 static __inline__ vector float __ATTRS_o_ai
3603 vec_floato(vector double __a) {
3604 #ifdef __LITTLE_ENDIAN__
3605 return __builtin_vsx_xvcvdpsp(__a);
3607 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3608 return vec_sld(__ret, __ret, 12);
3616 static __inline__ vector double __ATTRS_o_ai
3617 vec_double(vector signed long long __a) {
3618 return __builtin_convertvector(__a, vector double);
3621 static __inline__ vector double __ATTRS_o_ai
3622 vec_double(vector unsigned long long __a) {
3623 return __builtin_convertvector(__a, vector double);
3626 static __inline__ vector double __ATTRS_o_ai
3627 vec_doublee(vector signed int __a) {
3628 #ifdef __LITTLE_ENDIAN__
3629 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3631 return __builtin_vsx_xvcvsxwdp(__a);
3635 static __inline__ vector double __ATTRS_o_ai
3636 vec_doublee(vector unsigned int __a) {
3637 #ifdef __LITTLE_ENDIAN__
3638 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3640 return __builtin_vsx_xvcvuxwdp(__a);
3644 static __inline__ vector double __ATTRS_o_ai
3645 vec_doublee(vector float __a) {
3646 #ifdef __LITTLE_ENDIAN__
3647 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3649 return __builtin_vsx_xvcvspdp(__a);
3653 static __inline__ vector double __ATTRS_o_ai
3654 vec_doubleh(vector signed int __a) {
3655 vector double __ret = {__a[0], __a[1]};
3659 static __inline__ vector double __ATTRS_o_ai
3660 vec_doubleh(vector unsigned int __a) {
3661 vector double __ret = {__a[0], __a[1]};
3665 static __inline__ vector double __ATTRS_o_ai
3666 vec_doubleh(vector float __a) {
3667 vector double __ret = {__a[0], __a[1]};
3671 static __inline__ vector double __ATTRS_o_ai
3672 vec_doublel(vector signed int __a) {
3673 vector double __ret = {__a[2], __a[3]};
3677 static __inline__ vector double __ATTRS_o_ai
3678 vec_doublel(vector unsigned int __a) {
3679 vector double __ret = {__a[2], __a[3]};
3683 static __inline__ vector double __ATTRS_o_ai
3684 vec_doublel(vector float __a) {
3685 vector double __ret = {__a[2], __a[3]};
3689 static __inline__ vector double __ATTRS_o_ai
3690 vec_doubleo(vector signed int __a) {
3691 #ifdef __LITTLE_ENDIAN__
3692 return __builtin_vsx_xvcvsxwdp(__a);
3694 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3698 static __inline__ vector double __ATTRS_o_ai
3699 vec_doubleo(vector unsigned int __a) {
3700 #ifdef __LITTLE_ENDIAN__
3701 return __builtin_vsx_xvcvuxwdp(__a);
3703 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3707 static __inline__ vector double __ATTRS_o_ai
3708 vec_doubleo(vector float __a) {
3709 #ifdef __LITTLE_ENDIAN__
3710 return __builtin_vsx_xvcvspdp(__a);
3712 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3717 static __inline__ vector double __ATTRS_o_ai vec_cvf(vector float __a) {
3718 return vec_doublee(__a);
3721 static __inline__ vector float __ATTRS_o_ai vec_cvf(vector double __a) {
3722 return vec_floate(__a);
3728 /* Integer vector divides (vectors are scalarized, elements divided
3729 and the vectors reassembled).
3731 static __inline__ vector signed char __ATTRS_o_ai
3732 vec_div(vector signed char __a, vector signed char __b) {
3736 static __inline__ vector unsigned char __ATTRS_o_ai
3737 vec_div(vector unsigned char __a, vector unsigned char __b) {
3741 static __inline__ vector signed short __ATTRS_o_ai
3742 vec_div(vector signed short __a, vector signed short __b) {
3746 static __inline__ vector unsigned short __ATTRS_o_ai
3747 vec_div(vector unsigned short __a, vector unsigned short __b) {
3751 static __inline__ vector signed int __ATTRS_o_ai
3752 vec_div(vector signed int __a, vector signed int __b) {
3756 static __inline__ vector unsigned int __ATTRS_o_ai
3757 vec_div(vector unsigned int __a, vector unsigned int __b) {
3762 static __inline__ vector signed long long __ATTRS_o_ai
3763 vec_div(vector signed long long __a, vector signed long long __b) {
3767 static __inline__ vector unsigned long long __ATTRS_o_ai
3768 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3772 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3777 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3778 vector double __b) {
3785 #ifdef __POWER10_VECTOR__
3786 static __inline__ vector signed int __ATTRS_o_ai
3787 vec_dive(vector signed int __a, vector signed int __b) {
3788 return __builtin_altivec_vdivesw(__a, __b);
3791 static __inline__ vector unsigned int __ATTRS_o_ai
3792 vec_dive(vector unsigned int __a, vector unsigned int __b) {
3793 return __builtin_altivec_vdiveuw(__a, __b);
3796 static __inline__ vector signed long long __ATTRS_o_ai
3797 vec_dive(vector signed long long __a, vector signed long long __b) {
3798 return __builtin_altivec_vdivesd(__a, __b);
3801 static __inline__ vector unsigned long long __ATTRS_o_ai
3802 vec_dive(vector unsigned long long __a, vector unsigned long long __b) {
3803 return __builtin_altivec_vdiveud(__a, __b);
3806 #ifdef __SIZEOF_INT128__
3807 static __inline__ vector unsigned __int128 __ATTRS_o_ai
3808 vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3809 return __builtin_altivec_vdiveuq(__a, __b);
3812 static __inline__ vector signed __int128 __ATTRS_o_ai
3813 vec_dive(vector signed __int128 __a, vector signed __int128 __b) {
3814 return __builtin_altivec_vdivesq(__a, __b);
3819 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3820 static __inline__ vector unsigned __int128 __ATTRS_o_ai
3821 vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3825 static __inline__ vector signed __int128 __ATTRS_o_ai
3826 vec_div(vector signed __int128 __a, vector signed __int128 __b) {
3829 #endif /* __POWER10_VECTOR__ */
3834 static __inline__ int __ATTRS_o_ai vec_test_swdiv(vector double __a,
3835 vector double __b) {
3836 return __builtin_vsx_xvtdivdp(__a, __b);
3839 static __inline__ int __ATTRS_o_ai vec_test_swdivs(vector float __a,
3841 return __builtin_vsx_xvtdivsp(__a, __b);
3847 #define vec_dss __builtin_altivec_dss
3851 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3852 __builtin_altivec_dssall();
3856 #define vec_dst(__PTR, __CW, __STR) \
3857 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
3860 #define vec_dstst(__PTR, __CW, __STR) \
3861 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
3864 #define vec_dststt(__PTR, __CW, __STR) \
3865 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
3868 #define vec_dstt(__PTR, __CW, __STR) \
3869 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
3873 #ifdef __POWER8_VECTOR__
3874 static __inline__ vector signed char __ATTRS_o_ai
3875 vec_eqv(vector signed char __a, vector signed char __b) {
3876 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3877 (vector unsigned int)__b);
3880 static __inline__ vector unsigned char __ATTRS_o_ai
3881 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3882 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3883 (vector unsigned int)__b);
3886 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3887 vector bool char __b) {
3888 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3889 (vector unsigned int)__b);
3892 static __inline__ vector signed short __ATTRS_o_ai
3893 vec_eqv(vector signed short __a, vector signed short __b) {
3894 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3895 (vector unsigned int)__b);
3898 static __inline__ vector unsigned short __ATTRS_o_ai
3899 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3900 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3901 (vector unsigned int)__b);
3904 static __inline__ vector bool short __ATTRS_o_ai
3905 vec_eqv(vector bool short __a, vector bool short __b) {
3906 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3907 (vector unsigned int)__b);
3910 static __inline__ vector signed int __ATTRS_o_ai
3911 vec_eqv(vector signed int __a, vector signed int __b) {
3912 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3913 (vector unsigned int)__b);
3916 static __inline__ vector unsigned int __ATTRS_o_ai
3917 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3918 return __builtin_vsx_xxleqv(__a, __b);
3921 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3922 vector bool int __b) {
3923 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3924 (vector unsigned int)__b);
3927 static __inline__ vector signed long long __ATTRS_o_ai
3928 vec_eqv(vector signed long long __a, vector signed long long __b) {
3929 return (vector signed long long)__builtin_vsx_xxleqv(
3930 (vector unsigned int)__a, (vector unsigned int)__b);
3933 static __inline__ vector unsigned long long __ATTRS_o_ai
3934 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3935 return (vector unsigned long long)__builtin_vsx_xxleqv(
3936 (vector unsigned int)__a, (vector unsigned int)__b);
3939 static __inline__ vector bool long long __ATTRS_o_ai
3940 vec_eqv(vector bool long long __a, vector bool long long __b) {
3941 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3942 (vector unsigned int)__b);
3945 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3947 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3948 (vector unsigned int)__b);
3951 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3952 vector double __b) {
3953 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3954 (vector unsigned int)__b);
3960 static __inline__ vector float __attribute__((__always_inline__))
3961 vec_expte(vector float __a) {
3962 return __builtin_altivec_vexptefp(__a);
3967 static __inline__ vector float __attribute__((__always_inline__))
3968 vec_vexptefp(vector float __a) {
3969 return __builtin_altivec_vexptefp(__a);
3974 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3976 return __builtin_vsx_xvrspim(__a);
3978 return __builtin_altivec_vrfim(__a);
3983 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3984 return __builtin_vsx_xvrdpim(__a);
3989 static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a) {
3990 return vec_floor(__a);
3994 static __inline__ vector double __ATTRS_o_ai vec_roundm(vector double __a) {
3995 return vec_floor(__a);
4001 static __inline__ vector float __attribute__((__always_inline__))
4002 vec_vrfim(vector float __a) {
4003 return __builtin_altivec_vrfim(__a);
4008 static __inline__ vector signed char __ATTRS_o_ai
4009 vec_ld(long __a, const vector signed char *__b) {
4010 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4013 static __inline__ vector signed char __ATTRS_o_ai
4014 vec_ld(long __a, const signed char *__b) {
4015 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4018 static __inline__ vector unsigned char __ATTRS_o_ai
4019 vec_ld(long __a, const vector unsigned char *__b) {
4020 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4023 static __inline__ vector unsigned char __ATTRS_o_ai
4024 vec_ld(long __a, const unsigned char *__b) {
4025 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4028 static __inline__ vector bool char __ATTRS_o_ai
4029 vec_ld(long __a, const vector bool char *__b) {
4030 return (vector bool char)__builtin_altivec_lvx(__a, __b);
4033 static __inline__ vector short __ATTRS_o_ai vec_ld(long __a,
4034 const vector short *__b) {
4035 return (vector short)__builtin_altivec_lvx(__a, __b);
4038 static __inline__ vector short __ATTRS_o_ai vec_ld(long __a, const short *__b) {
4039 return (vector short)__builtin_altivec_lvx(__a, __b);
4042 static __inline__ vector unsigned short __ATTRS_o_ai
4043 vec_ld(long __a, const vector unsigned short *__b) {
4044 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4047 static __inline__ vector unsigned short __ATTRS_o_ai
4048 vec_ld(long __a, const unsigned short *__b) {
4049 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4052 static __inline__ vector bool short __ATTRS_o_ai
4053 vec_ld(long __a, const vector bool short *__b) {
4054 return (vector bool short)__builtin_altivec_lvx(__a, __b);
4057 static __inline__ vector pixel __ATTRS_o_ai vec_ld(long __a,
4058 const vector pixel *__b) {
4059 return (vector pixel)__builtin_altivec_lvx(__a, __b);
4062 static __inline__ vector int __ATTRS_o_ai vec_ld(long __a,
4063 const vector int *__b) {
4064 return (vector int)__builtin_altivec_lvx(__a, __b);
4067 static __inline__ vector int __ATTRS_o_ai vec_ld(long __a, const int *__b) {
4068 return (vector int)__builtin_altivec_lvx(__a, __b);
4071 static __inline__ vector unsigned int __ATTRS_o_ai
4072 vec_ld(long __a, const vector unsigned int *__b) {
4073 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4076 static __inline__ vector unsigned int __ATTRS_o_ai
4077 vec_ld(long __a, const unsigned int *__b) {
4078 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4081 static __inline__ vector bool int __ATTRS_o_ai
4082 vec_ld(long __a, const vector bool int *__b) {
4083 return (vector bool int)__builtin_altivec_lvx(__a, __b);
4086 static __inline__ vector float __ATTRS_o_ai vec_ld(long __a,
4087 const vector float *__b) {
4088 return (vector float)__builtin_altivec_lvx(__a, __b);
4091 static __inline__ vector float __ATTRS_o_ai vec_ld(long __a, const float *__b) {
4092 return (vector float)__builtin_altivec_lvx(__a, __b);
4097 static __inline__ vector signed char __ATTRS_o_ai
4098 vec_lvx(long __a, const vector signed char *__b) {
4099 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4102 static __inline__ vector signed char __ATTRS_o_ai
4103 vec_lvx(long __a, const signed char *__b) {
4104 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4107 static __inline__ vector unsigned char __ATTRS_o_ai
4108 vec_lvx(long __a, const vector unsigned char *__b) {
4109 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4112 static __inline__ vector unsigned char __ATTRS_o_ai
4113 vec_lvx(long __a, const unsigned char *__b) {
4114 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4117 static __inline__ vector bool char __ATTRS_o_ai
4118 vec_lvx(long __a, const vector bool char *__b) {
4119 return (vector bool char)__builtin_altivec_lvx(__a, __b);
4122 static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a,
4123 const vector short *__b) {
4124 return (vector short)__builtin_altivec_lvx(__a, __b);
4127 static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a, const short *__b) {
4128 return (vector short)__builtin_altivec_lvx(__a, __b);
4131 static __inline__ vector unsigned short __ATTRS_o_ai
4132 vec_lvx(long __a, const vector unsigned short *__b) {
4133 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4136 static __inline__ vector unsigned short __ATTRS_o_ai
4137 vec_lvx(long __a, const unsigned short *__b) {
4138 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4141 static __inline__ vector bool short __ATTRS_o_ai
4142 vec_lvx(long __a, const vector bool short *__b) {
4143 return (vector bool short)__builtin_altivec_lvx(__a, __b);
4146 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(long __a,
4147 const vector pixel *__b) {
4148 return (vector pixel)__builtin_altivec_lvx(__a, __b);
4151 static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a,
4152 const vector int *__b) {
4153 return (vector int)__builtin_altivec_lvx(__a, __b);
4156 static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a, const int *__b) {
4157 return (vector int)__builtin_altivec_lvx(__a, __b);
4160 static __inline__ vector unsigned int __ATTRS_o_ai
4161 vec_lvx(long __a, const vector unsigned int *__b) {
4162 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4165 static __inline__ vector unsigned int __ATTRS_o_ai
4166 vec_lvx(long __a, const unsigned int *__b) {
4167 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4170 static __inline__ vector bool int __ATTRS_o_ai
4171 vec_lvx(long __a, const vector bool int *__b) {
4172 return (vector bool int)__builtin_altivec_lvx(__a, __b);
4175 static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a,
4176 const vector float *__b) {
4177 return (vector float)__builtin_altivec_lvx(__a, __b);
4180 static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a, const float *__b) {
4181 return (vector float)__builtin_altivec_lvx(__a, __b);
4186 static __inline__ vector signed char __ATTRS_o_ai
4187 vec_lde(long __a, const signed char *__b) {
4188 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
4191 static __inline__ vector unsigned char __ATTRS_o_ai
4192 vec_lde(long __a, const unsigned char *__b) {
4193 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
4196 static __inline__ vector short __ATTRS_o_ai vec_lde(long __a, const short *__b) {
4197 return (vector short)__builtin_altivec_lvehx(__a, __b);
4200 static __inline__ vector unsigned short __ATTRS_o_ai
4201 vec_lde(long __a, const unsigned short *__b) {
4202 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
4205 static __inline__ vector int __ATTRS_o_ai vec_lde(long __a, const int *__b) {
4206 return (vector int)__builtin_altivec_lvewx(__a, __b);
4209 static __inline__ vector unsigned int __ATTRS_o_ai
4210 vec_lde(long __a, const unsigned int *__b) {
4211 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
4214 static __inline__ vector float __ATTRS_o_ai vec_lde(long __a, const float *__b) {
4215 return (vector float)__builtin_altivec_lvewx(__a, __b);
4220 static __inline__ vector signed char __ATTRS_o_ai
4221 vec_lvebx(long __a, const signed char *__b) {
4222 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
4225 static __inline__ vector unsigned char __ATTRS_o_ai
4226 vec_lvebx(long __a, const unsigned char *__b) {
4227 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
4232 static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a,
4234 return (vector short)__builtin_altivec_lvehx(__a, __b);
4237 static __inline__ vector unsigned short __ATTRS_o_ai
4238 vec_lvehx(long __a, const unsigned short *__b) {
4239 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
4244 static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b) {
4245 return (vector int)__builtin_altivec_lvewx(__a, __b);
4248 static __inline__ vector unsigned int __ATTRS_o_ai
4249 vec_lvewx(long __a, const unsigned int *__b) {
4250 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
4253 static __inline__ vector float __ATTRS_o_ai vec_lvewx(long __a,
4255 return (vector float)__builtin_altivec_lvewx(__a, __b);
4260 static __inline__ vector signed char __ATTRS_o_ai
4261 vec_ldl(long __a, const vector signed char *__b) {
4262 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4265 static __inline__ vector signed char __ATTRS_o_ai
4266 vec_ldl(long __a, const signed char *__b) {
4267 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4270 static __inline__ vector unsigned char __ATTRS_o_ai
4271 vec_ldl(long __a, const vector unsigned char *__b) {
4272 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4275 static __inline__ vector unsigned char __ATTRS_o_ai
4276 vec_ldl(long __a, const unsigned char *__b) {
4277 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4280 static __inline__ vector bool char __ATTRS_o_ai
4281 vec_ldl(long __a, const vector bool char *__b) {
4282 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4285 static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a,
4286 const vector short *__b) {
4287 return (vector short)__builtin_altivec_lvxl(__a, __b);
4290 static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a, const short *__b) {
4291 return (vector short)__builtin_altivec_lvxl(__a, __b);
4294 static __inline__ vector unsigned short __ATTRS_o_ai
4295 vec_ldl(long __a, const vector unsigned short *__b) {
4296 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4299 static __inline__ vector unsigned short __ATTRS_o_ai
4300 vec_ldl(long __a, const unsigned short *__b) {
4301 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4304 static __inline__ vector bool short __ATTRS_o_ai
4305 vec_ldl(long __a, const vector bool short *__b) {
4306 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4309 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(long __a,
4310 const vector pixel *__b) {
4311 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
4314 static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a,
4315 const vector int *__b) {
4316 return (vector int)__builtin_altivec_lvxl(__a, __b);
4319 static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a, const int *__b) {
4320 return (vector int)__builtin_altivec_lvxl(__a, __b);
4323 static __inline__ vector unsigned int __ATTRS_o_ai
4324 vec_ldl(long __a, const vector unsigned int *__b) {
4325 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4328 static __inline__ vector unsigned int __ATTRS_o_ai
4329 vec_ldl(long __a, const unsigned int *__b) {
4330 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4333 static __inline__ vector bool int __ATTRS_o_ai
4334 vec_ldl(long __a, const vector bool int *__b) {
4335 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4338 static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a,
4339 const vector float *__b) {
4340 return (vector float)__builtin_altivec_lvxl(__a, __b);
4343 static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a, const float *__b) {
4344 return (vector float)__builtin_altivec_lvxl(__a, __b);
4349 static __inline__ vector signed char __ATTRS_o_ai
4350 vec_lvxl(long __a, const vector signed char *__b) {
4351 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4354 static __inline__ vector signed char __ATTRS_o_ai
4355 vec_lvxl(long __a, const signed char *__b) {
4356 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4359 static __inline__ vector unsigned char __ATTRS_o_ai
4360 vec_lvxl(long __a, const vector unsigned char *__b) {
4361 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4364 static __inline__ vector unsigned char __ATTRS_o_ai
4365 vec_lvxl(long __a, const unsigned char *__b) {
4366 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4369 static __inline__ vector bool char __ATTRS_o_ai
4370 vec_lvxl(long __a, const vector bool char *__b) {
4371 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4374 static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4375 const vector short *__b) {
4376 return (vector short)__builtin_altivec_lvxl(__a, __b);
4379 static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4381 return (vector short)__builtin_altivec_lvxl(__a, __b);
4384 static __inline__ vector unsigned short __ATTRS_o_ai
4385 vec_lvxl(long __a, const vector unsigned short *__b) {
4386 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4389 static __inline__ vector unsigned short __ATTRS_o_ai
4390 vec_lvxl(long __a, const unsigned short *__b) {
4391 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4394 static __inline__ vector bool short __ATTRS_o_ai
4395 vec_lvxl(long __a, const vector bool short *__b) {
4396 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4399 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(long __a,
4400 const vector pixel *__b) {
4401 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
4404 static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a,
4405 const vector int *__b) {
4406 return (vector int)__builtin_altivec_lvxl(__a, __b);
4409 static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a, const int *__b) {
4410 return (vector int)__builtin_altivec_lvxl(__a, __b);
4413 static __inline__ vector unsigned int __ATTRS_o_ai
4414 vec_lvxl(long __a, const vector unsigned int *__b) {
4415 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4418 static __inline__ vector unsigned int __ATTRS_o_ai
4419 vec_lvxl(long __a, const unsigned int *__b) {
4420 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4423 static __inline__ vector bool int __ATTRS_o_ai
4424 vec_lvxl(long __a, const vector bool int *__b) {
4425 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4428 static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4429 const vector float *__b) {
4430 return (vector float)__builtin_altivec_lvxl(__a, __b);
4433 static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4435 return (vector float)__builtin_altivec_lvxl(__a, __b);
4440 static __inline__ vector float __attribute__((__always_inline__))
4441 vec_loge(vector float __a) {
4442 return __builtin_altivec_vlogefp(__a);
4447 static __inline__ vector float __attribute__((__always_inline__))
4448 vec_vlogefp(vector float __a) {
4449 return __builtin_altivec_vlogefp(__a);
4454 #ifdef __LITTLE_ENDIAN__
4455 static __inline__ vector unsigned char __ATTRS_o_ai
4456 __attribute__((__deprecated__("use assignment for unaligned little endian \
4457 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
4458 vector unsigned char mask =
4459 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4460 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4461 7, 6, 5, 4, 3, 2, 1, 0};
4462 return vec_perm(mask, mask, reverse);
4465 static __inline__ vector unsigned char __ATTRS_o_ai
4466 vec_lvsl(int __a, const signed char *__b) {
4467 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4471 #ifdef __LITTLE_ENDIAN__
4472 static __inline__ vector unsigned char __ATTRS_o_ai
4473 __attribute__((__deprecated__("use assignment for unaligned little endian \
4474 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
4475 vector unsigned char mask =
4476 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4477 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4478 7, 6, 5, 4, 3, 2, 1, 0};
4479 return vec_perm(mask, mask, reverse);
4482 static __inline__ vector unsigned char __ATTRS_o_ai
4483 vec_lvsl(int __a, const unsigned char *__b) {
4484 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4488 #ifdef __LITTLE_ENDIAN__
4489 static __inline__ vector unsigned char __ATTRS_o_ai
4490 __attribute__((__deprecated__("use assignment for unaligned little endian \
4491 loads/stores"))) vec_lvsl(int __a, const short *__b) {
4492 vector unsigned char mask =
4493 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4494 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4495 7, 6, 5, 4, 3, 2, 1, 0};
4496 return vec_perm(mask, mask, reverse);
4499 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4501 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4505 #ifdef __LITTLE_ENDIAN__
4506 static __inline__ vector unsigned char __ATTRS_o_ai
4507 __attribute__((__deprecated__("use assignment for unaligned little endian \
4508 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
4509 vector unsigned char mask =
4510 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4511 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4512 7, 6, 5, 4, 3, 2, 1, 0};
4513 return vec_perm(mask, mask, reverse);
4516 static __inline__ vector unsigned char __ATTRS_o_ai
4517 vec_lvsl(int __a, const unsigned short *__b) {
4518 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4522 #ifdef __LITTLE_ENDIAN__
4523 static __inline__ vector unsigned char __ATTRS_o_ai
4524 __attribute__((__deprecated__("use assignment for unaligned little endian \
4525 loads/stores"))) vec_lvsl(int __a, const int *__b) {
4526 vector unsigned char mask =
4527 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4528 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4529 7, 6, 5, 4, 3, 2, 1, 0};
4530 return vec_perm(mask, mask, reverse);
4533 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4535 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4539 #ifdef __LITTLE_ENDIAN__
4540 static __inline__ vector unsigned char __ATTRS_o_ai
4541 __attribute__((__deprecated__("use assignment for unaligned little endian \
4542 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
4543 vector unsigned char mask =
4544 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4545 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4546 7, 6, 5, 4, 3, 2, 1, 0};
4547 return vec_perm(mask, mask, reverse);
4550 static __inline__ vector unsigned char __ATTRS_o_ai
4551 vec_lvsl(int __a, const unsigned int *__b) {
4552 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4556 #ifdef __LITTLE_ENDIAN__
4557 static __inline__ vector unsigned char __ATTRS_o_ai
4558 __attribute__((__deprecated__("use assignment for unaligned little endian \
4559 loads/stores"))) vec_lvsl(int __a, const float *__b) {
4560 vector unsigned char mask =
4561 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4562 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4563 7, 6, 5, 4, 3, 2, 1, 0};
4564 return vec_perm(mask, mask, reverse);
4567 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4569 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4575 #ifdef __LITTLE_ENDIAN__
4576 static __inline__ vector unsigned char __ATTRS_o_ai
4577 __attribute__((__deprecated__("use assignment for unaligned little endian \
4578 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4579 vector unsigned char mask =
4580 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4581 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4582 7, 6, 5, 4, 3, 2, 1, 0};
4583 return vec_perm(mask, mask, reverse);
4586 static __inline__ vector unsigned char __ATTRS_o_ai
4587 vec_lvsr(int __a, const signed char *__b) {
4588 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4592 #ifdef __LITTLE_ENDIAN__
4593 static __inline__ vector unsigned char __ATTRS_o_ai
4594 __attribute__((__deprecated__("use assignment for unaligned little endian \
4595 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4596 vector unsigned char mask =
4597 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4598 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4599 7, 6, 5, 4, 3, 2, 1, 0};
4600 return vec_perm(mask, mask, reverse);
4603 static __inline__ vector unsigned char __ATTRS_o_ai
4604 vec_lvsr(int __a, const unsigned char *__b) {
4605 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4609 #ifdef __LITTLE_ENDIAN__
4610 static __inline__ vector unsigned char __ATTRS_o_ai
4611 __attribute__((__deprecated__("use assignment for unaligned little endian \
4612 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4613 vector unsigned char mask =
4614 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4615 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4616 7, 6, 5, 4, 3, 2, 1, 0};
4617 return vec_perm(mask, mask, reverse);
4620 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4622 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4626 #ifdef __LITTLE_ENDIAN__
4627 static __inline__ vector unsigned char __ATTRS_o_ai
4628 __attribute__((__deprecated__("use assignment for unaligned little endian \
4629 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4630 vector unsigned char mask =
4631 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4632 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4633 7, 6, 5, 4, 3, 2, 1, 0};
4634 return vec_perm(mask, mask, reverse);
4637 static __inline__ vector unsigned char __ATTRS_o_ai
4638 vec_lvsr(int __a, const unsigned short *__b) {
4639 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4643 #ifdef __LITTLE_ENDIAN__
4644 static __inline__ vector unsigned char __ATTRS_o_ai
4645 __attribute__((__deprecated__("use assignment for unaligned little endian \
4646 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4647 vector unsigned char mask =
4648 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4649 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4650 7, 6, 5, 4, 3, 2, 1, 0};
4651 return vec_perm(mask, mask, reverse);
4654 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4656 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4660 #ifdef __LITTLE_ENDIAN__
4661 static __inline__ vector unsigned char __ATTRS_o_ai
4662 __attribute__((__deprecated__("use assignment for unaligned little endian \
4663 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4664 vector unsigned char mask =
4665 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4666 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4667 7, 6, 5, 4, 3, 2, 1, 0};
4668 return vec_perm(mask, mask, reverse);
4671 static __inline__ vector unsigned char __ATTRS_o_ai
4672 vec_lvsr(int __a, const unsigned int *__b) {
4673 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4677 #ifdef __LITTLE_ENDIAN__
4678 static __inline__ vector unsigned char __ATTRS_o_ai
4679 __attribute__((__deprecated__("use assignment for unaligned little endian \
4680 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4681 vector unsigned char mask =
4682 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4683 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4684 7, 6, 5, 4, 3, 2, 1, 0};
4685 return vec_perm(mask, mask, reverse);
4688 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4690 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4695 static __inline__ vector signed short __ATTRS_o_ai
4696 vec_mladd(vector signed short, vector signed short, vector signed short);
4697 static __inline__ vector signed short __ATTRS_o_ai
4698 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4699 static __inline__ vector signed short __ATTRS_o_ai
4700 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4701 static __inline__ vector unsigned short __ATTRS_o_ai
4702 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4704 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4705 vector signed short __a, vector signed short __b, vector signed short __c) {
4706 return vec_mladd(__a, __b, __c);
4709 static __inline__ vector signed short __ATTRS_o_ai
4710 vec_madd(vector signed short __a, vector unsigned short __b,
4711 vector unsigned short __c) {
4712 return vec_mladd(__a, __b, __c);
4715 static __inline__ vector signed short __ATTRS_o_ai
4716 vec_madd(vector unsigned short __a, vector signed short __b,
4717 vector signed short __c) {
4718 return vec_mladd(__a, __b, __c);
4721 static __inline__ vector unsigned short __ATTRS_o_ai
4722 vec_madd(vector unsigned short __a, vector unsigned short __b,
4723 vector unsigned short __c) {
4724 return vec_mladd(__a, __b, __c);
4727 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4731 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4733 return __builtin_altivec_vmaddfp(__a, __b, __c);
4738 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4740 vector double __c) {
4741 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4747 static __inline__ vector float __attribute__((__always_inline__))
4748 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4749 return __builtin_altivec_vmaddfp(__a, __b, __c);
4754 static __inline__ vector signed short __attribute__((__always_inline__))
4755 vec_madds(vector signed short __a, vector signed short __b,
4756 vector signed short __c) {
4757 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4761 static __inline__ vector signed short __attribute__((__always_inline__))
4762 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4763 vector signed short __c) {
4764 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4770 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4773 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4776 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4778 vector double __c) {
4779 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4785 static __inline__ vector signed char __ATTRS_o_ai
4786 vec_max(vector signed char __a, vector signed char __b) {
4787 return __builtin_altivec_vmaxsb(__a, __b);
4790 static __inline__ vector signed char __ATTRS_o_ai
4791 vec_max(vector bool char __a, vector signed char __b) {
4792 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4795 static __inline__ vector signed char __ATTRS_o_ai
4796 vec_max(vector signed char __a, vector bool char __b) {
4797 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4800 static __inline__ vector unsigned char __ATTRS_o_ai
4801 vec_max(vector unsigned char __a, vector unsigned char __b) {
4802 return __builtin_altivec_vmaxub(__a, __b);
4805 static __inline__ vector unsigned char __ATTRS_o_ai
4806 vec_max(vector bool char __a, vector unsigned char __b) {
4807 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4810 static __inline__ vector unsigned char __ATTRS_o_ai
4811 vec_max(vector unsigned char __a, vector bool char __b) {
4812 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4815 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4817 return __builtin_altivec_vmaxsh(__a, __b);
4820 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4822 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4825 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4826 vector bool short __b) {
4827 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4830 static __inline__ vector unsigned short __ATTRS_o_ai
4831 vec_max(vector unsigned short __a, vector unsigned short __b) {
4832 return __builtin_altivec_vmaxuh(__a, __b);
4835 static __inline__ vector unsigned short __ATTRS_o_ai
4836 vec_max(vector bool short __a, vector unsigned short __b) {
4837 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4840 static __inline__ vector unsigned short __ATTRS_o_ai
4841 vec_max(vector unsigned short __a, vector bool short __b) {
4842 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4845 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4847 return __builtin_altivec_vmaxsw(__a, __b);
4850 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4852 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4855 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4856 vector bool int __b) {
4857 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4860 static __inline__ vector unsigned int __ATTRS_o_ai
4861 vec_max(vector unsigned int __a, vector unsigned int __b) {
4862 return __builtin_altivec_vmaxuw(__a, __b);
4865 static __inline__ vector unsigned int __ATTRS_o_ai
4866 vec_max(vector bool int __a, vector unsigned int __b) {
4867 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4870 static __inline__ vector unsigned int __ATTRS_o_ai
4871 vec_max(vector unsigned int __a, vector bool int __b) {
4872 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4875 #ifdef __POWER8_VECTOR__
4876 static __inline__ vector signed long long __ATTRS_o_ai
4877 vec_max(vector signed long long __a, vector signed long long __b) {
4878 return __builtin_altivec_vmaxsd(__a, __b);
4881 static __inline__ vector signed long long __ATTRS_o_ai
4882 vec_max(vector bool long long __a, vector signed long long __b) {
4883 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4886 static __inline__ vector signed long long __ATTRS_o_ai
4887 vec_max(vector signed long long __a, vector bool long long __b) {
4888 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4891 static __inline__ vector unsigned long long __ATTRS_o_ai
4892 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4893 return __builtin_altivec_vmaxud(__a, __b);
4896 static __inline__ vector unsigned long long __ATTRS_o_ai
4897 vec_max(vector bool long long __a, vector unsigned long long __b) {
4898 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4901 static __inline__ vector unsigned long long __ATTRS_o_ai
4902 vec_max(vector unsigned long long __a, vector bool long long __b) {
4903 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4907 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4910 return __builtin_vsx_xvmaxsp(__a, __b);
4912 return __builtin_altivec_vmaxfp(__a, __b);
4917 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4918 vector double __b) {
4919 return __builtin_vsx_xvmaxdp(__a, __b);
4925 static __inline__ vector signed char __ATTRS_o_ai
4926 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4927 return __builtin_altivec_vmaxsb(__a, __b);
4930 static __inline__ vector signed char __ATTRS_o_ai
4931 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4932 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4935 static __inline__ vector signed char __ATTRS_o_ai
4936 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4937 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4942 static __inline__ vector unsigned char __ATTRS_o_ai
4943 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4944 return __builtin_altivec_vmaxub(__a, __b);
4947 static __inline__ vector unsigned char __ATTRS_o_ai
4948 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4949 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4952 static __inline__ vector unsigned char __ATTRS_o_ai
4953 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4954 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4959 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4961 return __builtin_altivec_vmaxsh(__a, __b);
4964 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4966 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4969 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4970 vector bool short __b) {
4971 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4976 static __inline__ vector unsigned short __ATTRS_o_ai
4977 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4978 return __builtin_altivec_vmaxuh(__a, __b);
4981 static __inline__ vector unsigned short __ATTRS_o_ai
4982 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4983 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4986 static __inline__ vector unsigned short __ATTRS_o_ai
4987 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4988 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4993 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4995 return __builtin_altivec_vmaxsw(__a, __b);
4998 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
5000 return __builtin_altivec_vmaxsw((vector int)__a, __b);
5003 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
5004 vector bool int __b) {
5005 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
5010 static __inline__ vector unsigned int __ATTRS_o_ai
5011 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
5012 return __builtin_altivec_vmaxuw(__a, __b);
5015 static __inline__ vector unsigned int __ATTRS_o_ai
5016 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
5017 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
5020 static __inline__ vector unsigned int __ATTRS_o_ai
5021 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
5022 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
5027 static __inline__ vector float __attribute__((__always_inline__))
5028 vec_vmaxfp(vector float __a, vector float __b) {
5030 return __builtin_vsx_xvmaxsp(__a, __b);
5032 return __builtin_altivec_vmaxfp(__a, __b);
5038 static __inline__ vector signed char __ATTRS_o_ai
5039 vec_mergeh(vector signed char __a, vector signed char __b) {
5040 return vec_perm(__a, __b,
5041 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5042 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5043 0x06, 0x16, 0x07, 0x17));
5046 static __inline__ vector unsigned char __ATTRS_o_ai
5047 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
5048 return vec_perm(__a, __b,
5049 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5050 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5051 0x06, 0x16, 0x07, 0x17));
5054 static __inline__ vector bool char __ATTRS_o_ai
5055 vec_mergeh(vector bool char __a, vector bool char __b) {
5056 return vec_perm(__a, __b,
5057 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5058 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5059 0x06, 0x16, 0x07, 0x17));
5062 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
5064 return vec_perm(__a, __b,
5065 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5066 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5067 0x06, 0x07, 0x16, 0x17));
5070 static __inline__ vector unsigned short __ATTRS_o_ai
5071 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
5072 return vec_perm(__a, __b,
5073 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5074 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5075 0x06, 0x07, 0x16, 0x17));
5078 static __inline__ vector bool short __ATTRS_o_ai
5079 vec_mergeh(vector bool short __a, vector bool short __b) {
5080 return vec_perm(__a, __b,
5081 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5082 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5083 0x06, 0x07, 0x16, 0x17));
5086 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
5088 return vec_perm(__a, __b,
5089 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5090 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5091 0x06, 0x07, 0x16, 0x17));
5094 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
5096 return vec_perm(__a, __b,
5097 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5098 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5099 0x14, 0x15, 0x16, 0x17));
5102 static __inline__ vector unsigned int __ATTRS_o_ai
5103 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
5104 return vec_perm(__a, __b,
5105 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5106 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5107 0x14, 0x15, 0x16, 0x17));
5110 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
5111 vector bool int __b) {
5112 return vec_perm(__a, __b,
5113 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5114 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5115 0x14, 0x15, 0x16, 0x17));
5118 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
5120 return vec_perm(__a, __b,
5121 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5122 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5123 0x14, 0x15, 0x16, 0x17));
5127 static __inline__ vector signed long long __ATTRS_o_ai
5128 vec_mergeh(vector signed long long __a, vector signed long long __b) {
5129 return vec_perm(__a, __b,
5130 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5131 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5132 0x14, 0x15, 0x16, 0x17));
5135 static __inline__ vector signed long long __ATTRS_o_ai
5136 vec_mergeh(vector signed long long __a, vector bool long long __b) {
5137 return vec_perm(__a, (vector signed long long)__b,
5138 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5139 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5140 0x14, 0x15, 0x16, 0x17));
5143 static __inline__ vector signed long long __ATTRS_o_ai
5144 vec_mergeh(vector bool long long __a, vector signed long long __b) {
5145 return vec_perm((vector signed long long)__a, __b,
5146 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5147 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5148 0x14, 0x15, 0x16, 0x17));
5151 static __inline__ vector unsigned long long __ATTRS_o_ai
5152 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
5153 return vec_perm(__a, __b,
5154 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5155 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5156 0x14, 0x15, 0x16, 0x17));
5159 static __inline__ vector unsigned long long __ATTRS_o_ai
5160 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
5161 return vec_perm(__a, (vector unsigned long long)__b,
5162 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5163 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5164 0x14, 0x15, 0x16, 0x17));
5167 static __inline__ vector unsigned long long __ATTRS_o_ai
5168 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
5169 return vec_perm((vector unsigned long long)__a, __b,
5170 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5171 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5172 0x14, 0x15, 0x16, 0x17));
5175 static __inline__ vector bool long long __ATTRS_o_ai
5176 vec_mergeh(vector bool long long __a, vector bool long long __b) {
5177 return vec_perm(__a, __b,
5178 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5179 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5180 0x14, 0x15, 0x16, 0x17));
5183 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
5184 vector double __b) {
5185 return vec_perm(__a, __b,
5186 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5187 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5188 0x14, 0x15, 0x16, 0x17));
5190 static __inline__ vector double __ATTRS_o_ai
5191 vec_mergeh(vector double __a, vector bool long long __b) {
5192 return vec_perm(__a, (vector double)__b,
5193 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5194 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5195 0x14, 0x15, 0x16, 0x17));
5197 static __inline__ vector double __ATTRS_o_ai
5198 vec_mergeh(vector bool long long __a, vector double __b) {
5199 return vec_perm((vector double)__a, __b,
5200 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5201 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5202 0x14, 0x15, 0x16, 0x17));
5208 #define __builtin_altivec_vmrghb vec_vmrghb
5210 static __inline__ vector signed char __ATTRS_o_ai
5211 vec_vmrghb(vector signed char __a, vector signed char __b) {
5212 return vec_perm(__a, __b,
5213 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5214 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5215 0x06, 0x16, 0x07, 0x17));
5218 static __inline__ vector unsigned char __ATTRS_o_ai
5219 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
5220 return vec_perm(__a, __b,
5221 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5222 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5223 0x06, 0x16, 0x07, 0x17));
5226 static __inline__ vector bool char __ATTRS_o_ai
5227 vec_vmrghb(vector bool char __a, vector bool char __b) {
5228 return vec_perm(__a, __b,
5229 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5230 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5231 0x06, 0x16, 0x07, 0x17));
5236 #define __builtin_altivec_vmrghh vec_vmrghh
5238 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
5240 return vec_perm(__a, __b,
5241 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5242 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5243 0x06, 0x07, 0x16, 0x17));
5246 static __inline__ vector unsigned short __ATTRS_o_ai
5247 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
5248 return vec_perm(__a, __b,
5249 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5250 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5251 0x06, 0x07, 0x16, 0x17));
5254 static __inline__ vector bool short __ATTRS_o_ai
5255 vec_vmrghh(vector bool short __a, vector bool short __b) {
5256 return vec_perm(__a, __b,
5257 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5258 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5259 0x06, 0x07, 0x16, 0x17));
5262 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
5264 return vec_perm(__a, __b,
5265 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5266 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5267 0x06, 0x07, 0x16, 0x17));
5272 #define __builtin_altivec_vmrghw vec_vmrghw
5274 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
5276 return vec_perm(__a, __b,
5277 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5278 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5279 0x14, 0x15, 0x16, 0x17));
5282 static __inline__ vector unsigned int __ATTRS_o_ai
5283 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
5284 return vec_perm(__a, __b,
5285 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5286 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5287 0x14, 0x15, 0x16, 0x17));
5290 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
5291 vector bool int __b) {
5292 return vec_perm(__a, __b,
5293 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5294 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5295 0x14, 0x15, 0x16, 0x17));
5298 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
5300 return vec_perm(__a, __b,
5301 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5302 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5303 0x14, 0x15, 0x16, 0x17));
5308 static __inline__ vector signed char __ATTRS_o_ai
5309 vec_mergel(vector signed char __a, vector signed char __b) {
5310 return vec_perm(__a, __b,
5311 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5312 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5313 0x0E, 0x1E, 0x0F, 0x1F));
5316 static __inline__ vector unsigned char __ATTRS_o_ai
5317 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
5318 return vec_perm(__a, __b,
5319 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5320 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5321 0x0E, 0x1E, 0x0F, 0x1F));
5324 static __inline__ vector bool char __ATTRS_o_ai
5325 vec_mergel(vector bool char __a, vector bool char __b) {
5326 return vec_perm(__a, __b,
5327 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5328 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5329 0x0E, 0x1E, 0x0F, 0x1F));
5332 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
5334 return vec_perm(__a, __b,
5335 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5336 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5337 0x0E, 0x0F, 0x1E, 0x1F));
5340 static __inline__ vector unsigned short __ATTRS_o_ai
5341 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
5342 return vec_perm(__a, __b,
5343 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5344 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5345 0x0E, 0x0F, 0x1E, 0x1F));
5348 static __inline__ vector bool short __ATTRS_o_ai
5349 vec_mergel(vector bool short __a, vector bool short __b) {
5350 return vec_perm(__a, __b,
5351 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5352 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5353 0x0E, 0x0F, 0x1E, 0x1F));
5356 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
5358 return vec_perm(__a, __b,
5359 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5360 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5361 0x0E, 0x0F, 0x1E, 0x1F));
5364 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
5366 return vec_perm(__a, __b,
5367 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5368 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5369 0x1C, 0x1D, 0x1E, 0x1F));
5372 static __inline__ vector unsigned int __ATTRS_o_ai
5373 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
5374 return vec_perm(__a, __b,
5375 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5376 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5377 0x1C, 0x1D, 0x1E, 0x1F));
5380 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
5381 vector bool int __b) {
5382 return vec_perm(__a, __b,
5383 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5384 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5385 0x1C, 0x1D, 0x1E, 0x1F));
5388 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
5390 return vec_perm(__a, __b,
5391 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5392 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5393 0x1C, 0x1D, 0x1E, 0x1F));
5397 static __inline__ vector signed long long __ATTRS_o_ai
5398 vec_mergel(vector signed long long __a, vector signed long long __b) {
5399 return vec_perm(__a, __b,
5400 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5401 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5402 0x1C, 0x1D, 0x1E, 0x1F));
5404 static __inline__ vector signed long long __ATTRS_o_ai
5405 vec_mergel(vector signed long long __a, vector bool long long __b) {
5406 return vec_perm(__a, (vector signed long long)__b,
5407 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5408 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5409 0x1C, 0x1D, 0x1E, 0x1F));
5411 static __inline__ vector signed long long __ATTRS_o_ai
5412 vec_mergel(vector bool long long __a, vector signed long long __b) {
5413 return vec_perm((vector signed long long)__a, __b,
5414 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5415 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5416 0x1C, 0x1D, 0x1E, 0x1F));
5418 static __inline__ vector unsigned long long __ATTRS_o_ai
5419 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
5420 return vec_perm(__a, __b,
5421 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5422 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5423 0x1C, 0x1D, 0x1E, 0x1F));
5425 static __inline__ vector unsigned long long __ATTRS_o_ai
5426 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
5427 return vec_perm(__a, (vector unsigned long long)__b,
5428 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5429 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5430 0x1C, 0x1D, 0x1E, 0x1F));
5432 static __inline__ vector unsigned long long __ATTRS_o_ai
5433 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
5434 return vec_perm((vector unsigned long long)__a, __b,
5435 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5436 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5437 0x1C, 0x1D, 0x1E, 0x1F));
5439 static __inline__ vector bool long long __ATTRS_o_ai
5440 vec_mergel(vector bool long long __a, vector bool long long __b) {
5441 return vec_perm(__a, __b,
5442 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5443 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5444 0x1C, 0x1D, 0x1E, 0x1F));
5446 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
5447 vector double __b) {
5448 return vec_perm(__a, __b,
5449 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5450 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5451 0x1C, 0x1D, 0x1E, 0x1F));
5453 static __inline__ vector double __ATTRS_o_ai
5454 vec_mergel(vector double __a, vector bool long long __b) {
5455 return vec_perm(__a, (vector double)__b,
5456 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5457 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5458 0x1C, 0x1D, 0x1E, 0x1F));
5460 static __inline__ vector double __ATTRS_o_ai
5461 vec_mergel(vector bool long long __a, vector double __b) {
5462 return vec_perm((vector double)__a, __b,
5463 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5464 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5465 0x1C, 0x1D, 0x1E, 0x1F));
5471 #define __builtin_altivec_vmrglb vec_vmrglb
5473 static __inline__ vector signed char __ATTRS_o_ai
5474 vec_vmrglb(vector signed char __a, vector signed char __b) {
5475 return vec_perm(__a, __b,
5476 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5477 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5478 0x0E, 0x1E, 0x0F, 0x1F));
5481 static __inline__ vector unsigned char __ATTRS_o_ai
5482 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
5483 return vec_perm(__a, __b,
5484 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5485 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5486 0x0E, 0x1E, 0x0F, 0x1F));
5489 static __inline__ vector bool char __ATTRS_o_ai
5490 vec_vmrglb(vector bool char __a, vector bool char __b) {
5491 return vec_perm(__a, __b,
5492 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5493 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5494 0x0E, 0x1E, 0x0F, 0x1F));
5499 #define __builtin_altivec_vmrglh vec_vmrglh
5501 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
5503 return vec_perm(__a, __b,
5504 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5505 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5506 0x0E, 0x0F, 0x1E, 0x1F));
5509 static __inline__ vector unsigned short __ATTRS_o_ai
5510 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
5511 return vec_perm(__a, __b,
5512 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5513 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5514 0x0E, 0x0F, 0x1E, 0x1F));
5517 static __inline__ vector bool short __ATTRS_o_ai
5518 vec_vmrglh(vector bool short __a, vector bool short __b) {
5519 return vec_perm(__a, __b,
5520 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5521 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5522 0x0E, 0x0F, 0x1E, 0x1F));
5525 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
5527 return vec_perm(__a, __b,
5528 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5529 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5530 0x0E, 0x0F, 0x1E, 0x1F));
5535 #define __builtin_altivec_vmrglw vec_vmrglw
5537 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
5539 return vec_perm(__a, __b,
5540 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5541 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5542 0x1C, 0x1D, 0x1E, 0x1F));
5545 static __inline__ vector unsigned int __ATTRS_o_ai
5546 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
5547 return vec_perm(__a, __b,
5548 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5549 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5550 0x1C, 0x1D, 0x1E, 0x1F));
5553 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5554 vector bool int __b) {
5555 return vec_perm(__a, __b,
5556 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5557 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5558 0x1C, 0x1D, 0x1E, 0x1F));
5561 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5563 return vec_perm(__a, __b,
5564 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5565 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5566 0x1C, 0x1D, 0x1E, 0x1F));
5569 #ifdef __POWER8_VECTOR__
5572 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5573 vector bool int __b) {
5574 return vec_perm(__a, __b,
5575 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5576 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5577 0x18, 0x19, 0x1A, 0x1B));
5580 static __inline__ vector signed int __ATTRS_o_ai
5581 vec_mergee(vector signed int __a, vector signed int __b) {
5582 return vec_perm(__a, __b,
5583 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5584 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5585 0x18, 0x19, 0x1A, 0x1B));
5588 static __inline__ vector unsigned int __ATTRS_o_ai
5589 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5590 return vec_perm(__a, __b,
5591 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5592 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5593 0x18, 0x19, 0x1A, 0x1B));
5596 static __inline__ vector bool long long __ATTRS_o_ai
5597 vec_mergee(vector bool long long __a, vector bool long long __b) {
5598 return vec_mergeh(__a, __b);
5601 static __inline__ vector signed long long __ATTRS_o_ai
5602 vec_mergee(vector signed long long __a, vector signed long long __b) {
5603 return vec_mergeh(__a, __b);
5606 static __inline__ vector unsigned long long __ATTRS_o_ai
5607 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5608 return vec_mergeh(__a, __b);
5611 static __inline__ vector float __ATTRS_o_ai
5612 vec_mergee(vector float __a, vector float __b) {
5613 return vec_perm(__a, __b,
5614 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5615 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5616 0x18, 0x19, 0x1A, 0x1B));
5619 static __inline__ vector double __ATTRS_o_ai
5620 vec_mergee(vector double __a, vector double __b) {
5621 return vec_mergeh(__a, __b);
5626 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5627 vector bool int __b) {
5628 return vec_perm(__a, __b,
5629 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5630 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5631 0x1C, 0x1D, 0x1E, 0x1F));
5634 static __inline__ vector signed int __ATTRS_o_ai
5635 vec_mergeo(vector signed int __a, vector signed int __b) {
5636 return vec_perm(__a, __b,
5637 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5638 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5639 0x1C, 0x1D, 0x1E, 0x1F));
5642 static __inline__ vector unsigned int __ATTRS_o_ai
5643 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5644 return vec_perm(__a, __b,
5645 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5646 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5647 0x1C, 0x1D, 0x1E, 0x1F));
5650 static __inline__ vector bool long long __ATTRS_o_ai
5651 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5652 return vec_mergel(__a, __b);
5655 static __inline__ vector signed long long __ATTRS_o_ai
5656 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5657 return vec_mergel(__a, __b);
5660 static __inline__ vector unsigned long long __ATTRS_o_ai
5661 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5662 return vec_mergel(__a, __b);
5665 static __inline__ vector float __ATTRS_o_ai
5666 vec_mergeo(vector float __a, vector float __b) {
5667 return vec_perm(__a, __b,
5668 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5669 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5670 0x1C, 0x1D, 0x1E, 0x1F));
5673 static __inline__ vector double __ATTRS_o_ai
5674 vec_mergeo(vector double __a, vector double __b) {
5675 return vec_mergel(__a, __b);
5682 static __inline__ vector unsigned short __attribute__((__always_inline__))
5684 return __builtin_altivec_mfvscr();
5689 static __inline__ vector signed char __ATTRS_o_ai
5690 vec_min(vector signed char __a, vector signed char __b) {
5691 return __builtin_altivec_vminsb(__a, __b);
5694 static __inline__ vector signed char __ATTRS_o_ai
5695 vec_min(vector bool char __a, vector signed char __b) {
5696 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5699 static __inline__ vector signed char __ATTRS_o_ai
5700 vec_min(vector signed char __a, vector bool char __b) {
5701 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5704 static __inline__ vector unsigned char __ATTRS_o_ai
5705 vec_min(vector unsigned char __a, vector unsigned char __b) {
5706 return __builtin_altivec_vminub(__a, __b);
5709 static __inline__ vector unsigned char __ATTRS_o_ai
5710 vec_min(vector bool char __a, vector unsigned char __b) {
5711 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5714 static __inline__ vector unsigned char __ATTRS_o_ai
5715 vec_min(vector unsigned char __a, vector bool char __b) {
5716 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5719 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5721 return __builtin_altivec_vminsh(__a, __b);
5724 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5726 return __builtin_altivec_vminsh((vector short)__a, __b);
5729 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5730 vector bool short __b) {
5731 return __builtin_altivec_vminsh(__a, (vector short)__b);
5734 static __inline__ vector unsigned short __ATTRS_o_ai
5735 vec_min(vector unsigned short __a, vector unsigned short __b) {
5736 return __builtin_altivec_vminuh(__a, __b);
5739 static __inline__ vector unsigned short __ATTRS_o_ai
5740 vec_min(vector bool short __a, vector unsigned short __b) {
5741 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5744 static __inline__ vector unsigned short __ATTRS_o_ai
5745 vec_min(vector unsigned short __a, vector bool short __b) {
5746 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5749 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5751 return __builtin_altivec_vminsw(__a, __b);
5754 static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5756 return __builtin_altivec_vminsw((vector int)__a, __b);
5759 static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5760 vector bool int __b) {
5761 return __builtin_altivec_vminsw(__a, (vector int)__b);
5764 static __inline__ vector unsigned int __ATTRS_o_ai
5765 vec_min(vector unsigned int __a, vector unsigned int __b) {
5766 return __builtin_altivec_vminuw(__a, __b);
5769 static __inline__ vector unsigned int __ATTRS_o_ai
5770 vec_min(vector bool int __a, vector unsigned int __b) {
5771 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5774 static __inline__ vector unsigned int __ATTRS_o_ai
5775 vec_min(vector unsigned int __a, vector bool int __b) {
5776 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5779 #ifdef __POWER8_VECTOR__
5780 static __inline__ vector signed long long __ATTRS_o_ai
5781 vec_min(vector signed long long __a, vector signed long long __b) {
5782 return __builtin_altivec_vminsd(__a, __b);
5785 static __inline__ vector signed long long __ATTRS_o_ai
5786 vec_min(vector bool long long __a, vector signed long long __b) {
5787 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5790 static __inline__ vector signed long long __ATTRS_o_ai
5791 vec_min(vector signed long long __a, vector bool long long __b) {
5792 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5795 static __inline__ vector unsigned long long __ATTRS_o_ai
5796 vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5797 return __builtin_altivec_vminud(__a, __b);
5800 static __inline__ vector unsigned long long __ATTRS_o_ai
5801 vec_min(vector bool long long __a, vector unsigned long long __b) {
5802 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5805 static __inline__ vector unsigned long long __ATTRS_o_ai
5806 vec_min(vector unsigned long long __a, vector bool long long __b) {
5807 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5811 static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5814 return __builtin_vsx_xvminsp(__a, __b);
5816 return __builtin_altivec_vminfp(__a, __b);
5821 static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5822 vector double __b) {
5823 return __builtin_vsx_xvmindp(__a, __b);
5829 static __inline__ vector signed char __ATTRS_o_ai
5830 vec_vminsb(vector signed char __a, vector signed char __b) {
5831 return __builtin_altivec_vminsb(__a, __b);
5834 static __inline__ vector signed char __ATTRS_o_ai
5835 vec_vminsb(vector bool char __a, vector signed char __b) {
5836 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5839 static __inline__ vector signed char __ATTRS_o_ai
5840 vec_vminsb(vector signed char __a, vector bool char __b) {
5841 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5846 static __inline__ vector unsigned char __ATTRS_o_ai
5847 vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5848 return __builtin_altivec_vminub(__a, __b);
5851 static __inline__ vector unsigned char __ATTRS_o_ai
5852 vec_vminub(vector bool char __a, vector unsigned char __b) {
5853 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5856 static __inline__ vector unsigned char __ATTRS_o_ai
5857 vec_vminub(vector unsigned char __a, vector bool char __b) {
5858 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5863 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5865 return __builtin_altivec_vminsh(__a, __b);
5868 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5870 return __builtin_altivec_vminsh((vector short)__a, __b);
5873 static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5874 vector bool short __b) {
5875 return __builtin_altivec_vminsh(__a, (vector short)__b);
5880 static __inline__ vector unsigned short __ATTRS_o_ai
5881 vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5882 return __builtin_altivec_vminuh(__a, __b);
5885 static __inline__ vector unsigned short __ATTRS_o_ai
5886 vec_vminuh(vector bool short __a, vector unsigned short __b) {
5887 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5890 static __inline__ vector unsigned short __ATTRS_o_ai
5891 vec_vminuh(vector unsigned short __a, vector bool short __b) {
5892 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5897 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5899 return __builtin_altivec_vminsw(__a, __b);
5902 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5904 return __builtin_altivec_vminsw((vector int)__a, __b);
5907 static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5908 vector bool int __b) {
5909 return __builtin_altivec_vminsw(__a, (vector int)__b);
5914 static __inline__ vector unsigned int __ATTRS_o_ai
5915 vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5916 return __builtin_altivec_vminuw(__a, __b);
5919 static __inline__ vector unsigned int __ATTRS_o_ai
5920 vec_vminuw(vector bool int __a, vector unsigned int __b) {
5921 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5924 static __inline__ vector unsigned int __ATTRS_o_ai
5925 vec_vminuw(vector unsigned int __a, vector bool int __b) {
5926 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5931 static __inline__ vector float __attribute__((__always_inline__))
5932 vec_vminfp(vector float __a, vector float __b) {
5934 return __builtin_vsx_xvminsp(__a, __b);
5936 return __builtin_altivec_vminfp(__a, __b);
5942 #define __builtin_altivec_vmladduhm vec_mladd
5944 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5947 return __a * __b + __c;
5950 static __inline__ vector short __ATTRS_o_ai vec_mladd(
5951 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5952 return __a * (vector short)__b + (vector short)__c;
5955 static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5958 return (vector short)__a * __b + __c;
5961 static __inline__ vector unsigned short __ATTRS_o_ai
5962 vec_mladd(vector unsigned short __a, vector unsigned short __b,
5963 vector unsigned short __c) {
5964 return __a * __b + __c;
5969 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5972 return __a * __b + __c;
5975 static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5976 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5977 return __a * (vector short)__b + (vector short)__c;
5980 static __inline__ vector short __ATTRS_o_ai
5981 vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5982 return (vector short)__a * __b + __c;
5985 static __inline__ vector unsigned short __ATTRS_o_ai
5986 vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5987 vector unsigned short __c) {
5988 return __a * __b + __c;
5993 static __inline__ vector short __attribute__((__always_inline__))
5994 vec_mradds(vector short __a, vector short __b, vector short __c) {
5995 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5998 /* vec_vmhraddshs */
6000 static __inline__ vector short __attribute__((__always_inline__))
6001 vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
6002 return __builtin_altivec_vmhraddshs(__a, __b, __c);
6007 static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
6008 vector unsigned char __b,
6010 return __builtin_altivec_vmsummbm(__a, __b, __c);
6013 static __inline__ vector unsigned int __ATTRS_o_ai
6014 vec_msum(vector unsigned char __a, vector unsigned char __b,
6015 vector unsigned int __c) {
6016 return __builtin_altivec_vmsumubm(__a, __b, __c);
6019 static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
6022 return __builtin_altivec_vmsumshm(__a, __b, __c);
6025 static __inline__ vector unsigned int __ATTRS_o_ai
6026 vec_msum(vector unsigned short __a, vector unsigned short __b,
6027 vector unsigned int __c) {
6028 return __builtin_altivec_vmsumuhm(__a, __b, __c);
6033 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6034 static __inline__ vector unsigned __int128 __ATTRS_o_ai
6035 vec_msumc(vector unsigned long long __a, vector unsigned long long __b,
6036 vector unsigned __int128 __c) {
6037 return __builtin_altivec_vmsumcud(__a, __b, __c);
6043 static __inline__ vector int __attribute__((__always_inline__))
6044 vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
6045 return __builtin_altivec_vmsummbm(__a, __b, __c);
6050 static __inline__ vector unsigned int __attribute__((__always_inline__))
6051 vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
6052 vector unsigned int __c) {
6053 return __builtin_altivec_vmsumubm(__a, __b, __c);
6058 static __inline__ vector int __attribute__((__always_inline__))
6059 vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
6060 return __builtin_altivec_vmsumshm(__a, __b, __c);
6065 static __inline__ vector unsigned int __attribute__((__always_inline__))
6066 vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
6067 vector unsigned int __c) {
6068 return __builtin_altivec_vmsumuhm(__a, __b, __c);
6073 static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
6076 return __builtin_altivec_vmsumshs(__a, __b, __c);
6079 static __inline__ vector unsigned int __ATTRS_o_ai
6080 vec_msums(vector unsigned short __a, vector unsigned short __b,
6081 vector unsigned int __c) {
6082 return __builtin_altivec_vmsumuhs(__a, __b, __c);
6087 static __inline__ vector int __attribute__((__always_inline__))
6088 vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
6089 return __builtin_altivec_vmsumshs(__a, __b, __c);
6094 static __inline__ vector unsigned int __attribute__((__always_inline__))
6095 vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
6096 vector unsigned int __c) {
6097 return __builtin_altivec_vmsumuhs(__a, __b, __c);
6102 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
6103 __builtin_altivec_mtvscr((vector int)__a);
6106 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
6107 __builtin_altivec_mtvscr((vector int)__a);
6110 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
6111 __builtin_altivec_mtvscr((vector int)__a);
6114 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
6115 __builtin_altivec_mtvscr((vector int)__a);
6118 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
6119 __builtin_altivec_mtvscr((vector int)__a);
6122 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
6123 __builtin_altivec_mtvscr((vector int)__a);
6126 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
6127 __builtin_altivec_mtvscr((vector int)__a);
6130 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
6131 __builtin_altivec_mtvscr((vector int)__a);
6134 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
6135 __builtin_altivec_mtvscr((vector int)__a);
6138 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
6139 __builtin_altivec_mtvscr((vector int)__a);
6142 static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
6143 __builtin_altivec_mtvscr((vector int)__a);
6148 /* Integer vector multiplication will involve multiplication of the odd/even
6149 elements separately, then truncating the results and moving to the
6152 static __inline__ vector signed char __ATTRS_o_ai
6153 vec_mul(vector signed char __a, vector signed char __b) {
6157 static __inline__ vector unsigned char __ATTRS_o_ai
6158 vec_mul(vector unsigned char __a, vector unsigned char __b) {
6162 static __inline__ vector signed short __ATTRS_o_ai
6163 vec_mul(vector signed short __a, vector signed short __b) {
6167 static __inline__ vector unsigned short __ATTRS_o_ai
6168 vec_mul(vector unsigned short __a, vector unsigned short __b) {
6172 static __inline__ vector signed int __ATTRS_o_ai
6173 vec_mul(vector signed int __a, vector signed int __b) {
6177 static __inline__ vector unsigned int __ATTRS_o_ai
6178 vec_mul(vector unsigned int __a, vector unsigned int __b) {
6183 static __inline__ vector signed long long __ATTRS_o_ai
6184 vec_mul(vector signed long long __a, vector signed long long __b) {
6188 static __inline__ vector unsigned long long __ATTRS_o_ai
6189 vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
6194 static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
6200 static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
6201 vector double __b) {
6206 /* The vmulos* and vmules* instructions have a big endian bias, so
6207 we must reverse the meaning of "even" and "odd" for little endian. */
6211 static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
6212 vector signed char __b) {
6213 #ifdef __LITTLE_ENDIAN__
6214 return __builtin_altivec_vmulosb(__a, __b);
6216 return __builtin_altivec_vmulesb(__a, __b);
6220 static __inline__ vector unsigned short __ATTRS_o_ai
6221 vec_mule(vector unsigned char __a, vector unsigned char __b) {
6222 #ifdef __LITTLE_ENDIAN__
6223 return __builtin_altivec_vmuloub(__a, __b);
6225 return __builtin_altivec_vmuleub(__a, __b);
6229 static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
6231 #ifdef __LITTLE_ENDIAN__
6232 return __builtin_altivec_vmulosh(__a, __b);
6234 return __builtin_altivec_vmulesh(__a, __b);
6238 static __inline__ vector unsigned int __ATTRS_o_ai
6239 vec_mule(vector unsigned short __a, vector unsigned short __b) {
6240 #ifdef __LITTLE_ENDIAN__
6241 return __builtin_altivec_vmulouh(__a, __b);
6243 return __builtin_altivec_vmuleuh(__a, __b);
6247 #ifdef __POWER8_VECTOR__
6248 static __inline__ vector signed long long __ATTRS_o_ai
6249 vec_mule(vector signed int __a, vector signed int __b) {
6250 #ifdef __LITTLE_ENDIAN__
6251 return __builtin_altivec_vmulosw(__a, __b);
6253 return __builtin_altivec_vmulesw(__a, __b);
6257 static __inline__ vector unsigned long long __ATTRS_o_ai
6258 vec_mule(vector unsigned int __a, vector unsigned int __b) {
6259 #ifdef __LITTLE_ENDIAN__
6260 return __builtin_altivec_vmulouw(__a, __b);
6262 return __builtin_altivec_vmuleuw(__a, __b);
6267 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6268 static __inline__ vector signed __int128 __ATTRS_o_ai
6269 vec_mule(vector signed long long __a, vector signed long long __b) {
6270 #ifdef __LITTLE_ENDIAN__
6271 return __builtin_altivec_vmulosd(__a, __b);
6273 return __builtin_altivec_vmulesd(__a, __b);
6277 static __inline__ vector unsigned __int128 __ATTRS_o_ai
6278 vec_mule(vector unsigned long long __a, vector unsigned long long __b) {
6279 #ifdef __LITTLE_ENDIAN__
6280 return __builtin_altivec_vmuloud(__a, __b);
6282 return __builtin_altivec_vmuleud(__a, __b);
6289 static __inline__ vector short __attribute__((__always_inline__))
6290 vec_vmulesb(vector signed char __a, vector signed char __b) {
6291 #ifdef __LITTLE_ENDIAN__
6292 return __builtin_altivec_vmulosb(__a, __b);
6294 return __builtin_altivec_vmulesb(__a, __b);
6300 static __inline__ vector unsigned short __attribute__((__always_inline__))
6301 vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
6302 #ifdef __LITTLE_ENDIAN__
6303 return __builtin_altivec_vmuloub(__a, __b);
6305 return __builtin_altivec_vmuleub(__a, __b);
6311 static __inline__ vector int __attribute__((__always_inline__))
6312 vec_vmulesh(vector short __a, vector short __b) {
6313 #ifdef __LITTLE_ENDIAN__
6314 return __builtin_altivec_vmulosh(__a, __b);
6316 return __builtin_altivec_vmulesh(__a, __b);
6322 static __inline__ vector unsigned int __attribute__((__always_inline__))
6323 vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
6324 #ifdef __LITTLE_ENDIAN__
6325 return __builtin_altivec_vmulouh(__a, __b);
6327 return __builtin_altivec_vmuleuh(__a, __b);
6333 #ifdef __POWER10_VECTOR__
6334 static __inline__ vector signed int __ATTRS_o_ai
6335 vec_mulh(vector signed int __a, vector signed int __b) {
6336 return __builtin_altivec_vmulhsw(__a, __b);
6339 static __inline__ vector unsigned int __ATTRS_o_ai
6340 vec_mulh(vector unsigned int __a, vector unsigned int __b) {
6341 return __builtin_altivec_vmulhuw(__a, __b);
6344 static __inline__ vector signed long long __ATTRS_o_ai
6345 vec_mulh(vector signed long long __a, vector signed long long __b) {
6346 return __builtin_altivec_vmulhsd(__a, __b);
6349 static __inline__ vector unsigned long long __ATTRS_o_ai
6350 vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {
6351 return __builtin_altivec_vmulhud(__a, __b);
6357 static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
6358 vector signed char __b) {
6359 #ifdef __LITTLE_ENDIAN__
6360 return __builtin_altivec_vmulesb(__a, __b);
6362 return __builtin_altivec_vmulosb(__a, __b);
6366 static __inline__ vector unsigned short __ATTRS_o_ai
6367 vec_mulo(vector unsigned char __a, vector unsigned char __b) {
6368 #ifdef __LITTLE_ENDIAN__
6369 return __builtin_altivec_vmuleub(__a, __b);
6371 return __builtin_altivec_vmuloub(__a, __b);
6375 static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
6377 #ifdef __LITTLE_ENDIAN__
6378 return __builtin_altivec_vmulesh(__a, __b);
6380 return __builtin_altivec_vmulosh(__a, __b);
6384 static __inline__ vector unsigned int __ATTRS_o_ai
6385 vec_mulo(vector unsigned short __a, vector unsigned short __b) {
6386 #ifdef __LITTLE_ENDIAN__
6387 return __builtin_altivec_vmuleuh(__a, __b);
6389 return __builtin_altivec_vmulouh(__a, __b);
6393 #ifdef __POWER8_VECTOR__
6394 static __inline__ vector signed long long __ATTRS_o_ai
6395 vec_mulo(vector signed int __a, vector signed int __b) {
6396 #ifdef __LITTLE_ENDIAN__
6397 return __builtin_altivec_vmulesw(__a, __b);
6399 return __builtin_altivec_vmulosw(__a, __b);
6403 static __inline__ vector unsigned long long __ATTRS_o_ai
6404 vec_mulo(vector unsigned int __a, vector unsigned int __b) {
6405 #ifdef __LITTLE_ENDIAN__
6406 return __builtin_altivec_vmuleuw(__a, __b);
6408 return __builtin_altivec_vmulouw(__a, __b);
6413 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6414 static __inline__ vector signed __int128 __ATTRS_o_ai
6415 vec_mulo(vector signed long long __a, vector signed long long __b) {
6416 #ifdef __LITTLE_ENDIAN__
6417 return __builtin_altivec_vmulesd(__a, __b);
6419 return __builtin_altivec_vmulosd(__a, __b);
6423 static __inline__ vector unsigned __int128 __ATTRS_o_ai
6424 vec_mulo(vector unsigned long long __a, vector unsigned long long __b) {
6425 #ifdef __LITTLE_ENDIAN__
6426 return __builtin_altivec_vmuleud(__a, __b);
6428 return __builtin_altivec_vmuloud(__a, __b);
6435 static __inline__ vector short __attribute__((__always_inline__))
6436 vec_vmulosb(vector signed char __a, vector signed char __b) {
6437 #ifdef __LITTLE_ENDIAN__
6438 return __builtin_altivec_vmulesb(__a, __b);
6440 return __builtin_altivec_vmulosb(__a, __b);
6446 static __inline__ vector unsigned short __attribute__((__always_inline__))
6447 vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
6448 #ifdef __LITTLE_ENDIAN__
6449 return __builtin_altivec_vmuleub(__a, __b);
6451 return __builtin_altivec_vmuloub(__a, __b);
6457 static __inline__ vector int __attribute__((__always_inline__))
6458 vec_vmulosh(vector short __a, vector short __b) {
6459 #ifdef __LITTLE_ENDIAN__
6460 return __builtin_altivec_vmulesh(__a, __b);
6462 return __builtin_altivec_vmulosh(__a, __b);
6468 static __inline__ vector unsigned int __attribute__((__always_inline__))
6469 vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
6470 #ifdef __LITTLE_ENDIAN__
6471 return __builtin_altivec_vmuleuh(__a, __b);
6473 return __builtin_altivec_vmulouh(__a, __b);
6479 #ifdef __POWER8_VECTOR__
6480 static __inline__ vector signed char __ATTRS_o_ai
6481 vec_nand(vector signed char __a, vector signed char __b) {
6482 return ~(__a & __b);
6485 static __inline__ vector signed char __ATTRS_o_ai
6486 vec_nand(vector signed char __a, vector bool char __b) {
6487 return ~(__a & __b);
6490 static __inline__ vector signed char __ATTRS_o_ai
6491 vec_nand(vector bool char __a, vector signed char __b) {
6492 return ~(__a & __b);
6495 static __inline__ vector unsigned char __ATTRS_o_ai
6496 vec_nand(vector unsigned char __a, vector unsigned char __b) {
6497 return ~(__a & __b);
6500 static __inline__ vector unsigned char __ATTRS_o_ai
6501 vec_nand(vector unsigned char __a, vector bool char __b) {
6502 return ~(__a & __b);
6505 static __inline__ vector unsigned char __ATTRS_o_ai
6506 vec_nand(vector bool char __a, vector unsigned char __b) {
6507 return ~(__a & __b);
6510 static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
6511 vector bool char __b) {
6512 return ~(__a & __b);
6515 static __inline__ vector signed short __ATTRS_o_ai
6516 vec_nand(vector signed short __a, vector signed short __b) {
6517 return ~(__a & __b);
6520 static __inline__ vector signed short __ATTRS_o_ai
6521 vec_nand(vector signed short __a, vector bool short __b) {
6522 return ~(__a & __b);
6525 static __inline__ vector signed short __ATTRS_o_ai
6526 vec_nand(vector bool short __a, vector signed short __b) {
6527 return ~(__a & __b);
6530 static __inline__ vector unsigned short __ATTRS_o_ai
6531 vec_nand(vector unsigned short __a, vector unsigned short __b) {
6532 return ~(__a & __b);
6535 static __inline__ vector unsigned short __ATTRS_o_ai
6536 vec_nand(vector unsigned short __a, vector bool short __b) {
6537 return ~(__a & __b);
6540 static __inline__ vector bool short __ATTRS_o_ai
6541 vec_nand(vector bool short __a, vector bool short __b) {
6542 return ~(__a & __b);
6545 static __inline__ vector signed int __ATTRS_o_ai
6546 vec_nand(vector signed int __a, vector signed int __b) {
6547 return ~(__a & __b);
6550 static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
6551 vector bool int __b) {
6552 return ~(__a & __b);
6555 static __inline__ vector signed int __ATTRS_o_ai
6556 vec_nand(vector bool int __a, vector signed int __b) {
6557 return ~(__a & __b);
6560 static __inline__ vector unsigned int __ATTRS_o_ai
6561 vec_nand(vector unsigned int __a, vector unsigned int __b) {
6562 return ~(__a & __b);
6565 static __inline__ vector unsigned int __ATTRS_o_ai
6566 vec_nand(vector unsigned int __a, vector bool int __b) {
6567 return ~(__a & __b);
6570 static __inline__ vector unsigned int __ATTRS_o_ai
6571 vec_nand(vector bool int __a, vector unsigned int __b) {
6572 return ~(__a & __b);
6575 static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
6576 vector bool int __b) {
6577 return ~(__a & __b);
6580 static __inline__ vector float __ATTRS_o_ai
6581 vec_nand(vector float __a, vector float __b) {
6582 return (vector float)(~((vector unsigned int)__a &
6583 (vector unsigned int)__b));
6586 static __inline__ vector signed long long __ATTRS_o_ai
6587 vec_nand(vector signed long long __a, vector signed long long __b) {
6588 return ~(__a & __b);
6591 static __inline__ vector signed long long __ATTRS_o_ai
6592 vec_nand(vector signed long long __a, vector bool long long __b) {
6593 return ~(__a & __b);
6596 static __inline__ vector signed long long __ATTRS_o_ai
6597 vec_nand(vector bool long long __a, vector signed long long __b) {
6598 return ~(__a & __b);
6601 static __inline__ vector unsigned long long __ATTRS_o_ai
6602 vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
6603 return ~(__a & __b);
6606 static __inline__ vector unsigned long long __ATTRS_o_ai
6607 vec_nand(vector unsigned long long __a, vector bool long long __b) {
6608 return ~(__a & __b);
6611 static __inline__ vector unsigned long long __ATTRS_o_ai
6612 vec_nand(vector bool long long __a, vector unsigned long long __b) {
6613 return ~(__a & __b);
6616 static __inline__ vector bool long long __ATTRS_o_ai
6617 vec_nand(vector bool long long __a, vector bool long long __b) {
6618 return ~(__a & __b);
6621 static __inline__ vector double __ATTRS_o_ai
6622 vec_nand(vector double __a, vector double __b) {
6623 return (vector double)(~((vector unsigned long long)__a &
6624 (vector unsigned long long)__b));
6632 static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6635 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6638 static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6640 vector double __c) {
6641 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6647 static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6651 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6653 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6658 static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6660 vector double __c) {
6661 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6667 static __inline__ vector float __attribute__((__always_inline__))
6668 vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6669 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6674 #define __builtin_altivec_vnor vec_nor
6676 static __inline__ vector signed char __ATTRS_o_ai
6677 vec_nor(vector signed char __a, vector signed char __b) {
6678 return ~(__a | __b);
6681 static __inline__ vector unsigned char __ATTRS_o_ai
6682 vec_nor(vector unsigned char __a, vector unsigned char __b) {
6683 return ~(__a | __b);
6686 static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6687 vector bool char __b) {
6688 return ~(__a | __b);
6691 static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6693 return ~(__a | __b);
6696 static __inline__ vector unsigned short __ATTRS_o_ai
6697 vec_nor(vector unsigned short __a, vector unsigned short __b) {
6698 return ~(__a | __b);
6701 static __inline__ vector bool short __ATTRS_o_ai
6702 vec_nor(vector bool short __a, vector bool short __b) {
6703 return ~(__a | __b);
6706 static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6708 return ~(__a | __b);
6711 static __inline__ vector unsigned int __ATTRS_o_ai
6712 vec_nor(vector unsigned int __a, vector unsigned int __b) {
6713 return ~(__a | __b);
6716 static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6717 vector bool int __b) {
6718 return ~(__a | __b);
6721 static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6723 vector unsigned int __res =
6724 ~((vector unsigned int)__a | (vector unsigned int)__b);
6725 return (vector float)__res;
6729 static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6730 vector double __b) {
6731 vector unsigned long long __res =
6732 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6733 return (vector double)__res;
6739 static __inline__ vector signed char __ATTRS_o_ai
6740 vec_vnor(vector signed char __a, vector signed char __b) {
6741 return ~(__a | __b);
6744 static __inline__ vector unsigned char __ATTRS_o_ai
6745 vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6746 return ~(__a | __b);
6749 static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6750 vector bool char __b) {
6751 return ~(__a | __b);
6754 static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6756 return ~(__a | __b);
6759 static __inline__ vector unsigned short __ATTRS_o_ai
6760 vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6761 return ~(__a | __b);
6764 static __inline__ vector bool short __ATTRS_o_ai
6765 vec_vnor(vector bool short __a, vector bool short __b) {
6766 return ~(__a | __b);
6769 static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6771 return ~(__a | __b);
6774 static __inline__ vector unsigned int __ATTRS_o_ai
6775 vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6776 return ~(__a | __b);
6779 static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6780 vector bool int __b) {
6781 return ~(__a | __b);
6784 static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6786 vector unsigned int __res =
6787 ~((vector unsigned int)__a | (vector unsigned int)__b);
6788 return (vector float)__res;
6792 static __inline__ vector signed long long __ATTRS_o_ai
6793 vec_nor(vector signed long long __a, vector signed long long __b) {
6794 return ~(__a | __b);
6797 static __inline__ vector unsigned long long __ATTRS_o_ai
6798 vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6799 return ~(__a | __b);
6802 static __inline__ vector bool long long __ATTRS_o_ai
6803 vec_nor(vector bool long long __a, vector bool long long __b) {
6804 return ~(__a | __b);
6810 #define __builtin_altivec_vor vec_or
6812 static __inline__ vector signed char __ATTRS_o_ai
6813 vec_or(vector signed char __a, vector signed char __b) {
6817 static __inline__ vector signed char __ATTRS_o_ai
6818 vec_or(vector bool char __a, vector signed char __b) {
6819 return (vector signed char)__a | __b;
6822 static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6823 vector bool char __b) {
6824 return __a | (vector signed char)__b;
6827 static __inline__ vector unsigned char __ATTRS_o_ai
6828 vec_or(vector unsigned char __a, vector unsigned char __b) {
6832 static __inline__ vector unsigned char __ATTRS_o_ai
6833 vec_or(vector bool char __a, vector unsigned char __b) {
6834 return (vector unsigned char)__a | __b;
6837 static __inline__ vector unsigned char __ATTRS_o_ai
6838 vec_or(vector unsigned char __a, vector bool char __b) {
6839 return __a | (vector unsigned char)__b;
6842 static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6843 vector bool char __b) {
6847 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6852 static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6854 return (vector short)__a | __b;
6857 static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6858 vector bool short __b) {
6859 return __a | (vector short)__b;
6862 static __inline__ vector unsigned short __ATTRS_o_ai
6863 vec_or(vector unsigned short __a, vector unsigned short __b) {
6867 static __inline__ vector unsigned short __ATTRS_o_ai
6868 vec_or(vector bool short __a, vector unsigned short __b) {
6869 return (vector unsigned short)__a | __b;
6872 static __inline__ vector unsigned short __ATTRS_o_ai
6873 vec_or(vector unsigned short __a, vector bool short __b) {
6874 return __a | (vector unsigned short)__b;
6877 static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6878 vector bool short __b) {
6882 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6887 static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6889 return (vector int)__a | __b;
6892 static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6893 vector bool int __b) {
6894 return __a | (vector int)__b;
6897 static __inline__ vector unsigned int __ATTRS_o_ai
6898 vec_or(vector unsigned int __a, vector unsigned int __b) {
6902 static __inline__ vector unsigned int __ATTRS_o_ai
6903 vec_or(vector bool int __a, vector unsigned int __b) {
6904 return (vector unsigned int)__a | __b;
6907 static __inline__ vector unsigned int __ATTRS_o_ai
6908 vec_or(vector unsigned int __a, vector bool int __b) {
6909 return __a | (vector unsigned int)__b;
6912 static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6913 vector bool int __b) {
6917 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6919 vector unsigned int __res =
6920 (vector unsigned int)__a | (vector unsigned int)__b;
6921 return (vector float)__res;
6924 static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6926 vector unsigned int __res =
6927 (vector unsigned int)__a | (vector unsigned int)__b;
6928 return (vector float)__res;
6931 static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6932 vector bool int __b) {
6933 vector unsigned int __res =
6934 (vector unsigned int)__a | (vector unsigned int)__b;
6935 return (vector float)__res;
6939 static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6940 vector double __b) {
6941 return (vector double)((vector unsigned long long)__a |
6942 (vector unsigned long long)__b);
6945 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6946 vector bool long long __b) {
6947 return (vector double)((vector unsigned long long)__a |
6948 (vector unsigned long long)__b);
6951 static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6952 vector double __b) {
6953 return (vector double)((vector unsigned long long)__a |
6954 (vector unsigned long long)__b);
6957 static __inline__ vector signed long long __ATTRS_o_ai
6958 vec_or(vector signed long long __a, vector signed long long __b) {
6962 static __inline__ vector signed long long __ATTRS_o_ai
6963 vec_or(vector bool long long __a, vector signed long long __b) {
6964 return (vector signed long long)__a | __b;
6967 static __inline__ vector signed long long __ATTRS_o_ai
6968 vec_or(vector signed long long __a, vector bool long long __b) {
6969 return __a | (vector signed long long)__b;
6972 static __inline__ vector unsigned long long __ATTRS_o_ai
6973 vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6977 static __inline__ vector unsigned long long __ATTRS_o_ai
6978 vec_or(vector bool long long __a, vector unsigned long long __b) {
6979 return (vector unsigned long long)__a | __b;
6982 static __inline__ vector unsigned long long __ATTRS_o_ai
6983 vec_or(vector unsigned long long __a, vector bool long long __b) {
6984 return __a | (vector unsigned long long)__b;
6987 static __inline__ vector bool long long __ATTRS_o_ai
6988 vec_or(vector bool long long __a, vector bool long long __b) {
6993 #ifdef __POWER8_VECTOR__
6994 static __inline__ vector signed char __ATTRS_o_ai
6995 vec_orc(vector signed char __a, vector signed char __b) {
6999 static __inline__ vector signed char __ATTRS_o_ai
7000 vec_orc(vector signed char __a, vector bool char __b) {
7004 static __inline__ vector signed char __ATTRS_o_ai
7005 vec_orc(vector bool char __a, vector signed char __b) {
7009 static __inline__ vector unsigned char __ATTRS_o_ai
7010 vec_orc(vector unsigned char __a, vector unsigned char __b) {
7014 static __inline__ vector unsigned char __ATTRS_o_ai
7015 vec_orc(vector unsigned char __a, vector bool char __b) {
7019 static __inline__ vector unsigned char __ATTRS_o_ai
7020 vec_orc(vector bool char __a, vector unsigned char __b) {
7024 static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
7025 vector bool char __b) {
7029 static __inline__ vector signed short __ATTRS_o_ai
7030 vec_orc(vector signed short __a, vector signed short __b) {
7034 static __inline__ vector signed short __ATTRS_o_ai
7035 vec_orc(vector signed short __a, vector bool short __b) {
7039 static __inline__ vector signed short __ATTRS_o_ai
7040 vec_orc(vector bool short __a, vector signed short __b) {
7044 static __inline__ vector unsigned short __ATTRS_o_ai
7045 vec_orc(vector unsigned short __a, vector unsigned short __b) {
7049 static __inline__ vector unsigned short __ATTRS_o_ai
7050 vec_orc(vector unsigned short __a, vector bool short __b) {
7054 static __inline__ vector unsigned short __ATTRS_o_ai
7055 vec_orc(vector bool short __a, vector unsigned short __b) {
7059 static __inline__ vector bool short __ATTRS_o_ai
7060 vec_orc(vector bool short __a, vector bool short __b) {
7064 static __inline__ vector signed int __ATTRS_o_ai
7065 vec_orc(vector signed int __a, vector signed int __b) {
7069 static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
7070 vector bool int __b) {
7074 static __inline__ vector signed int __ATTRS_o_ai
7075 vec_orc(vector bool int __a, vector signed int __b) {
7079 static __inline__ vector unsigned int __ATTRS_o_ai
7080 vec_orc(vector unsigned int __a, vector unsigned int __b) {
7084 static __inline__ vector unsigned int __ATTRS_o_ai
7085 vec_orc(vector unsigned int __a, vector bool int __b) {
7089 static __inline__ vector unsigned int __ATTRS_o_ai
7090 vec_orc(vector bool int __a, vector unsigned int __b) {
7094 static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
7095 vector bool int __b) {
7099 static __inline__ vector float __ATTRS_o_ai
7100 vec_orc(vector bool int __a, vector float __b) {
7101 return (vector float)(__a | ~(vector unsigned int)__b);
7104 static __inline__ vector float __ATTRS_o_ai
7105 vec_orc(vector float __a, vector bool int __b) {
7106 return (vector float)((vector unsigned int)__a | ~__b);
7109 static __inline__ vector signed long long __ATTRS_o_ai
7110 vec_orc(vector signed long long __a, vector signed long long __b) {
7114 static __inline__ vector signed long long __ATTRS_o_ai
7115 vec_orc(vector signed long long __a, vector bool long long __b) {
7119 static __inline__ vector signed long long __ATTRS_o_ai
7120 vec_orc(vector bool long long __a, vector signed long long __b) {
7124 static __inline__ vector unsigned long long __ATTRS_o_ai
7125 vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
7129 static __inline__ vector unsigned long long __ATTRS_o_ai
7130 vec_orc(vector unsigned long long __a, vector bool long long __b) {
7134 static __inline__ vector unsigned long long __ATTRS_o_ai
7135 vec_orc(vector bool long long __a, vector unsigned long long __b) {
7139 static __inline__ vector bool long long __ATTRS_o_ai
7140 vec_orc(vector bool long long __a, vector bool long long __b) {
7144 static __inline__ vector double __ATTRS_o_ai
7145 vec_orc(vector double __a, vector bool long long __b) {
7146 return (vector double)((vector unsigned long long)__a | ~__b);
7149 static __inline__ vector double __ATTRS_o_ai
7150 vec_orc(vector bool long long __a, vector double __b) {
7151 return (vector double)(__a | ~(vector unsigned long long)__b);
7157 static __inline__ vector signed char __ATTRS_o_ai
7158 vec_vor(vector signed char __a, vector signed char __b) {
7162 static __inline__ vector signed char __ATTRS_o_ai
7163 vec_vor(vector bool char __a, vector signed char __b) {
7164 return (vector signed char)__a | __b;
7167 static __inline__ vector signed char __ATTRS_o_ai
7168 vec_vor(vector signed char __a, vector bool char __b) {
7169 return __a | (vector signed char)__b;
7172 static __inline__ vector unsigned char __ATTRS_o_ai
7173 vec_vor(vector unsigned char __a, vector unsigned char __b) {
7177 static __inline__ vector unsigned char __ATTRS_o_ai
7178 vec_vor(vector bool char __a, vector unsigned char __b) {
7179 return (vector unsigned char)__a | __b;
7182 static __inline__ vector unsigned char __ATTRS_o_ai
7183 vec_vor(vector unsigned char __a, vector bool char __b) {
7184 return __a | (vector unsigned char)__b;
7187 static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
7188 vector bool char __b) {
7192 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
7197 static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
7199 return (vector short)__a | __b;
7202 static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
7203 vector bool short __b) {
7204 return __a | (vector short)__b;
7207 static __inline__ vector unsigned short __ATTRS_o_ai
7208 vec_vor(vector unsigned short __a, vector unsigned short __b) {
7212 static __inline__ vector unsigned short __ATTRS_o_ai
7213 vec_vor(vector bool short __a, vector unsigned short __b) {
7214 return (vector unsigned short)__a | __b;
7217 static __inline__ vector unsigned short __ATTRS_o_ai
7218 vec_vor(vector unsigned short __a, vector bool short __b) {
7219 return __a | (vector unsigned short)__b;
7222 static __inline__ vector bool short __ATTRS_o_ai
7223 vec_vor(vector bool short __a, vector bool short __b) {
7227 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
7232 static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
7234 return (vector int)__a | __b;
7237 static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
7238 vector bool int __b) {
7239 return __a | (vector int)__b;
7242 static __inline__ vector unsigned int __ATTRS_o_ai
7243 vec_vor(vector unsigned int __a, vector unsigned int __b) {
7247 static __inline__ vector unsigned int __ATTRS_o_ai
7248 vec_vor(vector bool int __a, vector unsigned int __b) {
7249 return (vector unsigned int)__a | __b;
7252 static __inline__ vector unsigned int __ATTRS_o_ai
7253 vec_vor(vector unsigned int __a, vector bool int __b) {
7254 return __a | (vector unsigned int)__b;
7257 static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
7258 vector bool int __b) {
7262 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
7264 vector unsigned int __res =
7265 (vector unsigned int)__a | (vector unsigned int)__b;
7266 return (vector float)__res;
7269 static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
7271 vector unsigned int __res =
7272 (vector unsigned int)__a | (vector unsigned int)__b;
7273 return (vector float)__res;
7276 static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
7277 vector bool int __b) {
7278 vector unsigned int __res =
7279 (vector unsigned int)__a | (vector unsigned int)__b;
7280 return (vector float)__res;
7284 static __inline__ vector signed long long __ATTRS_o_ai
7285 vec_vor(vector signed long long __a, vector signed long long __b) {
7289 static __inline__ vector signed long long __ATTRS_o_ai
7290 vec_vor(vector bool long long __a, vector signed long long __b) {
7291 return (vector signed long long)__a | __b;
7294 static __inline__ vector signed long long __ATTRS_o_ai
7295 vec_vor(vector signed long long __a, vector bool long long __b) {
7296 return __a | (vector signed long long)__b;
7299 static __inline__ vector unsigned long long __ATTRS_o_ai
7300 vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
7304 static __inline__ vector unsigned long long __ATTRS_o_ai
7305 vec_vor(vector bool long long __a, vector unsigned long long __b) {
7306 return (vector unsigned long long)__a | __b;
7309 static __inline__ vector unsigned long long __ATTRS_o_ai
7310 vec_vor(vector unsigned long long __a, vector bool long long __b) {
7311 return __a | (vector unsigned long long)__b;
7314 static __inline__ vector bool long long __ATTRS_o_ai
7315 vec_vor(vector bool long long __a, vector bool long long __b) {
7322 /* The various vector pack instructions have a big-endian bias, so for
7323 little endian we must handle reversed element numbering. */
7325 static __inline__ vector signed char __ATTRS_o_ai
7326 vec_pack(vector signed short __a, vector signed short __b) {
7327 #ifdef __LITTLE_ENDIAN__
7328 return (vector signed char)vec_perm(
7330 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7331 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7333 return (vector signed char)vec_perm(
7335 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7336 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7340 static __inline__ vector unsigned char __ATTRS_o_ai
7341 vec_pack(vector unsigned short __a, vector unsigned short __b) {
7342 #ifdef __LITTLE_ENDIAN__
7343 return (vector unsigned char)vec_perm(
7345 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7346 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7348 return (vector unsigned char)vec_perm(
7350 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7351 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7355 static __inline__ vector bool char __ATTRS_o_ai
7356 vec_pack(vector bool short __a, vector bool short __b) {
7357 #ifdef __LITTLE_ENDIAN__
7358 return (vector bool char)vec_perm(
7360 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7361 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7363 return (vector bool char)vec_perm(
7365 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7366 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7370 static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
7372 #ifdef __LITTLE_ENDIAN__
7373 return (vector short)vec_perm(
7375 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7376 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7378 return (vector short)vec_perm(
7380 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7381 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7385 static __inline__ vector unsigned short __ATTRS_o_ai
7386 vec_pack(vector unsigned int __a, vector unsigned int __b) {
7387 #ifdef __LITTLE_ENDIAN__
7388 return (vector unsigned short)vec_perm(
7390 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7391 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7393 return (vector unsigned short)vec_perm(
7395 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7396 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7400 static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
7401 vector bool int __b) {
7402 #ifdef __LITTLE_ENDIAN__
7403 return (vector bool short)vec_perm(
7405 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7406 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7408 return (vector bool short)vec_perm(
7410 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7411 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7416 static __inline__ vector signed int __ATTRS_o_ai
7417 vec_pack(vector signed long long __a, vector signed long long __b) {
7418 #ifdef __LITTLE_ENDIAN__
7419 return (vector signed int)vec_perm(
7421 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7422 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7424 return (vector signed int)vec_perm(
7426 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7427 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7430 static __inline__ vector unsigned int __ATTRS_o_ai
7431 vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
7432 #ifdef __LITTLE_ENDIAN__
7433 return (vector unsigned int)vec_perm(
7435 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7436 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7438 return (vector unsigned int)vec_perm(
7440 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7441 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7445 static __inline__ vector bool int __ATTRS_o_ai
7446 vec_pack(vector bool long long __a, vector bool long long __b) {
7447 #ifdef __LITTLE_ENDIAN__
7448 return (vector bool int)vec_perm(
7450 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7451 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7453 return (vector bool int)vec_perm(
7455 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7456 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7460 static __inline__ vector float __ATTRS_o_ai
7461 vec_pack(vector double __a, vector double __b) {
7462 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
7466 #ifdef __POWER9_VECTOR__
7467 static __inline__ vector unsigned short __ATTRS_o_ai
7468 vec_pack_to_short_fp32(vector float __a, vector float __b) {
7469 vector float __resa = __builtin_vsx_xvcvsphp(__a);
7470 vector float __resb = __builtin_vsx_xvcvsphp(__b);
7471 #ifdef __LITTLE_ENDIAN__
7472 return (vector unsigned short)vec_mergee(__resa, __resb);
7474 return (vector unsigned short)vec_mergeo(__resa, __resb);
7481 #define __builtin_altivec_vpkuhum vec_vpkuhum
7483 static __inline__ vector signed char __ATTRS_o_ai
7484 vec_vpkuhum(vector signed short __a, vector signed short __b) {
7485 #ifdef __LITTLE_ENDIAN__
7486 return (vector signed char)vec_perm(
7488 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7489 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7491 return (vector signed char)vec_perm(
7493 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7494 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7498 static __inline__ vector unsigned char __ATTRS_o_ai
7499 vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
7500 #ifdef __LITTLE_ENDIAN__
7501 return (vector unsigned char)vec_perm(
7503 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7504 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7506 return (vector unsigned char)vec_perm(
7508 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7509 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7513 static __inline__ vector bool char __ATTRS_o_ai
7514 vec_vpkuhum(vector bool short __a, vector bool short __b) {
7515 #ifdef __LITTLE_ENDIAN__
7516 return (vector bool char)vec_perm(
7518 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7519 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7521 return (vector bool char)vec_perm(
7523 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7524 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7530 #define __builtin_altivec_vpkuwum vec_vpkuwum
7532 static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
7534 #ifdef __LITTLE_ENDIAN__
7535 return (vector short)vec_perm(
7537 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7538 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7540 return (vector short)vec_perm(
7542 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7543 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7547 static __inline__ vector unsigned short __ATTRS_o_ai
7548 vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
7549 #ifdef __LITTLE_ENDIAN__
7550 return (vector unsigned short)vec_perm(
7552 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7553 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7555 return (vector unsigned short)vec_perm(
7557 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7558 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7562 static __inline__ vector bool short __ATTRS_o_ai
7563 vec_vpkuwum(vector bool int __a, vector bool int __b) {
7564 #ifdef __LITTLE_ENDIAN__
7565 return (vector bool short)vec_perm(
7567 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7568 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7570 return (vector bool short)vec_perm(
7572 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7573 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7579 #ifdef __POWER8_VECTOR__
7580 #define __builtin_altivec_vpkudum vec_vpkudum
7582 static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
7583 vector long long __b) {
7584 #ifdef __LITTLE_ENDIAN__
7585 return (vector int)vec_perm(
7587 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7588 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7590 return (vector int)vec_perm(
7592 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7593 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7597 static __inline__ vector unsigned int __ATTRS_o_ai
7598 vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
7599 #ifdef __LITTLE_ENDIAN__
7600 return (vector unsigned int)vec_perm(
7602 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7603 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7605 return (vector unsigned int)vec_perm(
7607 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7608 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7612 static __inline__ vector bool int __ATTRS_o_ai
7613 vec_vpkudum(vector bool long long __a, vector bool long long __b) {
7614 #ifdef __LITTLE_ENDIAN__
7615 return (vector bool int)vec_perm(
7616 (vector long long)__a, (vector long long)__b,
7617 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7618 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7620 return (vector bool int)vec_perm(
7621 (vector long long)__a, (vector long long)__b,
7622 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7623 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7630 static __inline__ vector pixel __attribute__((__always_inline__))
7631 vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7632 #ifdef __LITTLE_ENDIAN__
7633 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7635 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7641 static __inline__ vector pixel __attribute__((__always_inline__))
7642 vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7643 #ifdef __LITTLE_ENDIAN__
7644 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7646 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7652 static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7654 #ifdef __LITTLE_ENDIAN__
7655 return __builtin_altivec_vpkshss(__b, __a);
7657 return __builtin_altivec_vpkshss(__a, __b);
7661 static __inline__ vector unsigned char __ATTRS_o_ai
7662 vec_packs(vector unsigned short __a, vector unsigned short __b) {
7663 #ifdef __LITTLE_ENDIAN__
7664 return __builtin_altivec_vpkuhus(__b, __a);
7666 return __builtin_altivec_vpkuhus(__a, __b);
7670 static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7672 #ifdef __LITTLE_ENDIAN__
7673 return __builtin_altivec_vpkswss(__b, __a);
7675 return __builtin_altivec_vpkswss(__a, __b);
7679 static __inline__ vector unsigned short __ATTRS_o_ai
7680 vec_packs(vector unsigned int __a, vector unsigned int __b) {
7681 #ifdef __LITTLE_ENDIAN__
7682 return __builtin_altivec_vpkuwus(__b, __a);
7684 return __builtin_altivec_vpkuwus(__a, __b);
7688 #ifdef __POWER8_VECTOR__
7689 static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7690 vector long long __b) {
7691 #ifdef __LITTLE_ENDIAN__
7692 return __builtin_altivec_vpksdss(__b, __a);
7694 return __builtin_altivec_vpksdss(__a, __b);
7698 static __inline__ vector unsigned int __ATTRS_o_ai
7699 vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7700 #ifdef __LITTLE_ENDIAN__
7701 return __builtin_altivec_vpkudus(__b, __a);
7703 return __builtin_altivec_vpkudus(__a, __b);
7710 static __inline__ vector signed char __attribute__((__always_inline__))
7711 vec_vpkshss(vector short __a, vector short __b) {
7712 #ifdef __LITTLE_ENDIAN__
7713 return __builtin_altivec_vpkshss(__b, __a);
7715 return __builtin_altivec_vpkshss(__a, __b);
7721 #ifdef __POWER8_VECTOR__
7722 static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7723 vector long long __b) {
7724 #ifdef __LITTLE_ENDIAN__
7725 return __builtin_altivec_vpksdss(__b, __a);
7727 return __builtin_altivec_vpksdss(__a, __b);
7734 static __inline__ vector unsigned char __attribute__((__always_inline__))
7735 vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7736 #ifdef __LITTLE_ENDIAN__
7737 return __builtin_altivec_vpkuhus(__b, __a);
7739 return __builtin_altivec_vpkuhus(__a, __b);
7745 #ifdef __POWER8_VECTOR__
7746 static __inline__ vector unsigned int __attribute__((__always_inline__))
7747 vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7748 #ifdef __LITTLE_ENDIAN__
7749 return __builtin_altivec_vpkudus(__b, __a);
7751 return __builtin_altivec_vpkudus(__a, __b);
7758 static __inline__ vector signed short __attribute__((__always_inline__))
7759 vec_vpkswss(vector int __a, vector int __b) {
7760 #ifdef __LITTLE_ENDIAN__
7761 return __builtin_altivec_vpkswss(__b, __a);
7763 return __builtin_altivec_vpkswss(__a, __b);
7769 static __inline__ vector unsigned short __attribute__((__always_inline__))
7770 vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7771 #ifdef __LITTLE_ENDIAN__
7772 return __builtin_altivec_vpkuwus(__b, __a);
7774 return __builtin_altivec_vpkuwus(__a, __b);
7780 static __inline__ vector unsigned char __ATTRS_o_ai
7781 vec_packsu(vector short __a, vector short __b) {
7782 #ifdef __LITTLE_ENDIAN__
7783 return __builtin_altivec_vpkshus(__b, __a);
7785 return __builtin_altivec_vpkshus(__a, __b);
7789 static __inline__ vector unsigned char __ATTRS_o_ai
7790 vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7791 #ifdef __LITTLE_ENDIAN__
7792 return __builtin_altivec_vpkuhus(__b, __a);
7794 return __builtin_altivec_vpkuhus(__a, __b);
7798 static __inline__ vector unsigned short __ATTRS_o_ai
7799 vec_packsu(vector int __a, vector int __b) {
7800 #ifdef __LITTLE_ENDIAN__
7801 return __builtin_altivec_vpkswus(__b, __a);
7803 return __builtin_altivec_vpkswus(__a, __b);
7807 static __inline__ vector unsigned short __ATTRS_o_ai
7808 vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7809 #ifdef __LITTLE_ENDIAN__
7810 return __builtin_altivec_vpkuwus(__b, __a);
7812 return __builtin_altivec_vpkuwus(__a, __b);
7816 #ifdef __POWER8_VECTOR__
7817 static __inline__ vector unsigned int __ATTRS_o_ai
7818 vec_packsu(vector long long __a, vector long long __b) {
7819 #ifdef __LITTLE_ENDIAN__
7820 return __builtin_altivec_vpksdus(__b, __a);
7822 return __builtin_altivec_vpksdus(__a, __b);
7826 static __inline__ vector unsigned int __ATTRS_o_ai
7827 vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7828 #ifdef __LITTLE_ENDIAN__
7829 return __builtin_altivec_vpkudus(__b, __a);
7831 return __builtin_altivec_vpkudus(__a, __b);
7838 static __inline__ vector unsigned char __ATTRS_o_ai
7839 vec_vpkshus(vector short __a, vector short __b) {
7840 #ifdef __LITTLE_ENDIAN__
7841 return __builtin_altivec_vpkshus(__b, __a);
7843 return __builtin_altivec_vpkshus(__a, __b);
7847 static __inline__ vector unsigned char __ATTRS_o_ai
7848 vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7849 #ifdef __LITTLE_ENDIAN__
7850 return __builtin_altivec_vpkuhus(__b, __a);
7852 return __builtin_altivec_vpkuhus(__a, __b);
7858 static __inline__ vector unsigned short __ATTRS_o_ai
7859 vec_vpkswus(vector int __a, vector int __b) {
7860 #ifdef __LITTLE_ENDIAN__
7861 return __builtin_altivec_vpkswus(__b, __a);
7863 return __builtin_altivec_vpkswus(__a, __b);
7867 static __inline__ vector unsigned short __ATTRS_o_ai
7868 vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7869 #ifdef __LITTLE_ENDIAN__
7870 return __builtin_altivec_vpkuwus(__b, __a);
7872 return __builtin_altivec_vpkuwus(__a, __b);
7878 #ifdef __POWER8_VECTOR__
7879 static __inline__ vector unsigned int __ATTRS_o_ai
7880 vec_vpksdus(vector long long __a, vector long long __b) {
7881 #ifdef __LITTLE_ENDIAN__
7882 return __builtin_altivec_vpksdus(__b, __a);
7884 return __builtin_altivec_vpksdus(__a, __b);
7891 // The vperm instruction is defined architecturally with a big-endian bias.
7892 // For little endian, we swap the input operands and invert the permute
7893 // control vector. Only the rightmost 5 bits matter, so we could use
7894 // a vector of all 31s instead of all 255s to perform the inversion.
7895 // However, when the PCV is not a constant, using 255 has an advantage
7896 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7897 // later, possibly a vec_nand).
7899 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7900 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7901 #ifdef __LITTLE_ENDIAN__
7902 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7903 255, 255, 255, 255, 255, 255, 255, 255};
7904 __d = vec_xor(__c, __d);
7905 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7906 (vector int)__a, __d);
7908 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7909 (vector int)__b, __c);
7913 static __inline__ vector unsigned char __ATTRS_o_ai
7914 vec_perm(vector unsigned char __a, vector unsigned char __b,
7915 vector unsigned char __c) {
7916 #ifdef __LITTLE_ENDIAN__
7917 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7918 255, 255, 255, 255, 255, 255, 255, 255};
7919 __d = vec_xor(__c, __d);
7920 return (vector unsigned char)__builtin_altivec_vperm_4si(
7921 (vector int)__b, (vector int)__a, __d);
7923 return (vector unsigned char)__builtin_altivec_vperm_4si(
7924 (vector int)__a, (vector int)__b, __c);
7928 static __inline__ vector bool char __ATTRS_o_ai
7929 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7930 #ifdef __LITTLE_ENDIAN__
7931 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7932 255, 255, 255, 255, 255, 255, 255, 255};
7933 __d = vec_xor(__c, __d);
7934 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7935 (vector int)__a, __d);
7937 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7938 (vector int)__b, __c);
7942 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7943 vector signed short __b,
7944 vector unsigned char __c) {
7945 #ifdef __LITTLE_ENDIAN__
7946 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7947 255, 255, 255, 255, 255, 255, 255, 255};
7948 __d = vec_xor(__c, __d);
7949 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7950 (vector int)__a, __d);
7952 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7953 (vector int)__b, __c);
7957 static __inline__ vector unsigned short __ATTRS_o_ai
7958 vec_perm(vector unsigned short __a, vector unsigned short __b,
7959 vector unsigned char __c) {
7960 #ifdef __LITTLE_ENDIAN__
7961 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7962 255, 255, 255, 255, 255, 255, 255, 255};
7963 __d = vec_xor(__c, __d);
7964 return (vector unsigned short)__builtin_altivec_vperm_4si(
7965 (vector int)__b, (vector int)__a, __d);
7967 return (vector unsigned short)__builtin_altivec_vperm_4si(
7968 (vector int)__a, (vector int)__b, __c);
7972 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7973 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7974 #ifdef __LITTLE_ENDIAN__
7975 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7976 255, 255, 255, 255, 255, 255, 255, 255};
7977 __d = vec_xor(__c, __d);
7978 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7979 (vector int)__a, __d);
7981 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7982 (vector int)__b, __c);
7986 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7988 vector unsigned char __c) {
7989 #ifdef __LITTLE_ENDIAN__
7990 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7991 255, 255, 255, 255, 255, 255, 255, 255};
7992 __d = vec_xor(__c, __d);
7993 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7994 (vector int)__a, __d);
7996 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7997 (vector int)__b, __c);
8001 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
8002 vector signed int __b,
8003 vector unsigned char __c) {
8004 #ifdef __LITTLE_ENDIAN__
8005 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8006 255, 255, 255, 255, 255, 255, 255, 255};
8007 __d = vec_xor(__c, __d);
8008 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
8010 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
8014 static __inline__ vector unsigned int __ATTRS_o_ai
8015 vec_perm(vector unsigned int __a, vector unsigned int __b,
8016 vector unsigned char __c) {
8017 #ifdef __LITTLE_ENDIAN__
8018 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8019 255, 255, 255, 255, 255, 255, 255, 255};
8020 __d = vec_xor(__c, __d);
8021 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
8022 (vector int)__a, __d);
8024 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
8025 (vector int)__b, __c);
8029 static __inline__ vector bool int __ATTRS_o_ai
8030 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
8031 #ifdef __LITTLE_ENDIAN__
8032 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8033 255, 255, 255, 255, 255, 255, 255, 255};
8034 __d = vec_xor(__c, __d);
8035 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
8036 (vector int)__a, __d);
8038 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
8039 (vector int)__b, __c);
8043 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
8045 vector unsigned char __c) {
8046 #ifdef __LITTLE_ENDIAN__
8047 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8048 255, 255, 255, 255, 255, 255, 255, 255};
8049 __d = vec_xor(__c, __d);
8050 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
8051 (vector int)__a, __d);
8053 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
8054 (vector int)__b, __c);
8059 static __inline__ vector long long __ATTRS_o_ai
8060 vec_perm(vector signed long long __a, vector signed long long __b,
8061 vector unsigned char __c) {
8062 #ifdef __LITTLE_ENDIAN__
8063 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8064 255, 255, 255, 255, 255, 255, 255, 255};
8065 __d = vec_xor(__c, __d);
8066 return (vector signed long long)__builtin_altivec_vperm_4si(
8067 (vector int)__b, (vector int)__a, __d);
8069 return (vector signed long long)__builtin_altivec_vperm_4si(
8070 (vector int)__a, (vector int)__b, __c);
8074 static __inline__ vector unsigned long long __ATTRS_o_ai
8075 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
8076 vector unsigned char __c) {
8077 #ifdef __LITTLE_ENDIAN__
8078 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8079 255, 255, 255, 255, 255, 255, 255, 255};
8080 __d = vec_xor(__c, __d);
8081 return (vector unsigned long long)__builtin_altivec_vperm_4si(
8082 (vector int)__b, (vector int)__a, __d);
8084 return (vector unsigned long long)__builtin_altivec_vperm_4si(
8085 (vector int)__a, (vector int)__b, __c);
8089 static __inline__ vector bool long long __ATTRS_o_ai
8090 vec_perm(vector bool long long __a, vector bool long long __b,
8091 vector unsigned char __c) {
8092 #ifdef __LITTLE_ENDIAN__
8093 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8094 255, 255, 255, 255, 255, 255, 255, 255};
8095 __d = vec_xor(__c, __d);
8096 return (vector bool long long)__builtin_altivec_vperm_4si(
8097 (vector int)__b, (vector int)__a, __d);
8099 return (vector bool long long)__builtin_altivec_vperm_4si(
8100 (vector int)__a, (vector int)__b, __c);
8104 static __inline__ vector double __ATTRS_o_ai
8105 vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
8106 #ifdef __LITTLE_ENDIAN__
8107 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8108 255, 255, 255, 255, 255, 255, 255, 255};
8109 __d = vec_xor(__c, __d);
8110 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
8111 (vector int)__a, __d);
8113 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
8114 (vector int)__b, __c);
8121 static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
8122 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8123 return vec_perm(__a, __b, __c);
8126 static __inline__ vector unsigned char __ATTRS_o_ai
8127 vec_vperm(vector unsigned char __a, vector unsigned char __b,
8128 vector unsigned char __c) {
8129 return vec_perm(__a, __b, __c);
8132 static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
8133 vector bool char __a, vector bool char __b, vector unsigned char __c) {
8134 return vec_perm(__a, __b, __c);
8137 static __inline__ vector short __ATTRS_o_ai
8138 vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
8139 return vec_perm(__a, __b, __c);
8142 static __inline__ vector unsigned short __ATTRS_o_ai
8143 vec_vperm(vector unsigned short __a, vector unsigned short __b,
8144 vector unsigned char __c) {
8145 return vec_perm(__a, __b, __c);
8148 static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
8149 vector bool short __a, vector bool short __b, vector unsigned char __c) {
8150 return vec_perm(__a, __b, __c);
8153 static __inline__ vector pixel __ATTRS_o_ai
8154 vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
8155 return vec_perm(__a, __b, __c);
8158 static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
8160 vector unsigned char __c) {
8161 return vec_perm(__a, __b, __c);
8164 static __inline__ vector unsigned int __ATTRS_o_ai
8165 vec_vperm(vector unsigned int __a, vector unsigned int __b,
8166 vector unsigned char __c) {
8167 return vec_perm(__a, __b, __c);
8170 static __inline__ vector bool int __ATTRS_o_ai
8171 vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
8172 return vec_perm(__a, __b, __c);
8175 static __inline__ vector float __ATTRS_o_ai
8176 vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
8177 return vec_perm(__a, __b, __c);
8181 static __inline__ vector long long __ATTRS_o_ai vec_vperm(
8182 vector long long __a, vector long long __b, vector unsigned char __c) {
8183 return vec_perm(__a, __b, __c);
8186 static __inline__ vector unsigned long long __ATTRS_o_ai
8187 vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
8188 vector unsigned char __c) {
8189 return vec_perm(__a, __b, __c);
8192 static __inline__ vector double __ATTRS_o_ai
8193 vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
8194 return vec_perm(__a, __b, __c);
8200 static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
8202 return __builtin_vsx_xvresp(__a);
8204 return __builtin_altivec_vrefp(__a);
8209 static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
8210 return __builtin_vsx_xvredp(__a);
8216 static __inline__ vector float __attribute__((__always_inline__))
8217 vec_vrefp(vector float __a) {
8218 return __builtin_altivec_vrefp(__a);
8223 static __inline__ vector signed char __ATTRS_o_ai
8224 vec_rl(vector signed char __a, vector unsigned char __b) {
8225 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
8228 static __inline__ vector unsigned char __ATTRS_o_ai
8229 vec_rl(vector unsigned char __a, vector unsigned char __b) {
8230 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
8233 static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
8234 vector unsigned short __b) {
8235 return __builtin_altivec_vrlh(__a, __b);
8238 static __inline__ vector unsigned short __ATTRS_o_ai
8239 vec_rl(vector unsigned short __a, vector unsigned short __b) {
8240 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
8243 static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
8244 vector unsigned int __b) {
8245 return __builtin_altivec_vrlw(__a, __b);
8248 static __inline__ vector unsigned int __ATTRS_o_ai
8249 vec_rl(vector unsigned int __a, vector unsigned int __b) {
8250 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
8253 #ifdef __POWER8_VECTOR__
8254 static __inline__ vector signed long long __ATTRS_o_ai
8255 vec_rl(vector signed long long __a, vector unsigned long long __b) {
8256 return __builtin_altivec_vrld(__a, __b);
8259 static __inline__ vector unsigned long long __ATTRS_o_ai
8260 vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
8261 return __builtin_altivec_vrld(__a, __b);
8265 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8266 static __inline__ vector signed __int128 __ATTRS_o_ai
8267 vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {
8268 return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector signed __int128)) - __a));
8271 static __inline__ vector unsigned __int128 __ATTRS_o_ai
8272 vec_rl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
8273 return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector unsigned __int128)) - __a));
8278 #ifdef __POWER9_VECTOR__
8279 static __inline__ vector unsigned int __ATTRS_o_ai
8280 vec_rlmi(vector unsigned int __a, vector unsigned int __b,
8281 vector unsigned int __c) {
8282 return __builtin_altivec_vrlwmi(__a, __c, __b);
8285 static __inline__ vector unsigned long long __ATTRS_o_ai
8286 vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
8287 vector unsigned long long __c) {
8288 return __builtin_altivec_vrldmi(__a, __c, __b);
8292 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8293 static __inline__ vector unsigned __int128 __ATTRS_o_ai
8294 vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,
8295 vector unsigned __int128 __c) {
8296 return __builtin_altivec_vrlqmi(__a, __c, __b);
8299 static __inline__ vector signed __int128 __ATTRS_o_ai
8300 vec_rlmi(vector signed __int128 __a, vector signed __int128 __b,
8301 vector signed __int128 __c) {
8302 return __builtin_altivec_vrlqmi(__a, __c, __b);
8307 #ifdef __POWER9_VECTOR__
8308 static __inline__ vector unsigned int __ATTRS_o_ai
8309 vec_rlnm(vector unsigned int __a, vector unsigned int __b,
8310 vector unsigned int __c) {
8311 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
8312 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
8315 static __inline__ vector unsigned long long __ATTRS_o_ai
8316 vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
8317 vector unsigned long long __c) {
8318 vector unsigned long long OneByte = { 0x8, 0x8 };
8319 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
8323 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8324 static __inline__ vector unsigned __int128 __ATTRS_o_ai
8325 vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,
8326 vector unsigned __int128 __c) {
8327 // Merge __b and __c using an appropriate shuffle.
8328 vector unsigned char TmpB = (vector unsigned char)__b;
8329 vector unsigned char TmpC = (vector unsigned char)__c;
8330 vector unsigned char MaskAndShift =
8331 #ifdef __LITTLE_ENDIAN__
8332 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8333 1, -1, -1, -1, -1, -1);
8335 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8336 -1, -1, -1, -1, -1, -1, -1);
8338 return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);
8341 static __inline__ vector signed __int128 __ATTRS_o_ai
8342 vec_rlnm(vector signed __int128 __a, vector signed __int128 __b,
8343 vector signed __int128 __c) {
8344 // Merge __b and __c using an appropriate shuffle.
8345 vector unsigned char TmpB = (vector unsigned char)__b;
8346 vector unsigned char TmpC = (vector unsigned char)__c;
8347 vector unsigned char MaskAndShift =
8348 #ifdef __LITTLE_ENDIAN__
8349 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8350 1, -1, -1, -1, -1, -1);
8352 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8353 -1, -1, -1, -1, -1, -1, -1);
8355 return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);
8361 static __inline__ vector signed char __ATTRS_o_ai
8362 vec_vrlb(vector signed char __a, vector unsigned char __b) {
8363 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
8366 static __inline__ vector unsigned char __ATTRS_o_ai
8367 vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
8368 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
8373 static __inline__ vector short __ATTRS_o_ai
8374 vec_vrlh(vector short __a, vector unsigned short __b) {
8375 return __builtin_altivec_vrlh(__a, __b);
8378 static __inline__ vector unsigned short __ATTRS_o_ai
8379 vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
8380 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
8385 static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
8386 vector unsigned int __b) {
8387 return __builtin_altivec_vrlw(__a, __b);
8390 static __inline__ vector unsigned int __ATTRS_o_ai
8391 vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
8392 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
8397 static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
8398 return __builtin_altivec_vrfin(__a);
8402 static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
8403 return __builtin_vsx_xvrdpi(__a);
8408 static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
8409 return __builtin_vsx_xvrspic(__a);
8412 static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
8413 return __builtin_vsx_xvrdpic(__a);
8418 static __inline__ vector float __ATTRS_o_ai vec_roundc(vector float __a) {
8419 return __builtin_vsx_xvrspic(__a);
8422 static __inline__ vector double __ATTRS_o_ai vec_roundc(vector double __a) {
8423 return __builtin_vsx_xvrdpic(__a);
8428 static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
8429 return __builtin_vsx_xvrspi(__a);
8432 static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
8433 return __builtin_vsx_xvrdpi(__a);
8439 static __inline__ vector float __attribute__((__always_inline__))
8440 vec_vrfin(vector float __a) {
8441 return __builtin_altivec_vrfin(__a);
8447 static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
8448 return __builtin_vsx_xvsqrtsp(__a);
8451 static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
8452 return __builtin_vsx_xvsqrtdp(__a);
8458 static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
8460 return __builtin_vsx_xvrsqrtesp(__a);
8462 return __builtin_altivec_vrsqrtefp(__a);
8467 static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
8468 return __builtin_vsx_xvrsqrtedp(__a);
8472 static vector float __ATTRS_o_ai vec_rsqrt(vector float __a) {
8473 return __builtin_ppc_rsqrtf(__a);
8477 static vector double __ATTRS_o_ai vec_rsqrt(vector double __a) {
8478 return __builtin_ppc_rsqrtd(__a);
8484 static __inline__ __vector float __attribute__((__always_inline__))
8485 vec_vrsqrtefp(vector float __a) {
8486 return __builtin_altivec_vrsqrtefp(__a);
8492 static __inline__ int __ATTRS_o_ai vec_test_swsqrt(vector double __a) {
8493 return __builtin_vsx_xvtsqrtdp(__a);
8496 static __inline__ int __ATTRS_o_ai vec_test_swsqrts(vector float __a) {
8497 return __builtin_vsx_xvtsqrtsp(__a);
8503 #define __builtin_altivec_vsel_4si vec_sel
8505 static __inline__ vector signed char __ATTRS_o_ai vec_sel(
8506 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8507 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8510 static __inline__ vector signed char __ATTRS_o_ai
8511 vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
8512 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8515 static __inline__ vector unsigned char __ATTRS_o_ai
8516 vec_sel(vector unsigned char __a, vector unsigned char __b,
8517 vector unsigned char __c) {
8518 return (__a & ~__c) | (__b & __c);
8521 static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
8522 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
8523 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
8526 static __inline__ vector bool char __ATTRS_o_ai
8527 vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
8528 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
8531 static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
8532 vector bool char __b,
8533 vector bool char __c) {
8534 return (__a & ~__c) | (__b & __c);
8537 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
8539 vector unsigned short __c) {
8540 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8543 static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
8545 vector bool short __c) {
8546 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8549 static __inline__ vector unsigned short __ATTRS_o_ai
8550 vec_sel(vector unsigned short __a, vector unsigned short __b,
8551 vector unsigned short __c) {
8552 return (__a & ~__c) | (__b & __c);
8555 static __inline__ vector unsigned short __ATTRS_o_ai
8556 vec_sel(vector unsigned short __a, vector unsigned short __b,
8557 vector bool short __c) {
8558 return (__a & ~(vector unsigned short)__c) |
8559 (__b & (vector unsigned short)__c);
8562 static __inline__ vector bool short __ATTRS_o_ai vec_sel(
8563 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8564 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8567 static __inline__ vector bool short __ATTRS_o_ai
8568 vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
8569 return (__a & ~__c) | (__b & __c);
8572 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
8574 vector unsigned int __c) {
8575 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8578 static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
8580 vector bool int __c) {
8581 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8584 static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
8585 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8586 return (__a & ~__c) | (__b & __c);
8589 static __inline__ vector unsigned int __ATTRS_o_ai
8590 vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8591 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8594 static __inline__ vector bool int __ATTRS_o_ai
8595 vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8596 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8599 static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
8600 vector bool int __b,
8601 vector bool int __c) {
8602 return (__a & ~__c) | (__b & __c);
8605 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
8607 vector unsigned int __c) {
8608 vector int __res = ((vector int)__a & ~(vector int)__c) |
8609 ((vector int)__b & (vector int)__c);
8610 return (vector float)__res;
8613 static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
8615 vector bool int __c) {
8616 vector int __res = ((vector int)__a & ~(vector int)__c) |
8617 ((vector int)__b & (vector int)__c);
8618 return (vector float)__res;
8622 static __inline__ vector double __ATTRS_o_ai
8623 vec_sel(vector double __a, vector double __b, vector bool long long __c) {
8624 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
8625 ((vector long long)__b & (vector long long)__c);
8626 return (vector double)__res;
8629 static __inline__ vector double __ATTRS_o_ai
8630 vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
8631 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
8632 ((vector long long)__b & (vector long long)__c);
8633 return (vector double)__res;
8636 static __inline__ vector bool long long __ATTRS_o_ai
8637 vec_sel(vector bool long long __a, vector bool long long __b,
8638 vector bool long long __c) {
8639 return (__a & ~__c) | (__b & __c);
8642 static __inline__ vector bool long long __ATTRS_o_ai
8643 vec_sel(vector bool long long __a, vector bool long long __b,
8644 vector unsigned long long __c) {
8645 return (__a & ~(vector bool long long)__c) |
8646 (__b & (vector bool long long)__c);
8649 static __inline__ vector signed long long __ATTRS_o_ai
8650 vec_sel(vector signed long long __a, vector signed long long __b,
8651 vector bool long long __c) {
8652 return (__a & ~(vector signed long long)__c) |
8653 (__b & (vector signed long long)__c);
8656 static __inline__ vector signed long long __ATTRS_o_ai
8657 vec_sel(vector signed long long __a, vector signed long long __b,
8658 vector unsigned long long __c) {
8659 return (__a & ~(vector signed long long)__c) |
8660 (__b & (vector signed long long)__c);
8663 static __inline__ vector unsigned long long __ATTRS_o_ai
8664 vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8665 vector bool long long __c) {
8666 return (__a & ~(vector unsigned long long)__c) |
8667 (__b & (vector unsigned long long)__c);
8670 static __inline__ vector unsigned long long __ATTRS_o_ai
8671 vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8672 vector unsigned long long __c) {
8673 return (__a & ~__c) | (__b & __c);
8679 static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
8680 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8681 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8684 static __inline__ vector signed char __ATTRS_o_ai
8685 vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
8686 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8689 static __inline__ vector unsigned char __ATTRS_o_ai
8690 vec_vsel(vector unsigned char __a, vector unsigned char __b,
8691 vector unsigned char __c) {
8692 return (__a & ~__c) | (__b & __c);
8695 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
8696 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
8697 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
8700 static __inline__ vector bool char __ATTRS_o_ai
8701 vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
8702 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
8705 static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
8706 vector bool char __b,
8707 vector bool char __c) {
8708 return (__a & ~__c) | (__b & __c);
8711 static __inline__ vector short __ATTRS_o_ai
8712 vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
8713 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8716 static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
8718 vector bool short __c) {
8719 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8722 static __inline__ vector unsigned short __ATTRS_o_ai
8723 vec_vsel(vector unsigned short __a, vector unsigned short __b,
8724 vector unsigned short __c) {
8725 return (__a & ~__c) | (__b & __c);
8728 static __inline__ vector unsigned short __ATTRS_o_ai
8729 vec_vsel(vector unsigned short __a, vector unsigned short __b,
8730 vector bool short __c) {
8731 return (__a & ~(vector unsigned short)__c) |
8732 (__b & (vector unsigned short)__c);
8735 static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
8736 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8737 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8740 static __inline__ vector bool short __ATTRS_o_ai
8741 vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
8742 return (__a & ~__c) | (__b & __c);
8745 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8747 vector unsigned int __c) {
8748 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8751 static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8753 vector bool int __c) {
8754 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8757 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8758 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8759 return (__a & ~__c) | (__b & __c);
8762 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8763 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8764 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8767 static __inline__ vector bool int __ATTRS_o_ai
8768 vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8769 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8772 static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8773 vector bool int __b,
8774 vector bool int __c) {
8775 return (__a & ~__c) | (__b & __c);
8778 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8780 vector unsigned int __c) {
8781 vector int __res = ((vector int)__a & ~(vector int)__c) |
8782 ((vector int)__b & (vector int)__c);
8783 return (vector float)__res;
8786 static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8788 vector bool int __c) {
8789 vector int __res = ((vector int)__a & ~(vector int)__c) |
8790 ((vector int)__b & (vector int)__c);
8791 return (vector float)__res;
8796 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8797 // than the length of __a.
8798 static __inline__ vector unsigned char __ATTRS_o_ai
8799 vec_sl(vector unsigned char __a, vector unsigned char __b) {
8800 return __a << (__b %
8801 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8804 static __inline__ vector signed char __ATTRS_o_ai
8805 vec_sl(vector signed char __a, vector unsigned char __b) {
8806 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8809 static __inline__ vector unsigned short __ATTRS_o_ai
8810 vec_sl(vector unsigned short __a, vector unsigned short __b) {
8811 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8815 static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8816 vector unsigned short __b) {
8817 return (vector short)vec_sl((vector unsigned short)__a, __b);
8820 static __inline__ vector unsigned int __ATTRS_o_ai
8821 vec_sl(vector unsigned int __a, vector unsigned int __b) {
8822 return __a << (__b %
8823 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8826 static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8827 vector unsigned int __b) {
8828 return (vector int)vec_sl((vector unsigned int)__a, __b);
8831 #ifdef __POWER8_VECTOR__
8832 static __inline__ vector unsigned long long __ATTRS_o_ai
8833 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8834 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8838 static __inline__ vector long long __ATTRS_o_ai
8839 vec_sl(vector long long __a, vector unsigned long long __b) {
8840 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8843 static __inline__ vector unsigned char __ATTRS_o_ai
8844 vec_vspltb(vector unsigned char __a, unsigned char __b);
8845 static __inline__ vector unsigned long long __ATTRS_o_ai
8846 vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8847 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
8849 // Big endian element one (the right doubleword) can be left shifted as-is.
8850 // The other element needs to be swapped into the right doubleword and
8851 // shifted. Then the right doublewords of the two result vectors are merged.
8852 vector signed long long __rightelt =
8853 (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8854 (vector signed int)__b);
8855 #ifdef __LITTLE_ENDIAN__
8856 __rightelt = (vector signed long long)__builtin_altivec_vsl(
8857 (vector signed int)__rightelt,
8858 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8860 __rightelt = (vector signed long long)__builtin_altivec_vsl(
8861 (vector signed int)__rightelt,
8862 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8864 __a = __builtin_shufflevector(__a, __a, 1, 0);
8865 __b = __builtin_shufflevector(__b, __b, 1, 0);
8866 vector signed long long __leftelt =
8867 (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8868 (vector signed int)__b);
8869 #ifdef __LITTLE_ENDIAN__
8870 __leftelt = (vector signed long long)__builtin_altivec_vsl(
8871 (vector signed int)__leftelt,
8872 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8873 return (vector unsigned long long)__builtin_shufflevector(__rightelt,
8876 __leftelt = (vector signed long long)__builtin_altivec_vsl(
8877 (vector signed int)__leftelt,
8878 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8879 return (vector unsigned long long)__builtin_shufflevector(__leftelt,
8884 static __inline__ vector long long __ATTRS_o_ai
8885 vec_sl(vector long long __a, vector unsigned long long __b) {
8886 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8892 #define __builtin_altivec_vslb vec_vslb
8894 static __inline__ vector signed char __ATTRS_o_ai
8895 vec_vslb(vector signed char __a, vector unsigned char __b) {
8896 return vec_sl(__a, __b);
8899 static __inline__ vector unsigned char __ATTRS_o_ai
8900 vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8901 return vec_sl(__a, __b);
8906 #define __builtin_altivec_vslh vec_vslh
8908 static __inline__ vector short __ATTRS_o_ai
8909 vec_vslh(vector short __a, vector unsigned short __b) {
8910 return vec_sl(__a, __b);
8913 static __inline__ vector unsigned short __ATTRS_o_ai
8914 vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8915 return vec_sl(__a, __b);
8920 #define __builtin_altivec_vslw vec_vslw
8922 static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8923 vector unsigned int __b) {
8924 return vec_sl(__a, __b);
8927 static __inline__ vector unsigned int __ATTRS_o_ai
8928 vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8929 return vec_sl(__a, __b);
8934 #define __builtin_altivec_vsldoi_4si vec_sld
8936 static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8937 vector signed char __a, vector signed char __b, unsigned const int __c) {
8938 unsigned char __d = __c & 0x0F;
8939 #ifdef __LITTLE_ENDIAN__
8941 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8942 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8943 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8944 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8948 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8949 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8950 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8954 static __inline__ vector unsigned char __ATTRS_o_ai
8955 vec_sld(vector unsigned char __a, vector unsigned char __b,
8956 unsigned const int __c) {
8957 unsigned char __d = __c & 0x0F;
8958 #ifdef __LITTLE_ENDIAN__
8960 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8961 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8962 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8963 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8967 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8968 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8969 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8973 static __inline__ vector bool char __ATTRS_o_ai
8974 vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8975 unsigned char __d = __c & 0x0F;
8976 #ifdef __LITTLE_ENDIAN__
8978 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8979 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8980 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8981 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8985 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8986 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8987 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8991 static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8992 vector signed short __a, vector signed short __b, unsigned const int __c) {
8993 unsigned char __d = __c & 0x0F;
8994 #ifdef __LITTLE_ENDIAN__
8996 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8997 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8998 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8999 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9003 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9004 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9005 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9009 static __inline__ vector unsigned short __ATTRS_o_ai
9010 vec_sld(vector unsigned short __a, vector unsigned short __b,
9011 unsigned const int __c) {
9012 unsigned char __d = __c & 0x0F;
9013 #ifdef __LITTLE_ENDIAN__
9015 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9016 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9017 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9018 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9022 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9023 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9024 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9028 static __inline__ vector bool short __ATTRS_o_ai
9029 vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
9030 unsigned char __d = __c & 0x0F;
9031 #ifdef __LITTLE_ENDIAN__
9033 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9034 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9035 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9036 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9040 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9041 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9042 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9046 static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
9048 unsigned const int __c) {
9049 unsigned char __d = __c & 0x0F;
9050 #ifdef __LITTLE_ENDIAN__
9052 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9053 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9054 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9055 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9059 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9060 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9061 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9065 static __inline__ vector signed int __ATTRS_o_ai
9066 vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
9067 unsigned char __d = __c & 0x0F;
9068 #ifdef __LITTLE_ENDIAN__
9070 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9071 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9072 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9073 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9077 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9078 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9079 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9083 static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
9084 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
9085 unsigned char __d = __c & 0x0F;
9086 #ifdef __LITTLE_ENDIAN__
9088 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9089 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9090 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9091 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9095 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9096 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9097 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9101 static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
9102 vector bool int __b,
9103 unsigned const int __c) {
9104 unsigned char __d = __c & 0x0F;
9105 #ifdef __LITTLE_ENDIAN__
9107 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9108 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9109 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9110 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9114 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9115 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9116 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9120 static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
9122 unsigned const int __c) {
9123 unsigned char __d = __c & 0x0F;
9124 #ifdef __LITTLE_ENDIAN__
9126 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9127 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9128 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9129 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9133 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9134 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9135 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9140 static __inline__ vector bool long long __ATTRS_o_ai
9141 vec_sld(vector bool long long __a, vector bool long long __b,
9142 unsigned const int __c) {
9143 unsigned char __d = __c & 0x0F;
9144 #ifdef __LITTLE_ENDIAN__
9146 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9147 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9148 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9149 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9153 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9154 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9155 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9159 static __inline__ vector signed long long __ATTRS_o_ai
9160 vec_sld(vector signed long long __a, vector signed long long __b,
9161 unsigned const int __c) {
9162 unsigned char __d = __c & 0x0F;
9163 #ifdef __LITTLE_ENDIAN__
9165 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9166 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9167 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9168 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9172 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9173 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9174 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9178 static __inline__ vector unsigned long long __ATTRS_o_ai
9179 vec_sld(vector unsigned long long __a, vector unsigned long long __b,
9180 unsigned const int __c) {
9181 unsigned char __d = __c & 0x0F;
9182 #ifdef __LITTLE_ENDIAN__
9184 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9185 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9186 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9187 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9191 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9192 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9193 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9197 static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
9199 unsigned const int __c) {
9200 unsigned char __d = __c & 0x0F;
9201 #ifdef __LITTLE_ENDIAN__
9203 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9204 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9205 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9206 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9210 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9211 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9212 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9218 static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
9219 vector signed char __a, vector signed char __b, unsigned const int __c) {
9220 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9223 static __inline__ vector unsigned char __ATTRS_o_ai
9224 vec_sldw(vector unsigned char __a, vector unsigned char __b,
9225 unsigned const int __c) {
9226 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9229 static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
9230 vector signed short __a, vector signed short __b, unsigned const int __c) {
9231 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9234 static __inline__ vector unsigned short __ATTRS_o_ai
9235 vec_sldw(vector unsigned short __a, vector unsigned short __b,
9236 unsigned const int __c) {
9237 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9240 static __inline__ vector signed int __ATTRS_o_ai
9241 vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
9242 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9245 static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
9246 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
9247 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9250 static __inline__ vector float __ATTRS_o_ai vec_sldw(
9251 vector float __a, vector float __b, unsigned const int __c) {
9252 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9256 static __inline__ vector signed long long __ATTRS_o_ai
9257 vec_sldw(vector signed long long __a, vector signed long long __b,
9258 unsigned const int __c) {
9259 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9262 static __inline__ vector unsigned long long __ATTRS_o_ai
9263 vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
9264 unsigned const int __c) {
9265 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9268 static __inline__ vector double __ATTRS_o_ai vec_sldw(
9269 vector double __a, vector double __b, unsigned const int __c) {
9270 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9274 #ifdef __POWER9_VECTOR__
9276 static __inline__ vector unsigned char __ATTRS_o_ai
9277 vec_slv(vector unsigned char __a, vector unsigned char __b) {
9278 return __builtin_altivec_vslv(__a, __b);
9282 static __inline__ vector unsigned char __ATTRS_o_ai
9283 vec_srv(vector unsigned char __a, vector unsigned char __b) {
9284 return __builtin_altivec_vsrv(__a, __b);
9290 static __inline__ vector signed char __ATTRS_o_ai
9291 vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
9292 unsigned char __d = __c & 0x0F;
9293 #ifdef __LITTLE_ENDIAN__
9295 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9296 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9297 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9298 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9302 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9303 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9304 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9308 static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
9309 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
9310 unsigned char __d = __c & 0x0F;
9311 #ifdef __LITTLE_ENDIAN__
9313 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9314 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9315 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9316 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9320 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9321 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9322 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9326 static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
9328 unsigned char __c) {
9329 unsigned char __d = __c & 0x0F;
9330 #ifdef __LITTLE_ENDIAN__
9332 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9333 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9334 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9335 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9339 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9340 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9341 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9345 static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
9346 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
9347 unsigned char __d = __c & 0x0F;
9348 #ifdef __LITTLE_ENDIAN__
9350 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9351 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9352 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9353 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9357 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9358 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9359 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9363 static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
9365 unsigned char __c) {
9366 unsigned char __d = __c & 0x0F;
9367 #ifdef __LITTLE_ENDIAN__
9369 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9370 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9371 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9372 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9376 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9377 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9378 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9382 static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
9384 unsigned char __c) {
9385 unsigned char __d = __c & 0x0F;
9386 #ifdef __LITTLE_ENDIAN__
9388 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9389 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9390 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9391 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9395 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9396 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9397 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9401 static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
9402 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
9403 unsigned char __d = __c & 0x0F;
9404 #ifdef __LITTLE_ENDIAN__
9406 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9407 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9408 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9409 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9413 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9414 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9415 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9419 static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
9421 unsigned char __c) {
9422 unsigned char __d = __c & 0x0F;
9423 #ifdef __LITTLE_ENDIAN__
9425 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9426 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9427 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9428 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9432 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9433 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9434 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9440 static __inline__ vector signed char __ATTRS_o_ai
9441 vec_sll(vector signed char __a, vector unsigned char __b) {
9442 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9446 static __inline__ vector signed char __ATTRS_o_ai
9447 vec_sll(vector signed char __a, vector unsigned short __b) {
9448 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9452 static __inline__ vector signed char __ATTRS_o_ai
9453 vec_sll(vector signed char __a, vector unsigned int __b) {
9454 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9458 static __inline__ vector unsigned char __ATTRS_o_ai
9459 vec_sll(vector unsigned char __a, vector unsigned char __b) {
9460 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9464 static __inline__ vector unsigned char __ATTRS_o_ai
9465 vec_sll(vector unsigned char __a, vector unsigned short __b) {
9466 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9470 static __inline__ vector unsigned char __ATTRS_o_ai
9471 vec_sll(vector unsigned char __a, vector unsigned int __b) {
9472 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9476 static __inline__ vector bool char __ATTRS_o_ai
9477 vec_sll(vector bool char __a, vector unsigned char __b) {
9478 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9482 static __inline__ vector bool char __ATTRS_o_ai
9483 vec_sll(vector bool char __a, vector unsigned short __b) {
9484 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9488 static __inline__ vector bool char __ATTRS_o_ai
9489 vec_sll(vector bool char __a, vector unsigned int __b) {
9490 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9494 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9495 vector unsigned char __b) {
9496 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9499 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9500 vector unsigned short __b) {
9501 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9504 static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9505 vector unsigned int __b) {
9506 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9509 static __inline__ vector unsigned short __ATTRS_o_ai
9510 vec_sll(vector unsigned short __a, vector unsigned char __b) {
9511 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9515 static __inline__ vector unsigned short __ATTRS_o_ai
9516 vec_sll(vector unsigned short __a, vector unsigned short __b) {
9517 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9521 static __inline__ vector unsigned short __ATTRS_o_ai
9522 vec_sll(vector unsigned short __a, vector unsigned int __b) {
9523 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9527 static __inline__ vector bool short __ATTRS_o_ai
9528 vec_sll(vector bool short __a, vector unsigned char __b) {
9529 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9533 static __inline__ vector bool short __ATTRS_o_ai
9534 vec_sll(vector bool short __a, vector unsigned short __b) {
9535 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9539 static __inline__ vector bool short __ATTRS_o_ai
9540 vec_sll(vector bool short __a, vector unsigned int __b) {
9541 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9545 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9546 vector unsigned char __b) {
9547 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9550 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9551 vector unsigned short __b) {
9552 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9555 static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9556 vector unsigned int __b) {
9557 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9560 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9561 vector unsigned char __b) {
9562 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9565 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9566 vector unsigned short __b) {
9567 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9570 static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9571 vector unsigned int __b) {
9572 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9575 static __inline__ vector unsigned int __ATTRS_o_ai
9576 vec_sll(vector unsigned int __a, vector unsigned char __b) {
9577 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9581 static __inline__ vector unsigned int __ATTRS_o_ai
9582 vec_sll(vector unsigned int __a, vector unsigned short __b) {
9583 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9587 static __inline__ vector unsigned int __ATTRS_o_ai
9588 vec_sll(vector unsigned int __a, vector unsigned int __b) {
9589 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9593 static __inline__ vector bool int __ATTRS_o_ai
9594 vec_sll(vector bool int __a, vector unsigned char __b) {
9595 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9599 static __inline__ vector bool int __ATTRS_o_ai
9600 vec_sll(vector bool int __a, vector unsigned short __b) {
9601 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9605 static __inline__ vector bool int __ATTRS_o_ai
9606 vec_sll(vector bool int __a, vector unsigned int __b) {
9607 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9612 static __inline__ vector signed long long __ATTRS_o_ai
9613 vec_sll(vector signed long long __a, vector unsigned char __b) {
9614 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
9618 static __inline__ vector unsigned long long __ATTRS_o_ai
9619 vec_sll(vector unsigned long long __a, vector unsigned char __b) {
9620 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
9627 static __inline__ vector signed char __ATTRS_o_ai
9628 vec_vsl(vector signed char __a, vector unsigned char __b) {
9629 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9633 static __inline__ vector signed char __ATTRS_o_ai
9634 vec_vsl(vector signed char __a, vector unsigned short __b) {
9635 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9639 static __inline__ vector signed char __ATTRS_o_ai
9640 vec_vsl(vector signed char __a, vector unsigned int __b) {
9641 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9645 static __inline__ vector unsigned char __ATTRS_o_ai
9646 vec_vsl(vector unsigned char __a, vector unsigned char __b) {
9647 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9651 static __inline__ vector unsigned char __ATTRS_o_ai
9652 vec_vsl(vector unsigned char __a, vector unsigned short __b) {
9653 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9657 static __inline__ vector unsigned char __ATTRS_o_ai
9658 vec_vsl(vector unsigned char __a, vector unsigned int __b) {
9659 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9663 static __inline__ vector bool char __ATTRS_o_ai
9664 vec_vsl(vector bool char __a, vector unsigned char __b) {
9665 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9669 static __inline__ vector bool char __ATTRS_o_ai
9670 vec_vsl(vector bool char __a, vector unsigned short __b) {
9671 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9675 static __inline__ vector bool char __ATTRS_o_ai
9676 vec_vsl(vector bool char __a, vector unsigned int __b) {
9677 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9681 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9682 vector unsigned char __b) {
9683 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9686 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9687 vector unsigned short __b) {
9688 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9691 static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9692 vector unsigned int __b) {
9693 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9696 static __inline__ vector unsigned short __ATTRS_o_ai
9697 vec_vsl(vector unsigned short __a, vector unsigned char __b) {
9698 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9702 static __inline__ vector unsigned short __ATTRS_o_ai
9703 vec_vsl(vector unsigned short __a, vector unsigned short __b) {
9704 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9708 static __inline__ vector unsigned short __ATTRS_o_ai
9709 vec_vsl(vector unsigned short __a, vector unsigned int __b) {
9710 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9714 static __inline__ vector bool short __ATTRS_o_ai
9715 vec_vsl(vector bool short __a, vector unsigned char __b) {
9716 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9720 static __inline__ vector bool short __ATTRS_o_ai
9721 vec_vsl(vector bool short __a, vector unsigned short __b) {
9722 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9726 static __inline__ vector bool short __ATTRS_o_ai
9727 vec_vsl(vector bool short __a, vector unsigned int __b) {
9728 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9732 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9733 vector unsigned char __b) {
9734 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9737 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9738 vector unsigned short __b) {
9739 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9742 static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9743 vector unsigned int __b) {
9744 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9747 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9748 vector unsigned char __b) {
9749 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9752 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9753 vector unsigned short __b) {
9754 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9757 static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9758 vector unsigned int __b) {
9759 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9762 static __inline__ vector unsigned int __ATTRS_o_ai
9763 vec_vsl(vector unsigned int __a, vector unsigned char __b) {
9764 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9768 static __inline__ vector unsigned int __ATTRS_o_ai
9769 vec_vsl(vector unsigned int __a, vector unsigned short __b) {
9770 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9774 static __inline__ vector unsigned int __ATTRS_o_ai
9775 vec_vsl(vector unsigned int __a, vector unsigned int __b) {
9776 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9780 static __inline__ vector bool int __ATTRS_o_ai
9781 vec_vsl(vector bool int __a, vector unsigned char __b) {
9782 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9786 static __inline__ vector bool int __ATTRS_o_ai
9787 vec_vsl(vector bool int __a, vector unsigned short __b) {
9788 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9792 static __inline__ vector bool int __ATTRS_o_ai
9793 vec_vsl(vector bool int __a, vector unsigned int __b) {
9794 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9800 static __inline__ vector signed char __ATTRS_o_ai
9801 vec_slo(vector signed char __a, vector signed char __b) {
9802 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9806 static __inline__ vector signed char __ATTRS_o_ai
9807 vec_slo(vector signed char __a, vector unsigned char __b) {
9808 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9812 static __inline__ vector unsigned char __ATTRS_o_ai
9813 vec_slo(vector unsigned char __a, vector signed char __b) {
9814 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9818 static __inline__ vector unsigned char __ATTRS_o_ai
9819 vec_slo(vector unsigned char __a, vector unsigned char __b) {
9820 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9824 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9825 vector signed char __b) {
9826 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9829 static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9830 vector unsigned char __b) {
9831 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9834 static __inline__ vector unsigned short __ATTRS_o_ai
9835 vec_slo(vector unsigned short __a, vector signed char __b) {
9836 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9840 static __inline__ vector unsigned short __ATTRS_o_ai
9841 vec_slo(vector unsigned short __a, vector unsigned char __b) {
9842 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9846 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9847 vector signed char __b) {
9848 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9851 static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9852 vector unsigned char __b) {
9853 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9856 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9857 vector signed char __b) {
9858 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9861 static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9862 vector unsigned char __b) {
9863 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9866 static __inline__ vector unsigned int __ATTRS_o_ai
9867 vec_slo(vector unsigned int __a, vector signed char __b) {
9868 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9872 static __inline__ vector unsigned int __ATTRS_o_ai
9873 vec_slo(vector unsigned int __a, vector unsigned char __b) {
9874 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9878 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9879 vector signed char __b) {
9880 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9883 static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9884 vector unsigned char __b) {
9885 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9889 static __inline__ vector signed long long __ATTRS_o_ai
9890 vec_slo(vector signed long long __a, vector signed char __b) {
9891 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9895 static __inline__ vector signed long long __ATTRS_o_ai
9896 vec_slo(vector signed long long __a, vector unsigned char __b) {
9897 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9901 static __inline__ vector unsigned long long __ATTRS_o_ai
9902 vec_slo(vector unsigned long long __a, vector signed char __b) {
9903 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9907 static __inline__ vector unsigned long long __ATTRS_o_ai
9908 vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9909 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9916 static __inline__ vector signed char __ATTRS_o_ai
9917 vec_vslo(vector signed char __a, vector signed char __b) {
9918 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9922 static __inline__ vector signed char __ATTRS_o_ai
9923 vec_vslo(vector signed char __a, vector unsigned char __b) {
9924 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9928 static __inline__ vector unsigned char __ATTRS_o_ai
9929 vec_vslo(vector unsigned char __a, vector signed char __b) {
9930 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9934 static __inline__ vector unsigned char __ATTRS_o_ai
9935 vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9936 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9940 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9941 vector signed char __b) {
9942 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9945 static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9946 vector unsigned char __b) {
9947 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9950 static __inline__ vector unsigned short __ATTRS_o_ai
9951 vec_vslo(vector unsigned short __a, vector signed char __b) {
9952 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9956 static __inline__ vector unsigned short __ATTRS_o_ai
9957 vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9958 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9962 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9963 vector signed char __b) {
9964 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9967 static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9968 vector unsigned char __b) {
9969 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9972 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9973 vector signed char __b) {
9974 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9977 static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9978 vector unsigned char __b) {
9979 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9982 static __inline__ vector unsigned int __ATTRS_o_ai
9983 vec_vslo(vector unsigned int __a, vector signed char __b) {
9984 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9988 static __inline__ vector unsigned int __ATTRS_o_ai
9989 vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9990 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9994 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9995 vector signed char __b) {
9996 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9999 static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
10000 vector unsigned char __b) {
10001 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10006 static __inline__ vector signed char __ATTRS_o_ai
10007 vec_splat(vector signed char __a, unsigned const int __b) {
10008 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10011 static __inline__ vector unsigned char __ATTRS_o_ai
10012 vec_splat(vector unsigned char __a, unsigned const int __b) {
10013 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10016 static __inline__ vector bool char __ATTRS_o_ai
10017 vec_splat(vector bool char __a, unsigned const int __b) {
10018 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10021 static __inline__ vector signed short __ATTRS_o_ai
10022 vec_splat(vector signed short __a, unsigned const int __b) {
10023 unsigned char b0 = (__b & 0x07) * 2;
10024 unsigned char b1 = b0 + 1;
10025 return vec_perm(__a, __a,
10026 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10027 b0, b1, b0, b1, b0, b1));
10030 static __inline__ vector unsigned short __ATTRS_o_ai
10031 vec_splat(vector unsigned short __a, unsigned const int __b) {
10032 unsigned char b0 = (__b & 0x07) * 2;
10033 unsigned char b1 = b0 + 1;
10034 return vec_perm(__a, __a,
10035 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10036 b0, b1, b0, b1, b0, b1));
10039 static __inline__ vector bool short __ATTRS_o_ai
10040 vec_splat(vector bool short __a, unsigned const int __b) {
10041 unsigned char b0 = (__b & 0x07) * 2;
10042 unsigned char b1 = b0 + 1;
10043 return vec_perm(__a, __a,
10044 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10045 b0, b1, b0, b1, b0, b1));
10048 static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
10049 unsigned const int __b) {
10050 unsigned char b0 = (__b & 0x07) * 2;
10051 unsigned char b1 = b0 + 1;
10052 return vec_perm(__a, __a,
10053 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10054 b0, b1, b0, b1, b0, b1));
10057 static __inline__ vector signed int __ATTRS_o_ai
10058 vec_splat(vector signed int __a, unsigned const int __b) {
10059 unsigned char b0 = (__b & 0x03) * 4;
10060 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10061 return vec_perm(__a, __a,
10062 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10063 b2, b3, b0, b1, b2, b3));
10066 static __inline__ vector unsigned int __ATTRS_o_ai
10067 vec_splat(vector unsigned int __a, unsigned const int __b) {
10068 unsigned char b0 = (__b & 0x03) * 4;
10069 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10070 return vec_perm(__a, __a,
10071 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10072 b2, b3, b0, b1, b2, b3));
10075 static __inline__ vector bool int __ATTRS_o_ai
10076 vec_splat(vector bool int __a, unsigned const int __b) {
10077 unsigned char b0 = (__b & 0x03) * 4;
10078 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10079 return vec_perm(__a, __a,
10080 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10081 b2, b3, b0, b1, b2, b3));
10084 static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
10085 unsigned const int __b) {
10086 unsigned char b0 = (__b & 0x03) * 4;
10087 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10088 return vec_perm(__a, __a,
10089 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10090 b2, b3, b0, b1, b2, b3));
10094 static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
10095 unsigned const int __b) {
10096 unsigned char b0 = (__b & 0x01) * 8;
10097 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10098 b6 = b0 + 6, b7 = b0 + 7;
10099 return vec_perm(__a, __a,
10100 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10101 b2, b3, b4, b5, b6, b7));
10103 static __inline__ vector bool long long __ATTRS_o_ai
10104 vec_splat(vector bool long long __a, unsigned const int __b) {
10105 unsigned char b0 = (__b & 0x01) * 8;
10106 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10107 b6 = b0 + 6, b7 = b0 + 7;
10108 return vec_perm(__a, __a,
10109 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10110 b2, b3, b4, b5, b6, b7));
10112 static __inline__ vector signed long long __ATTRS_o_ai
10113 vec_splat(vector signed long long __a, unsigned const int __b) {
10114 unsigned char b0 = (__b & 0x01) * 8;
10115 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10116 b6 = b0 + 6, b7 = b0 + 7;
10117 return vec_perm(__a, __a,
10118 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10119 b2, b3, b4, b5, b6, b7));
10121 static __inline__ vector unsigned long long __ATTRS_o_ai
10122 vec_splat(vector unsigned long long __a, unsigned const int __b) {
10123 unsigned char b0 = (__b & 0x01) * 8;
10124 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10125 b6 = b0 + 6, b7 = b0 + 7;
10126 return vec_perm(__a, __a,
10127 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10128 b2, b3, b4, b5, b6, b7));
10134 #define __builtin_altivec_vspltb vec_vspltb
10136 static __inline__ vector signed char __ATTRS_o_ai
10137 vec_vspltb(vector signed char __a, unsigned char __b) {
10138 return vec_perm(__a, __a, (vector unsigned char)(__b));
10141 static __inline__ vector unsigned char __ATTRS_o_ai
10142 vec_vspltb(vector unsigned char __a, unsigned char __b) {
10143 return vec_perm(__a, __a, (vector unsigned char)(__b));
10146 static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
10147 unsigned char __b) {
10148 return vec_perm(__a, __a, (vector unsigned char)(__b));
10153 #define __builtin_altivec_vsplth vec_vsplth
10155 static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
10156 unsigned char __b) {
10158 unsigned char b1 = __b + 1;
10159 return vec_perm(__a, __a,
10160 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10161 __b, b1, __b, b1, __b, b1, __b, b1));
10164 static __inline__ vector unsigned short __ATTRS_o_ai
10165 vec_vsplth(vector unsigned short __a, unsigned char __b) {
10167 unsigned char b1 = __b + 1;
10168 return vec_perm(__a, __a,
10169 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10170 __b, b1, __b, b1, __b, b1, __b, b1));
10173 static __inline__ vector bool short __ATTRS_o_ai
10174 vec_vsplth(vector bool short __a, unsigned char __b) {
10176 unsigned char b1 = __b + 1;
10177 return vec_perm(__a, __a,
10178 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10179 __b, b1, __b, b1, __b, b1, __b, b1));
10182 static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
10183 unsigned char __b) {
10185 unsigned char b1 = __b + 1;
10186 return vec_perm(__a, __a,
10187 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10188 __b, b1, __b, b1, __b, b1, __b, b1));
10193 #define __builtin_altivec_vspltw vec_vspltw
10195 static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
10196 unsigned char __b) {
10198 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10199 return vec_perm(__a, __a,
10200 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10201 b1, b2, b3, __b, b1, b2, b3));
10204 static __inline__ vector unsigned int __ATTRS_o_ai
10205 vec_vspltw(vector unsigned int __a, unsigned char __b) {
10207 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10208 return vec_perm(__a, __a,
10209 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10210 b1, b2, b3, __b, b1, b2, b3));
10213 static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
10214 unsigned char __b) {
10216 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10217 return vec_perm(__a, __a,
10218 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10219 b1, b2, b3, __b, b1, b2, b3));
10222 static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
10223 unsigned char __b) {
10225 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10226 return vec_perm(__a, __a,
10227 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10228 b1, b2, b3, __b, b1, b2, b3));
10233 #define __builtin_altivec_vspltisb vec_splat_s8
10235 // FIXME: parameter should be treated as 5-bit signed literal
10236 static __inline__ vector signed char __ATTRS_o_ai
10237 vec_splat_s8(signed char __a) {
10238 return (vector signed char)(__a);
10243 // FIXME: parameter should be treated as 5-bit signed literal
10244 static __inline__ vector signed char __ATTRS_o_ai
10245 vec_vspltisb(signed char __a) {
10246 return (vector signed char)(__a);
10249 /* vec_splat_s16 */
10251 #define __builtin_altivec_vspltish vec_splat_s16
10253 // FIXME: parameter should be treated as 5-bit signed literal
10254 static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
10255 return (vector short)(__a);
10260 // FIXME: parameter should be treated as 5-bit signed literal
10261 static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
10262 return (vector short)(__a);
10265 /* vec_splat_s32 */
10267 #define __builtin_altivec_vspltisw vec_splat_s32
10269 // FIXME: parameter should be treated as 5-bit signed literal
10270 static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
10271 return (vector int)(__a);
10276 // FIXME: parameter should be treated as 5-bit signed literal
10277 static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
10278 return (vector int)(__a);
10283 // FIXME: parameter should be treated as 5-bit signed literal
10284 static __inline__ vector unsigned char __ATTRS_o_ai
10285 vec_splat_u8(unsigned char __a) {
10286 return (vector unsigned char)(__a);
10289 /* vec_splat_u16 */
10291 // FIXME: parameter should be treated as 5-bit signed literal
10292 static __inline__ vector unsigned short __ATTRS_o_ai
10293 vec_splat_u16(signed char __a) {
10294 return (vector unsigned short)(__a);
10297 /* vec_splat_u32 */
10299 // FIXME: parameter should be treated as 5-bit signed literal
10300 static __inline__ vector unsigned int __ATTRS_o_ai
10301 vec_splat_u32(signed char __a) {
10302 return (vector unsigned int)(__a);
10307 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
10308 // than the length of __a.
10309 static __inline__ vector unsigned char __ATTRS_o_ai
10310 vec_sr(vector unsigned char __a, vector unsigned char __b) {
10312 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
10315 static __inline__ vector signed char __ATTRS_o_ai
10316 vec_sr(vector signed char __a, vector unsigned char __b) {
10317 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
10320 static __inline__ vector unsigned short __ATTRS_o_ai
10321 vec_sr(vector unsigned short __a, vector unsigned short __b) {
10323 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
10326 static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
10327 vector unsigned short __b) {
10328 return (vector short)vec_sr((vector unsigned short)__a, __b);
10331 static __inline__ vector unsigned int __ATTRS_o_ai
10332 vec_sr(vector unsigned int __a, vector unsigned int __b) {
10334 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
10337 static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
10338 vector unsigned int __b) {
10339 return (vector int)vec_sr((vector unsigned int)__a, __b);
10342 #ifdef __POWER8_VECTOR__
10343 static __inline__ vector unsigned long long __ATTRS_o_ai
10344 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10345 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
10349 static __inline__ vector long long __ATTRS_o_ai
10350 vec_sr(vector long long __a, vector unsigned long long __b) {
10351 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10354 static __inline__ vector unsigned long long __ATTRS_o_ai
10355 vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10356 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10358 // Big endian element zero (the left doubleword) can be right shifted as-is.
10359 // However the shift amount must be in the right doubleword.
10360 // The other element needs to be swapped into the left doubleword and
10361 // shifted. Then the left doublewords of the two result vectors are merged.
10362 vector unsigned long long __swapshift =
10363 __builtin_shufflevector(__b, __b, 1, 0);
10364 vector unsigned long long __leftelt =
10365 (vector unsigned long long)__builtin_altivec_vsro(
10366 (vector signed int)__a, (vector signed int)__swapshift);
10367 #ifdef __LITTLE_ENDIAN__
10368 __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10369 (vector signed int)__leftelt,
10370 (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 0));
10372 __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10373 (vector signed int)__leftelt,
10374 (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 15));
10376 __a = __builtin_shufflevector(__a, __a, 1, 0);
10377 vector unsigned long long __rightelt =
10378 (vector unsigned long long)__builtin_altivec_vsro((vector signed int)__a,
10379 (vector signed int)__b);
10380 #ifdef __LITTLE_ENDIAN__
10381 __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10382 (vector signed int)__rightelt,
10383 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
10384 return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);
10386 __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10387 (vector signed int)__rightelt,
10388 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
10389 return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);
10393 static __inline__ vector long long __ATTRS_o_ai
10394 vec_sr(vector long long __a, vector unsigned long long __b) {
10395 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10401 #define __builtin_altivec_vsrb vec_vsrb
10403 static __inline__ vector signed char __ATTRS_o_ai
10404 vec_vsrb(vector signed char __a, vector unsigned char __b) {
10405 return vec_sr(__a, __b);
10408 static __inline__ vector unsigned char __ATTRS_o_ai
10409 vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
10410 return vec_sr(__a, __b);
10415 #define __builtin_altivec_vsrh vec_vsrh
10417 static __inline__ vector short __ATTRS_o_ai
10418 vec_vsrh(vector short __a, vector unsigned short __b) {
10419 return vec_sr(__a, __b);
10422 static __inline__ vector unsigned short __ATTRS_o_ai
10423 vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
10424 return vec_sr(__a, __b);
10429 #define __builtin_altivec_vsrw vec_vsrw
10431 static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
10432 vector unsigned int __b) {
10433 return vec_sr(__a, __b);
10436 static __inline__ vector unsigned int __ATTRS_o_ai
10437 vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
10438 return vec_sr(__a, __b);
10443 static __inline__ vector signed char __ATTRS_o_ai
10444 vec_sra(vector signed char __a, vector unsigned char __b) {
10445 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
10448 static __inline__ vector unsigned char __ATTRS_o_ai
10449 vec_sra(vector unsigned char __a, vector unsigned char __b) {
10450 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
10453 static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
10454 vector unsigned short __b) {
10455 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
10458 static __inline__ vector unsigned short __ATTRS_o_ai
10459 vec_sra(vector unsigned short __a, vector unsigned short __b) {
10460 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
10463 static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
10464 vector unsigned int __b) {
10465 return __builtin_altivec_vsraw(__a, __b);
10468 static __inline__ vector unsigned int __ATTRS_o_ai
10469 vec_sra(vector unsigned int __a, vector unsigned int __b) {
10470 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
10473 #ifdef __POWER8_VECTOR__
10474 static __inline__ vector signed long long __ATTRS_o_ai
10475 vec_sra(vector signed long long __a, vector unsigned long long __b) {
10479 static __inline__ vector unsigned long long __ATTRS_o_ai
10480 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10481 return (vector unsigned long long)((vector signed long long)__a >> __b);
10484 static __inline__ vector signed long long __ATTRS_o_ai
10485 vec_sra(vector signed long long __a, vector unsigned long long __b) {
10486 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10490 static __inline__ vector unsigned long long __ATTRS_o_ai
10491 vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10492 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10493 return (vector unsigned long long)((vector signed long long)__a >> __b);
10499 static __inline__ vector signed char __ATTRS_o_ai
10500 vec_vsrab(vector signed char __a, vector unsigned char __b) {
10501 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
10504 static __inline__ vector unsigned char __ATTRS_o_ai
10505 vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
10506 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
10511 static __inline__ vector short __ATTRS_o_ai
10512 vec_vsrah(vector short __a, vector unsigned short __b) {
10513 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
10516 static __inline__ vector unsigned short __ATTRS_o_ai
10517 vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
10518 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
10523 static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
10524 vector unsigned int __b) {
10525 return __builtin_altivec_vsraw(__a, __b);
10528 static __inline__ vector unsigned int __ATTRS_o_ai
10529 vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
10530 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
10535 static __inline__ vector signed char __ATTRS_o_ai
10536 vec_srl(vector signed char __a, vector unsigned char __b) {
10537 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10541 static __inline__ vector signed char __ATTRS_o_ai
10542 vec_srl(vector signed char __a, vector unsigned short __b) {
10543 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10547 static __inline__ vector signed char __ATTRS_o_ai
10548 vec_srl(vector signed char __a, vector unsigned int __b) {
10549 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10553 static __inline__ vector unsigned char __ATTRS_o_ai
10554 vec_srl(vector unsigned char __a, vector unsigned char __b) {
10555 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10559 static __inline__ vector unsigned char __ATTRS_o_ai
10560 vec_srl(vector unsigned char __a, vector unsigned short __b) {
10561 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10565 static __inline__ vector unsigned char __ATTRS_o_ai
10566 vec_srl(vector unsigned char __a, vector unsigned int __b) {
10567 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10571 static __inline__ vector bool char __ATTRS_o_ai
10572 vec_srl(vector bool char __a, vector unsigned char __b) {
10573 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10577 static __inline__ vector bool char __ATTRS_o_ai
10578 vec_srl(vector bool char __a, vector unsigned short __b) {
10579 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10583 static __inline__ vector bool char __ATTRS_o_ai
10584 vec_srl(vector bool char __a, vector unsigned int __b) {
10585 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10589 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10590 vector unsigned char __b) {
10591 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10594 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10595 vector unsigned short __b) {
10596 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10599 static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10600 vector unsigned int __b) {
10601 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10604 static __inline__ vector unsigned short __ATTRS_o_ai
10605 vec_srl(vector unsigned short __a, vector unsigned char __b) {
10606 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10610 static __inline__ vector unsigned short __ATTRS_o_ai
10611 vec_srl(vector unsigned short __a, vector unsigned short __b) {
10612 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10616 static __inline__ vector unsigned short __ATTRS_o_ai
10617 vec_srl(vector unsigned short __a, vector unsigned int __b) {
10618 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10622 static __inline__ vector bool short __ATTRS_o_ai
10623 vec_srl(vector bool short __a, vector unsigned char __b) {
10624 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10628 static __inline__ vector bool short __ATTRS_o_ai
10629 vec_srl(vector bool short __a, vector unsigned short __b) {
10630 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10634 static __inline__ vector bool short __ATTRS_o_ai
10635 vec_srl(vector bool short __a, vector unsigned int __b) {
10636 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10640 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10641 vector unsigned char __b) {
10642 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10645 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10646 vector unsigned short __b) {
10647 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10650 static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10651 vector unsigned int __b) {
10652 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10655 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10656 vector unsigned char __b) {
10657 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10660 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10661 vector unsigned short __b) {
10662 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10665 static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10666 vector unsigned int __b) {
10667 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10670 static __inline__ vector unsigned int __ATTRS_o_ai
10671 vec_srl(vector unsigned int __a, vector unsigned char __b) {
10672 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10676 static __inline__ vector unsigned int __ATTRS_o_ai
10677 vec_srl(vector unsigned int __a, vector unsigned short __b) {
10678 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10682 static __inline__ vector unsigned int __ATTRS_o_ai
10683 vec_srl(vector unsigned int __a, vector unsigned int __b) {
10684 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10688 static __inline__ vector bool int __ATTRS_o_ai
10689 vec_srl(vector bool int __a, vector unsigned char __b) {
10690 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10694 static __inline__ vector bool int __ATTRS_o_ai
10695 vec_srl(vector bool int __a, vector unsigned short __b) {
10696 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10700 static __inline__ vector bool int __ATTRS_o_ai
10701 vec_srl(vector bool int __a, vector unsigned int __b) {
10702 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10707 static __inline__ vector signed long long __ATTRS_o_ai
10708 vec_srl(vector signed long long __a, vector unsigned char __b) {
10709 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
10713 static __inline__ vector unsigned long long __ATTRS_o_ai
10714 vec_srl(vector unsigned long long __a, vector unsigned char __b) {
10715 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
10722 static __inline__ vector signed char __ATTRS_o_ai
10723 vec_vsr(vector signed char __a, vector unsigned char __b) {
10724 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10728 static __inline__ vector signed char __ATTRS_o_ai
10729 vec_vsr(vector signed char __a, vector unsigned short __b) {
10730 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10734 static __inline__ vector signed char __ATTRS_o_ai
10735 vec_vsr(vector signed char __a, vector unsigned int __b) {
10736 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10740 static __inline__ vector unsigned char __ATTRS_o_ai
10741 vec_vsr(vector unsigned char __a, vector unsigned char __b) {
10742 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10746 static __inline__ vector unsigned char __ATTRS_o_ai
10747 vec_vsr(vector unsigned char __a, vector unsigned short __b) {
10748 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10752 static __inline__ vector unsigned char __ATTRS_o_ai
10753 vec_vsr(vector unsigned char __a, vector unsigned int __b) {
10754 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10758 static __inline__ vector bool char __ATTRS_o_ai
10759 vec_vsr(vector bool char __a, vector unsigned char __b) {
10760 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10764 static __inline__ vector bool char __ATTRS_o_ai
10765 vec_vsr(vector bool char __a, vector unsigned short __b) {
10766 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10770 static __inline__ vector bool char __ATTRS_o_ai
10771 vec_vsr(vector bool char __a, vector unsigned int __b) {
10772 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10776 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10777 vector unsigned char __b) {
10778 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10781 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10782 vector unsigned short __b) {
10783 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10786 static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10787 vector unsigned int __b) {
10788 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10791 static __inline__ vector unsigned short __ATTRS_o_ai
10792 vec_vsr(vector unsigned short __a, vector unsigned char __b) {
10793 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10797 static __inline__ vector unsigned short __ATTRS_o_ai
10798 vec_vsr(vector unsigned short __a, vector unsigned short __b) {
10799 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10803 static __inline__ vector unsigned short __ATTRS_o_ai
10804 vec_vsr(vector unsigned short __a, vector unsigned int __b) {
10805 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10809 static __inline__ vector bool short __ATTRS_o_ai
10810 vec_vsr(vector bool short __a, vector unsigned char __b) {
10811 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10815 static __inline__ vector bool short __ATTRS_o_ai
10816 vec_vsr(vector bool short __a, vector unsigned short __b) {
10817 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10821 static __inline__ vector bool short __ATTRS_o_ai
10822 vec_vsr(vector bool short __a, vector unsigned int __b) {
10823 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10827 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10828 vector unsigned char __b) {
10829 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10832 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10833 vector unsigned short __b) {
10834 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10837 static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10838 vector unsigned int __b) {
10839 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10842 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10843 vector unsigned char __b) {
10844 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10847 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10848 vector unsigned short __b) {
10849 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10852 static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10853 vector unsigned int __b) {
10854 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10857 static __inline__ vector unsigned int __ATTRS_o_ai
10858 vec_vsr(vector unsigned int __a, vector unsigned char __b) {
10859 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10863 static __inline__ vector unsigned int __ATTRS_o_ai
10864 vec_vsr(vector unsigned int __a, vector unsigned short __b) {
10865 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10869 static __inline__ vector unsigned int __ATTRS_o_ai
10870 vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10871 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10875 static __inline__ vector bool int __ATTRS_o_ai
10876 vec_vsr(vector bool int __a, vector unsigned char __b) {
10877 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10881 static __inline__ vector bool int __ATTRS_o_ai
10882 vec_vsr(vector bool int __a, vector unsigned short __b) {
10883 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10887 static __inline__ vector bool int __ATTRS_o_ai
10888 vec_vsr(vector bool int __a, vector unsigned int __b) {
10889 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10895 static __inline__ vector signed char __ATTRS_o_ai
10896 vec_sro(vector signed char __a, vector signed char __b) {
10897 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10901 static __inline__ vector signed char __ATTRS_o_ai
10902 vec_sro(vector signed char __a, vector unsigned char __b) {
10903 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10907 static __inline__ vector unsigned char __ATTRS_o_ai
10908 vec_sro(vector unsigned char __a, vector signed char __b) {
10909 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10913 static __inline__ vector unsigned char __ATTRS_o_ai
10914 vec_sro(vector unsigned char __a, vector unsigned char __b) {
10915 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10919 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10920 vector signed char __b) {
10921 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10924 static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10925 vector unsigned char __b) {
10926 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10929 static __inline__ vector unsigned short __ATTRS_o_ai
10930 vec_sro(vector unsigned short __a, vector signed char __b) {
10931 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10935 static __inline__ vector unsigned short __ATTRS_o_ai
10936 vec_sro(vector unsigned short __a, vector unsigned char __b) {
10937 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10941 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10942 vector signed char __b) {
10943 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10946 static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10947 vector unsigned char __b) {
10948 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10951 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10952 vector signed char __b) {
10953 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10956 static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10957 vector unsigned char __b) {
10958 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10961 static __inline__ vector unsigned int __ATTRS_o_ai
10962 vec_sro(vector unsigned int __a, vector signed char __b) {
10963 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10967 static __inline__ vector unsigned int __ATTRS_o_ai
10968 vec_sro(vector unsigned int __a, vector unsigned char __b) {
10969 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10973 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10974 vector signed char __b) {
10975 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10978 static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10979 vector unsigned char __b) {
10980 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10984 static __inline__ vector signed long long __ATTRS_o_ai
10985 vec_sro(vector signed long long __a, vector signed char __b) {
10986 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10990 static __inline__ vector signed long long __ATTRS_o_ai
10991 vec_sro(vector signed long long __a, vector unsigned char __b) {
10992 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10996 static __inline__ vector unsigned long long __ATTRS_o_ai
10997 vec_sro(vector unsigned long long __a, vector signed char __b) {
10998 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
11002 static __inline__ vector unsigned long long __ATTRS_o_ai
11003 vec_sro(vector unsigned long long __a, vector unsigned char __b) {
11004 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
11011 static __inline__ vector signed char __ATTRS_o_ai
11012 vec_vsro(vector signed char __a, vector signed char __b) {
11013 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11017 static __inline__ vector signed char __ATTRS_o_ai
11018 vec_vsro(vector signed char __a, vector unsigned char __b) {
11019 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11023 static __inline__ vector unsigned char __ATTRS_o_ai
11024 vec_vsro(vector unsigned char __a, vector signed char __b) {
11025 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11029 static __inline__ vector unsigned char __ATTRS_o_ai
11030 vec_vsro(vector unsigned char __a, vector unsigned char __b) {
11031 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11035 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
11036 vector signed char __b) {
11037 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11040 static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
11041 vector unsigned char __b) {
11042 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11045 static __inline__ vector unsigned short __ATTRS_o_ai
11046 vec_vsro(vector unsigned short __a, vector signed char __b) {
11047 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11051 static __inline__ vector unsigned short __ATTRS_o_ai
11052 vec_vsro(vector unsigned short __a, vector unsigned char __b) {
11053 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11057 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
11058 vector signed char __b) {
11059 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11062 static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
11063 vector unsigned char __b) {
11064 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11067 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
11068 vector signed char __b) {
11069 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11072 static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
11073 vector unsigned char __b) {
11074 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11077 static __inline__ vector unsigned int __ATTRS_o_ai
11078 vec_vsro(vector unsigned int __a, vector signed char __b) {
11079 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11083 static __inline__ vector unsigned int __ATTRS_o_ai
11084 vec_vsro(vector unsigned int __a, vector unsigned char __b) {
11085 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11089 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
11090 vector signed char __b) {
11091 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11094 static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
11095 vector unsigned char __b) {
11096 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11101 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
11102 vector signed char *__c) {
11103 __builtin_altivec_stvx((vector int)__a, __b, __c);
11106 static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
11107 signed char *__c) {
11108 __builtin_altivec_stvx((vector int)__a, __b, __c);
11111 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
11112 vector unsigned char *__c) {
11113 __builtin_altivec_stvx((vector int)__a, __b, __c);
11116 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
11117 unsigned char *__c) {
11118 __builtin_altivec_stvx((vector int)__a, __b, __c);
11121 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11122 signed char *__c) {
11123 __builtin_altivec_stvx((vector int)__a, __b, __c);
11126 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11127 unsigned char *__c) {
11128 __builtin_altivec_stvx((vector int)__a, __b, __c);
11131 static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11132 vector bool char *__c) {
11133 __builtin_altivec_stvx((vector int)__a, __b, __c);
11136 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
11137 vector short *__c) {
11138 __builtin_altivec_stvx((vector int)__a, __b, __c);
11141 static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
11143 __builtin_altivec_stvx((vector int)__a, __b, __c);
11146 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
11147 vector unsigned short *__c) {
11148 __builtin_altivec_stvx((vector int)__a, __b, __c);
11151 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
11152 unsigned short *__c) {
11153 __builtin_altivec_stvx((vector int)__a, __b, __c);
11156 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11158 __builtin_altivec_stvx((vector int)__a, __b, __c);
11161 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11162 unsigned short *__c) {
11163 __builtin_altivec_stvx((vector int)__a, __b, __c);
11166 static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11167 vector bool short *__c) {
11168 __builtin_altivec_stvx((vector int)__a, __b, __c);
11171 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11173 __builtin_altivec_stvx((vector int)__a, __b, __c);
11176 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11177 unsigned short *__c) {
11178 __builtin_altivec_stvx((vector int)__a, __b, __c);
11181 static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11182 vector pixel *__c) {
11183 __builtin_altivec_stvx((vector int)__a, __b, __c);
11186 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b,
11188 __builtin_altivec_stvx(__a, __b, __c);
11191 static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b, int *__c) {
11192 __builtin_altivec_stvx(__a, __b, __c);
11195 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
11196 vector unsigned int *__c) {
11197 __builtin_altivec_stvx((vector int)__a, __b, __c);
11200 static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
11201 unsigned int *__c) {
11202 __builtin_altivec_stvx((vector int)__a, __b, __c);
11205 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11207 __builtin_altivec_stvx((vector int)__a, __b, __c);
11210 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11211 unsigned int *__c) {
11212 __builtin_altivec_stvx((vector int)__a, __b, __c);
11215 static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11216 vector bool int *__c) {
11217 __builtin_altivec_stvx((vector int)__a, __b, __c);
11220 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
11221 vector float *__c) {
11222 __builtin_altivec_stvx((vector int)__a, __b, __c);
11225 static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
11227 __builtin_altivec_stvx((vector int)__a, __b, __c);
11232 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
11233 vector signed char *__c) {
11234 __builtin_altivec_stvx((vector int)__a, __b, __c);
11237 static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
11238 signed char *__c) {
11239 __builtin_altivec_stvx((vector int)__a, __b, __c);
11242 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
11243 vector unsigned char *__c) {
11244 __builtin_altivec_stvx((vector int)__a, __b, __c);
11247 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
11248 unsigned char *__c) {
11249 __builtin_altivec_stvx((vector int)__a, __b, __c);
11252 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11253 signed char *__c) {
11254 __builtin_altivec_stvx((vector int)__a, __b, __c);
11257 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11258 unsigned char *__c) {
11259 __builtin_altivec_stvx((vector int)__a, __b, __c);
11262 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11263 vector bool char *__c) {
11264 __builtin_altivec_stvx((vector int)__a, __b, __c);
11267 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
11268 vector short *__c) {
11269 __builtin_altivec_stvx((vector int)__a, __b, __c);
11272 static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
11274 __builtin_altivec_stvx((vector int)__a, __b, __c);
11277 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
11278 vector unsigned short *__c) {
11279 __builtin_altivec_stvx((vector int)__a, __b, __c);
11282 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
11283 unsigned short *__c) {
11284 __builtin_altivec_stvx((vector int)__a, __b, __c);
11287 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11289 __builtin_altivec_stvx((vector int)__a, __b, __c);
11292 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11293 unsigned short *__c) {
11294 __builtin_altivec_stvx((vector int)__a, __b, __c);
11297 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11298 vector bool short *__c) {
11299 __builtin_altivec_stvx((vector int)__a, __b, __c);
11302 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11304 __builtin_altivec_stvx((vector int)__a, __b, __c);
11307 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11308 unsigned short *__c) {
11309 __builtin_altivec_stvx((vector int)__a, __b, __c);
11312 static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11313 vector pixel *__c) {
11314 __builtin_altivec_stvx((vector int)__a, __b, __c);
11317 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
11319 __builtin_altivec_stvx(__a, __b, __c);
11322 static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
11324 __builtin_altivec_stvx(__a, __b, __c);
11327 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
11328 vector unsigned int *__c) {
11329 __builtin_altivec_stvx((vector int)__a, __b, __c);
11332 static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
11333 unsigned int *__c) {
11334 __builtin_altivec_stvx((vector int)__a, __b, __c);
11337 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11339 __builtin_altivec_stvx((vector int)__a, __b, __c);
11342 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11343 unsigned int *__c) {
11344 __builtin_altivec_stvx((vector int)__a, __b, __c);
11347 static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11348 vector bool int *__c) {
11349 __builtin_altivec_stvx((vector int)__a, __b, __c);
11352 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
11353 vector float *__c) {
11354 __builtin_altivec_stvx((vector int)__a, __b, __c);
11357 static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
11359 __builtin_altivec_stvx((vector int)__a, __b, __c);
11364 static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b,
11365 signed char *__c) {
11366 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11369 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, long __b,
11370 unsigned char *__c) {
11371 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11374 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
11375 signed char *__c) {
11376 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11379 static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
11380 unsigned char *__c) {
11381 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11384 static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, long __b,
11386 __builtin_altivec_stvehx(__a, __b, __c);
11389 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, long __b,
11390 unsigned short *__c) {
11391 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11394 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
11396 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11399 static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
11400 unsigned short *__c) {
11401 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11404 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
11406 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11409 static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
11410 unsigned short *__c) {
11411 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11414 static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, long __b, int *__c) {
11415 __builtin_altivec_stvewx(__a, __b, __c);
11418 static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, long __b,
11419 unsigned int *__c) {
11420 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11423 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
11425 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11428 static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
11429 unsigned int *__c) {
11430 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11433 static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, long __b,
11435 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11440 static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b,
11441 signed char *__c) {
11442 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11445 static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
11446 long __b, unsigned char *__c) {
11447 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11450 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
11451 signed char *__c) {
11452 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11455 static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
11456 unsigned char *__c) {
11457 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11462 static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b,
11464 __builtin_altivec_stvehx(__a, __b, __c);
11467 static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
11468 long __b, unsigned short *__c) {
11469 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11472 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11474 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11477 static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11478 unsigned short *__c) {
11479 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11482 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11484 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11487 static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11488 unsigned short *__c) {
11489 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11494 static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b,
11496 __builtin_altivec_stvewx(__a, __b, __c);
11499 static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, long __b,
11500 unsigned int *__c) {
11501 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11504 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11506 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11509 static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11510 unsigned int *__c) {
11511 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11514 static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, long __b,
11516 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11521 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
11522 vector signed char *__c) {
11523 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11526 static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
11527 signed char *__c) {
11528 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11531 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
11532 vector unsigned char *__c) {
11533 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11536 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
11537 unsigned char *__c) {
11538 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11541 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11542 signed char *__c) {
11543 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11546 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11547 unsigned char *__c) {
11548 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11551 static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11552 vector bool char *__c) {
11553 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11556 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
11557 vector short *__c) {
11558 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11561 static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
11563 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11566 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
11567 vector unsigned short *__c) {
11568 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11571 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
11572 unsigned short *__c) {
11573 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11576 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11578 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11581 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11582 unsigned short *__c) {
11583 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11586 static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11587 vector bool short *__c) {
11588 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11591 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11593 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11596 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11597 unsigned short *__c) {
11598 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11601 static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11602 vector pixel *__c) {
11603 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11606 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
11608 __builtin_altivec_stvxl(__a, __b, __c);
11611 static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
11612 __builtin_altivec_stvxl(__a, __b, __c);
11615 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
11616 vector unsigned int *__c) {
11617 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11620 static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
11621 unsigned int *__c) {
11622 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11625 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11627 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11630 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11631 unsigned int *__c) {
11632 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11635 static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11636 vector bool int *__c) {
11637 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11640 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
11641 vector float *__c) {
11642 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11645 static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
11647 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11652 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
11653 vector signed char *__c) {
11654 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11657 static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
11658 signed char *__c) {
11659 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11662 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
11663 vector unsigned char *__c) {
11664 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11667 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
11668 unsigned char *__c) {
11669 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11672 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11673 signed char *__c) {
11674 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11677 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11678 unsigned char *__c) {
11679 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11682 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11683 vector bool char *__c) {
11684 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11687 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
11688 vector short *__c) {
11689 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11692 static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
11694 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11697 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
11699 vector unsigned short *__c) {
11700 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11703 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
11704 int __b, unsigned short *__c) {
11705 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11708 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11710 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11713 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11714 unsigned short *__c) {
11715 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11718 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11719 vector bool short *__c) {
11720 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11723 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11725 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11728 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11729 unsigned short *__c) {
11730 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11733 static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11734 vector pixel *__c) {
11735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11738 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
11740 __builtin_altivec_stvxl(__a, __b, __c);
11743 static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
11745 __builtin_altivec_stvxl(__a, __b, __c);
11748 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
11749 vector unsigned int *__c) {
11750 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11753 static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
11754 unsigned int *__c) {
11755 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11758 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11760 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11763 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11764 unsigned int *__c) {
11765 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11768 static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11769 vector bool int *__c) {
11770 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11773 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
11774 vector float *__c) {
11775 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11778 static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
11780 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11785 static __inline__ vector signed char __ATTRS_o_ai
11786 vec_sub(vector signed char __a, vector signed char __b) {
11790 static __inline__ vector signed char __ATTRS_o_ai
11791 vec_sub(vector bool char __a, vector signed char __b) {
11792 return (vector signed char)__a - __b;
11795 static __inline__ vector signed char __ATTRS_o_ai
11796 vec_sub(vector signed char __a, vector bool char __b) {
11797 return __a - (vector signed char)__b;
11800 static __inline__ vector unsigned char __ATTRS_o_ai
11801 vec_sub(vector unsigned char __a, vector unsigned char __b) {
11805 static __inline__ vector unsigned char __ATTRS_o_ai
11806 vec_sub(vector bool char __a, vector unsigned char __b) {
11807 return (vector unsigned char)__a - __b;
11810 static __inline__ vector unsigned char __ATTRS_o_ai
11811 vec_sub(vector unsigned char __a, vector bool char __b) {
11812 return __a - (vector unsigned char)__b;
11815 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11816 vector short __b) {
11820 static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
11821 vector short __b) {
11822 return (vector short)__a - __b;
11825 static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11826 vector bool short __b) {
11827 return __a - (vector short)__b;
11830 static __inline__ vector unsigned short __ATTRS_o_ai
11831 vec_sub(vector unsigned short __a, vector unsigned short __b) {
11835 static __inline__ vector unsigned short __ATTRS_o_ai
11836 vec_sub(vector bool short __a, vector unsigned short __b) {
11837 return (vector unsigned short)__a - __b;
11840 static __inline__ vector unsigned short __ATTRS_o_ai
11841 vec_sub(vector unsigned short __a, vector bool short __b) {
11842 return __a - (vector unsigned short)__b;
11845 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11850 static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
11852 return (vector int)__a - __b;
11855 static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11856 vector bool int __b) {
11857 return __a - (vector int)__b;
11860 static __inline__ vector unsigned int __ATTRS_o_ai
11861 vec_sub(vector unsigned int __a, vector unsigned int __b) {
11865 static __inline__ vector unsigned int __ATTRS_o_ai
11866 vec_sub(vector bool int __a, vector unsigned int __b) {
11867 return (vector unsigned int)__a - __b;
11870 static __inline__ vector unsigned int __ATTRS_o_ai
11871 vec_sub(vector unsigned int __a, vector bool int __b) {
11872 return __a - (vector unsigned int)__b;
11875 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11876 defined(__SIZEOF_INT128__)
11877 static __inline__ vector signed __int128 __ATTRS_o_ai
11878 vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11882 static __inline__ vector unsigned __int128 __ATTRS_o_ai
11883 vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11886 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
11887 // defined(__SIZEOF_INT128__)
11890 static __inline__ vector signed long long __ATTRS_o_ai
11891 vec_sub(vector signed long long __a, vector signed long long __b) {
11895 static __inline__ vector unsigned long long __ATTRS_o_ai
11896 vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11900 static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11901 vector double __b) {
11906 static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11907 vector float __b) {
11913 #define __builtin_altivec_vsububm vec_vsububm
11915 static __inline__ vector signed char __ATTRS_o_ai
11916 vec_vsububm(vector signed char __a, vector signed char __b) {
11920 static __inline__ vector signed char __ATTRS_o_ai
11921 vec_vsububm(vector bool char __a, vector signed char __b) {
11922 return (vector signed char)__a - __b;
11925 static __inline__ vector signed char __ATTRS_o_ai
11926 vec_vsububm(vector signed char __a, vector bool char __b) {
11927 return __a - (vector signed char)__b;
11930 static __inline__ vector unsigned char __ATTRS_o_ai
11931 vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11935 static __inline__ vector unsigned char __ATTRS_o_ai
11936 vec_vsububm(vector bool char __a, vector unsigned char __b) {
11937 return (vector unsigned char)__a - __b;
11940 static __inline__ vector unsigned char __ATTRS_o_ai
11941 vec_vsububm(vector unsigned char __a, vector bool char __b) {
11942 return __a - (vector unsigned char)__b;
11947 #define __builtin_altivec_vsubuhm vec_vsubuhm
11949 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11950 vector short __b) {
11954 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11955 vector short __b) {
11956 return (vector short)__a - __b;
11959 static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11960 vector bool short __b) {
11961 return __a - (vector short)__b;
11964 static __inline__ vector unsigned short __ATTRS_o_ai
11965 vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11969 static __inline__ vector unsigned short __ATTRS_o_ai
11970 vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11971 return (vector unsigned short)__a - __b;
11974 static __inline__ vector unsigned short __ATTRS_o_ai
11975 vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11976 return __a - (vector unsigned short)__b;
11981 #define __builtin_altivec_vsubuwm vec_vsubuwm
11983 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11988 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11990 return (vector int)__a - __b;
11993 static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11994 vector bool int __b) {
11995 return __a - (vector int)__b;
11998 static __inline__ vector unsigned int __ATTRS_o_ai
11999 vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
12003 static __inline__ vector unsigned int __ATTRS_o_ai
12004 vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
12005 return (vector unsigned int)__a - __b;
12008 static __inline__ vector unsigned int __ATTRS_o_ai
12009 vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
12010 return __a - (vector unsigned int)__b;
12015 #define __builtin_altivec_vsubfp vec_vsubfp
12017 static __inline__ vector float __attribute__((__always_inline__))
12018 vec_vsubfp(vector float __a, vector float __b) {
12024 static __inline__ vector signed int __ATTRS_o_ai
12025 vec_subc(vector signed int __a, vector signed int __b) {
12026 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
12027 (vector unsigned int) __b);
12030 static __inline__ vector unsigned int __ATTRS_o_ai
12031 vec_subc(vector unsigned int __a, vector unsigned int __b) {
12032 return __builtin_altivec_vsubcuw(__a, __b);
12035 #ifdef __POWER8_VECTOR__
12036 #ifdef __SIZEOF_INT128__
12037 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12038 vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12039 return __builtin_altivec_vsubcuq(__a, __b);
12042 static __inline__ vector signed __int128 __ATTRS_o_ai
12043 vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
12044 return __builtin_altivec_vsubcuq(__a, __b);
12048 static __inline__ vector unsigned char __attribute__((__always_inline__))
12049 vec_subc_u128(vector unsigned char __a, vector unsigned char __b) {
12050 return (vector unsigned char)__builtin_altivec_vsubcuq(__a, __b);
12052 #endif // __POWER8_VECTOR__
12056 static __inline__ vector unsigned int __attribute__((__always_inline__))
12057 vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
12058 return __builtin_altivec_vsubcuw(__a, __b);
12063 static __inline__ vector signed char __ATTRS_o_ai
12064 vec_subs(vector signed char __a, vector signed char __b) {
12065 return __builtin_altivec_vsubsbs(__a, __b);
12068 static __inline__ vector signed char __ATTRS_o_ai
12069 vec_subs(vector bool char __a, vector signed char __b) {
12070 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
12073 static __inline__ vector signed char __ATTRS_o_ai
12074 vec_subs(vector signed char __a, vector bool char __b) {
12075 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
12078 static __inline__ vector unsigned char __ATTRS_o_ai
12079 vec_subs(vector unsigned char __a, vector unsigned char __b) {
12080 return __builtin_altivec_vsububs(__a, __b);
12083 static __inline__ vector unsigned char __ATTRS_o_ai
12084 vec_subs(vector bool char __a, vector unsigned char __b) {
12085 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
12088 static __inline__ vector unsigned char __ATTRS_o_ai
12089 vec_subs(vector unsigned char __a, vector bool char __b) {
12090 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
12093 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
12094 vector short __b) {
12095 return __builtin_altivec_vsubshs(__a, __b);
12098 static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
12099 vector short __b) {
12100 return __builtin_altivec_vsubshs((vector short)__a, __b);
12103 static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
12104 vector bool short __b) {
12105 return __builtin_altivec_vsubshs(__a, (vector short)__b);
12108 static __inline__ vector unsigned short __ATTRS_o_ai
12109 vec_subs(vector unsigned short __a, vector unsigned short __b) {
12110 return __builtin_altivec_vsubuhs(__a, __b);
12113 static __inline__ vector unsigned short __ATTRS_o_ai
12114 vec_subs(vector bool short __a, vector unsigned short __b) {
12115 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
12118 static __inline__ vector unsigned short __ATTRS_o_ai
12119 vec_subs(vector unsigned short __a, vector bool short __b) {
12120 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
12123 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
12125 return __builtin_altivec_vsubsws(__a, __b);
12128 static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
12130 return __builtin_altivec_vsubsws((vector int)__a, __b);
12133 static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
12134 vector bool int __b) {
12135 return __builtin_altivec_vsubsws(__a, (vector int)__b);
12138 static __inline__ vector unsigned int __ATTRS_o_ai
12139 vec_subs(vector unsigned int __a, vector unsigned int __b) {
12140 return __builtin_altivec_vsubuws(__a, __b);
12143 static __inline__ vector unsigned int __ATTRS_o_ai
12144 vec_subs(vector bool int __a, vector unsigned int __b) {
12145 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
12148 static __inline__ vector unsigned int __ATTRS_o_ai
12149 vec_subs(vector unsigned int __a, vector bool int __b) {
12150 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
12155 static __inline__ vector signed char __ATTRS_o_ai
12156 vec_vsubsbs(vector signed char __a, vector signed char __b) {
12157 return __builtin_altivec_vsubsbs(__a, __b);
12160 static __inline__ vector signed char __ATTRS_o_ai
12161 vec_vsubsbs(vector bool char __a, vector signed char __b) {
12162 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
12165 static __inline__ vector signed char __ATTRS_o_ai
12166 vec_vsubsbs(vector signed char __a, vector bool char __b) {
12167 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
12172 static __inline__ vector unsigned char __ATTRS_o_ai
12173 vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
12174 return __builtin_altivec_vsububs(__a, __b);
12177 static __inline__ vector unsigned char __ATTRS_o_ai
12178 vec_vsububs(vector bool char __a, vector unsigned char __b) {
12179 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
12182 static __inline__ vector unsigned char __ATTRS_o_ai
12183 vec_vsububs(vector unsigned char __a, vector bool char __b) {
12184 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
12189 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
12190 vector short __b) {
12191 return __builtin_altivec_vsubshs(__a, __b);
12194 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
12195 vector short __b) {
12196 return __builtin_altivec_vsubshs((vector short)__a, __b);
12199 static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
12200 vector bool short __b) {
12201 return __builtin_altivec_vsubshs(__a, (vector short)__b);
12206 static __inline__ vector unsigned short __ATTRS_o_ai
12207 vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
12208 return __builtin_altivec_vsubuhs(__a, __b);
12211 static __inline__ vector unsigned short __ATTRS_o_ai
12212 vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
12213 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
12216 static __inline__ vector unsigned short __ATTRS_o_ai
12217 vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
12218 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
12223 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
12225 return __builtin_altivec_vsubsws(__a, __b);
12228 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
12230 return __builtin_altivec_vsubsws((vector int)__a, __b);
12233 static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
12234 vector bool int __b) {
12235 return __builtin_altivec_vsubsws(__a, (vector int)__b);
12240 static __inline__ vector unsigned int __ATTRS_o_ai
12241 vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
12242 return __builtin_altivec_vsubuws(__a, __b);
12245 static __inline__ vector unsigned int __ATTRS_o_ai
12246 vec_vsubuws(vector bool int __a, vector unsigned int __b) {
12247 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
12250 static __inline__ vector unsigned int __ATTRS_o_ai
12251 vec_vsubuws(vector unsigned int __a, vector bool int __b) {
12252 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
12255 #ifdef __POWER8_VECTOR__
12258 #ifdef __SIZEOF_INT128__
12259 static __inline__ vector signed __int128 __ATTRS_o_ai
12260 vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
12264 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12265 vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12270 static __inline__ vector unsigned char __attribute__((__always_inline__))
12271 vec_sub_u128(vector unsigned char __a, vector unsigned char __b) {
12272 return __builtin_altivec_vsubuqm(__a, __b);
12277 #ifdef __SIZEOF_INT128__
12278 static __inline__ vector signed __int128 __ATTRS_o_ai
12279 vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
12280 vector signed __int128 __c) {
12281 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12284 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12285 vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
12286 vector unsigned __int128 __c) {
12287 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12290 static __inline__ vector signed __int128 __ATTRS_o_ai
12291 vec_sube(vector signed __int128 __a, vector signed __int128 __b,
12292 vector signed __int128 __c) {
12293 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12296 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12297 vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
12298 vector unsigned __int128 __c) {
12299 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12303 static __inline__ vector unsigned char __attribute__((__always_inline__))
12304 vec_sube_u128(vector unsigned char __a, vector unsigned char __b,
12305 vector unsigned char __c) {
12306 return (vector unsigned char)__builtin_altivec_vsubeuqm(__a, __b, __c);
12311 #ifdef __SIZEOF_INT128__
12312 static __inline__ vector signed __int128 __ATTRS_o_ai
12313 vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
12314 return __builtin_altivec_vsubcuq(__a, __b);
12317 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12318 vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12319 return __builtin_altivec_vsubcuq(__a, __b);
12324 static __inline__ vector signed __int128 __ATTRS_o_ai
12325 vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
12326 vector signed __int128 __c) {
12327 return __builtin_altivec_vsubecuq(__a, __b, __c);
12330 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12331 vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
12332 vector unsigned __int128 __c) {
12333 return __builtin_altivec_vsubecuq(__a, __b, __c);
12337 #ifdef __powerpc64__
12338 static __inline__ vector signed int __ATTRS_o_ai
12339 vec_subec(vector signed int __a, vector signed int __b,
12340 vector signed int __c) {
12341 return vec_addec(__a, ~__b, __c);
12344 static __inline__ vector unsigned int __ATTRS_o_ai
12345 vec_subec(vector unsigned int __a, vector unsigned int __b,
12346 vector unsigned int __c) {
12347 return vec_addec(__a, ~__b, __c);
12351 #ifdef __SIZEOF_INT128__
12352 static __inline__ vector signed __int128 __ATTRS_o_ai
12353 vec_subec(vector signed __int128 __a, vector signed __int128 __b,
12354 vector signed __int128 __c) {
12355 return __builtin_altivec_vsubecuq(__a, __b, __c);
12358 static __inline__ vector unsigned __int128 __ATTRS_o_ai
12359 vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
12360 vector unsigned __int128 __c) {
12361 return __builtin_altivec_vsubecuq(__a, __b, __c);
12365 static __inline__ vector unsigned char __attribute__((__always_inline__))
12366 vec_subec_u128(vector unsigned char __a, vector unsigned char __b,
12367 vector unsigned char __c) {
12368 return (vector unsigned char)__builtin_altivec_vsubecuq(__a, __b, __c);
12370 #endif // __POWER8_VECTOR__
12372 static __inline__ vector signed int __ATTRS_o_ai
12373 vec_sube(vector signed int __a, vector signed int __b,
12374 vector signed int __c) {
12375 vector signed int __mask = {1, 1, 1, 1};
12376 vector signed int __carry = __c & __mask;
12377 return vec_adde(__a, ~__b, __carry);
12380 static __inline__ vector unsigned int __ATTRS_o_ai
12381 vec_sube(vector unsigned int __a, vector unsigned int __b,
12382 vector unsigned int __c) {
12383 vector unsigned int __mask = {1, 1, 1, 1};
12384 vector unsigned int __carry = __c & __mask;
12385 return vec_adde(__a, ~__b, __carry);
12389 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
12391 return __builtin_altivec_vsum4sbs(__a, __b);
12394 static __inline__ vector unsigned int __ATTRS_o_ai
12395 vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
12396 return __builtin_altivec_vsum4ubs(__a, __b);
12399 static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
12401 return __builtin_altivec_vsum4shs(__a, __b);
12406 static __inline__ vector int __attribute__((__always_inline__))
12407 vec_vsum4sbs(vector signed char __a, vector int __b) {
12408 return __builtin_altivec_vsum4sbs(__a, __b);
12413 static __inline__ vector unsigned int __attribute__((__always_inline__))
12414 vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
12415 return __builtin_altivec_vsum4ubs(__a, __b);
12420 static __inline__ vector int __attribute__((__always_inline__))
12421 vec_vsum4shs(vector signed short __a, vector int __b) {
12422 return __builtin_altivec_vsum4shs(__a, __b);
12427 /* The vsum2sws instruction has a big-endian bias, so that the second
12428 input vector and the result always reference big-endian elements
12429 1 and 3 (little-endian element 0 and 2). For ease of porting the
12430 programmer wants elements 1 and 3 in both cases, so for little
12431 endian we must perform some permutes. */
12433 static __inline__ vector signed int __attribute__((__always_inline__))
12434 vec_sum2s(vector int __a, vector int __b) {
12435 #ifdef __LITTLE_ENDIAN__
12436 vector int __c = (vector signed int)vec_perm(
12437 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12439 __c = __builtin_altivec_vsum2sws(__a, __c);
12440 return (vector signed int)vec_perm(
12441 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12444 return __builtin_altivec_vsum2sws(__a, __b);
12450 static __inline__ vector signed int __attribute__((__always_inline__))
12451 vec_vsum2sws(vector int __a, vector int __b) {
12452 #ifdef __LITTLE_ENDIAN__
12453 vector int __c = (vector signed int)vec_perm(
12454 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12456 __c = __builtin_altivec_vsum2sws(__a, __c);
12457 return (vector signed int)vec_perm(
12458 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12461 return __builtin_altivec_vsum2sws(__a, __b);
12467 /* The vsumsws instruction has a big-endian bias, so that the second
12468 input vector and the result always reference big-endian element 3
12469 (little-endian element 0). For ease of porting the programmer
12470 wants element 3 in both cases, so for little endian we must perform
12473 static __inline__ vector signed int __attribute__((__always_inline__))
12474 vec_sums(vector signed int __a, vector signed int __b) {
12475 #ifdef __LITTLE_ENDIAN__
12476 __b = (vector signed int)vec_splat(__b, 3);
12477 __b = __builtin_altivec_vsumsws(__a, __b);
12478 return (vector signed int)(0, 0, 0, __b[0]);
12480 return __builtin_altivec_vsumsws(__a, __b);
12486 static __inline__ vector signed int __attribute__((__always_inline__))
12487 vec_vsumsws(vector signed int __a, vector signed int __b) {
12488 #ifdef __LITTLE_ENDIAN__
12489 __b = (vector signed int)vec_splat(__b, 3);
12490 __b = __builtin_altivec_vsumsws(__a, __b);
12491 return (vector signed int)(0, 0, 0, __b[0]);
12493 return __builtin_altivec_vsumsws(__a, __b);
12499 static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
12501 return __builtin_vsx_xvrspiz(__a);
12503 return __builtin_altivec_vrfiz(__a);
12508 static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
12509 return __builtin_vsx_xvrdpiz(__a);
12514 static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a) {
12515 return vec_trunc(__a);
12519 static __inline__ vector double __ATTRS_o_ai vec_roundz(vector double __a) {
12520 return vec_trunc(__a);
12526 static __inline__ vector float __attribute__((__always_inline__))
12527 vec_vrfiz(vector float __a) {
12528 return __builtin_altivec_vrfiz(__a);
12533 /* The vector unpack instructions all have a big-endian bias, so for
12534 little endian we must reverse the meanings of "high" and "low." */
12535 #ifdef __LITTLE_ENDIAN__
12536 #define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12537 #define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12539 #define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12540 #define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12543 static __inline__ vector short __ATTRS_o_ai
12544 vec_unpackh(vector signed char __a) {
12545 #ifdef __LITTLE_ENDIAN__
12546 return __builtin_altivec_vupklsb((vector char)__a);
12548 return __builtin_altivec_vupkhsb((vector char)__a);
12552 static __inline__ vector bool short __ATTRS_o_ai
12553 vec_unpackh(vector bool char __a) {
12554 #ifdef __LITTLE_ENDIAN__
12555 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12557 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12561 static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
12562 #ifdef __LITTLE_ENDIAN__
12563 return __builtin_altivec_vupklsh(__a);
12565 return __builtin_altivec_vupkhsh(__a);
12569 static __inline__ vector bool int __ATTRS_o_ai
12570 vec_unpackh(vector bool short __a) {
12571 #ifdef __LITTLE_ENDIAN__
12572 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12574 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12578 static __inline__ vector unsigned int __ATTRS_o_ai
12579 vec_unpackh(vector pixel __a) {
12580 #ifdef __LITTLE_ENDIAN__
12581 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12583 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12587 #ifdef __POWER8_VECTOR__
12588 static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
12589 #ifdef __LITTLE_ENDIAN__
12590 return __builtin_altivec_vupklsw(__a);
12592 return __builtin_altivec_vupkhsw(__a);
12596 static __inline__ vector bool long long __ATTRS_o_ai
12597 vec_unpackh(vector bool int __a) {
12598 #ifdef __LITTLE_ENDIAN__
12599 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12601 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12605 static __inline__ vector double __ATTRS_o_ai
12606 vec_unpackh(vector float __a) {
12607 return (vector double)(__a[0], __a[1]);
12613 static __inline__ vector short __ATTRS_o_ai
12614 vec_vupkhsb(vector signed char __a) {
12615 #ifdef __LITTLE_ENDIAN__
12616 return __builtin_altivec_vupklsb((vector char)__a);
12618 return __builtin_altivec_vupkhsb((vector char)__a);
12622 static __inline__ vector bool short __ATTRS_o_ai
12623 vec_vupkhsb(vector bool char __a) {
12624 #ifdef __LITTLE_ENDIAN__
12625 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12627 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12633 static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
12634 #ifdef __LITTLE_ENDIAN__
12635 return __builtin_altivec_vupklsh(__a);
12637 return __builtin_altivec_vupkhsh(__a);
12641 static __inline__ vector bool int __ATTRS_o_ai
12642 vec_vupkhsh(vector bool short __a) {
12643 #ifdef __LITTLE_ENDIAN__
12644 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12646 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12650 static __inline__ vector unsigned int __ATTRS_o_ai
12651 vec_vupkhsh(vector pixel __a) {
12652 #ifdef __LITTLE_ENDIAN__
12653 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12655 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12661 #ifdef __POWER8_VECTOR__
12662 static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
12663 #ifdef __LITTLE_ENDIAN__
12664 return __builtin_altivec_vupklsw(__a);
12666 return __builtin_altivec_vupkhsw(__a);
12670 static __inline__ vector bool long long __ATTRS_o_ai
12671 vec_vupkhsw(vector bool int __a) {
12672 #ifdef __LITTLE_ENDIAN__
12673 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12675 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12682 static __inline__ vector short __ATTRS_o_ai
12683 vec_unpackl(vector signed char __a) {
12684 #ifdef __LITTLE_ENDIAN__
12685 return __builtin_altivec_vupkhsb((vector char)__a);
12687 return __builtin_altivec_vupklsb((vector char)__a);
12691 static __inline__ vector bool short __ATTRS_o_ai
12692 vec_unpackl(vector bool char __a) {
12693 #ifdef __LITTLE_ENDIAN__
12694 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12696 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12700 static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
12701 #ifdef __LITTLE_ENDIAN__
12702 return __builtin_altivec_vupkhsh(__a);
12704 return __builtin_altivec_vupklsh(__a);
12708 static __inline__ vector bool int __ATTRS_o_ai
12709 vec_unpackl(vector bool short __a) {
12710 #ifdef __LITTLE_ENDIAN__
12711 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12713 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12717 static __inline__ vector unsigned int __ATTRS_o_ai
12718 vec_unpackl(vector pixel __a) {
12719 #ifdef __LITTLE_ENDIAN__
12720 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12722 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12726 #ifdef __POWER8_VECTOR__
12727 static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
12728 #ifdef __LITTLE_ENDIAN__
12729 return __builtin_altivec_vupkhsw(__a);
12731 return __builtin_altivec_vupklsw(__a);
12735 static __inline__ vector bool long long __ATTRS_o_ai
12736 vec_unpackl(vector bool int __a) {
12737 #ifdef __LITTLE_ENDIAN__
12738 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12740 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12744 static __inline__ vector double __ATTRS_o_ai
12745 vec_unpackl(vector float __a) {
12746 return (vector double)(__a[2], __a[3]);
12752 static __inline__ vector short __ATTRS_o_ai
12753 vec_vupklsb(vector signed char __a) {
12754 #ifdef __LITTLE_ENDIAN__
12755 return __builtin_altivec_vupkhsb((vector char)__a);
12757 return __builtin_altivec_vupklsb((vector char)__a);
12761 static __inline__ vector bool short __ATTRS_o_ai
12762 vec_vupklsb(vector bool char __a) {
12763 #ifdef __LITTLE_ENDIAN__
12764 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12766 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12772 static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
12773 #ifdef __LITTLE_ENDIAN__
12774 return __builtin_altivec_vupkhsh(__a);
12776 return __builtin_altivec_vupklsh(__a);
12780 static __inline__ vector bool int __ATTRS_o_ai
12781 vec_vupklsh(vector bool short __a) {
12782 #ifdef __LITTLE_ENDIAN__
12783 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12785 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12789 static __inline__ vector unsigned int __ATTRS_o_ai
12790 vec_vupklsh(vector pixel __a) {
12791 #ifdef __LITTLE_ENDIAN__
12792 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12794 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12800 #ifdef __POWER8_VECTOR__
12801 static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
12802 #ifdef __LITTLE_ENDIAN__
12803 return __builtin_altivec_vupkhsw(__a);
12805 return __builtin_altivec_vupklsw(__a);
12809 static __inline__ vector bool long long __ATTRS_o_ai
12810 vec_vupklsw(vector bool int __a) {
12811 #ifdef __LITTLE_ENDIAN__
12812 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12814 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12823 static __inline__ vector bool int __ATTRS_o_ai
12824 vec_vsx_ld(int __a, const vector bool int *__b) {
12825 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
12828 static __inline__ vector signed int __ATTRS_o_ai
12829 vec_vsx_ld(int __a, const vector signed int *__b) {
12830 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
12833 static __inline__ vector signed int __ATTRS_o_ai
12834 vec_vsx_ld(int __a, const signed int *__b) {
12835 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
12838 static __inline__ vector unsigned int __ATTRS_o_ai
12839 vec_vsx_ld(int __a, const vector unsigned int *__b) {
12840 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
12843 static __inline__ vector unsigned int __ATTRS_o_ai
12844 vec_vsx_ld(int __a, const unsigned int *__b) {
12845 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
12848 static __inline__ vector float __ATTRS_o_ai
12849 vec_vsx_ld(int __a, const vector float *__b) {
12850 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
12853 static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
12854 const float *__b) {
12855 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
12858 static __inline__ vector signed long long __ATTRS_o_ai
12859 vec_vsx_ld(int __a, const vector signed long long *__b) {
12860 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
12863 static __inline__ vector unsigned long long __ATTRS_o_ai
12864 vec_vsx_ld(int __a, const vector unsigned long long *__b) {
12865 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
12868 static __inline__ vector double __ATTRS_o_ai
12869 vec_vsx_ld(int __a, const vector double *__b) {
12870 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
12873 static __inline__ vector double __ATTRS_o_ai
12874 vec_vsx_ld(int __a, const double *__b) {
12875 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
12878 static __inline__ vector bool short __ATTRS_o_ai
12879 vec_vsx_ld(int __a, const vector bool short *__b) {
12880 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
12883 static __inline__ vector signed short __ATTRS_o_ai
12884 vec_vsx_ld(int __a, const vector signed short *__b) {
12885 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12888 static __inline__ vector signed short __ATTRS_o_ai
12889 vec_vsx_ld(int __a, const signed short *__b) {
12890 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12893 static __inline__ vector unsigned short __ATTRS_o_ai
12894 vec_vsx_ld(int __a, const vector unsigned short *__b) {
12895 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12898 static __inline__ vector unsigned short __ATTRS_o_ai
12899 vec_vsx_ld(int __a, const unsigned short *__b) {
12900 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12903 static __inline__ vector bool char __ATTRS_o_ai
12904 vec_vsx_ld(int __a, const vector bool char *__b) {
12905 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
12908 static __inline__ vector signed char __ATTRS_o_ai
12909 vec_vsx_ld(int __a, const vector signed char *__b) {
12910 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12913 static __inline__ vector signed char __ATTRS_o_ai
12914 vec_vsx_ld(int __a, const signed char *__b) {
12915 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12918 static __inline__ vector unsigned char __ATTRS_o_ai
12919 vec_vsx_ld(int __a, const vector unsigned char *__b) {
12920 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12923 static __inline__ vector unsigned char __ATTRS_o_ai
12924 vec_vsx_ld(int __a, const unsigned char *__b) {
12925 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12934 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12935 vector bool int *__c) {
12936 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12939 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12941 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12944 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12945 unsigned int *__c) {
12946 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12949 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12950 vector signed int *__c) {
12951 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12954 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12956 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12959 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12960 vector unsigned int *__c) {
12961 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12964 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12965 unsigned int *__c) {
12966 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12969 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12970 vector float *__c) {
12971 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12974 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12976 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12979 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12981 vector signed long long *__c) {
12982 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12985 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12987 vector unsigned long long *__c) {
12988 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12991 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12992 vector double *__c) {
12993 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12996 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12998 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
13001 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13002 vector bool short *__c) {
13003 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13006 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13007 signed short *__c) {
13008 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13011 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13012 unsigned short *__c) {
13013 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13015 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
13016 vector signed short *__c) {
13017 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13020 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
13021 signed short *__c) {
13022 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13025 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
13027 vector unsigned short *__c) {
13028 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13031 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
13032 int __b, unsigned short *__c) {
13033 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13036 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13037 vector bool char *__c) {
13038 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13041 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13042 signed char *__c) {
13043 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13046 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13047 unsigned char *__c) {
13048 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13051 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
13052 vector signed char *__c) {
13053 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13056 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
13057 signed char *__c) {
13058 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13061 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
13063 vector unsigned char *__c) {
13064 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13067 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
13068 int __b, unsigned char *__c) {
13069 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13075 #define vec_xxpermdi __builtin_vsx_xxpermdi
13076 #define vec_xxsldwi __builtin_vsx_xxsldwi
13077 #define vec_permi(__a, __b, __c) \
13078 _Generic((__a), vector signed long long \
13079 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13080 (((__c)&0x1) + 2)), \
13081 vector unsigned long long \
13082 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13083 (((__c)&0x1) + 2)), \
13085 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13086 (((__c)&0x1) + 2)))
13091 #define __builtin_altivec_vxor vec_xor
13093 static __inline__ vector signed char __ATTRS_o_ai
13094 vec_xor(vector signed char __a, vector signed char __b) {
13098 static __inline__ vector signed char __ATTRS_o_ai
13099 vec_xor(vector bool char __a, vector signed char __b) {
13100 return (vector signed char)__a ^ __b;
13103 static __inline__ vector signed char __ATTRS_o_ai
13104 vec_xor(vector signed char __a, vector bool char __b) {
13105 return __a ^ (vector signed char)__b;
13108 static __inline__ vector unsigned char __ATTRS_o_ai
13109 vec_xor(vector unsigned char __a, vector unsigned char __b) {
13113 static __inline__ vector unsigned char __ATTRS_o_ai
13114 vec_xor(vector bool char __a, vector unsigned char __b) {
13115 return (vector unsigned char)__a ^ __b;
13118 static __inline__ vector unsigned char __ATTRS_o_ai
13119 vec_xor(vector unsigned char __a, vector bool char __b) {
13120 return __a ^ (vector unsigned char)__b;
13123 static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
13124 vector bool char __b) {
13128 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
13129 vector short __b) {
13133 static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
13134 vector short __b) {
13135 return (vector short)__a ^ __b;
13138 static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
13139 vector bool short __b) {
13140 return __a ^ (vector short)__b;
13143 static __inline__ vector unsigned short __ATTRS_o_ai
13144 vec_xor(vector unsigned short __a, vector unsigned short __b) {
13148 static __inline__ vector unsigned short __ATTRS_o_ai
13149 vec_xor(vector bool short __a, vector unsigned short __b) {
13150 return (vector unsigned short)__a ^ __b;
13153 static __inline__ vector unsigned short __ATTRS_o_ai
13154 vec_xor(vector unsigned short __a, vector bool short __b) {
13155 return __a ^ (vector unsigned short)__b;
13158 static __inline__ vector bool short __ATTRS_o_ai
13159 vec_xor(vector bool short __a, vector bool short __b) {
13163 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
13168 static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
13170 return (vector int)__a ^ __b;
13173 static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
13174 vector bool int __b) {
13175 return __a ^ (vector int)__b;
13178 static __inline__ vector unsigned int __ATTRS_o_ai
13179 vec_xor(vector unsigned int __a, vector unsigned int __b) {
13183 static __inline__ vector unsigned int __ATTRS_o_ai
13184 vec_xor(vector bool int __a, vector unsigned int __b) {
13185 return (vector unsigned int)__a ^ __b;
13188 static __inline__ vector unsigned int __ATTRS_o_ai
13189 vec_xor(vector unsigned int __a, vector bool int __b) {
13190 return __a ^ (vector unsigned int)__b;
13193 static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
13194 vector bool int __b) {
13198 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
13199 vector float __b) {
13200 vector unsigned int __res =
13201 (vector unsigned int)__a ^ (vector unsigned int)__b;
13202 return (vector float)__res;
13205 static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
13206 vector float __b) {
13207 vector unsigned int __res =
13208 (vector unsigned int)__a ^ (vector unsigned int)__b;
13209 return (vector float)__res;
13212 static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
13213 vector bool int __b) {
13214 vector unsigned int __res =
13215 (vector unsigned int)__a ^ (vector unsigned int)__b;
13216 return (vector float)__res;
13220 static __inline__ vector signed long long __ATTRS_o_ai
13221 vec_xor(vector signed long long __a, vector signed long long __b) {
13225 static __inline__ vector signed long long __ATTRS_o_ai
13226 vec_xor(vector bool long long __a, vector signed long long __b) {
13227 return (vector signed long long)__a ^ __b;
13230 static __inline__ vector signed long long __ATTRS_o_ai
13231 vec_xor(vector signed long long __a, vector bool long long __b) {
13232 return __a ^ (vector signed long long)__b;
13235 static __inline__ vector unsigned long long __ATTRS_o_ai
13236 vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
13240 static __inline__ vector unsigned long long __ATTRS_o_ai
13241 vec_xor(vector bool long long __a, vector unsigned long long __b) {
13242 return (vector unsigned long long)__a ^ __b;
13245 static __inline__ vector unsigned long long __ATTRS_o_ai
13246 vec_xor(vector unsigned long long __a, vector bool long long __b) {
13247 return __a ^ (vector unsigned long long)__b;
13250 static __inline__ vector bool long long __ATTRS_o_ai
13251 vec_xor(vector bool long long __a, vector bool long long __b) {
13255 static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
13256 vector double __b) {
13257 return (vector double)((vector unsigned long long)__a ^
13258 (vector unsigned long long)__b);
13261 static __inline__ vector double __ATTRS_o_ai
13262 vec_xor(vector double __a, vector bool long long __b) {
13263 return (vector double)((vector unsigned long long)__a ^
13264 (vector unsigned long long)__b);
13267 static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
13268 vector double __b) {
13269 return (vector double)((vector unsigned long long)__a ^
13270 (vector unsigned long long)__b);
13276 static __inline__ vector signed char __ATTRS_o_ai
13277 vec_vxor(vector signed char __a, vector signed char __b) {
13281 static __inline__ vector signed char __ATTRS_o_ai
13282 vec_vxor(vector bool char __a, vector signed char __b) {
13283 return (vector signed char)__a ^ __b;
13286 static __inline__ vector signed char __ATTRS_o_ai
13287 vec_vxor(vector signed char __a, vector bool char __b) {
13288 return __a ^ (vector signed char)__b;
13291 static __inline__ vector unsigned char __ATTRS_o_ai
13292 vec_vxor(vector unsigned char __a, vector unsigned char __b) {
13296 static __inline__ vector unsigned char __ATTRS_o_ai
13297 vec_vxor(vector bool char __a, vector unsigned char __b) {
13298 return (vector unsigned char)__a ^ __b;
13301 static __inline__ vector unsigned char __ATTRS_o_ai
13302 vec_vxor(vector unsigned char __a, vector bool char __b) {
13303 return __a ^ (vector unsigned char)__b;
13306 static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
13307 vector bool char __b) {
13311 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
13312 vector short __b) {
13316 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
13317 vector short __b) {
13318 return (vector short)__a ^ __b;
13321 static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
13322 vector bool short __b) {
13323 return __a ^ (vector short)__b;
13326 static __inline__ vector unsigned short __ATTRS_o_ai
13327 vec_vxor(vector unsigned short __a, vector unsigned short __b) {
13331 static __inline__ vector unsigned short __ATTRS_o_ai
13332 vec_vxor(vector bool short __a, vector unsigned short __b) {
13333 return (vector unsigned short)__a ^ __b;
13336 static __inline__ vector unsigned short __ATTRS_o_ai
13337 vec_vxor(vector unsigned short __a, vector bool short __b) {
13338 return __a ^ (vector unsigned short)__b;
13341 static __inline__ vector bool short __ATTRS_o_ai
13342 vec_vxor(vector bool short __a, vector bool short __b) {
13346 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
13351 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
13353 return (vector int)__a ^ __b;
13356 static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
13357 vector bool int __b) {
13358 return __a ^ (vector int)__b;
13361 static __inline__ vector unsigned int __ATTRS_o_ai
13362 vec_vxor(vector unsigned int __a, vector unsigned int __b) {
13366 static __inline__ vector unsigned int __ATTRS_o_ai
13367 vec_vxor(vector bool int __a, vector unsigned int __b) {
13368 return (vector unsigned int)__a ^ __b;
13371 static __inline__ vector unsigned int __ATTRS_o_ai
13372 vec_vxor(vector unsigned int __a, vector bool int __b) {
13373 return __a ^ (vector unsigned int)__b;
13376 static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
13377 vector bool int __b) {
13381 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
13382 vector float __b) {
13383 vector unsigned int __res =
13384 (vector unsigned int)__a ^ (vector unsigned int)__b;
13385 return (vector float)__res;
13388 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
13389 vector float __b) {
13390 vector unsigned int __res =
13391 (vector unsigned int)__a ^ (vector unsigned int)__b;
13392 return (vector float)__res;
13395 static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
13396 vector bool int __b) {
13397 vector unsigned int __res =
13398 (vector unsigned int)__a ^ (vector unsigned int)__b;
13399 return (vector float)__res;
13403 static __inline__ vector signed long long __ATTRS_o_ai
13404 vec_vxor(vector signed long long __a, vector signed long long __b) {
13408 static __inline__ vector signed long long __ATTRS_o_ai
13409 vec_vxor(vector bool long long __a, vector signed long long __b) {
13410 return (vector signed long long)__a ^ __b;
13413 static __inline__ vector signed long long __ATTRS_o_ai
13414 vec_vxor(vector signed long long __a, vector bool long long __b) {
13415 return __a ^ (vector signed long long)__b;
13418 static __inline__ vector unsigned long long __ATTRS_o_ai
13419 vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
13423 static __inline__ vector unsigned long long __ATTRS_o_ai
13424 vec_vxor(vector bool long long __a, vector unsigned long long __b) {
13425 return (vector unsigned long long)__a ^ __b;
13428 static __inline__ vector unsigned long long __ATTRS_o_ai
13429 vec_vxor(vector unsigned long long __a, vector bool long long __b) {
13430 return __a ^ (vector unsigned long long)__b;
13433 static __inline__ vector bool long long __ATTRS_o_ai
13434 vec_vxor(vector bool long long __a, vector bool long long __b) {
13439 /* ------------------------ extensions for CBEA ----------------------------- */
13443 static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
13444 unsigned int __b) {
13445 return __a[__b & 0xf];
13448 static __inline__ unsigned char __ATTRS_o_ai
13449 vec_extract(vector unsigned char __a, unsigned int __b) {
13450 return __a[__b & 0xf];
13453 static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
13454 unsigned int __b) {
13455 return __a[__b & 0xf];
13458 static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
13459 unsigned int __b) {
13460 return __a[__b & 0x7];
13463 static __inline__ unsigned short __ATTRS_o_ai
13464 vec_extract(vector unsigned short __a, unsigned int __b) {
13465 return __a[__b & 0x7];
13468 static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
13469 unsigned int __b) {
13470 return __a[__b & 0x7];
13473 static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
13474 unsigned int __b) {
13475 return __a[__b & 0x3];
13478 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
13479 unsigned int __b) {
13480 return __a[__b & 0x3];
13483 static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
13484 unsigned int __b) {
13485 return __a[__b & 0x3];
13489 static __inline__ signed long long __ATTRS_o_ai
13490 vec_extract(vector signed long long __a, unsigned int __b) {
13491 return __a[__b & 0x1];
13494 static __inline__ unsigned long long __ATTRS_o_ai
13495 vec_extract(vector unsigned long long __a, unsigned int __b) {
13496 return __a[__b & 0x1];
13499 static __inline__ unsigned long long __ATTRS_o_ai
13500 vec_extract(vector bool long long __a, unsigned int __b) {
13501 return __a[__b & 0x1];
13504 static __inline__ double __ATTRS_o_ai vec_extract(vector double __a,
13505 unsigned int __b) {
13506 return __a[__b & 0x1];
13510 static __inline__ float __ATTRS_o_ai vec_extract(vector float __a,
13511 unsigned int __b) {
13512 return __a[__b & 0x3];
13515 #ifdef __POWER9_VECTOR__
13517 #define vec_insert4b __builtin_vsx_insertword
13518 #define vec_extract4b __builtin_vsx_extractuword
13520 /* vec_extract_exp */
13522 static __inline__ vector unsigned int __ATTRS_o_ai
13523 vec_extract_exp(vector float __a) {
13524 return __builtin_vsx_xvxexpsp(__a);
13527 static __inline__ vector unsigned long long __ATTRS_o_ai
13528 vec_extract_exp(vector double __a) {
13529 return __builtin_vsx_xvxexpdp(__a);
13532 /* vec_extract_sig */
13534 static __inline__ vector unsigned int __ATTRS_o_ai
13535 vec_extract_sig(vector float __a) {
13536 return __builtin_vsx_xvxsigsp(__a);
13539 static __inline__ vector unsigned long long __ATTRS_o_ai
13540 vec_extract_sig (vector double __a) {
13541 return __builtin_vsx_xvxsigdp(__a);
13544 static __inline__ vector float __ATTRS_o_ai
13545 vec_extract_fp32_from_shorth(vector unsigned short __a) {
13546 vector unsigned short __b =
13547 #ifdef __LITTLE_ENDIAN__
13548 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
13550 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
13552 return __builtin_vsx_xvcvhpsp(__b);
13555 static __inline__ vector float __ATTRS_o_ai
13556 vec_extract_fp32_from_shortl(vector unsigned short __a) {
13557 vector unsigned short __b =
13558 #ifdef __LITTLE_ENDIAN__
13559 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
13561 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
13563 return __builtin_vsx_xvcvhpsp(__b);
13565 #endif /* __POWER9_VECTOR__ */
13569 static __inline__ vector signed char __ATTRS_o_ai
13570 vec_insert(signed char __a, vector signed char __b, int __c) {
13575 static __inline__ vector unsigned char __ATTRS_o_ai
13576 vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
13581 static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
13582 vector bool char __b,
13588 static __inline__ vector signed short __ATTRS_o_ai
13589 vec_insert(signed short __a, vector signed short __b, int __c) {
13594 static __inline__ vector unsigned short __ATTRS_o_ai
13595 vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
13600 static __inline__ vector bool short __ATTRS_o_ai
13601 vec_insert(unsigned short __a, vector bool short __b, int __c) {
13606 static __inline__ vector signed int __ATTRS_o_ai
13607 vec_insert(signed int __a, vector signed int __b, int __c) {
13612 static __inline__ vector unsigned int __ATTRS_o_ai
13613 vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
13618 static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
13619 vector bool int __b,
13626 static __inline__ vector signed long long __ATTRS_o_ai
13627 vec_insert(signed long long __a, vector signed long long __b, int __c) {
13632 static __inline__ vector unsigned long long __ATTRS_o_ai
13633 vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
13638 static __inline__ vector bool long long __ATTRS_o_ai
13639 vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
13643 static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
13651 static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
13660 static __inline__ vector signed char __ATTRS_o_ai
13661 vec_lvlx(int __a, const signed char *__b) {
13662 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
13663 vec_lvsl(__a, __b));
13666 static __inline__ vector signed char __ATTRS_o_ai
13667 vec_lvlx(int __a, const vector signed char *__b) {
13668 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
13669 vec_lvsl(__a, (unsigned char *)__b));
13672 static __inline__ vector unsigned char __ATTRS_o_ai
13673 vec_lvlx(int __a, const unsigned char *__b) {
13674 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
13675 vec_lvsl(__a, __b));
13678 static __inline__ vector unsigned char __ATTRS_o_ai
13679 vec_lvlx(int __a, const vector unsigned char *__b) {
13680 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
13681 vec_lvsl(__a, (unsigned char *)__b));
13684 static __inline__ vector bool char __ATTRS_o_ai
13685 vec_lvlx(int __a, const vector bool char *__b) {
13686 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
13687 vec_lvsl(__a, (unsigned char *)__b));
13690 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
13691 const short *__b) {
13692 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
13695 static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
13696 const vector short *__b) {
13697 return vec_perm(vec_ld(__a, __b), (vector short)(0),
13698 vec_lvsl(__a, (unsigned char *)__b));
13701 static __inline__ vector unsigned short __ATTRS_o_ai
13702 vec_lvlx(int __a, const unsigned short *__b) {
13703 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
13704 vec_lvsl(__a, __b));
13707 static __inline__ vector unsigned short __ATTRS_o_ai
13708 vec_lvlx(int __a, const vector unsigned short *__b) {
13709 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
13710 vec_lvsl(__a, (unsigned char *)__b));
13713 static __inline__ vector bool short __ATTRS_o_ai
13714 vec_lvlx(int __a, const vector bool short *__b) {
13715 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
13716 vec_lvsl(__a, (unsigned char *)__b));
13719 static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
13720 const vector pixel *__b) {
13721 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
13722 vec_lvsl(__a, (unsigned char *)__b));
13725 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
13726 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
13729 static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
13730 const vector int *__b) {
13731 return vec_perm(vec_ld(__a, __b), (vector int)(0),
13732 vec_lvsl(__a, (unsigned char *)__b));
13735 static __inline__ vector unsigned int __ATTRS_o_ai
13736 vec_lvlx(int __a, const unsigned int *__b) {
13737 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
13738 vec_lvsl(__a, __b));
13741 static __inline__ vector unsigned int __ATTRS_o_ai
13742 vec_lvlx(int __a, const vector unsigned int *__b) {
13743 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
13744 vec_lvsl(__a, (unsigned char *)__b));
13747 static __inline__ vector bool int __ATTRS_o_ai
13748 vec_lvlx(int __a, const vector bool int *__b) {
13749 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
13750 vec_lvsl(__a, (unsigned char *)__b));
13753 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
13754 const float *__b) {
13755 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
13758 static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
13759 const vector float *__b) {
13760 return vec_perm(vec_ld(__a, __b), (vector float)(0),
13761 vec_lvsl(__a, (unsigned char *)__b));
13766 static __inline__ vector signed char __ATTRS_o_ai
13767 vec_lvlxl(int __a, const signed char *__b) {
13768 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
13769 vec_lvsl(__a, __b));
13772 static __inline__ vector signed char __ATTRS_o_ai
13773 vec_lvlxl(int __a, const vector signed char *__b) {
13774 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
13775 vec_lvsl(__a, (unsigned char *)__b));
13778 static __inline__ vector unsigned char __ATTRS_o_ai
13779 vec_lvlxl(int __a, const unsigned char *__b) {
13780 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
13781 vec_lvsl(__a, __b));
13784 static __inline__ vector unsigned char __ATTRS_o_ai
13785 vec_lvlxl(int __a, const vector unsigned char *__b) {
13786 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
13787 vec_lvsl(__a, (unsigned char *)__b));
13790 static __inline__ vector bool char __ATTRS_o_ai
13791 vec_lvlxl(int __a, const vector bool char *__b) {
13792 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
13793 vec_lvsl(__a, (unsigned char *)__b));
13796 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
13797 const short *__b) {
13798 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
13801 static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
13802 const vector short *__b) {
13803 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
13804 vec_lvsl(__a, (unsigned char *)__b));
13807 static __inline__ vector unsigned short __ATTRS_o_ai
13808 vec_lvlxl(int __a, const unsigned short *__b) {
13809 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
13810 vec_lvsl(__a, __b));
13813 static __inline__ vector unsigned short __ATTRS_o_ai
13814 vec_lvlxl(int __a, const vector unsigned short *__b) {
13815 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
13816 vec_lvsl(__a, (unsigned char *)__b));
13819 static __inline__ vector bool short __ATTRS_o_ai
13820 vec_lvlxl(int __a, const vector bool short *__b) {
13821 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
13822 vec_lvsl(__a, (unsigned char *)__b));
13825 static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
13826 const vector pixel *__b) {
13827 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
13828 vec_lvsl(__a, (unsigned char *)__b));
13831 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
13832 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
13835 static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
13836 const vector int *__b) {
13837 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
13838 vec_lvsl(__a, (unsigned char *)__b));
13841 static __inline__ vector unsigned int __ATTRS_o_ai
13842 vec_lvlxl(int __a, const unsigned int *__b) {
13843 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
13844 vec_lvsl(__a, __b));
13847 static __inline__ vector unsigned int __ATTRS_o_ai
13848 vec_lvlxl(int __a, const vector unsigned int *__b) {
13849 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
13850 vec_lvsl(__a, (unsigned char *)__b));
13853 static __inline__ vector bool int __ATTRS_o_ai
13854 vec_lvlxl(int __a, const vector bool int *__b) {
13855 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
13856 vec_lvsl(__a, (unsigned char *)__b));
13859 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
13860 const float *__b) {
13861 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
13864 static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
13865 vector float *__b) {
13866 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
13867 vec_lvsl(__a, (unsigned char *)__b));
13872 static __inline__ vector signed char __ATTRS_o_ai
13873 vec_lvrx(int __a, const signed char *__b) {
13874 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
13875 vec_lvsl(__a, __b));
13878 static __inline__ vector signed char __ATTRS_o_ai
13879 vec_lvrx(int __a, const vector signed char *__b) {
13880 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
13881 vec_lvsl(__a, (unsigned char *)__b));
13884 static __inline__ vector unsigned char __ATTRS_o_ai
13885 vec_lvrx(int __a, const unsigned char *__b) {
13886 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
13887 vec_lvsl(__a, __b));
13890 static __inline__ vector unsigned char __ATTRS_o_ai
13891 vec_lvrx(int __a, const vector unsigned char *__b) {
13892 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
13893 vec_lvsl(__a, (unsigned char *)__b));
13896 static __inline__ vector bool char __ATTRS_o_ai
13897 vec_lvrx(int __a, const vector bool char *__b) {
13898 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
13899 vec_lvsl(__a, (unsigned char *)__b));
13902 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13903 const short *__b) {
13904 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13907 static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13908 const vector short *__b) {
13909 return vec_perm((vector short)(0), vec_ld(__a, __b),
13910 vec_lvsl(__a, (unsigned char *)__b));
13913 static __inline__ vector unsigned short __ATTRS_o_ai
13914 vec_lvrx(int __a, const unsigned short *__b) {
13915 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13916 vec_lvsl(__a, __b));
13919 static __inline__ vector unsigned short __ATTRS_o_ai
13920 vec_lvrx(int __a, const vector unsigned short *__b) {
13921 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13922 vec_lvsl(__a, (unsigned char *)__b));
13925 static __inline__ vector bool short __ATTRS_o_ai
13926 vec_lvrx(int __a, const vector bool short *__b) {
13927 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
13928 vec_lvsl(__a, (unsigned char *)__b));
13931 static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
13932 const vector pixel *__b) {
13933 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
13934 vec_lvsl(__a, (unsigned char *)__b));
13937 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
13938 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13941 static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
13942 const vector int *__b) {
13943 return vec_perm((vector int)(0), vec_ld(__a, __b),
13944 vec_lvsl(__a, (unsigned char *)__b));
13947 static __inline__ vector unsigned int __ATTRS_o_ai
13948 vec_lvrx(int __a, const unsigned int *__b) {
13949 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13950 vec_lvsl(__a, __b));
13953 static __inline__ vector unsigned int __ATTRS_o_ai
13954 vec_lvrx(int __a, const vector unsigned int *__b) {
13955 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13956 vec_lvsl(__a, (unsigned char *)__b));
13959 static __inline__ vector bool int __ATTRS_o_ai
13960 vec_lvrx(int __a, const vector bool int *__b) {
13961 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13962 vec_lvsl(__a, (unsigned char *)__b));
13965 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13966 const float *__b) {
13967 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13970 static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13971 const vector float *__b) {
13972 return vec_perm((vector float)(0), vec_ld(__a, __b),
13973 vec_lvsl(__a, (unsigned char *)__b));
13978 static __inline__ vector signed char __ATTRS_o_ai
13979 vec_lvrxl(int __a, const signed char *__b) {
13980 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13981 vec_lvsl(__a, __b));
13984 static __inline__ vector signed char __ATTRS_o_ai
13985 vec_lvrxl(int __a, const vector signed char *__b) {
13986 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13987 vec_lvsl(__a, (unsigned char *)__b));
13990 static __inline__ vector unsigned char __ATTRS_o_ai
13991 vec_lvrxl(int __a, const unsigned char *__b) {
13992 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13993 vec_lvsl(__a, __b));
13996 static __inline__ vector unsigned char __ATTRS_o_ai
13997 vec_lvrxl(int __a, const vector unsigned char *__b) {
13998 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13999 vec_lvsl(__a, (unsigned char *)__b));
14002 static __inline__ vector bool char __ATTRS_o_ai
14003 vec_lvrxl(int __a, const vector bool char *__b) {
14004 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
14005 vec_lvsl(__a, (unsigned char *)__b));
14008 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
14009 const short *__b) {
14010 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14013 static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
14014 const vector short *__b) {
14015 return vec_perm((vector short)(0), vec_ldl(__a, __b),
14016 vec_lvsl(__a, (unsigned char *)__b));
14019 static __inline__ vector unsigned short __ATTRS_o_ai
14020 vec_lvrxl(int __a, const unsigned short *__b) {
14021 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
14022 vec_lvsl(__a, __b));
14025 static __inline__ vector unsigned short __ATTRS_o_ai
14026 vec_lvrxl(int __a, const vector unsigned short *__b) {
14027 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
14028 vec_lvsl(__a, (unsigned char *)__b));
14031 static __inline__ vector bool short __ATTRS_o_ai
14032 vec_lvrxl(int __a, const vector bool short *__b) {
14033 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
14034 vec_lvsl(__a, (unsigned char *)__b));
14037 static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
14038 const vector pixel *__b) {
14039 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
14040 vec_lvsl(__a, (unsigned char *)__b));
14043 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
14044 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14047 static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
14048 const vector int *__b) {
14049 return vec_perm((vector int)(0), vec_ldl(__a, __b),
14050 vec_lvsl(__a, (unsigned char *)__b));
14053 static __inline__ vector unsigned int __ATTRS_o_ai
14054 vec_lvrxl(int __a, const unsigned int *__b) {
14055 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
14056 vec_lvsl(__a, __b));
14059 static __inline__ vector unsigned int __ATTRS_o_ai
14060 vec_lvrxl(int __a, const vector unsigned int *__b) {
14061 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
14062 vec_lvsl(__a, (unsigned char *)__b));
14065 static __inline__ vector bool int __ATTRS_o_ai
14066 vec_lvrxl(int __a, const vector bool int *__b) {
14067 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
14068 vec_lvsl(__a, (unsigned char *)__b));
14071 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
14072 const float *__b) {
14073 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14076 static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
14077 const vector float *__b) {
14078 return vec_perm((vector float)(0), vec_ldl(__a, __b),
14079 vec_lvsl(__a, (unsigned char *)__b));
14084 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
14085 signed char *__c) {
14086 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14090 static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
14091 vector signed char *__c) {
14093 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14097 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
14098 unsigned char *__c) {
14099 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14103 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
14104 vector unsigned char *__c) {
14106 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14110 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
14111 vector bool char *__c) {
14113 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14117 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
14119 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14123 static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
14124 vector short *__c) {
14126 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14130 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
14131 int __b, unsigned short *__c) {
14132 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14136 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
14138 vector unsigned short *__c) {
14140 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14144 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
14145 vector bool short *__c) {
14147 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14151 static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
14152 vector pixel *__c) {
14154 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14158 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
14160 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14164 static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
14167 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14171 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
14172 unsigned int *__c) {
14173 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14177 static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
14178 vector unsigned int *__c) {
14180 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14184 static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
14185 vector bool int *__c) {
14187 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14191 static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
14192 vector float *__c) {
14194 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14200 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
14201 signed char *__c) {
14202 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14206 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
14207 vector signed char *__c) {
14209 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14213 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
14214 int __b, unsigned char *__c) {
14215 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14219 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
14221 vector unsigned char *__c) {
14223 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14227 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
14228 vector bool char *__c) {
14230 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14234 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
14236 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14240 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
14241 vector short *__c) {
14243 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14247 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
14248 int __b, unsigned short *__c) {
14249 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14253 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
14255 vector unsigned short *__c) {
14257 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14261 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
14262 vector bool short *__c) {
14264 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14268 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
14269 vector pixel *__c) {
14271 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14275 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
14277 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14281 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
14284 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14288 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
14289 unsigned int *__c) {
14290 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
14294 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
14295 vector unsigned int *__c) {
14297 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14301 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
14302 vector bool int *__c) {
14304 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14308 static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
14309 vector float *__c) {
14311 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14317 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
14318 signed char *__c) {
14319 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14323 static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
14324 vector signed char *__c) {
14326 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14330 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
14331 unsigned char *__c) {
14332 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14336 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
14337 vector unsigned char *__c) {
14339 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14343 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
14344 vector bool char *__c) {
14346 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14350 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
14352 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14356 static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
14357 vector short *__c) {
14359 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14363 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
14364 int __b, unsigned short *__c) {
14365 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14369 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
14371 vector unsigned short *__c) {
14373 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14377 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
14378 vector bool short *__c) {
14380 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14384 static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
14385 vector pixel *__c) {
14387 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14391 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
14393 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14397 static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
14400 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14404 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
14405 unsigned int *__c) {
14406 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14410 static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
14411 vector unsigned int *__c) {
14413 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14417 static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
14418 vector bool int *__c) {
14420 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14424 static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
14425 vector float *__c) {
14427 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14433 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
14434 signed char *__c) {
14435 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14439 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
14440 vector signed char *__c) {
14442 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14446 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
14447 int __b, unsigned char *__c) {
14448 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14452 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
14454 vector unsigned char *__c) {
14456 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14460 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
14461 vector bool char *__c) {
14463 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14467 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
14469 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14473 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
14474 vector short *__c) {
14476 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14480 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
14481 int __b, unsigned short *__c) {
14482 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14486 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
14488 vector unsigned short *__c) {
14490 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14494 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
14495 vector bool short *__c) {
14497 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14501 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
14502 vector pixel *__c) {
14504 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14508 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
14510 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14514 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
14517 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14521 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
14522 unsigned int *__c) {
14523 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
14527 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
14528 vector unsigned int *__c) {
14530 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14534 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
14535 vector bool int *__c) {
14537 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14541 static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
14542 vector float *__c) {
14544 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14550 static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
14552 vector signed char __res = (vector signed char)(0);
14553 __res[__b & 0x7] = __a;
14557 static __inline__ vector unsigned char __ATTRS_o_ai
14558 vec_promote(unsigned char __a, int __b) {
14559 vector unsigned char __res = (vector unsigned char)(0);
14560 __res[__b & 0x7] = __a;
14564 static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
14565 vector short __res = (vector short)(0);
14566 __res[__b & 0x7] = __a;
14570 static __inline__ vector unsigned short __ATTRS_o_ai
14571 vec_promote(unsigned short __a, int __b) {
14572 vector unsigned short __res = (vector unsigned short)(0);
14573 __res[__b & 0x7] = __a;
14577 static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
14578 vector int __res = (vector int)(0);
14579 __res[__b & 0x3] = __a;
14583 static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
14585 vector unsigned int __res = (vector unsigned int)(0);
14586 __res[__b & 0x3] = __a;
14590 static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
14591 vector float __res = (vector float)(0);
14592 __res[__b & 0x3] = __a;
14597 static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {
14598 vector double __res = (vector double)(0);
14599 __res[__b & 0x1] = __a;
14603 static __inline__ vector signed long long __ATTRS_o_ai
14604 vec_promote(signed long long __a, int __b) {
14605 vector signed long long __res = (vector signed long long)(0);
14606 __res[__b & 0x1] = __a;
14610 static __inline__ vector unsigned long long __ATTRS_o_ai
14611 vec_promote(unsigned long long __a, int __b) {
14612 vector unsigned long long __res = (vector unsigned long long)(0);
14613 __res[__b & 0x1] = __a;
14620 static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
14621 return (vector signed char)(__a);
14624 static __inline__ vector unsigned char __ATTRS_o_ai
14625 vec_splats(unsigned char __a) {
14626 return (vector unsigned char)(__a);
14629 static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
14630 return (vector short)(__a);
14633 static __inline__ vector unsigned short __ATTRS_o_ai
14634 vec_splats(unsigned short __a) {
14635 return (vector unsigned short)(__a);
14638 static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
14639 return (vector int)(__a);
14642 static __inline__ vector unsigned int __ATTRS_o_ai
14643 vec_splats(unsigned int __a) {
14644 return (vector unsigned int)(__a);
14648 static __inline__ vector signed long long __ATTRS_o_ai
14649 vec_splats(signed long long __a) {
14650 return (vector signed long long)(__a);
14653 static __inline__ vector unsigned long long __ATTRS_o_ai
14654 vec_splats(unsigned long long __a) {
14655 return (vector unsigned long long)(__a);
14658 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14659 defined(__SIZEOF_INT128__)
14660 static __inline__ vector signed __int128 __ATTRS_o_ai
14661 vec_splats(signed __int128 __a) {
14662 return (vector signed __int128)(__a);
14665 static __inline__ vector unsigned __int128 __ATTRS_o_ai
14666 vec_splats(unsigned __int128 __a) {
14667 return (vector unsigned __int128)(__a);
14672 static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
14673 return (vector double)(__a);
14677 static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
14678 return (vector float)(__a);
14681 /* ----------------------------- predicates --------------------------------- */
14685 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
14686 vector signed char __b) {
14687 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14691 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
14692 vector bool char __b) {
14693 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14697 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
14698 vector unsigned char __b) {
14699 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14703 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
14704 vector bool char __b) {
14705 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14709 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14710 vector signed char __b) {
14711 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14715 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14716 vector unsigned char __b) {
14717 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14721 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14722 vector bool char __b) {
14723 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14727 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
14728 vector short __b) {
14729 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
14732 static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
14733 vector bool short __b) {
14734 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
14737 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
14738 vector unsigned short __b) {
14739 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14740 (vector short)__b);
14743 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
14744 vector bool short __b) {
14745 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14746 (vector short)__b);
14749 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14750 vector short __b) {
14751 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14752 (vector short)__b);
14755 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14756 vector unsigned short __b) {
14757 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14758 (vector short)__b);
14761 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14762 vector bool short __b) {
14763 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14764 (vector short)__b);
14767 static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
14768 vector pixel __b) {
14769 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14770 (vector short)__b);
14773 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
14774 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
14777 static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
14778 vector bool int __b) {
14779 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
14782 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
14783 vector unsigned int __b) {
14784 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14788 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
14789 vector bool int __b) {
14790 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14794 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14796 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14800 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14801 vector unsigned int __b) {
14802 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14806 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14807 vector bool int __b) {
14808 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14813 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
14814 vector signed long long __b) {
14815 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
14818 static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
14819 vector bool long long __b) {
14820 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
14823 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14824 vector unsigned long long __b) {
14825 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14826 (vector long long)__b);
14829 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14830 vector bool long long __b) {
14831 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14832 (vector long long)__b);
14835 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14836 vector long long __b) {
14837 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14838 (vector long long)__b);
14841 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14842 vector unsigned long long __b) {
14843 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14844 (vector long long)__b);
14847 static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14848 vector bool long long __b) {
14849 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14850 (vector long long)__b);
14854 static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
14855 vector float __b) {
14857 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
14859 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
14864 static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
14865 vector double __b) {
14866 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
14870 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14871 static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,
14872 vector signed __int128 __b) {
14873 return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14876 static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned __int128 __a,
14877 vector unsigned __int128 __b) {
14878 return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14884 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
14885 vector signed char __b) {
14886 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
14889 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
14890 vector bool char __b) {
14891 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
14894 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
14895 vector unsigned char __b) {
14896 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
14899 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
14900 vector bool char __b) {
14901 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
14904 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
14905 vector signed char __b) {
14906 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, (vector signed char)__a);
14909 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
14910 vector unsigned char __b) {
14911 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
14914 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
14915 vector bool char __b) {
14916 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
14917 (vector unsigned char)__a);
14920 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
14921 vector short __b) {
14922 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
14925 static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
14926 vector bool short __b) {
14927 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
14930 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14931 vector unsigned short __b) {
14932 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
14935 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14936 vector bool short __b) {
14937 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14941 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14942 vector short __b) {
14943 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, (vector signed short)__a);
14946 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14947 vector unsigned short __b) {
14948 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
14949 (vector unsigned short)__a);
14952 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14953 vector bool short __b) {
14954 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14955 (vector unsigned short)__a);
14958 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
14959 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
14962 static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
14963 vector bool int __b) {
14964 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
14967 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14968 vector unsigned int __b) {
14969 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
14972 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14973 vector bool int __b) {
14974 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14977 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14979 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, (vector signed int)__a);
14982 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14983 vector unsigned int __b) {
14984 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14987 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14988 vector bool int __b) {
14989 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14990 (vector unsigned int)__a);
14994 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14995 vector signed long long __b) {
14996 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14998 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14999 vector bool long long __b) {
15000 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
15004 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
15005 vector unsigned long long __b) {
15006 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
15009 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
15010 vector bool long long __b) {
15011 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
15015 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15016 vector signed long long __b) {
15017 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b,
15018 (vector signed long long)__a);
15021 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15022 vector unsigned long long __b) {
15023 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
15024 (vector unsigned long long)__a);
15027 static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15028 vector bool long long __b) {
15029 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
15030 (vector unsigned long long)__a);
15034 static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
15035 vector float __b) {
15037 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
15039 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
15044 static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
15045 vector double __b) {
15046 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
15050 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15051 static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,
15052 vector signed __int128 __b) {
15053 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);
15056 static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned __int128 __a,
15057 vector unsigned __int128 __b) {
15058 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __b, __a);
15064 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
15065 vector signed char __b) {
15066 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
15069 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
15070 vector bool char __b) {
15071 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
15074 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
15075 vector unsigned char __b) {
15076 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
15079 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
15080 vector bool char __b) {
15081 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
15084 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15085 vector signed char __b) {
15086 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__a, __b);
15089 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15090 vector unsigned char __b) {
15091 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
15094 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15095 vector bool char __b) {
15096 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
15097 (vector unsigned char)__b);
15100 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
15101 vector short __b) {
15102 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
15105 static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
15106 vector bool short __b) {
15107 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
15110 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
15111 vector unsigned short __b) {
15112 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
15115 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
15116 vector bool short __b) {
15117 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
15118 (vector unsigned short)__b);
15121 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15122 vector short __b) {
15123 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector signed short)__a, __b);
15126 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15127 vector unsigned short __b) {
15128 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
15132 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15133 vector bool short __b) {
15134 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
15135 (vector unsigned short)__b);
15138 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
15139 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
15142 static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
15143 vector bool int __b) {
15144 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
15147 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
15148 vector unsigned int __b) {
15149 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
15152 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
15153 vector bool int __b) {
15154 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
15157 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15159 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector signed int)__a, __b);
15162 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15163 vector unsigned int __b) {
15164 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
15167 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15168 vector bool int __b) {
15169 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
15170 (vector unsigned int)__b);
15174 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
15175 vector signed long long __b) {
15176 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
15178 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
15179 vector bool long long __b) {
15180 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
15181 (vector signed long long)__b);
15184 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
15185 vector unsigned long long __b) {
15186 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
15189 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
15190 vector bool long long __b) {
15191 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
15192 (vector unsigned long long)__b);
15195 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15196 vector signed long long __b) {
15197 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__a,
15201 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15202 vector unsigned long long __b) {
15203 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
15207 static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15208 vector bool long long __b) {
15209 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
15210 (vector unsigned long long)__b);
15214 static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
15215 vector float __b) {
15217 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
15219 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
15224 static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
15225 vector double __b) {
15226 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
15230 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15231 static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,
15232 vector signed __int128 __b) {
15233 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);
15236 static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned __int128 __a,
15237 vector unsigned __int128 __b) {
15238 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __a, __b);
15244 static __inline__ int __attribute__((__always_inline__))
15245 vec_all_in(vector float __a, vector float __b) {
15246 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
15251 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
15252 vector signed char __b) {
15253 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
15256 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
15257 vector bool char __b) {
15258 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
15261 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
15262 vector unsigned char __b) {
15263 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
15266 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
15267 vector bool char __b) {
15268 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
15271 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15272 vector signed char __b) {
15273 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__a, __b);
15276 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15277 vector unsigned char __b) {
15278 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
15281 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15282 vector bool char __b) {
15283 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
15284 (vector unsigned char)__b);
15287 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
15288 vector short __b) {
15289 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
15292 static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
15293 vector bool short __b) {
15294 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
15297 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
15298 vector unsigned short __b) {
15299 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
15302 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
15303 vector bool short __b) {
15304 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
15305 (vector unsigned short)__b);
15308 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15309 vector short __b) {
15310 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector signed short)__a, __b);
15313 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15314 vector unsigned short __b) {
15315 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
15319 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15320 vector bool short __b) {
15321 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
15322 (vector unsigned short)__b);
15325 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
15326 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
15329 static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
15330 vector bool int __b) {
15331 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
15334 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
15335 vector unsigned int __b) {
15336 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
15339 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
15340 vector bool int __b) {
15341 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
15344 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15346 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector signed int)__a, __b);
15349 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15350 vector unsigned int __b) {
15351 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
15354 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15355 vector bool int __b) {
15356 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
15357 (vector unsigned int)__b);
15361 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
15362 vector signed long long __b) {
15363 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
15366 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
15367 vector unsigned long long __b) {
15368 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
15371 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
15372 vector bool long long __b) {
15373 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
15374 (vector signed long long)__b);
15377 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
15378 vector bool long long __b) {
15379 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
15380 (vector unsigned long long)__b);
15383 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15384 vector signed long long __b) {
15385 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__a,
15389 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15390 vector unsigned long long __b) {
15391 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
15395 static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15396 vector bool long long __b) {
15397 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
15398 (vector unsigned long long)__b);
15402 static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
15403 vector float __b) {
15405 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
15407 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
15412 static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
15413 vector double __b) {
15414 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
15418 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15419 static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,
15420 vector signed __int128 __b) {
15421 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);
15424 static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned __int128 __a,
15425 vector unsigned __int128 __b) {
15426 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __a, __b);
15432 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
15433 vector signed char __b) {
15434 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
15437 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
15438 vector bool char __b) {
15439 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
15442 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
15443 vector unsigned char __b) {
15444 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
15447 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
15448 vector bool char __b) {
15449 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
15452 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15453 vector signed char __b) {
15454 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, (vector signed char)__a);
15457 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15458 vector unsigned char __b) {
15459 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
15462 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15463 vector bool char __b) {
15464 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
15465 (vector unsigned char)__a);
15468 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
15469 vector short __b) {
15470 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
15473 static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
15474 vector bool short __b) {
15475 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
15478 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
15479 vector unsigned short __b) {
15480 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
15483 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
15484 vector bool short __b) {
15485 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
15489 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15490 vector short __b) {
15491 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, (vector signed short)__a);
15494 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15495 vector unsigned short __b) {
15496 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
15497 (vector unsigned short)__a);
15500 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15501 vector bool short __b) {
15502 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
15503 (vector unsigned short)__a);
15506 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
15507 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
15510 static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
15511 vector bool int __b) {
15512 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
15515 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
15516 vector unsigned int __b) {
15517 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
15520 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
15521 vector bool int __b) {
15522 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
15525 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15527 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, (vector signed int)__a);
15530 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15531 vector unsigned int __b) {
15532 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
15535 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15536 vector bool int __b) {
15537 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
15538 (vector unsigned int)__a);
15542 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15543 vector signed long long __b) {
15544 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
15547 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15548 vector unsigned long long __b) {
15549 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
15552 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15553 vector bool long long __b) {
15554 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
15558 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15559 vector bool long long __b) {
15560 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15564 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15565 vector signed long long __b) {
15566 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b,
15567 (vector signed long long)__a);
15570 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15571 vector unsigned long long __b) {
15572 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
15573 (vector unsigned long long)__a);
15576 static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15577 vector bool long long __b) {
15578 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15579 (vector unsigned long long)__a);
15583 static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
15584 vector float __b) {
15586 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
15588 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
15593 static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
15594 vector double __b) {
15595 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
15599 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15600 static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,
15601 vector signed __int128 __b) {
15602 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);
15605 static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned __int128 __a,
15606 vector unsigned __int128 __b) {
15607 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __b, __a);
15613 static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
15615 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
15617 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
15622 static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
15623 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
15629 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
15630 vector signed char __b) {
15631 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15635 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
15636 vector bool char __b) {
15637 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15641 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
15642 vector unsigned char __b) {
15643 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15647 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
15648 vector bool char __b) {
15649 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15653 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15654 vector signed char __b) {
15655 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15659 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15660 vector unsigned char __b) {
15661 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15665 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15666 vector bool char __b) {
15667 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15671 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
15672 vector short __b) {
15673 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
15676 static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
15677 vector bool short __b) {
15678 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
15681 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
15682 vector unsigned short __b) {
15683 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15684 (vector short)__b);
15687 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
15688 vector bool short __b) {
15689 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15690 (vector short)__b);
15693 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15694 vector short __b) {
15695 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15696 (vector short)__b);
15699 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15700 vector unsigned short __b) {
15701 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15702 (vector short)__b);
15705 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15706 vector bool short __b) {
15707 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15708 (vector short)__b);
15711 static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
15712 vector pixel __b) {
15713 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15714 (vector short)__b);
15717 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
15718 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
15721 static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
15722 vector bool int __b) {
15723 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
15726 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
15727 vector unsigned int __b) {
15728 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15732 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
15733 vector bool int __b) {
15734 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15738 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15740 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15744 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15745 vector unsigned int __b) {
15746 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15750 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15751 vector bool int __b) {
15752 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15757 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15758 vector signed long long __b) {
15759 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
15762 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
15763 vector unsigned long long __b) {
15764 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
15765 (vector long long)__b);
15768 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15769 vector bool long long __b) {
15770 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
15771 (vector signed long long)__b);
15774 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
15775 vector bool long long __b) {
15776 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15777 (vector signed long long)__b);
15780 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15781 vector signed long long __b) {
15782 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15783 (vector signed long long)__b);
15786 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15787 vector unsigned long long __b) {
15788 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15789 (vector signed long long)__b);
15792 static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15793 vector bool long long __b) {
15794 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15795 (vector signed long long)__b);
15799 static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
15800 vector float __b) {
15802 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);
15804 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
15809 static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
15810 vector double __b) {
15811 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
15815 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15816 static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,
15817 vector signed __int128 __b) {
15818 return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15821 static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned __int128 __a,
15822 vector unsigned __int128 __b) {
15823 return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15829 static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
15830 vector float __b) {
15832 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
15834 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
15839 static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
15840 vector double __b) {
15841 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
15847 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
15848 vector float __b) {
15850 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
15852 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
15857 static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
15858 vector double __b) {
15859 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
15865 static __inline__ int __ATTRS_o_ai
15866 vec_all_nle(vector float __a, vector float __b) {
15868 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);
15870 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
15875 static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,
15876 vector double __b) {
15877 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);
15883 static __inline__ int __ATTRS_o_ai
15884 vec_all_nlt(vector float __a, vector float __b) {
15886 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);
15888 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
15893 static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,
15894 vector double __b) {
15895 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);
15899 /* vec_all_numeric */
15901 static __inline__ int __ATTRS_o_ai
15902 vec_all_numeric(vector float __a) {
15904 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);
15906 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
15911 static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {
15912 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);
15918 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
15919 vector signed char __b) {
15920 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15924 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
15925 vector bool char __b) {
15926 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15930 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
15931 vector unsigned char __b) {
15932 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15936 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
15937 vector bool char __b) {
15938 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15942 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
15943 vector signed char __b) {
15944 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15948 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
15949 vector unsigned char __b) {
15950 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15954 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
15955 vector bool char __b) {
15956 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
15960 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
15961 vector short __b) {
15962 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
15965 static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
15966 vector bool short __b) {
15967 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
15970 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
15971 vector unsigned short __b) {
15972 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15973 (vector short)__b);
15976 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
15977 vector bool short __b) {
15978 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15979 (vector short)__b);
15982 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
15983 vector short __b) {
15984 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15985 (vector short)__b);
15988 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
15989 vector unsigned short __b) {
15990 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15991 (vector short)__b);
15994 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
15995 vector bool short __b) {
15996 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15997 (vector short)__b);
16000 static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
16001 vector pixel __b) {
16002 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16003 (vector short)__b);
16006 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
16007 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
16010 static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
16011 vector bool int __b) {
16012 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
16015 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
16016 vector unsigned int __b) {
16017 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16021 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
16022 vector bool int __b) {
16023 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16027 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16029 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16033 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16034 vector unsigned int __b) {
16035 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16039 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16040 vector bool int __b) {
16041 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16046 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
16047 vector signed long long __b) {
16048 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
16051 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
16052 vector unsigned long long __b) {
16053 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
16054 (vector long long)__b);
16057 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
16058 vector bool long long __b) {
16059 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
16060 (vector signed long long)__b);
16063 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
16064 vector bool long long __b) {
16065 return __builtin_altivec_vcmpequd_p(
16066 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16069 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16070 vector signed long long __b) {
16071 return __builtin_altivec_vcmpequd_p(
16072 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16075 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16076 vector unsigned long long __b) {
16077 return __builtin_altivec_vcmpequd_p(
16078 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16081 static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16082 vector bool long long __b) {
16083 return __builtin_altivec_vcmpequd_p(
16084 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16088 static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
16089 vector float __b) {
16091 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
16093 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
16098 static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
16099 vector double __b) {
16100 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
16104 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16105 static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,
16106 vector signed __int128 __b) {
16107 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
16110 static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned __int128 __a,
16111 vector unsigned __int128 __b) {
16112 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
16118 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
16119 vector signed char __b) {
16120 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
16123 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
16124 vector bool char __b) {
16125 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
16129 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
16130 vector unsigned char __b) {
16131 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
16134 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
16135 vector bool char __b) {
16136 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
16140 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16141 vector signed char __b) {
16142 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b,
16143 (vector signed char)__a);
16146 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16147 vector unsigned char __b) {
16148 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
16149 (vector unsigned char)__a);
16152 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16153 vector bool char __b) {
16154 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
16155 (vector unsigned char)__a);
16158 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
16159 vector short __b) {
16160 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
16163 static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
16164 vector bool short __b) {
16165 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
16168 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
16169 vector unsigned short __b) {
16170 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
16173 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
16174 vector bool short __b) {
16175 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
16179 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16180 vector short __b) {
16181 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b,
16182 (vector signed short)__a);
16185 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16186 vector unsigned short __b) {
16187 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
16188 (vector unsigned short)__a);
16191 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16192 vector bool short __b) {
16193 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
16194 (vector unsigned short)__a);
16197 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
16198 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
16201 static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
16202 vector bool int __b) {
16203 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
16206 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
16207 vector unsigned int __b) {
16208 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
16211 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
16212 vector bool int __b) {
16213 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
16217 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16219 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b,
16220 (vector signed int)__a);
16223 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16224 vector unsigned int __b) {
16225 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
16226 (vector unsigned int)__a);
16229 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16230 vector bool int __b) {
16231 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
16232 (vector unsigned int)__a);
16236 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
16237 vector signed long long __b) {
16238 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
16241 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
16242 vector unsigned long long __b) {
16243 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
16246 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
16247 vector bool long long __b) {
16248 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16249 (vector signed long long)__b, __a);
16252 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
16253 vector bool long long __b) {
16254 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16255 (vector unsigned long long)__b, __a);
16258 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16259 vector signed long long __b) {
16260 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b,
16261 (vector signed long long)__a);
16264 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16265 vector unsigned long long __b) {
16266 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
16267 (vector unsigned long long)__a);
16270 static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16271 vector bool long long __b) {
16272 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16273 (vector unsigned long long)__b,
16274 (vector unsigned long long)__a);
16278 static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
16279 vector float __b) {
16281 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
16283 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
16288 static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
16289 vector double __b) {
16290 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
16294 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16295 static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,
16296 vector signed __int128 __b) {
16297 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);
16300 static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned __int128 __a,
16301 vector unsigned __int128 __b) {
16302 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __b, __a);
16308 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
16309 vector signed char __b) {
16310 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
16313 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
16314 vector bool char __b) {
16315 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
16316 (vector signed char)__b);
16319 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
16320 vector unsigned char __b) {
16321 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
16324 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
16325 vector bool char __b) {
16326 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
16327 (vector unsigned char)__b);
16330 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16331 vector signed char __b) {
16332 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__a,
16336 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16337 vector unsigned char __b) {
16338 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
16342 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16343 vector bool char __b) {
16344 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
16345 (vector unsigned char)__b);
16348 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
16349 vector short __b) {
16350 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
16353 static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
16354 vector bool short __b) {
16355 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
16358 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
16359 vector unsigned short __b) {
16360 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
16363 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
16364 vector bool short __b) {
16365 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
16366 (vector unsigned short)__b);
16369 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16370 vector short __b) {
16371 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector signed short)__a,
16375 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16376 vector unsigned short __b) {
16377 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
16381 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16382 vector bool short __b) {
16383 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
16384 (vector unsigned short)__b);
16387 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
16388 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
16391 static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
16392 vector bool int __b) {
16393 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
16396 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
16397 vector unsigned int __b) {
16398 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
16401 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
16402 vector bool int __b) {
16403 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
16404 (vector unsigned int)__b);
16407 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16409 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector signed int)__a,
16413 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16414 vector unsigned int __b) {
16415 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
16419 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16420 vector bool int __b) {
16421 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
16422 (vector unsigned int)__b);
16426 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
16427 vector signed long long __b) {
16428 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
16431 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
16432 vector unsigned long long __b) {
16433 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
16436 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
16437 vector bool long long __b) {
16438 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
16439 (vector signed long long)__b);
16442 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
16443 vector bool long long __b) {
16444 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
16445 (vector unsigned long long)__b);
16448 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16449 vector signed long long __b) {
16450 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16451 (vector signed long long)__a, __b);
16454 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16455 vector unsigned long long __b) {
16456 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16457 (vector unsigned long long)__a, __b);
16460 static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16461 vector bool long long __b) {
16462 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16463 (vector unsigned long long)__a,
16464 (vector unsigned long long)__b);
16468 static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
16469 vector float __b) {
16471 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
16473 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
16478 static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
16479 vector double __b) {
16480 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
16484 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16485 static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,
16486 vector signed __int128 __b) {
16487 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);
16490 static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned __int128 __a,
16491 vector unsigned __int128 __b) {
16492 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __a, __b);
16498 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
16499 vector signed char __b) {
16500 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
16503 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
16504 vector bool char __b) {
16505 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
16506 (vector signed char)__b);
16509 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
16510 vector unsigned char __b) {
16511 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
16514 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
16515 vector bool char __b) {
16516 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
16517 (vector unsigned char)__b);
16520 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16521 vector signed char __b) {
16522 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__a,
16526 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16527 vector unsigned char __b) {
16528 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
16532 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16533 vector bool char __b) {
16534 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
16535 (vector unsigned char)__b);
16538 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
16539 vector short __b) {
16540 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
16543 static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
16544 vector bool short __b) {
16545 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
16548 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
16549 vector unsigned short __b) {
16550 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
16553 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
16554 vector bool short __b) {
16555 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
16556 (vector unsigned short)__b);
16559 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16560 vector short __b) {
16561 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector signed short)__a,
16565 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16566 vector unsigned short __b) {
16567 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
16571 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16572 vector bool short __b) {
16573 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
16574 (vector unsigned short)__b);
16577 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
16578 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
16581 static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
16582 vector bool int __b) {
16583 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
16586 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16587 vector unsigned int __b) {
16588 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
16591 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16592 vector bool int __b) {
16593 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
16594 (vector unsigned int)__b);
16597 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16599 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector signed int)__a,
16603 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16604 vector unsigned int __b) {
16605 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16609 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16610 vector bool int __b) {
16611 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16612 (vector unsigned int)__b);
16616 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16617 vector signed long long __b) {
16618 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
16621 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16622 vector unsigned long long __b) {
16623 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
16626 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16627 vector bool long long __b) {
16628 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
16629 (vector signed long long)__b);
16632 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16633 vector bool long long __b) {
16634 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
16635 (vector unsigned long long)__b);
16638 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16639 vector signed long long __b) {
16640 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16641 (vector signed long long)__a, __b);
16644 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16645 vector unsigned long long __b) {
16646 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16647 (vector unsigned long long)__a, __b);
16650 static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16651 vector bool long long __b) {
16652 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16653 (vector unsigned long long)__a,
16654 (vector unsigned long long)__b);
16658 static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
16659 vector float __b) {
16661 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
16663 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
16668 static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
16669 vector double __b) {
16670 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
16674 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16675 static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,
16676 vector signed __int128 __b) {
16677 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);
16680 static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned __int128 __a,
16681 vector unsigned __int128 __b) {
16682 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __a, __b);
16688 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
16689 vector signed char __b) {
16690 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
16693 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
16694 vector bool char __b) {
16695 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
16699 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16700 vector unsigned char __b) {
16701 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
16704 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16705 vector bool char __b) {
16706 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16710 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16711 vector signed char __b) {
16712 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b,
16713 (vector signed char)__a);
16716 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16717 vector unsigned char __b) {
16718 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
16719 (vector unsigned char)__a);
16722 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16723 vector bool char __b) {
16724 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16725 (vector unsigned char)__a);
16728 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
16729 vector short __b) {
16730 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
16733 static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
16734 vector bool short __b) {
16735 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
16738 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16739 vector unsigned short __b) {
16740 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
16743 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16744 vector bool short __b) {
16745 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16749 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16750 vector short __b) {
16751 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b,
16752 (vector signed short)__a);
16755 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16756 vector unsigned short __b) {
16757 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
16758 (vector unsigned short)__a);
16761 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16762 vector bool short __b) {
16763 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16764 (vector unsigned short)__a);
16767 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
16768 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
16771 static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
16772 vector bool int __b) {
16773 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
16776 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16777 vector unsigned int __b) {
16778 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
16781 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16782 vector bool int __b) {
16783 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16787 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16789 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b,
16790 (vector signed int)__a);
16793 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16794 vector unsigned int __b) {
16795 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
16796 (vector unsigned int)__a);
16799 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16800 vector bool int __b) {
16801 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16802 (vector unsigned int)__a);
16806 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16807 vector signed long long __b) {
16808 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
16811 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16812 vector unsigned long long __b) {
16813 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
16816 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16817 vector bool long long __b) {
16818 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16819 (vector signed long long)__b, __a);
16822 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16823 vector bool long long __b) {
16824 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16825 (vector unsigned long long)__b, __a);
16828 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
16829 vector signed long long __b) {
16830 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b,
16831 (vector signed long long)__a);
16834 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
16835 vector unsigned long long __b) {
16836 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
16837 (vector unsigned long long)__a);
16840 static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
16841 vector bool long long __b) {
16842 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16843 (vector unsigned long long)__b,
16844 (vector unsigned long long)__a);
16848 static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
16849 vector float __b) {
16851 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
16853 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
16858 static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
16859 vector double __b) {
16860 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
16864 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16865 static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,
16866 vector signed __int128 __b) {
16867 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);
16870 static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,
16871 vector unsigned __int128 __b) {
16872 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __b, __a);
16878 static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a) {
16880 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __a);
16882 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
16886 static __inline__ int __ATTRS_o_ai vec_any_nan(vector double __a) {
16887 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __a);
16893 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
16894 vector signed char __b) {
16895 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16899 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
16900 vector bool char __b) {
16901 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16905 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
16906 vector unsigned char __b) {
16907 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16911 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
16912 vector bool char __b) {
16913 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16917 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
16918 vector signed char __b) {
16919 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16923 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
16924 vector unsigned char __b) {
16925 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16929 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
16930 vector bool char __b) {
16931 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
16935 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
16936 vector short __b) {
16937 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
16940 static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
16941 vector bool short __b) {
16942 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
16945 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
16946 vector unsigned short __b) {
16947 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16948 (vector short)__b);
16951 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
16952 vector bool short __b) {
16953 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16954 (vector short)__b);
16957 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
16958 vector short __b) {
16959 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16960 (vector short)__b);
16963 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
16964 vector unsigned short __b) {
16965 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16966 (vector short)__b);
16969 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
16970 vector bool short __b) {
16971 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16972 (vector short)__b);
16975 static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
16976 vector pixel __b) {
16977 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
16978 (vector short)__b);
16981 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
16982 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
16985 static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
16986 vector bool int __b) {
16987 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
16990 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
16991 vector unsigned int __b) {
16992 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
16996 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
16997 vector bool int __b) {
16998 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17002 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17004 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17008 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17009 vector unsigned int __b) {
17010 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17014 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17015 vector bool int __b) {
17016 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17021 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
17022 vector signed long long __b) {
17023 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
17026 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
17027 vector unsigned long long __b) {
17028 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
17029 (vector long long)__b);
17032 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
17033 vector bool long long __b) {
17034 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
17035 (vector signed long long)__b);
17038 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
17039 vector bool long long __b) {
17040 return __builtin_altivec_vcmpequd_p(
17041 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17044 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17045 vector signed long long __b) {
17046 return __builtin_altivec_vcmpequd_p(
17047 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17050 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17051 vector unsigned long long __b) {
17052 return __builtin_altivec_vcmpequd_p(
17053 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17056 static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17057 vector bool long long __b) {
17058 return __builtin_altivec_vcmpequd_p(
17059 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17063 static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
17064 vector float __b) {
17066 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
17068 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
17073 static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
17074 vector double __b) {
17075 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
17079 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
17080 static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,
17081 vector signed __int128 __b) {
17082 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
17085 static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,
17086 vector unsigned __int128 __b) {
17087 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
17093 static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a,
17094 vector float __b) {
17096 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __a, __b);
17098 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
17103 static __inline__ int __ATTRS_o_ai vec_any_nge(vector double __a,
17104 vector double __b) {
17105 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __a, __b);
17111 static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a,
17112 vector float __b) {
17114 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __a, __b);
17116 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
17121 static __inline__ int __ATTRS_o_ai vec_any_ngt(vector double __a,
17122 vector double __b) {
17123 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __a, __b);
17129 static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a,
17130 vector float __b) {
17132 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __b, __a);
17134 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
17139 static __inline__ int __ATTRS_o_ai vec_any_nle(vector double __a,
17140 vector double __b) {
17141 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __b, __a);
17147 static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a,
17148 vector float __b) {
17150 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __b, __a);
17152 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
17157 static __inline__ int __ATTRS_o_ai vec_any_nlt(vector double __a,
17158 vector double __b) {
17159 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __b, __a);
17163 /* vec_any_numeric */
17165 static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a) {
17167 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __a);
17169 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
17174 static __inline__ int __ATTRS_o_ai vec_any_numeric(vector double __a) {
17175 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __a);
17181 static __inline__ int __attribute__((__always_inline__))
17182 vec_any_out(vector float __a, vector float __b) {
17183 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
17186 /* Power 8 Crypto functions
17187 Note: We diverge from the current GCC implementation with regard
17188 to cryptography and related functions as follows:
17189 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
17190 - The remaining ones are only available on Power8 and up so
17191 require -mpower8-vector
17192 The justification for this is that export requirements require that
17193 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
17194 support). As a result, we need to be able to turn off support for those.
17195 The remaining ones (currently controlled by -mcrypto for GCC) still
17196 need to be provided on compliant hardware even if Vector.Crypto is not
17200 #define vec_sbox_be __builtin_altivec_crypto_vsbox
17201 #define vec_cipher_be __builtin_altivec_crypto_vcipher
17202 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
17203 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
17204 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
17206 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17207 __builtin_crypto_vsbox(vector unsigned long long __a) {
17208 return __builtin_altivec_crypto_vsbox(__a);
17211 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17212 __builtin_crypto_vcipher(vector unsigned long long __a,
17213 vector unsigned long long __b) {
17214 return __builtin_altivec_crypto_vcipher(__a, __b);
17217 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17218 __builtin_crypto_vcipherlast(vector unsigned long long __a,
17219 vector unsigned long long __b) {
17220 return __builtin_altivec_crypto_vcipherlast(__a, __b);
17223 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17224 __builtin_crypto_vncipher(vector unsigned long long __a,
17225 vector unsigned long long __b) {
17226 return __builtin_altivec_crypto_vncipher(__a, __b);
17229 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17230 __builtin_crypto_vncipherlast(vector unsigned long long __a,
17231 vector unsigned long long __b) {
17232 return __builtin_altivec_crypto_vncipherlast(__a, __b);
17235 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
17236 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
17238 #define vec_shasigma_be(X, Y, Z) \
17239 _Generic((X), vector unsigned int \
17240 : __builtin_crypto_vshasigmaw, vector unsigned long long \
17241 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
17244 #ifdef __POWER8_VECTOR__
17245 static __inline__ vector bool char __ATTRS_o_ai
17246 vec_permxor(vector bool char __a, vector bool char __b,
17247 vector bool char __c) {
17248 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17251 static __inline__ vector signed char __ATTRS_o_ai
17252 vec_permxor(vector signed char __a, vector signed char __b,
17253 vector signed char __c) {
17254 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17257 static __inline__ vector unsigned char __ATTRS_o_ai
17258 vec_permxor(vector unsigned char __a, vector unsigned char __b,
17259 vector unsigned char __c) {
17260 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17263 static __inline__ vector unsigned char __ATTRS_o_ai
17264 __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
17265 vector unsigned char __c) {
17266 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17269 static __inline__ vector unsigned short __ATTRS_o_ai
17270 __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
17271 vector unsigned short __c) {
17272 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
17273 (vector unsigned char)__a, (vector unsigned char)__b,
17274 (vector unsigned char)__c);
17277 static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
17278 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
17279 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
17280 (vector unsigned char)__a, (vector unsigned char)__b,
17281 (vector unsigned char)__c);
17284 static __inline__ vector unsigned long long __ATTRS_o_ai
17285 __builtin_crypto_vpermxor(vector unsigned long long __a,
17286 vector unsigned long long __b,
17287 vector unsigned long long __c) {
17288 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
17289 (vector unsigned char)__a, (vector unsigned char)__b,
17290 (vector unsigned char)__c);
17293 static __inline__ vector unsigned char __ATTRS_o_ai
17294 __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
17295 return __builtin_altivec_crypto_vpmsumb(__a, __b);
17298 static __inline__ vector unsigned short __ATTRS_o_ai
17299 __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
17300 return __builtin_altivec_crypto_vpmsumh(__a, __b);
17303 static __inline__ vector unsigned int __ATTRS_o_ai
17304 __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
17305 return __builtin_altivec_crypto_vpmsumw(__a, __b);
17308 static __inline__ vector unsigned long long __ATTRS_o_ai
17309 __builtin_crypto_vpmsumb(vector unsigned long long __a,
17310 vector unsigned long long __b) {
17311 return __builtin_altivec_crypto_vpmsumd(__a, __b);
17314 static __inline__ vector signed char __ATTRS_o_ai
17315 vec_vgbbd(vector signed char __a) {
17316 return __builtin_altivec_vgbbd((vector unsigned char)__a);
17319 #define vec_pmsum_be __builtin_crypto_vpmsumb
17320 #define vec_gb __builtin_altivec_vgbbd
17322 static __inline__ vector unsigned char __ATTRS_o_ai
17323 vec_vgbbd(vector unsigned char __a) {
17324 return __builtin_altivec_vgbbd(__a);
17327 static __inline__ vector signed long long __ATTRS_o_ai
17328 vec_gbb(vector signed long long __a) {
17329 return __builtin_altivec_vgbbd((vector unsigned char)__a);
17332 static __inline__ vector unsigned long long __ATTRS_o_ai
17333 vec_gbb(vector unsigned long long __a) {
17334 return __builtin_altivec_vgbbd((vector unsigned char)__a);
17337 static __inline__ vector long long __ATTRS_o_ai
17338 vec_vbpermq(vector signed char __a, vector signed char __b) {
17339 return __builtin_altivec_vbpermq((vector unsigned char)__a,
17340 (vector unsigned char)__b);
17343 static __inline__ vector long long __ATTRS_o_ai
17344 vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
17345 return __builtin_altivec_vbpermq(__a, __b);
17348 #if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
17349 static __inline__ vector unsigned long long __attribute__((__always_inline__))
17350 vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
17351 return __builtin_altivec_vbpermq((vector unsigned char)__a,
17352 (vector unsigned char)__b);
17360 static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
17361 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17365 static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
17366 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17370 static inline __ATTRS_o_ai vector unsigned char
17371 vec_reve(vector unsigned char __a) {
17372 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17376 static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
17377 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17380 static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
17381 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17384 static inline __ATTRS_o_ai vector unsigned int
17385 vec_reve(vector unsigned int __a) {
17386 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17389 static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
17390 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17393 static inline __ATTRS_o_ai vector signed short
17394 vec_reve(vector signed short __a) {
17395 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17398 static inline __ATTRS_o_ai vector unsigned short
17399 vec_reve(vector unsigned short __a) {
17400 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17403 static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
17404 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17408 static inline __ATTRS_o_ai vector bool long long
17409 vec_reve(vector bool long long __a) {
17410 return __builtin_shufflevector(__a, __a, 1, 0);
17413 static inline __ATTRS_o_ai vector signed long long
17414 vec_reve(vector signed long long __a) {
17415 return __builtin_shufflevector(__a, __a, 1, 0);
17418 static inline __ATTRS_o_ai vector unsigned long long
17419 vec_reve(vector unsigned long long __a) {
17420 return __builtin_shufflevector(__a, __a, 1, 0);
17423 static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
17424 return __builtin_shufflevector(__a, __a, 1, 0);
17429 static __inline__ vector bool char __ATTRS_o_ai
17430 vec_revb(vector bool char __a) {
17434 static __inline__ vector signed char __ATTRS_o_ai
17435 vec_revb(vector signed char __a) {
17439 static __inline__ vector unsigned char __ATTRS_o_ai
17440 vec_revb(vector unsigned char __a) {
17444 static __inline__ vector bool short __ATTRS_o_ai
17445 vec_revb(vector bool short __a) {
17446 vector unsigned char __indices =
17447 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17448 return vec_perm(__a, __a, __indices);
17451 static __inline__ vector signed short __ATTRS_o_ai
17452 vec_revb(vector signed short __a) {
17453 vector unsigned char __indices =
17454 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17455 return vec_perm(__a, __a, __indices);
17458 static __inline__ vector unsigned short __ATTRS_o_ai
17459 vec_revb(vector unsigned short __a) {
17460 vector unsigned char __indices =
17461 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17462 return vec_perm(__a, __a, __indices);
17465 static __inline__ vector bool int __ATTRS_o_ai
17466 vec_revb(vector bool int __a) {
17467 vector unsigned char __indices =
17468 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17469 return vec_perm(__a, __a, __indices);
17472 static __inline__ vector signed int __ATTRS_o_ai
17473 vec_revb(vector signed int __a) {
17474 vector unsigned char __indices =
17475 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17476 return vec_perm(__a, __a, __indices);
17479 static __inline__ vector unsigned int __ATTRS_o_ai
17480 vec_revb(vector unsigned int __a) {
17481 vector unsigned char __indices =
17482 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17483 return vec_perm(__a, __a, __indices);
17486 static __inline__ vector float __ATTRS_o_ai
17487 vec_revb(vector float __a) {
17488 vector unsigned char __indices =
17489 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17490 return vec_perm(__a, __a, __indices);
17494 static __inline__ vector bool long long __ATTRS_o_ai
17495 vec_revb(vector bool long long __a) {
17496 vector unsigned char __indices =
17497 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17498 return vec_perm(__a, __a, __indices);
17501 static __inline__ vector signed long long __ATTRS_o_ai
17502 vec_revb(vector signed long long __a) {
17503 vector unsigned char __indices =
17504 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17505 return vec_perm(__a, __a, __indices);
17508 static __inline__ vector unsigned long long __ATTRS_o_ai
17509 vec_revb(vector unsigned long long __a) {
17510 vector unsigned char __indices =
17511 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17512 return vec_perm(__a, __a, __indices);
17515 static __inline__ vector double __ATTRS_o_ai
17516 vec_revb(vector double __a) {
17517 vector unsigned char __indices =
17518 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17519 return vec_perm(__a, __a, __indices);
17521 #endif /* End __VSX__ */
17523 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17524 defined(__SIZEOF_INT128__)
17525 static __inline__ vector signed __int128 __ATTRS_o_ai
17526 vec_revb(vector signed __int128 __a) {
17527 vector unsigned char __indices =
17528 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17529 return (vector signed __int128)vec_perm((vector signed int)__a,
17530 (vector signed int)__a,
17534 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17535 vec_revb(vector unsigned __int128 __a) {
17536 vector unsigned char __indices =
17537 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17538 return (vector unsigned __int128)vec_perm((vector signed int)__a,
17539 (vector signed int)__a,
17542 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
17546 #define vec_xld2 vec_xl
17547 #define vec_xlw4 vec_xl
17548 typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
17549 typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
17550 typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
17551 typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
17552 typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
17553 typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
17554 typedef vector float unaligned_vec_float __attribute__((aligned(1)));
17556 static inline __ATTRS_o_ai vector signed char vec_xl(ptrdiff_t __offset,
17557 const signed char *__ptr) {
17558 return *(unaligned_vec_schar *)(__ptr + __offset);
17561 static inline __ATTRS_o_ai vector unsigned char
17562 vec_xl(ptrdiff_t __offset, const unsigned char *__ptr) {
17563 return *(unaligned_vec_uchar*)(__ptr + __offset);
17566 static inline __ATTRS_o_ai vector signed short
17567 vec_xl(ptrdiff_t __offset, const signed short *__ptr) {
17568 signed char *__addr = (signed char *)__ptr + __offset;
17569 return *(unaligned_vec_sshort *)__addr;
17572 static inline __ATTRS_o_ai vector unsigned short
17573 vec_xl(ptrdiff_t __offset, const unsigned short *__ptr) {
17574 signed char *__addr = (signed char *)__ptr + __offset;
17575 return *(unaligned_vec_ushort *)__addr;
17578 static inline __ATTRS_o_ai vector signed int vec_xl(ptrdiff_t __offset,
17579 const signed int *__ptr) {
17580 signed char *__addr = (signed char *)__ptr + __offset;
17581 return *(unaligned_vec_sint *)__addr;
17584 static inline __ATTRS_o_ai vector unsigned int
17585 vec_xl(ptrdiff_t __offset, const unsigned int *__ptr) {
17586 signed char *__addr = (signed char *)__ptr + __offset;
17587 return *(unaligned_vec_uint *)__addr;
17590 static inline __ATTRS_o_ai vector float vec_xl(ptrdiff_t __offset,
17591 const float *__ptr) {
17592 signed char *__addr = (signed char *)__ptr + __offset;
17593 return *(unaligned_vec_float *)__addr;
17597 typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
17598 typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
17599 typedef vector double unaligned_vec_double __attribute__((aligned(1)));
17601 static inline __ATTRS_o_ai vector signed long long
17602 vec_xl(ptrdiff_t __offset, const signed long long *__ptr) {
17603 signed char *__addr = (signed char *)__ptr + __offset;
17604 return *(unaligned_vec_sll *)__addr;
17607 static inline __ATTRS_o_ai vector unsigned long long
17608 vec_xl(ptrdiff_t __offset, const unsigned long long *__ptr) {
17609 signed char *__addr = (signed char *)__ptr + __offset;
17610 return *(unaligned_vec_ull *)__addr;
17613 static inline __ATTRS_o_ai vector double vec_xl(ptrdiff_t __offset,
17614 const double *__ptr) {
17615 signed char *__addr = (signed char *)__ptr + __offset;
17616 return *(unaligned_vec_double *)__addr;
17620 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17621 defined(__SIZEOF_INT128__)
17622 typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
17623 typedef vector unsigned __int128 unaligned_vec_ui128
17624 __attribute__((aligned(1)));
17625 static inline __ATTRS_o_ai vector signed __int128
17626 vec_xl(ptrdiff_t __offset, const signed __int128 *__ptr) {
17627 signed char *__addr = (signed char *)__ptr + __offset;
17628 return *(unaligned_vec_si128 *)__addr;
17631 static inline __ATTRS_o_ai vector unsigned __int128
17632 vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {
17633 signed char *__addr = (signed char *)__ptr + __offset;
17634 return *(unaligned_vec_ui128 *)__addr;
17640 #ifdef __LITTLE_ENDIAN__
17641 static __inline__ vector signed char __ATTRS_o_ai
17642 vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {
17643 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17644 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17645 13, 12, 11, 10, 9, 8);
17648 static __inline__ vector unsigned char __ATTRS_o_ai
17649 vec_xl_be(ptrdiff_t __offset, const unsigned char *__ptr) {
17650 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17651 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17652 13, 12, 11, 10, 9, 8);
17655 static __inline__ vector signed short __ATTRS_o_ai
17656 vec_xl_be(ptrdiff_t __offset, const signed short *__ptr) {
17657 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17658 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17661 static __inline__ vector unsigned short __ATTRS_o_ai
17662 vec_xl_be(ptrdiff_t __offset, const unsigned short *__ptr) {
17663 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17664 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17667 static __inline__ vector signed int __ATTRS_o_ai
17668 vec_xl_be(signed long long __offset, const signed int *__ptr) {
17669 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17672 static __inline__ vector unsigned int __ATTRS_o_ai
17673 vec_xl_be(signed long long __offset, const unsigned int *__ptr) {
17674 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17677 static __inline__ vector float __ATTRS_o_ai
17678 vec_xl_be(signed long long __offset, const float *__ptr) {
17679 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17683 static __inline__ vector signed long long __ATTRS_o_ai
17684 vec_xl_be(signed long long __offset, const signed long long *__ptr) {
17685 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17688 static __inline__ vector unsigned long long __ATTRS_o_ai
17689 vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {
17690 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17693 static __inline__ vector double __ATTRS_o_ai
17694 vec_xl_be(signed long long __offset, const double *__ptr) {
17695 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17699 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17700 defined(__SIZEOF_INT128__)
17701 static __inline__ vector signed __int128 __ATTRS_o_ai
17702 vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
17703 return vec_xl(__offset, __ptr);
17706 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17707 vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
17708 return vec_xl(__offset, __ptr);
17712 #define vec_xl_be vec_xl
17715 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17716 defined(__SIZEOF_INT128__)
17720 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17721 vec_xl_sext(ptrdiff_t __offset, const signed char *__pointer) {
17722 return (vector unsigned __int128)*(__pointer + __offset);
17725 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17726 vec_xl_sext(ptrdiff_t __offset, const signed short *__pointer) {
17727 return (vector unsigned __int128)*(__pointer + __offset);
17730 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17731 vec_xl_sext(ptrdiff_t __offset, const signed int *__pointer) {
17732 return (vector unsigned __int128)*(__pointer + __offset);
17735 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17736 vec_xl_sext(ptrdiff_t __offset, const signed long long *__pointer) {
17737 return (vector unsigned __int128)*(__pointer + __offset);
17742 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17743 vec_xl_zext(ptrdiff_t __offset, const unsigned char *__pointer) {
17744 return (vector unsigned __int128)*(__pointer + __offset);
17747 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17748 vec_xl_zext(ptrdiff_t __offset, const unsigned short *__pointer) {
17749 return (vector unsigned __int128)*(__pointer + __offset);
17752 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17753 vec_xl_zext(ptrdiff_t __offset, const unsigned int *__pointer) {
17754 return (vector unsigned __int128)*(__pointer + __offset);
17757 static __inline__ vector unsigned __int128 __ATTRS_o_ai
17758 vec_xl_zext(ptrdiff_t __offset, const unsigned long long *__pointer) {
17759 return (vector unsigned __int128)*(__pointer + __offset);
17766 static __inline__ vector signed long long __ATTRS_o_ai
17767 vec_xlds(ptrdiff_t __offset, const signed long long *__ptr) {
17768 signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);
17769 return (vector signed long long) *__addr;
17772 static __inline__ vector unsigned long long __ATTRS_o_ai
17773 vec_xlds(ptrdiff_t __offset, const unsigned long long *__ptr) {
17774 unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);
17775 return (unaligned_vec_ull) *__addr;
17778 static __inline__ vector double __ATTRS_o_ai vec_xlds(ptrdiff_t __offset,
17779 const double *__ptr) {
17780 double *__addr = (double*)((signed char *)__ptr + __offset);
17781 return (unaligned_vec_double) *__addr;
17784 /* vec_load_splats */
17785 static __inline__ vector signed int __ATTRS_o_ai
17786 vec_load_splats(signed long long __offset, const signed int *__ptr) {
17787 signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17788 return (vector signed int)*__addr;
17791 static __inline__ vector signed int __ATTRS_o_ai
17792 vec_load_splats(unsigned long long __offset, const signed int *__ptr) {
17793 signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17794 return (vector signed int)*__addr;
17797 static __inline__ vector unsigned int __ATTRS_o_ai
17798 vec_load_splats(signed long long __offset, const unsigned int *__ptr) {
17799 unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17800 return (vector unsigned int)*__addr;
17803 static __inline__ vector unsigned int __ATTRS_o_ai
17804 vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {
17805 unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17806 return (vector unsigned int)*__addr;
17809 static __inline__ vector float __ATTRS_o_ai
17810 vec_load_splats(signed long long __offset, const float *__ptr) {
17811 float *__addr = (float*)((signed char *)__ptr + __offset);
17812 return (vector float)*__addr;
17815 static __inline__ vector float __ATTRS_o_ai
17816 vec_load_splats(unsigned long long __offset, const float *__ptr) {
17817 float *__addr = (float*)((signed char *)__ptr + __offset);
17818 return (vector float)*__addr;
17824 #define vec_xstd2 vec_xst
17825 #define vec_xstw4 vec_xst
17826 static inline __ATTRS_o_ai void
17827 vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr) {
17828 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
17831 static inline __ATTRS_o_ai void
17832 vec_xst(vector unsigned char __vec, ptrdiff_t __offset, unsigned char *__ptr) {
17833 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
17836 static inline __ATTRS_o_ai void
17837 vec_xst(vector signed short __vec, ptrdiff_t __offset, signed short *__ptr) {
17838 signed char *__addr = (signed char *)__ptr + __offset;
17839 *(unaligned_vec_sshort *)__addr = __vec;
17842 static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
17843 ptrdiff_t __offset,
17844 unsigned short *__ptr) {
17845 signed char *__addr = (signed char *)__ptr + __offset;
17846 *(unaligned_vec_ushort *)__addr = __vec;
17849 static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
17850 ptrdiff_t __offset, signed int *__ptr) {
17851 signed char *__addr = (signed char *)__ptr + __offset;
17852 *(unaligned_vec_sint *)__addr = __vec;
17855 static inline __ATTRS_o_ai void
17856 vec_xst(vector unsigned int __vec, ptrdiff_t __offset, unsigned int *__ptr) {
17857 signed char *__addr = (signed char *)__ptr + __offset;
17858 *(unaligned_vec_uint *)__addr = __vec;
17861 static inline __ATTRS_o_ai void vec_xst(vector float __vec, ptrdiff_t __offset,
17863 signed char *__addr = (signed char *)__ptr + __offset;
17864 *(unaligned_vec_float *)__addr = __vec;
17868 static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
17869 ptrdiff_t __offset,
17870 signed long long *__ptr) {
17871 signed char *__addr = (signed char *)__ptr + __offset;
17872 *(unaligned_vec_sll *)__addr = __vec;
17875 static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
17876 ptrdiff_t __offset,
17877 unsigned long long *__ptr) {
17878 signed char *__addr = (signed char *)__ptr + __offset;
17879 *(unaligned_vec_ull *)__addr = __vec;
17882 static inline __ATTRS_o_ai void vec_xst(vector double __vec, ptrdiff_t __offset,
17884 signed char *__addr = (signed char *)__ptr + __offset;
17885 *(unaligned_vec_double *)__addr = __vec;
17889 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17890 defined(__SIZEOF_INT128__)
17891 static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
17892 ptrdiff_t __offset,
17893 signed __int128 *__ptr) {
17894 signed char *__addr = (signed char *)__ptr + __offset;
17895 *(unaligned_vec_si128 *)__addr = __vec;
17898 static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
17899 ptrdiff_t __offset,
17900 unsigned __int128 *__ptr) {
17901 signed char *__addr = (signed char *)__ptr + __offset;
17902 *(unaligned_vec_ui128 *)__addr = __vec;
17906 /* vec_xst_trunc */
17908 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17909 defined(__SIZEOF_INT128__)
17910 static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17911 ptrdiff_t __offset,
17912 signed char *__ptr) {
17913 *(__ptr + __offset) = (signed char)__vec[0];
17916 static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17917 ptrdiff_t __offset,
17918 unsigned char *__ptr) {
17919 *(__ptr + __offset) = (unsigned char)__vec[0];
17922 static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17923 ptrdiff_t __offset,
17924 signed short *__ptr) {
17925 *(__ptr + __offset) = (signed short)__vec[0];
17928 static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17929 ptrdiff_t __offset,
17930 unsigned short *__ptr) {
17931 *(__ptr + __offset) = (unsigned short)__vec[0];
17934 static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17935 ptrdiff_t __offset,
17936 signed int *__ptr) {
17937 *(__ptr + __offset) = (signed int)__vec[0];
17940 static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17941 ptrdiff_t __offset,
17942 unsigned int *__ptr) {
17943 *(__ptr + __offset) = (unsigned int)__vec[0];
17946 static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17947 ptrdiff_t __offset,
17948 signed long long *__ptr) {
17949 *(__ptr + __offset) = (signed long long)__vec[0];
17952 static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17953 ptrdiff_t __offset,
17954 unsigned long long *__ptr) {
17955 *(__ptr + __offset) = (unsigned long long)__vec[0];
17961 #ifdef __LITTLE_ENDIAN__
17962 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
17963 signed long long __offset,
17964 signed char *__ptr) {
17965 vector signed char __tmp =
17966 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17967 13, 12, 11, 10, 9, 8);
17968 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
17969 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
17972 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
17973 signed long long __offset,
17974 unsigned char *__ptr) {
17975 vector unsigned char __tmp =
17976 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17977 13, 12, 11, 10, 9, 8);
17978 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
17979 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
17982 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
17983 signed long long __offset,
17984 signed short *__ptr) {
17985 vector signed short __tmp =
17986 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17987 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
17988 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
17991 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
17992 signed long long __offset,
17993 unsigned short *__ptr) {
17994 vector unsigned short __tmp =
17995 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17996 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
17997 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18000 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
18001 signed long long __offset,
18002 signed int *__ptr) {
18003 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
18006 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
18007 signed long long __offset,
18008 unsigned int *__ptr) {
18009 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
18012 static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
18013 signed long long __offset,
18015 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
18019 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
18020 signed long long __offset,
18021 signed long long *__ptr) {
18022 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18025 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
18026 signed long long __offset,
18027 unsigned long long *__ptr) {
18028 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18031 static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
18032 signed long long __offset,
18034 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18038 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18039 defined(__SIZEOF_INT128__)
18040 static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
18041 signed long long __offset,
18042 signed __int128 *__ptr) {
18043 vec_xst(__vec, __offset, __ptr);
18046 static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
18047 signed long long __offset,
18048 unsigned __int128 *__ptr) {
18049 vec_xst(__vec, __offset, __ptr);
18053 #define vec_xst_be vec_xst
18056 #ifdef __POWER9_VECTOR__
18057 #define vec_test_data_class(__a, __b) \
18059 (__a), vector float \
18060 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
18062 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
18065 #endif /* #ifdef __POWER9_VECTOR__ */
18067 static vector float __ATTRS_o_ai vec_neg(vector float __a) {
18072 static vector double __ATTRS_o_ai vec_neg(vector double __a) {
18079 static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
18084 static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
18088 static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
18092 static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
18096 static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
18097 return - vec_abs(__a);
18101 static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
18102 return - vec_abs(__a);
18107 #ifdef __POWER8_VECTOR__
18108 static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
18109 return __builtin_altivec_vminsd(__a, -__a);
18113 static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
18114 return __builtin_altivec_vminsw(__a, -__a);
18117 static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
18118 return __builtin_altivec_vminsh(__a, -__a);
18121 static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
18122 return __builtin_altivec_vminsb(__a, -__a);
18125 static vector float __ATTRS_o_ai vec_recipdiv(vector float __a,
18126 vector float __b) {
18127 return __builtin_ppc_recipdivf(__a, __b);
18131 static vector double __ATTRS_o_ai vec_recipdiv(vector double __a,
18132 vector double __b) {
18133 return __builtin_ppc_recipdivd(__a, __b);
18137 #ifdef __POWER10_VECTOR__
18141 static __inline__ unsigned int __ATTRS_o_ai
18142 vec_extractm(vector unsigned char __a) {
18143 return __builtin_altivec_vextractbm(__a);
18146 static __inline__ unsigned int __ATTRS_o_ai
18147 vec_extractm(vector unsigned short __a) {
18148 return __builtin_altivec_vextracthm(__a);
18151 static __inline__ unsigned int __ATTRS_o_ai
18152 vec_extractm(vector unsigned int __a) {
18153 return __builtin_altivec_vextractwm(__a);
18156 static __inline__ unsigned int __ATTRS_o_ai
18157 vec_extractm(vector unsigned long long __a) {
18158 return __builtin_altivec_vextractdm(__a);
18161 #ifdef __SIZEOF_INT128__
18162 static __inline__ unsigned int __ATTRS_o_ai
18163 vec_extractm(vector unsigned __int128 __a) {
18164 return __builtin_altivec_vextractqm(__a);
18170 static __inline__ vector unsigned char __ATTRS_o_ai
18171 vec_expandm(vector unsigned char __a) {
18172 return __builtin_altivec_vexpandbm(__a);
18175 static __inline__ vector unsigned short __ATTRS_o_ai
18176 vec_expandm(vector unsigned short __a) {
18177 return __builtin_altivec_vexpandhm(__a);
18180 static __inline__ vector unsigned int __ATTRS_o_ai
18181 vec_expandm(vector unsigned int __a) {
18182 return __builtin_altivec_vexpandwm(__a);
18185 static __inline__ vector unsigned long long __ATTRS_o_ai
18186 vec_expandm(vector unsigned long long __a) {
18187 return __builtin_altivec_vexpanddm(__a);
18190 #ifdef __SIZEOF_INT128__
18191 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18192 vec_expandm(vector unsigned __int128 __a) {
18193 return __builtin_altivec_vexpandqm(__a);
18199 #define vec_cntm(__a, __mp) \
18200 _Generic((__a), vector unsigned char \
18201 : __builtin_altivec_vcntmbb((__a), (unsigned int)(__mp)), \
18202 vector unsigned short \
18203 : __builtin_altivec_vcntmbh((__a), (unsigned int)(__mp)), \
18204 vector unsigned int \
18205 : __builtin_altivec_vcntmbw((__a), (unsigned int)(__mp)), \
18206 vector unsigned long long \
18207 : __builtin_altivec_vcntmbd((__a), (unsigned int)(__mp)))
18209 /* vec_gen[b|h|w|d|q]m */
18211 static __inline__ vector unsigned char __ATTRS_o_ai
18212 vec_genbm(unsigned long long __bm) {
18213 return __builtin_altivec_mtvsrbm(__bm);
18216 static __inline__ vector unsigned short __ATTRS_o_ai
18217 vec_genhm(unsigned long long __bm) {
18218 return __builtin_altivec_mtvsrhm(__bm);
18221 static __inline__ vector unsigned int __ATTRS_o_ai
18222 vec_genwm(unsigned long long __bm) {
18223 return __builtin_altivec_mtvsrwm(__bm);
18226 static __inline__ vector unsigned long long __ATTRS_o_ai
18227 vec_gendm(unsigned long long __bm) {
18228 return __builtin_altivec_mtvsrdm(__bm);
18231 #ifdef __SIZEOF_INT128__
18232 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18233 vec_genqm(unsigned long long __bm) {
18234 return __builtin_altivec_mtvsrqm(__bm);
18240 static __inline__ vector unsigned long long __ATTRS_o_ai
18241 vec_pdep(vector unsigned long long __a, vector unsigned long long __b) {
18242 return __builtin_altivec_vpdepd(__a, __b);
18247 static __inline__ vector unsigned long long __ATTRS_o_ai
18248 vec_pext(vector unsigned long long __a, vector unsigned long long __b) {
18249 return __builtin_altivec_vpextd(__a, __b);
18254 static __inline__ vector unsigned long long __ATTRS_o_ai
18255 vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
18256 return __builtin_altivec_vcfuged(__a, __b);
18261 #define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
18263 /* vec_ternarylogic */
18265 #ifdef __SIZEOF_INT128__
18266 #define vec_ternarylogic(__a, __b, __c, __imm) \
18267 _Generic((__a), vector unsigned char \
18268 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18269 (vector unsigned long long)(__b), \
18270 (vector unsigned long long)(__c), (__imm)), \
18271 vector unsigned short \
18272 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18273 (vector unsigned long long)(__b), \
18274 (vector unsigned long long)(__c), (__imm)), \
18275 vector unsigned int \
18276 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18277 (vector unsigned long long)(__b), \
18278 (vector unsigned long long)(__c), (__imm)), \
18279 vector unsigned long long \
18280 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18281 (vector unsigned long long)(__b), \
18282 (vector unsigned long long)(__c), (__imm)), \
18283 vector unsigned __int128 \
18284 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18285 (vector unsigned long long)(__b), \
18286 (vector unsigned long long)(__c), (__imm)))
18288 #define vec_ternarylogic(__a, __b, __c, __imm) \
18289 _Generic((__a), vector unsigned char \
18290 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18291 (vector unsigned long long)(__b), \
18292 (vector unsigned long long)(__c), (__imm)), \
18293 vector unsigned short \
18294 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18295 (vector unsigned long long)(__b), \
18296 (vector unsigned long long)(__c), (__imm)), \
18297 vector unsigned int \
18298 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18299 (vector unsigned long long)(__b), \
18300 (vector unsigned long long)(__c), (__imm)), \
18301 vector unsigned long long \
18302 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18303 (vector unsigned long long)(__b), \
18304 (vector unsigned long long)(__c), (__imm)))
18305 #endif /* __SIZEOF_INT128__ */
18306 #endif /* __VSX__ */
18311 #define vec_genpcvm(__a, __imm) \
18312 _Generic((__a), vector unsigned char \
18313 : __builtin_vsx_xxgenpcvbm((__a), (int)(__imm)), \
18314 vector unsigned short \
18315 : __builtin_vsx_xxgenpcvhm((__a), (int)(__imm)), \
18316 vector unsigned int \
18317 : __builtin_vsx_xxgenpcvwm((__a), (int)(__imm)), \
18318 vector unsigned long long \
18319 : __builtin_vsx_xxgenpcvdm((__a), (int)(__imm)))
18320 #endif /* __VSX__ */
18324 static __inline__ vector signed char __ATTRS_o_ai
18325 vec_clrl(vector signed char __a, unsigned int __n) {
18326 #ifdef __LITTLE_ENDIAN__
18327 return __builtin_altivec_vclrrb(__a, __n);
18329 return __builtin_altivec_vclrlb( __a, __n);
18333 static __inline__ vector unsigned char __ATTRS_o_ai
18334 vec_clrl(vector unsigned char __a, unsigned int __n) {
18335 #ifdef __LITTLE_ENDIAN__
18336 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
18338 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
18344 static __inline__ vector signed char __ATTRS_o_ai
18345 vec_clrr(vector signed char __a, unsigned int __n) {
18346 #ifdef __LITTLE_ENDIAN__
18347 return __builtin_altivec_vclrlb(__a, __n);
18349 return __builtin_altivec_vclrrb( __a, __n);
18353 static __inline__ vector unsigned char __ATTRS_o_ai
18354 vec_clrr(vector unsigned char __a, unsigned int __n) {
18355 #ifdef __LITTLE_ENDIAN__
18356 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
18358 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
18364 static __inline__ vector unsigned long long __ATTRS_o_ai
18365 vec_cntlzm(vector unsigned long long __a, vector unsigned long long __b) {
18366 return __builtin_altivec_vclzdm(__a, __b);
18371 static __inline__ vector unsigned long long __ATTRS_o_ai
18372 vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
18373 return __builtin_altivec_vctzdm(__a, __b);
18378 static __inline__ vector signed int __ATTRS_o_ai
18379 vec_mod(vector signed int __a, vector signed int __b) {
18383 static __inline__ vector unsigned int __ATTRS_o_ai
18384 vec_mod(vector unsigned int __a, vector unsigned int __b) {
18388 static __inline__ vector signed long long __ATTRS_o_ai
18389 vec_mod(vector signed long long __a, vector signed long long __b) {
18393 static __inline__ vector unsigned long long __ATTRS_o_ai
18394 vec_mod(vector unsigned long long __a, vector unsigned long long __b) {
18398 #ifdef __SIZEOF_INT128__
18399 static __inline__ vector signed __int128 __ATTRS_o_ai
18400 vec_mod(vector signed __int128 __a, vector signed __int128 __b) {
18404 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18405 vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18412 #define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))
18416 #define vec_srdb(__a, __b, __c) __builtin_altivec_vsrdbi(__a, __b, (__c & 0x7))
18420 static __inline__ vector unsigned char __ATTRS_o_ai
18421 vec_insertl(unsigned char __a, vector unsigned char __b, unsigned int __c) {
18422 #ifdef __LITTLE_ENDIAN__
18423 return __builtin_altivec_vinsbrx(__b, __c, __a);
18425 return __builtin_altivec_vinsblx(__b, __c, __a);
18429 static __inline__ vector unsigned short __ATTRS_o_ai
18430 vec_insertl(unsigned short __a, vector unsigned short __b, unsigned int __c) {
18431 #ifdef __LITTLE_ENDIAN__
18432 return __builtin_altivec_vinshrx(__b, __c, __a);
18434 return __builtin_altivec_vinshlx(__b, __c, __a);
18438 static __inline__ vector unsigned int __ATTRS_o_ai
18439 vec_insertl(unsigned int __a, vector unsigned int __b, unsigned int __c) {
18440 #ifdef __LITTLE_ENDIAN__
18441 return __builtin_altivec_vinswrx(__b, __c, __a);
18443 return __builtin_altivec_vinswlx(__b, __c, __a);
18447 static __inline__ vector unsigned long long __ATTRS_o_ai
18448 vec_insertl(unsigned long long __a, vector unsigned long long __b,
18449 unsigned int __c) {
18450 #ifdef __LITTLE_ENDIAN__
18451 return __builtin_altivec_vinsdrx(__b, __c, __a);
18453 return __builtin_altivec_vinsdlx(__b, __c, __a);
18457 static __inline__ vector unsigned char __ATTRS_o_ai
18458 vec_insertl(vector unsigned char __a, vector unsigned char __b,
18459 unsigned int __c) {
18460 #ifdef __LITTLE_ENDIAN__
18461 return __builtin_altivec_vinsbvrx(__b, __c, __a);
18463 return __builtin_altivec_vinsbvlx(__b, __c, __a);
18467 static __inline__ vector unsigned short __ATTRS_o_ai
18468 vec_insertl(vector unsigned short __a, vector unsigned short __b,
18469 unsigned int __c) {
18470 #ifdef __LITTLE_ENDIAN__
18471 return __builtin_altivec_vinshvrx(__b, __c, __a);
18473 return __builtin_altivec_vinshvlx(__b, __c, __a);
18477 static __inline__ vector unsigned int __ATTRS_o_ai
18478 vec_insertl(vector unsigned int __a, vector unsigned int __b,
18479 unsigned int __c) {
18480 #ifdef __LITTLE_ENDIAN__
18481 return __builtin_altivec_vinswvrx(__b, __c, __a);
18483 return __builtin_altivec_vinswvlx(__b, __c, __a);
18489 static __inline__ vector unsigned char __ATTRS_o_ai
18490 vec_inserth(unsigned char __a, vector unsigned char __b, unsigned int __c) {
18491 #ifdef __LITTLE_ENDIAN__
18492 return __builtin_altivec_vinsblx(__b, __c, __a);
18494 return __builtin_altivec_vinsbrx(__b, __c, __a);
18498 static __inline__ vector unsigned short __ATTRS_o_ai
18499 vec_inserth(unsigned short __a, vector unsigned short __b, unsigned int __c) {
18500 #ifdef __LITTLE_ENDIAN__
18501 return __builtin_altivec_vinshlx(__b, __c, __a);
18503 return __builtin_altivec_vinshrx(__b, __c, __a);
18507 static __inline__ vector unsigned int __ATTRS_o_ai
18508 vec_inserth(unsigned int __a, vector unsigned int __b, unsigned int __c) {
18509 #ifdef __LITTLE_ENDIAN__
18510 return __builtin_altivec_vinswlx(__b, __c, __a);
18512 return __builtin_altivec_vinswrx(__b, __c, __a);
18516 static __inline__ vector unsigned long long __ATTRS_o_ai
18517 vec_inserth(unsigned long long __a, vector unsigned long long __b,
18518 unsigned int __c) {
18519 #ifdef __LITTLE_ENDIAN__
18520 return __builtin_altivec_vinsdlx(__b, __c, __a);
18522 return __builtin_altivec_vinsdrx(__b, __c, __a);
18526 static __inline__ vector unsigned char __ATTRS_o_ai
18527 vec_inserth(vector unsigned char __a, vector unsigned char __b,
18528 unsigned int __c) {
18529 #ifdef __LITTLE_ENDIAN__
18530 return __builtin_altivec_vinsbvlx(__b, __c, __a);
18532 return __builtin_altivec_vinsbvrx(__b, __c, __a);
18536 static __inline__ vector unsigned short __ATTRS_o_ai
18537 vec_inserth(vector unsigned short __a, vector unsigned short __b,
18538 unsigned int __c) {
18539 #ifdef __LITTLE_ENDIAN__
18540 return __builtin_altivec_vinshvlx(__b, __c, __a);
18542 return __builtin_altivec_vinshvrx(__b, __c, __a);
18546 static __inline__ vector unsigned int __ATTRS_o_ai
18547 vec_inserth(vector unsigned int __a, vector unsigned int __b,
18548 unsigned int __c) {
18549 #ifdef __LITTLE_ENDIAN__
18550 return __builtin_altivec_vinswvlx(__b, __c, __a);
18552 return __builtin_altivec_vinswvrx(__b, __c, __a);
18558 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18559 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
18560 #ifdef __LITTLE_ENDIAN__
18561 return __builtin_altivec_vextdubvrx(__a, __b, __c);
18563 vector unsigned long long __ret = __builtin_altivec_vextdubvlx(__a, __b, __c);
18564 return vec_sld(__ret, __ret, 8);
18568 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18569 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
18570 #ifdef __LITTLE_ENDIAN__
18571 return __builtin_altivec_vextduhvrx(__a, __b, __c);
18573 vector unsigned long long __ret = __builtin_altivec_vextduhvlx(__a, __b, __c);
18574 return vec_sld(__ret, __ret, 8);
18578 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18579 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
18580 #ifdef __LITTLE_ENDIAN__
18581 return __builtin_altivec_vextduwvrx(__a, __b, __c);
18583 vector unsigned long long __ret = __builtin_altivec_vextduwvlx(__a, __b, __c);
18584 return vec_sld(__ret, __ret, 8);
18588 static __inline__ vector unsigned long long __ATTRS_o_ai
18589 vec_extractl(vector unsigned long long __a, vector unsigned long long __b,
18590 unsigned int __c) {
18591 #ifdef __LITTLE_ENDIAN__
18592 return __builtin_altivec_vextddvrx(__a, __b, __c);
18594 vector unsigned long long __ret = __builtin_altivec_vextddvlx(__a, __b, __c);
18595 return vec_sld(__ret, __ret, 8);
18601 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18602 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
18603 #ifdef __LITTLE_ENDIAN__
18604 return __builtin_altivec_vextdubvlx(__a, __b, __c);
18606 vector unsigned long long __ret = __builtin_altivec_vextdubvrx(__a, __b, __c);
18607 return vec_sld(__ret, __ret, 8);
18611 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18612 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
18613 #ifdef __LITTLE_ENDIAN__
18614 return __builtin_altivec_vextduhvlx(__a, __b, __c);
18616 vector unsigned long long __ret = __builtin_altivec_vextduhvrx(__a, __b, __c);
18617 return vec_sld(__ret, __ret, 8);
18621 static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18622 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
18623 #ifdef __LITTLE_ENDIAN__
18624 return __builtin_altivec_vextduwvlx(__a, __b, __c);
18626 vector unsigned long long __ret = __builtin_altivec_vextduwvrx(__a, __b, __c);
18627 return vec_sld(__ret, __ret, 8);
18631 static __inline__ vector unsigned long long __ATTRS_o_ai
18632 vec_extracth(vector unsigned long long __a, vector unsigned long long __b,
18633 unsigned int __c) {
18634 #ifdef __LITTLE_ENDIAN__
18635 return __builtin_altivec_vextddvlx(__a, __b, __c);
18637 vector unsigned long long __ret = __builtin_altivec_vextddvrx(__a, __b, __c);
18638 return vec_sld(__ret, __ret, 8);
18646 #define vec_permx(__a, __b, __c, __d) \
18647 __builtin_vsx_xxpermx((__a), (__b), (__c), (__d))
18651 static __inline__ vector signed char __ATTRS_o_ai
18652 vec_blendv(vector signed char __a, vector signed char __b,
18653 vector unsigned char __c) {
18654 return __builtin_vsx_xxblendvb(__a, __b, __c);
18657 static __inline__ vector unsigned char __ATTRS_o_ai
18658 vec_blendv(vector unsigned char __a, vector unsigned char __b,
18659 vector unsigned char __c) {
18660 return __builtin_vsx_xxblendvb(__a, __b, __c);
18663 static __inline__ vector signed short __ATTRS_o_ai
18664 vec_blendv(vector signed short __a, vector signed short __b,
18665 vector unsigned short __c) {
18666 return __builtin_vsx_xxblendvh(__a, __b, __c);
18669 static __inline__ vector unsigned short __ATTRS_o_ai
18670 vec_blendv(vector unsigned short __a, vector unsigned short __b,
18671 vector unsigned short __c) {
18672 return __builtin_vsx_xxblendvh(__a, __b, __c);
18675 static __inline__ vector signed int __ATTRS_o_ai
18676 vec_blendv(vector signed int __a, vector signed int __b,
18677 vector unsigned int __c) {
18678 return __builtin_vsx_xxblendvw(__a, __b, __c);
18681 static __inline__ vector unsigned int __ATTRS_o_ai
18682 vec_blendv(vector unsigned int __a, vector unsigned int __b,
18683 vector unsigned int __c) {
18684 return __builtin_vsx_xxblendvw(__a, __b, __c);
18687 static __inline__ vector signed long long __ATTRS_o_ai
18688 vec_blendv(vector signed long long __a, vector signed long long __b,
18689 vector unsigned long long __c) {
18690 return __builtin_vsx_xxblendvd(__a, __b, __c);
18693 static __inline__ vector unsigned long long __ATTRS_o_ai
18694 vec_blendv(vector unsigned long long __a, vector unsigned long long __b,
18695 vector unsigned long long __c) {
18696 return __builtin_vsx_xxblendvd(__a, __b, __c);
18699 static __inline__ vector float __ATTRS_o_ai
18700 vec_blendv(vector float __a, vector float __b, vector unsigned int __c) {
18701 return __builtin_vsx_xxblendvw(__a, __b, __c);
18704 static __inline__ vector double __ATTRS_o_ai
18705 vec_blendv(vector double __a, vector double __b,
18706 vector unsigned long long __c) {
18707 return __builtin_vsx_xxblendvd(__a, __b, __c);
18710 /* vec_replace_elt */
18712 #define vec_replace_elt __builtin_altivec_vec_replace_elt
18714 /* vec_replace_unaligned */
18716 #define vec_replace_unaligned __builtin_altivec_vec_replace_unaligned
18720 #define vec_splati(__a) \
18721 _Generic((__a), signed int \
18722 : ((vector signed int)__a), unsigned int \
18723 : ((vector unsigned int)__a), float \
18724 : ((vector float)__a))
18728 static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {
18729 return ((vector double)((double)__a));
18732 /* vec_splati_ins */
18734 static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(
18735 vector signed int __a, const unsigned int __b, const signed int __c) {
18736 #ifdef __LITTLE_ENDIAN__
18737 __a[1 - __b] = __c;
18738 __a[3 - __b] = __c;
18741 __a[2 + __b] = __c;
18746 static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(
18747 vector unsigned int __a, const unsigned int __b, const unsigned int __c) {
18748 #ifdef __LITTLE_ENDIAN__
18749 __a[1 - __b] = __c;
18750 __a[3 - __b] = __c;
18753 __a[2 + __b] = __c;
18758 static __inline__ vector float __ATTRS_o_ai
18759 vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {
18760 #ifdef __LITTLE_ENDIAN__
18761 __a[1 - __b] = __c;
18762 __a[3 - __b] = __c;
18765 __a[2 + __b] = __c;
18770 /* vec_test_lsbb_all_ones */
18772 static __inline__ int __ATTRS_o_ai
18773 vec_test_lsbb_all_ones(vector unsigned char __a) {
18774 return __builtin_vsx_xvtlsbb(__a, 1);
18777 /* vec_test_lsbb_all_zeros */
18779 static __inline__ int __ATTRS_o_ai
18780 vec_test_lsbb_all_zeros(vector unsigned char __a) {
18781 return __builtin_vsx_xvtlsbb(__a, 0);
18783 #endif /* __VSX__ */
18787 static __inline__ vector unsigned char __ATTRS_o_ai
18788 vec_stril(vector unsigned char __a) {
18789 #ifdef __LITTLE_ENDIAN__
18790 return __builtin_altivec_vstribr((vector signed char)__a);
18792 return __builtin_altivec_vstribl((vector signed char)__a);
18796 static __inline__ vector signed char __ATTRS_o_ai
18797 vec_stril(vector signed char __a) {
18798 #ifdef __LITTLE_ENDIAN__
18799 return __builtin_altivec_vstribr(__a);
18801 return __builtin_altivec_vstribl(__a);
18805 static __inline__ vector unsigned short __ATTRS_o_ai
18806 vec_stril(vector unsigned short __a) {
18807 #ifdef __LITTLE_ENDIAN__
18808 return __builtin_altivec_vstrihr((vector signed short)__a);
18810 return __builtin_altivec_vstrihl((vector signed short)__a);
18814 static __inline__ vector signed short __ATTRS_o_ai
18815 vec_stril(vector signed short __a) {
18816 #ifdef __LITTLE_ENDIAN__
18817 return __builtin_altivec_vstrihr(__a);
18819 return __builtin_altivec_vstrihl(__a);
18825 static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned char __a) {
18826 #ifdef __LITTLE_ENDIAN__
18827 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector signed char)__a);
18829 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector signed char)__a);
18833 static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed char __a) {
18834 #ifdef __LITTLE_ENDIAN__
18835 return __builtin_altivec_vstribr_p(__CR6_EQ, __a);
18837 return __builtin_altivec_vstribl_p(__CR6_EQ, __a);
18841 static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned short __a) {
18842 #ifdef __LITTLE_ENDIAN__
18843 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
18845 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
18849 static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed short __a) {
18850 #ifdef __LITTLE_ENDIAN__
18851 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
18853 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
18859 static __inline__ vector unsigned char __ATTRS_o_ai
18860 vec_strir(vector unsigned char __a) {
18861 #ifdef __LITTLE_ENDIAN__
18862 return __builtin_altivec_vstribl((vector signed char)__a);
18864 return __builtin_altivec_vstribr((vector signed char)__a);
18868 static __inline__ vector signed char __ATTRS_o_ai
18869 vec_strir(vector signed char __a) {
18870 #ifdef __LITTLE_ENDIAN__
18871 return __builtin_altivec_vstribl(__a);
18873 return __builtin_altivec_vstribr(__a);
18877 static __inline__ vector unsigned short __ATTRS_o_ai
18878 vec_strir(vector unsigned short __a) {
18879 #ifdef __LITTLE_ENDIAN__
18880 return __builtin_altivec_vstrihl((vector signed short)__a);
18882 return __builtin_altivec_vstrihr((vector signed short)__a);
18886 static __inline__ vector signed short __ATTRS_o_ai
18887 vec_strir(vector signed short __a) {
18888 #ifdef __LITTLE_ENDIAN__
18889 return __builtin_altivec_vstrihl(__a);
18891 return __builtin_altivec_vstrihr(__a);
18897 static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned char __a) {
18898 #ifdef __LITTLE_ENDIAN__
18899 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector signed char)__a);
18901 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector signed char)__a);
18905 static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed char __a) {
18906 #ifdef __LITTLE_ENDIAN__
18907 return __builtin_altivec_vstribl_p(__CR6_EQ, __a);
18909 return __builtin_altivec_vstribr_p(__CR6_EQ, __a);
18913 static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned short __a) {
18914 #ifdef __LITTLE_ENDIAN__
18915 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
18917 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
18921 static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {
18922 #ifdef __LITTLE_ENDIAN__
18923 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
18925 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
18929 /* vs[l | r | ra] */
18931 #ifdef __SIZEOF_INT128__
18932 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18933 vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18934 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18938 static __inline__ vector signed __int128 __ATTRS_o_ai
18939 vec_sl(vector signed __int128 __a, vector unsigned __int128 __b) {
18940 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18944 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18945 vec_sr(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18946 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18950 static __inline__ vector signed __int128 __ATTRS_o_ai
18951 vec_sr(vector signed __int128 __a, vector unsigned __int128 __b) {
18953 vector signed __int128)(((vector unsigned __int128)__a) >>
18955 (vector unsigned __int128)(sizeof(
18956 unsigned __int128) *
18960 static __inline__ vector unsigned __int128 __ATTRS_o_ai
18961 vec_sra(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18963 vector unsigned __int128)(((vector signed __int128)__a) >>
18965 (vector unsigned __int128)(sizeof(
18966 unsigned __int128) *
18970 static __inline__ vector signed __int128 __ATTRS_o_ai
18971 vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
18972 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18976 #endif /* __SIZEOF_INT128__ */
18977 #endif /* __POWER10_VECTOR__ */
18979 #undef __ATTRS_o_ai
18981 #endif /* __ALTIVEC_H */